tx · t3D15JsUrDF3KM6M8h7VkgdTXPDpdkQjMkqXSLGRfJf 3MvFWdf5NgnMVSprWTkEP1okPo1pDgqLH76: -0.01400000 Waves 2020.10.02 13:03 [1202784] smart account 3MvFWdf5NgnMVSprWTkEP1okPo1pDgqLH76 > SELF 0.00000000 Waves
{ "type": 13, "id": "t3D15JsUrDF3KM6M8h7VkgdTXPDpdkQjMkqXSLGRfJf", "fee": 1400000, "feeAssetId": null, "timestamp": 1601633005952, "version": 2, "chainId": 84, "sender": "3MvFWdf5NgnMVSprWTkEP1okPo1pDgqLH76", "senderPublicKey": "7qQJSjnWatmsj6R3ztxN7Z8dnfhozBHpLwKYKgpSKWMd", "proofs": [ "2khFA98zGGLHcUmLxWxUM8Z2zgfbxvnzA8TFmh4GEmwsjF76xTaobro6eyMPid7QUFA4dVQJgHnEJWeqYCTrNTqj", "5knGeMLbgA4DDTLPw9bPWy3Hxhgu3CwZ6KYwDwtkK3Phat32N6n12Wbj5CgubiCszVS74dt2WDTNLyoTATgJUMGk" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAwAAAAALYWxpY2VQdWJLZXkBAAAAIGWMWL1xS8UM0sunKVizh4wfr9liEBCLf8kf/FHCLjtAAAAAAAlib2JQdWJLZXkBAAAAIFWhIQjZ0p7zX1Aax7DUrjRyF/IFaG7tPly3lj9wpgMYAAAAAAxjb29wZXJQdWJLZXkBAAAAIH6pV/Zr5KzU7mhyJG84bHzs5/S+RkxIN29Q/qRoYgpmAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBjYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAA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Y29vcGVyMgcGAwUAAAAGYWxpY2UxBQAAAAdjb29wZXIzBwYDBQAAAAZhbGljZTIFAAAAB2Nvb3BlcjEHBgMFAAAABmFsaWNlMgUAAAAHY29vcGVyMwcGAwUAAAAGYWxpY2UzBQAAAAdjb29wZXIxBwYDBQAAAAZhbGljZTMFAAAAB2Nvb3BlcjIHBAAAAAxib2JBbmRDb29wZXIDAwMDAwMFAAAAB2Nvb3BlcjEFAAAABGJvYjIHBgMFAAAAB2Nvb3BlcjEFAAAABGJvYjMHBgMFAAAAB2Nvb3BlcjIFAAAABGJvYjEHBgMFAAAAB2Nvb3BlcjIFAAAABGJvYjMHBgMFAAAAB2Nvb3BlcjMFAAAABGJvYjEHBgMFAAAAB2Nvb3BlcjMFAAAABGJvYjIHBAAAAAckbWF0Y2gwBQAAAAJ0eAMDBQAAAAthbGljZUFuZEJvYgYFAAAADmFsaWNlQW5kQ29vcGVyBgUAAAAMYm9iQW5kQ29vcGVyB+i6Lw==", "height": 1202784, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3T6LRUadpf5YnqUk5heWCGeewaQQBVj4mqQZ38wSvqb6 Next: 9ojzsroAi3MUvS9cTpiv339ATH3gzfxVrYBtkog5QZMi Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let bobPubKey = base58'6mGA9LY4CmJFmQjCd2owynzAriXsRbtGrV7nKoimiuLs' | |
7 | 7 | ||
8 | 8 | let cooperPubKey = base58'9XS9277UP5uChd1k1JU2T3mgZzvAooJf8yciGGrqGWK7' | |
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 | 4 | let alicePubKey = base58'7qQJSjnWatmsj6R3ztxN7Z8dnfhozBHpLwKYKgpSKWMd' | |
5 | 5 | ||
6 | 6 | let bobPubKey = base58'6mGA9LY4CmJFmQjCd2owynzAriXsRbtGrV7nKoimiuLs' | |
7 | 7 | ||
8 | 8 | let cooperPubKey = base58'9XS9277UP5uChd1k1JU2T3mgZzvAooJf8yciGGrqGWK7' | |
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 bobAndCooper = if (if (if (if (if (if (cooper1) | |
69 | 90 | then bob2 | |
70 | 91 | else false) | |
71 | 92 | then true | |
72 | 93 | else if (cooper1) | |
73 | 94 | then bob3 | |
74 | 95 | else false) | |
75 | 96 | then true | |
76 | 97 | else if (cooper2) | |
77 | 98 | then bob1 | |
78 | 99 | else false) | |
79 | 100 | then true | |
80 | 101 | else if (cooper2) | |
81 | 102 | then bob3 | |
82 | 103 | else false) | |
83 | 104 | then true | |
84 | 105 | else if (cooper3) | |
85 | 106 | then bob1 | |
86 | 107 | else false) | |
87 | 108 | then true | |
88 | 109 | else if (cooper3) | |
89 | 110 | then bob2 | |
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 bobAndCooper | |
98 | 119 | } | |
99 | 120 | } | |
100 | 121 |
github/deemru/w8io/026f985 38.34 ms ◑