tx · CYnLrhbai8gd4a3dA7gnj4gRa57rGVgvrbzGtPk21kms 3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX: -0.01400000 Waves 2019.09.07 23:45 [666171] smart account 3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX > SELF 0.00000000 Waves
{ "type": 13, "id": "CYnLrhbai8gd4a3dA7gnj4gRa57rGVgvrbzGtPk21kms", "fee": 1400000, "feeAssetId": null, "timestamp": 1567889096819, "version": 1, "sender": "3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX", "senderPublicKey": "D1oc84fv4treBFDLvPS9vQdrs7A9HwTHxaeK9C7nHRTH", "proofs": [ "JNTbvnVEnnjC8dqFCKWEpsepVttcs7tWjcR3rh6p6RgXsCjHogE3MLjyPZNCpttyo5pLrZFS3gwrtYeMZ71T7XM" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAgAAAAFpAQAAAAtjcmVhdGVPcmRlcgAAAAEAAAAFcHJpY2UEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIllvdSBuZWVkIHRvIHVzZSB0b2tlbklkLCBub3Qgd2F2ZXMEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAHYXNzZXRJZAkAAlgAAAABCQEAAAAHZXh0cmFjdAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAAHdW5pcUtleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAApjdXJyZW50S2V5AgAAAAFfBQAAAAdhc3NldElkAgAAAAFfCQABpAAAAAEFAAAABmhlaWdodAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAA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AAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQkAAlkAAAABBQAAAAdhc3NldElkBQAAAANuaWwAAAAASMjH0Q==", "chainId": 84, "height": 666171, "spentComplexity": 0 } View: original | compacted Prev: AiNP94bdx52s1MG39PCpSLcZEy8Ja9p1XQsuckMYAuks Next: ALH1rRiBTs2x1V6qbZBLMuYiDFw1k2u3BbKU324QaB9M Diff:
Old | New | Differences | |
---|---|---|---|
40 | 40 | then throw("You need to use waves") | |
41 | 41 | else if ((pmt.amount != price)) | |
42 | 42 | then throw("Count of waves is not match price") | |
43 | - | else | |
43 | + | else TransferSet([ScriptTransfer(i.caller, 1, fromBase58String(assetId))]) | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func createOrder (price) = { | |
8 | 8 | let pmt = extract(i.payment) | |
9 | 9 | if (!(isDefined(pmt.assetId))) | |
10 | 10 | then throw("You need to use tokenId, not waves") | |
11 | 11 | else { | |
12 | 12 | let currentKey = toBase58String(i.caller.bytes) | |
13 | 13 | let assetId = toBase58String(extract(pmt.assetId)) | |
14 | 14 | let uniqKey = ((((currentKey + "_") + assetId) + "_") + toString(height)) | |
15 | 15 | WriteSet([DataEntry(("assetAmount_" + uniqKey), pmt.amount), DataEntry(("assetPrice_" + uniqKey), price)]) | |
16 | 16 | } | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | 22 | func buyTicket (uniqKey) = { | |
23 | 23 | let pmt = extract(i.payment) | |
24 | 24 | let assetId = extract(split(uniqKey, "_")[1]) | |
25 | 25 | let price = match getInteger(this, ("assetPrice_" + uniqKey)) { | |
26 | 26 | case p: Int => | |
27 | 27 | p | |
28 | 28 | case _ => | |
29 | 29 | 0 | |
30 | 30 | } | |
31 | 31 | let currentAmount = match getInteger(this, ("assetAmount_" + uniqKey)) { | |
32 | 32 | case a: Int => | |
33 | 33 | a | |
34 | 34 | case _ => | |
35 | 35 | 0 | |
36 | 36 | } | |
37 | 37 | if ((0 >= currentAmount)) | |
38 | 38 | then throw("Have not enough of tickets") | |
39 | 39 | else if (isDefined(pmt.assetId)) | |
40 | 40 | then throw("You need to use waves") | |
41 | 41 | else if ((pmt.amount != price)) | |
42 | 42 | then throw("Count of waves is not match price") | |
43 | - | else | |
43 | + | else TransferSet([ScriptTransfer(i.caller, 1, fromBase58String(assetId))]) | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 |
github/deemru/w8io/169f3d6 32.04 ms ◑