tx · CC6SjPAZg75MLopDhuPLdBDyAxAZmdQwHPnMNH3bqr4K

3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX:  -0.01400000 Waves

2019.09.08 11:28 [666860] smart account 3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX > SELF 0.00000000 Waves

{ "type": 13, "id": "CC6SjPAZg75MLopDhuPLdBDyAxAZmdQwHPnMNH3bqr4K", "fee": 1400000, "feeAssetId": null, "timestamp": 1567931382300, "version": 1, "sender": "3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX", "senderPublicKey": "D1oc84fv4treBFDLvPS9vQdrs7A9HwTHxaeK9C7nHRTH", "proofs": [ "4Lomeyf1zMVo8cAf9vaebRiUaXzxiFoQJNguk67vWGArLGtx8WEgJQMEt2bzrumbaRHkWs559MNd6G3SDBJXLMMs" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAwAAAAFpAQAAAAtjcmVhdGVPcmRlcgAAAAEAAAAFcHJpY2UEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIllvdSBuZWVkIHRvIHVzZSB0b2tlbklkLCBub3Qgd2F2ZXMEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAHYXNzZXRJZAkAAlgAAAABCQEAAAAHZXh0cmFjdAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAAHdW5pcUtleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAApjdXJyZW50S2V5AgAAAAFfBQAAAAdhc3NldElkAgAAAAFfCQABpAAAAAEFAAAABmhlaWdodAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACA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QABLAAAAAIFAAAACmN1cnJlbnRLZXkCAAAAAV8FAAAAB2Fzc2V0SWQCAAAAAV8JAAGkAAAAAQUAAAAGaGVpZ2h0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAACGNoZWNraW5fBQAAAAd1bmlxS2V5BgUAAAADbmlsAAAAADT3ofY=", "chainId": 84, "height": 666860, "spentComplexity": 0 } View: original | compacted Prev: DRsLqX2QarzkEPmF6nEBGRXqtApGqAR3sQp3idMG9SR2 Next: GraTu7FdZRcy6EvgsW8ASHTfE9ZMQHboJdvNucMwvEtf Diff:
OldNewDifferences
5252 let pmt = extract(i.payment)
5353 if (!(isDefined(pmt.assetId)))
5454 then throw("You need to use tokenId, not waves")
55- else {
56- let currentKey = toBase58String(i.caller.bytes)
57- let assetId = toBase58String(extract(pmt.assetId))
58- let uniqKey = ((((currentKey + "_") + assetId) + "_") + toString(height))
59- WriteSet([DataEntry(("checkin_" + uniqKey), true)])
60- }
55+ else if ((pmt.amount != 1))
56+ then throw("Give only one ticket")
57+ else {
58+ let currentKey = toBase58String(i.caller.bytes)
59+ let assetId = toBase58String(extract(pmt.assetId))
60+ let uniqKey = ((((currentKey + "_") + assetId) + "_") + toString(height))
61+ WriteSet([DataEntry(("checkin_" + uniqKey), true)])
62+ }
6163 }
6264
6365
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func createOrder (price) = {
88 let pmt = extract(i.payment)
99 if (!(isDefined(pmt.assetId)))
1010 then throw("You need to use tokenId, not waves")
1111 else {
1212 let currentKey = toBase58String(i.caller.bytes)
1313 let assetId = toBase58String(extract(pmt.assetId))
1414 let uniqKey = ((((currentKey + "_") + assetId) + "_") + toString(height))
1515 WriteSet([DataEntry(("assetAmount_" + uniqKey), pmt.amount), DataEntry(("assetPrice_" + uniqKey), price)])
1616 }
1717 }
1818
1919
2020
2121 @Callable(i)
2222 func buyTicket (uniqKey) = {
2323 let pmt = extract(i.payment)
2424 let assetId = extract(split(uniqKey, "_")[1])
2525 let ownerId = extract(addressFromString(split(uniqKey, "_")[0]))
2626 let price = match getInteger(this, ("assetPrice_" + uniqKey)) {
2727 case p: Int =>
2828 p
2929 case _ =>
3030 0
3131 }
3232 let currentAmount = match getInteger(this, ("assetAmount_" + uniqKey)) {
3333 case a: Int =>
3434 a
3535 case _ =>
3636 0
3737 }
3838 let newAmount = (currentAmount - 1)
3939 if ((0 >= currentAmount))
4040 then throw("Have not enough of tickets for this price")
4141 else if (isDefined(pmt.assetId))
4242 then throw("You need to use waves")
4343 else if ((price > pmt.amount))
4444 then throw("Count of waves is not match price")
4545 else ScriptResult(WriteSet([DataEntry(("assetAmount_" + uniqKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, 1, fromBase58String(assetId)), ScriptTransfer(ownerId, price, unit)]))
4646 }
4747
4848
4949
5050 @Callable(i)
5151 func checkIn () = {
5252 let pmt = extract(i.payment)
5353 if (!(isDefined(pmt.assetId)))
5454 then throw("You need to use tokenId, not waves")
55- else {
56- let currentKey = toBase58String(i.caller.bytes)
57- let assetId = toBase58String(extract(pmt.assetId))
58- let uniqKey = ((((currentKey + "_") + assetId) + "_") + toString(height))
59- WriteSet([DataEntry(("checkin_" + uniqKey), true)])
60- }
55+ else if ((pmt.amount != 1))
56+ then throw("Give only one ticket")
57+ else {
58+ let currentKey = toBase58String(i.caller.bytes)
59+ let assetId = toBase58String(extract(pmt.assetId))
60+ let uniqKey = ((((currentKey + "_") + assetId) + "_") + toString(height))
61+ WriteSet([DataEntry(("checkin_" + uniqKey), true)])
62+ }
6163 }
6264
6365

github/deemru/w8io/169f3d6 
25.55 ms