tx · 6S4J21o1mPzazTd6ge93R674mbA7S4UMMDw4wZj6JgST 3N4QttBLzbhNNu8zcHgXioi49Nh6mV9MxCJ: -0.01400000 Waves 2020.11.18 16:49 [1270864] smart account 3N4QttBLzbhNNu8zcHgXioi49Nh6mV9MxCJ > SELF 0.00000000 Waves
{ "type": 13, "id": "6S4J21o1mPzazTd6ge93R674mbA7S4UMMDw4wZj6JgST", "fee": 1400000, "feeAssetId": null, "timestamp": 1605707401836, "version": 2, "chainId": 84, "sender": "3N4QttBLzbhNNu8zcHgXioi49Nh6mV9MxCJ", "senderPublicKey": "HfLpRhXtnuCabRyNT6z7soaXcbUpwLUhjyBCVQ4szwzd", "proofs": [ "2eYP2471Y6woeqL1QnNKjYaF4aETVKmLUwE42ifmiqhtTtYmV5LLju4nDg4usjDS6bYTUvt6is2yNM8SbgcHXDxM" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAwAAAAARYWNjb3VudDFQdWJsaWNLZXkBAAAAIPeNeDDs4TWVhR1bzOk94lFsHOraL9B/FRj0XfVMj0hOAAAAABFhY2NvdW50MlB1YmxpY0tleQEAAAAgG1e/aEwKrtMkcq9WyiLLAHtKPJgLd/oAoUXcKuUDIhUAAAAADm90aGVyUHVibGljS2V5AQAAACDnblGJprjxGAm9jEz8V5M0TOEG6bhNvbMQquBNrx0dWgAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEIBQAAAAFpAAAACHBheW1lbnRzAwkBAAAACWlzRGVmaW5lZAAAAAEICQABkQAAAAIFAAAAA3BtdAAAAAAAAAAAAAAAAAdhc3NldElkCQAAAgAAAAECAAAACG9ubHkgd3dzBAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQ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HJG1hdGNoMAYDAwUAAAAQYWNjb3VudDFhY2NvdW50MgYFAAAADWFjY291bnQxb3RoZXIGBQAAAA1hY2NvdW50Mm90aGVy2RMIZA==", "height": 1270864, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BjpRESNFDqH81LsYuX3nUVCy7EfT53MHWq38tW25UQmy Next: Fv2SK3QMx9BvMPSRfUVaFJbu89DHNkwQUptpSjTHFPda Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let account1PublicKey = base58'HfLpRhXtnuCabRyNT6z7soaXcbUpwLUhjyBCVQ4szwzd' | |
5 | 5 | ||
6 | 6 | let account2PublicKey = base58'2qjcWuL7QitmuhkSTM7CnNxurCYXuqJ9ubswLBGmXfDv' | |
7 | 7 | ||
8 | 8 | let otherPublicKey = base58'GaQkBG6yLLAarb8wvPrEKnQhFqWomD2ZGT1T4vVx24qw' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func purchase () = { | |
12 | 12 | let pmt = value(i.payments) | |
13 | 13 | if (isDefined(pmt[0].assetId)) | |
14 | 14 | then throw("only wws") | |
15 | 15 | else { | |
16 | 16 | let customerAddress = toBase58String(i.caller.bytes) | |
17 | 17 | let price = match getInteger(this, "item_A_coupon_price") { | |
18 | 18 | case a: Int => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | if ((price > pmt[0].amount)) | |
24 | 24 | then throw("moar moeny") | |
25 | 25 | else if ((pmt[0].amount > price)) | |
26 | 26 | then throw("tu macz money") | |
27 | 27 | else if ((size(pmt) > 0)) | |
28 | 28 | then throw("single item only") | |
29 | 29 | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] | |
30 | 30 | } | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Verifier(tx) | |
35 | 35 | func verify () = { | |
36 | 36 | let account1 = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], account1PublicKey)) | |
37 | 37 | then true | |
38 | 38 | else sigVerify(tx.bodyBytes, tx.proofs[1], account1PublicKey)) | |
39 | 39 | then true | |
40 | 40 | else sigVerify(tx.bodyBytes, tx.proofs[2], account1PublicKey) | |
41 | 41 | let account2 = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], account2PublicKey)) | |
42 | 42 | then true | |
43 | 43 | else sigVerify(tx.bodyBytes, tx.proofs[1], account2PublicKey)) | |
44 | 44 | then true | |
45 | 45 | else sigVerify(tx.bodyBytes, tx.proofs[2], account2PublicKey) | |
46 | 46 | let other = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], otherPublicKey)) | |
47 | 47 | then true | |
48 | 48 | else sigVerify(tx.bodyBytes, tx.proofs[1], otherPublicKey)) | |
49 | 49 | then true | |
50 | 50 | else sigVerify(tx.bodyBytes, tx.proofs[2], otherPublicKey) | |
51 | 51 | let account1account2 = if (account1) | |
52 | 52 | then account2 | |
53 | 53 | else false | |
54 | 54 | let account1other = if (account1) | |
55 | 55 | then other | |
56 | 56 | else false | |
57 | 57 | let account2other = if (other) | |
58 | 58 | then account2 | |
59 | 59 | else false | |
60 | 60 | match tx { | |
61 | 61 | case d: SetScriptTransaction => | |
62 | 62 | true | |
63 | 63 | case d: DataTransaction => | |
64 | 64 | true | |
65 | 65 | case _ => | |
66 | 66 | if (if (account1account2) | |
67 | 67 | then true | |
68 | 68 | else account1other) | |
69 | 69 | then true | |
70 | 70 | else account2other | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 |
github/deemru/w8io/169f3d6 36.75 ms ◑