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