tx · 3E4Yuv1Y2Xm52ZKy8G1GJA7c2gjwoStDJWdsDvtTj5M5 3Mr47Kpwz3hxvXt417SP42WaoT5iGsSEr5h: -0.04000000 Waves 2019.11.14 16:20 [764792] smart account 3Mr47Kpwz3hxvXt417SP42WaoT5iGsSEr5h > SELF 0.00000000 Waves
{ "type": 13, "id": "3E4Yuv1Y2Xm52ZKy8G1GJA7c2gjwoStDJWdsDvtTj5M5", "fee": 4000000, "feeAssetId": null, "timestamp": 1573737609060, "version": 1, "sender": "3Mr47Kpwz3hxvXt417SP42WaoT5iGsSEr5h", "senderPublicKey": "8JFVEhPAiLA1CbnTkMF6GdCqYJoNYUYUX6bmt8wk7VNc", "proofs": [ "oWzkcpMZgS9UmKqeTxv893jM5eq6CdPvjvqMbmmANFyNi9W4y9Red515RAh5HS9ut6g9eMHNitmJkfrmdWv1F3o" ], "script": "base64:AAIDAAAAAAAAAAgIARIECgIIAQAAAAAAAAABAAAAAWkBAAAACWJ1eVRpY2tldAAAAAIAAAAIdGlja2V0SWQAAAAGYW1vdW50BAAAAAdwYXltZW50CQEAAAAFdmFsdWUAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAp0aWNrZXRJbmZvCQEAAAAFdmFsdWUAAAABCQAD7AAAAAEJAAJZAAAAAQUAAAAIdGlja2V0SWQEAAAAC3N0YXJ0SGVpZ2h0BAAAAAckbWF0Y2gwCQAEGgAAAAIIBQAAAAp0aWNrZXRJbmZvAAAABmlzc3VlcgIAAAAFc3RhcnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQEAAAAAXgFAAAAByRtYXRjaDAAAAAAAAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABeAUAAAAHJG1hdGNoMAUAAAABeAkBAAAABXRocm93AAAAAAQAAAAKc3RvcEhlaWdodAQAAAAHJG1hdGNoMAkABBoAAAACCAUAAAAKdGlja2V0SW5mbwAAAAZpc3N1ZXICAAAAA2VuZAMJAAABAAAAAgU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ALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50CQACWQAAAAEFAAAACHRpY2tldElkBQAAAANuaWwAAAAA8WI4Jg==", "chainId": 84, "height": 764792, "spentComplexity": 0 } View: original | compacted Prev: CsePCZpMtuL4Sp2CezH1qUuvnLThUeEfWrGhDr1HmiEn 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 20.17 ms ◑