tx · J3gmkPbgsayGUGFo2LkMpSeAf1FyQTCnhPi2Q5VNMhUx 3N9AtucmdwhyXxBKSPSfbJPHDFK6mVDpTny: -0.01400000 Waves 2019.09.01 11:16 [656622] smart account 3N9AtucmdwhyXxBKSPSfbJPHDFK6mVDpTny > SELF 0.00000000 Waves
{ "type": 13, "id": "J3gmkPbgsayGUGFo2LkMpSeAf1FyQTCnhPi2Q5VNMhUx", "fee": 1400000, "feeAssetId": null, "timestamp": 1567325579645, "version": 1, "sender": "3N9AtucmdwhyXxBKSPSfbJPHDFK6mVDpTny", "senderPublicKey": "5rRMYG6R2BNvQFL9Ztxr4mLQL3XTvTYEpeLbta3nbmHs", "proofs": [ "4PAJe48NZ61Xkft74o5y2hQWUw2yDcYr38QxSwNpba8mF3MHVni12kAhU1ma7ViHEvdBGD4W7KJuZ9TcWcjyd5pk", "3zPVSPeg7ACE91oQALEF2J2RYK8Aqyrrkuy4ryaMWnBq3oMN8hexzeRSm8zKE68JtzoXpTQrYTUNzMEYFJ6w6n3q" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBjYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAAE2l0ZW1fQV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAALnB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgbGVzcyB0aGFuIGl0ZW0gcHJpY2UDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAAC9wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGhpZ2VyIHRoYW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAANYWNjb3VudFB1YktleQEAAAAgSBe+oNQOMjMOf9TSCUtuoOQVE2pEm86+J/I8qij16CIEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYJAAH0AAAAAwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAJYm9keUJ5dGVzBQAAAA1hY2NvdW50UHViS2V5n8G0zA==", "chainId": 84, "height": 656622, "spentComplexity": 0 } View: original | compacted Prev: 62SoLiSbkgG6LrGrzzZ52j2GzFjZkMV9uaR6U3MkStyz Next: GPE6j7fbzvCAm8KJAyamX8Br88AV9G26meKZojcQYMXB Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let ownerPubKey = base58'5rRMYG6R2BNvQFL9Ztxr4mLQL3XTvTYEpeLbta3nbmHs' | |
5 | 4 | ||
6 | - | let account1PubKey = base58'4zwP5vTDkMxUjVVgGcPk6u4K9fHroRKF6VKACAWsJQdD' | |
7 | 5 | ||
8 | - | let account3PubKey = base58'3h6sXhTtfLedgnipsHp1VSJ8FapFXuvzYz83LcNQSdZf' | |
6 | + | @Callable(i) | |
7 | + | func purchase () = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if (isDefined(pmt.assetId)) | |
10 | + | then throw("can use WAVES only at the moment") | |
11 | + | else { | |
12 | + | let customerAddress = toBase58String(i.caller.bytes) | |
13 | + | let price = match getInteger(this, "item_A_coupon_price") { | |
14 | + | case a: Int => | |
15 | + | a | |
16 | + | case _ => | |
17 | + | 0 | |
18 | + | } | |
19 | + | if ((price > pmt.amount)) | |
20 | + | then throw("purchase amount cannot be less than item price") | |
21 | + | else if ((pmt.amount > price)) | |
22 | + | then throw("purchase amount cannot be higer than item price") | |
23 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
24 | + | } | |
25 | + | } | |
9 | 26 | ||
10 | 27 | ||
11 | 28 | @Verifier(tx) | |
12 | 29 | func verify () = { | |
13 | - | let owner1 = sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) | |
14 | - | let owner2 = sigVerify(tx.bodyBytes, tx.proofs[1], ownerPubKey) | |
15 | - | let owner3 = sigVerify(tx.bodyBytes, tx.proofs[2], ownerPubKey) | |
16 | - | let account11 = sigVerify(tx.bodyBytes, tx.proofs[0], account1PubKey) | |
17 | - | let account12 = sigVerify(tx.bodyBytes, tx.proofs[1], account1PubKey) | |
18 | - | let account13 = sigVerify(tx.bodyBytes, tx.proofs[2], account1PubKey) | |
19 | - | let account31 = sigVerify(tx.bodyBytes, tx.proofs[0], account3PubKey) | |
20 | - | let account32 = sigVerify(tx.bodyBytes, tx.proofs[1], account3PubKey) | |
21 | - | let account33 = sigVerify(tx.bodyBytes, tx.proofs[2], account3PubKey) | |
22 | - | let ownerAndOne = if (if (if (if (if (if (owner1) | |
23 | - | then account12 | |
24 | - | else false) | |
25 | - | then true | |
26 | - | else if (owner1) | |
27 | - | then account13 | |
28 | - | else false) | |
29 | - | then true | |
30 | - | else if (owner2) | |
31 | - | then account11 | |
32 | - | else false) | |
33 | - | then true | |
34 | - | else if (owner2) | |
35 | - | then account13 | |
36 | - | else false) | |
37 | - | then true | |
38 | - | else if (owner3) | |
39 | - | then account11 | |
40 | - | else false) | |
41 | - | then true | |
42 | - | else if (owner3) | |
43 | - | then account12 | |
44 | - | else false | |
45 | - | let ownerAndThree = if (if (if (if (if (if (owner1) | |
46 | - | then account32 | |
47 | - | else false) | |
48 | - | then true | |
49 | - | else if (owner1) | |
50 | - | then account33 | |
51 | - | else false) | |
52 | - | then true | |
53 | - | else if (owner2) | |
54 | - | then account31 | |
55 | - | else false) | |
56 | - | then true | |
57 | - | else if (owner2) | |
58 | - | then account33 | |
59 | - | else false) | |
60 | - | then true | |
61 | - | else if (owner3) | |
62 | - | then account31 | |
63 | - | else false) | |
64 | - | then true | |
65 | - | else if (owner3) | |
66 | - | then account32 | |
67 | - | else false | |
68 | - | let oneAndThree = if (if (if (if (if (if (account11) | |
69 | - | then account32 | |
70 | - | else false) | |
71 | - | then true | |
72 | - | else if (account11) | |
73 | - | then account33 | |
74 | - | else false) | |
75 | - | then true | |
76 | - | else if (account12) | |
77 | - | then account31 | |
78 | - | else false) | |
79 | - | then true | |
80 | - | else if (account12) | |
81 | - | then account33 | |
82 | - | else false) | |
83 | - | then true | |
84 | - | else if (account13) | |
85 | - | then account31 | |
86 | - | else false) | |
87 | - | then true | |
88 | - | else if (account13) | |
89 | - | then account32 | |
90 | - | else false | |
30 | + | let accountPubKey = base58'5rRMYG6R2BNvQFL9Ztxr4mLQL3XTvTYEpeLbta3nbmHs' | |
91 | 31 | match tx { | |
32 | + | case d: SetScriptTransaction => | |
33 | + | true | |
34 | + | case d: DataTransaction => | |
35 | + | true | |
92 | 36 | case _ => | |
93 | - | if (if (ownerAndOne) | |
94 | - | then true | |
95 | - | else ownerAndThree) | |
96 | - | then true | |
97 | - | else oneAndThree | |
37 | + | sigVerify(tx.proofs[0], tx.bodyBytes, accountPubKey) | |
98 | 38 | } | |
99 | 39 | } | |
100 | 40 |
github/deemru/w8io/03bedc9 22.59 ms ◑