tx · jN7RF4xfkJGNFyzqnjfNa46ibnWUhgLxQ6vkkFs36B4 3N3TQ9di2BKwAqkqwMFNWNigLQduCbVnwEz: -0.04000000 Waves 2019.11.13 17:20 [763417] smart account 3N3TQ9di2BKwAqkqwMFNWNigLQduCbVnwEz > SELF 0.00000000 Waves
{ "type": 13, "id": "jN7RF4xfkJGNFyzqnjfNa46ibnWUhgLxQ6vkkFs36B4", "fee": 4000000, "feeAssetId": null, "timestamp": 1573654948823, "version": 1, "sender": "3N3TQ9di2BKwAqkqwMFNWNigLQduCbVnwEz", "senderPublicKey": "5siQDWeRnAQ4knysN2J5ncozvByyjUiB7UzxA49MJrEm", "proofs": [ "gvQChwBJWh8mMDi3vjbcbbSMDHtMm9eZW7m6amRqKpAYdsLzfp2t2pMD3uEuV2nF9R7RSJ5K884he1BMdhWE6zD" ], "script": "base64:AAIDAAAAAAAAAAgIARIECgIIAQAAAAAAAAABAAAAAWkBAAAACWJ1eVRpY2tldAAAAAIAAAAIdGlja2V0SWQAAAAGYW1vdW50BAAAAAdwYXltZW50CQEAAAAFdmFsdWUAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAp0aWNrZXRJbmZvCQEAAAAFdmFsdWUAAAABCQAD7AAAAAEJAAJZAAAAAQUAAAAIdGlja2V0SWQEAAAAC3N0YXJ0SGVpZ2h0BAAAAAckbWF0Y2gwCQAEGgAAAAIIBQAAAAp0aWNrZXRJbmZvAAAABmlzc3VlcgIAAAAFc3RhcnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQEAAAAAXgFAAAAByRtYXRjaDAAAAAAAAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABeAUAAAAHJG1hdGNoMAUAAAABeAkBAAAABXRocm93AAAAAAQAAAAKc3RvcEhlaWdodAQAAAAHJG1hdGNoMAkABBoAAAACCAUAAAAKdGlja2V0SW5mbwAAAAZpc3N1ZXICAAAAA2VuZAMJAAABAAAAAgUAAAAHJG1hdG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JTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50CQACWQAAAAEFAAAACHRpY2tldElkBQAAAANuaWwAAAAA8WI4Jg==", "chainId": 84, "height": 763417, "spentComplexity": 0 } View: original | compacted Prev: 8N4Fjm8v2XppidRj9YuBPHamr1F4pRwdBEQAQmHhgHZz Next: none Full:
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 buyTicket (ticketId,amount) = { | |
8 | 8 | let payment = value(i.payment) | |
9 | 9 | let ticketInfo = value(assetInfo(fromBase58String(ticketId))) | |
10 | 10 | let startHeight = match getInteger(ticketInfo.issuer, "start") { | |
11 | 11 | case x: Unit => | |
12 | 12 | 0 | |
13 | 13 | case x: Int => | |
14 | 14 | x | |
15 | 15 | case _ => | |
16 | 16 | throw() | |
17 | 17 | } | |
18 | 18 | let stopHeight = match getInteger(ticketInfo.issuer, "end") { | |
19 | 19 | case x: Unit => | |
20 | 20 | 0 | |
21 | 21 | case x: Int => | |
22 | 22 | x | |
23 | 23 | case _ => | |
24 | 24 | throw() | |
25 | 25 | } | |
26 | 26 | if (isDefined(payment.assetId)) | |
27 | 27 | then throw("only waves for now") | |
28 | 28 | else if (if (((startHeight + stopHeight) > 0)) | |
29 | 29 | then if ((startHeight > height)) | |
30 | 30 | then true | |
31 | 31 | else (height > stopHeight) | |
32 | 32 | else false) | |
33 | 33 | then throw(((("you can only by a ticket between block: " + toString(startHeight)) + " and ") + toString(stopHeight))) | |
34 | 34 | else { | |
35 | 35 | let price = getIntegerValue(ticketInfo.issuer, "price") | |
36 | 36 | if (((price * amount) != payment.amount)) | |
37 | 37 | then throw(((((("Not the correct price. The price for " + toString(amount)) + " tickets = ") + toString((price * amount))) + ". You are paying: ") + toString(payment.amount))) | |
38 | 38 | else TransferSet([ScriptTransfer(i.caller, amount, fromBase58String(ticketId))]) | |
39 | 39 | } | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 |
github/deemru/w8io/169f3d6 49.24 ms ◑