tx · GHnhNbfD84LRqPkjuyY69QKziYEsyu7bdJTEkpt7BBU8 3MzVXk2cYsNaLfTxtBDYVGk2vaWoxALVQYF: -0.04000000 Waves 2019.10.10 02:44 [712996] smart account 3MzVXk2cYsNaLfTxtBDYVGk2vaWoxALVQYF > SELF 0.00000000 Waves
{ "type": 13, "id": "GHnhNbfD84LRqPkjuyY69QKziYEsyu7bdJTEkpt7BBU8", "fee": 4000000, "feeAssetId": null, "timestamp": 1570663556098, "version": 1, "sender": "3MzVXk2cYsNaLfTxtBDYVGk2vaWoxALVQYF", "senderPublicKey": "9B4neTu1Wt3FKP3H1XE5i99creaB5vZ2VeJineSJEAt5", "proofs": [ "2XkHuSw9xtDp7xf6cdhVq84LzmyW8FnpJJXUHhXgScaQ1QUBWrQM8S2ySnQehE5DpbwRRKfrFzKHuTPpkMRnV3YC", "s3XBicq31eaVsQMs5b3PV52ppY9sE4nHHnB8NTiedu8q8re951rKNhgMGLrZqksviXwK9HZjU5gH6a8iDpMUzd5" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAwAAAAALYWxpY2VQdWJLZXkBAAAAICbr+bTZ7Q5z0obV9LyOT4DHF9gq98d+1nSrrzIvBR82AAAAAAlib2JQdWJLZXkBAAAAIB64hRnTHLeOQ26Dm1pHFsrHFv0q6VEdpxH/xhNe+sVQAAAAAAxjb29wZXJQdWJLZXkBAAAAIHlxleGrS0myZMS9922HrQwWZ3kytPuwdWZKMRJHY7dOAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBjYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAA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AAAAGYWxpY2UxBQAAAAdjb29wZXIzBwYDBQAAAAZhbGljZTIFAAAAB2Nvb3BlcjEHBgMFAAAABmFsaWNlMgUAAAAHY29vcGVyMwcGAwUAAAAGYWxpY2UzBQAAAAdjb29wZXIxBwYDBQAAAAZhbGljZTMFAAAAB2Nvb3BlcjIHBAAAAA1ib2JlQW5kQ29vcGVyAwMDAwMDBQAAAARib2IxBQAAAAdjb29wZXIyBwYDBQAAAARib2IyBQAAAAdjb29wZXIzBwYDBQAAAARib2IyBQAAAAdjb29wZXIxBwYDBQAAAARib2IyBQAAAAdjb29wZXIzBwYDBQAAAARib2IzBQAAAAdjb29wZXIxBwYDBQAAAARib2IzBQAAAAdjb29wZXIyBwQAAAAHJG1hdGNoMAUAAAACdHgDAwUAAAALYWxpY2VBbmRCb2IGBQAAAA5hbGljZUFuZENvb3BlcgYFAAAADWJvYmVBbmRDb29wZXIpFVeJ", "chainId": 84, "height": 712996, "spentComplexity": 0 } View: original | compacted Prev: 7fs1GJ3HmVc8eK5spKGhLVWo9Dv9S9DYndkgHYJC8JAi Next: FS9KikawnPGb4qgmLVU92WKpYjpYqm6nJNkuv3BG3EZL Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let alicePubKey = base58' | |
4 | + | let alicePubKey = base58'3cwC3QGDvTuJ4fiJGtkSZUkUDLMMHADsNjee31nn31TK' | |
5 | 5 | ||
6 | 6 | let bobPubKey = base58'34vRSDmbyQ1P5B2KJKRW5snyxaXD7qNUqJ9b7a5HmwTu' | |
7 | 7 | ||
8 | - | let cooperPubKey = base58'3cwC3QGDvTuJ4fiJGtkSZUkUDLMMHADsNjee31nn31TK' | |
8 | + | let cooperPubKey = base58'9B4neTu1Wt3FKP3H1XE5i99creaB5vZ2VeJineSJEAt5' | |
9 | + | ||
10 | + | @Callable(i) | |
11 | + | func purchase () = { | |
12 | + | let pmt = extract(i.payment) | |
13 | + | if (isDefined(pmt.assetId)) | |
14 | + | then throw("can use WAVES only at the moment") | |
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.amount)) | |
24 | + | then throw("purchase amount cannot be less than item price") | |
25 | + | else if ((pmt.amount > price)) | |
26 | + | then throw("purchase amount cannot be higher than item price") | |
27 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
28 | + | } | |
29 | + | } | |
9 | 30 | ||
10 | 31 | ||
11 | 32 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let alicePubKey = base58' | |
4 | + | let alicePubKey = base58'3cwC3QGDvTuJ4fiJGtkSZUkUDLMMHADsNjee31nn31TK' | |
5 | 5 | ||
6 | 6 | let bobPubKey = base58'34vRSDmbyQ1P5B2KJKRW5snyxaXD7qNUqJ9b7a5HmwTu' | |
7 | 7 | ||
8 | - | let cooperPubKey = base58'3cwC3QGDvTuJ4fiJGtkSZUkUDLMMHADsNjee31nn31TK' | |
8 | + | let cooperPubKey = base58'9B4neTu1Wt3FKP3H1XE5i99creaB5vZ2VeJineSJEAt5' | |
9 | + | ||
10 | + | @Callable(i) | |
11 | + | func purchase () = { | |
12 | + | let pmt = extract(i.payment) | |
13 | + | if (isDefined(pmt.assetId)) | |
14 | + | then throw("can use WAVES only at the moment") | |
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.amount)) | |
24 | + | then throw("purchase amount cannot be less than item price") | |
25 | + | else if ((pmt.amount > price)) | |
26 | + | then throw("purchase amount cannot be higher than item price") | |
27 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
28 | + | } | |
29 | + | } | |
9 | 30 | ||
10 | 31 | ||
11 | 32 | @Verifier(tx) | |
12 | 33 | func verify () = { | |
13 | 34 | let alice1 = sigVerify(tx.bodyBytes, tx.proofs[0], alicePubKey) | |
14 | 35 | let alice2 = sigVerify(tx.bodyBytes, tx.proofs[1], alicePubKey) | |
15 | 36 | let alice3 = sigVerify(tx.bodyBytes, tx.proofs[2], alicePubKey) | |
16 | 37 | let bob1 = sigVerify(tx.bodyBytes, tx.proofs[0], bobPubKey) | |
17 | 38 | let bob2 = sigVerify(tx.bodyBytes, tx.proofs[1], bobPubKey) | |
18 | 39 | let bob3 = sigVerify(tx.bodyBytes, tx.proofs[2], bobPubKey) | |
19 | 40 | let cooper1 = sigVerify(tx.bodyBytes, tx.proofs[0], cooperPubKey) | |
20 | 41 | let cooper2 = sigVerify(tx.bodyBytes, tx.proofs[1], cooperPubKey) | |
21 | 42 | let cooper3 = sigVerify(tx.bodyBytes, tx.proofs[2], cooperPubKey) | |
22 | 43 | let aliceAndBob = if (if (if (if (if (if (alice1) | |
23 | 44 | then bob2 | |
24 | 45 | else false) | |
25 | 46 | then true | |
26 | 47 | else if (alice1) | |
27 | 48 | then bob3 | |
28 | 49 | else false) | |
29 | 50 | then true | |
30 | 51 | else if (alice2) | |
31 | 52 | then bob1 | |
32 | 53 | else false) | |
33 | 54 | then true | |
34 | 55 | else if (alice2) | |
35 | 56 | then bob3 | |
36 | 57 | else false) | |
37 | 58 | then true | |
38 | 59 | else if (alice3) | |
39 | 60 | then bob1 | |
40 | 61 | else false) | |
41 | 62 | then true | |
42 | 63 | else if (alice3) | |
43 | 64 | then bob2 | |
44 | 65 | else false | |
45 | 66 | let aliceAndCooper = if (if (if (if (if (if (alice1) | |
46 | 67 | then cooper2 | |
47 | 68 | else false) | |
48 | 69 | then true | |
49 | 70 | else if (alice1) | |
50 | 71 | then cooper3 | |
51 | 72 | else false) | |
52 | 73 | then true | |
53 | 74 | else if (alice2) | |
54 | 75 | then cooper1 | |
55 | 76 | else false) | |
56 | 77 | then true | |
57 | 78 | else if (alice2) | |
58 | 79 | then cooper3 | |
59 | 80 | else false) | |
60 | 81 | then true | |
61 | 82 | else if (alice3) | |
62 | 83 | then cooper1 | |
63 | 84 | else false) | |
64 | 85 | then true | |
65 | 86 | else if (alice3) | |
66 | 87 | then cooper2 | |
67 | 88 | else false | |
68 | 89 | let bobeAndCooper = if (if (if (if (if (if (bob1) | |
69 | 90 | then cooper2 | |
70 | 91 | else false) | |
71 | 92 | then true | |
72 | 93 | else if (bob2) | |
73 | 94 | then cooper3 | |
74 | 95 | else false) | |
75 | 96 | then true | |
76 | 97 | else if (bob2) | |
77 | 98 | then cooper1 | |
78 | 99 | else false) | |
79 | 100 | then true | |
80 | 101 | else if (bob2) | |
81 | 102 | then cooper3 | |
82 | 103 | else false) | |
83 | 104 | then true | |
84 | 105 | else if (bob3) | |
85 | 106 | then cooper1 | |
86 | 107 | else false) | |
87 | 108 | then true | |
88 | 109 | else if (bob3) | |
89 | 110 | then cooper2 | |
90 | 111 | else false | |
91 | 112 | match tx { | |
92 | 113 | case _ => | |
93 | 114 | if (if (aliceAndBob) | |
94 | 115 | then true | |
95 | 116 | else aliceAndCooper) | |
96 | 117 | then true | |
97 | 118 | else bobeAndCooper | |
98 | 119 | } | |
99 | 120 | } | |
100 | 121 |
github/deemru/w8io/169f3d6 33.10 ms ◑