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