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