tx · 4ppnnPcbAokg66apjxWC9sX6gGmFbkGz9CShCiExuNu5 3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt: -0.01400000 Waves 2020.11.18 18:07 [1270943] smart account 3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt > SELF 0.00000000 Waves
{ "type": 13, "id": "4ppnnPcbAokg66apjxWC9sX6gGmFbkGz9CShCiExuNu5", "fee": 1400000, "feeAssetId": null, "timestamp": 1605712093598, "version": 2, "chainId": 84, "sender": "3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt", "senderPublicKey": "iRqJrgq4rS2ndNGFJoZtKcoTfskkxr3zfTesPWqtKzp", "proofs": [ "24VeXdH4zMgZooVMtVoeJYa1jZ77Q5iapF481SDFT1bX57Tdkwdv53HRRcMDce5dEQgyL4TyNCAohSkiNZ6HvB8i" ], "script": "base64:AAIEAAAAAAAAAAIIAgAAAAAAAAAAAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAYwiXbx", "height": 1270943, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BzahxzYZFuNh5PvUKJKQGB4KxPVgrYQC937ZQE1sMCQM Next: G6kXk79JB3HKjpbhJ7mkue6BEPbU5CTGRXbo52WFCVBB Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | - | ||
6 | - | @Callable(i) | |
7 | - | func purchase (item) = { | |
8 | - | let payment = value(i.payments[0]) | |
9 | - | if (isDefined(payment.assetId)) | |
10 | - | then throw("Waves only") | |
11 | - | else { | |
12 | - | let userAddress = toBase58String(i.caller.bytes) | |
13 | - | let price = getIntegerValue(this, (item + "_price")) | |
14 | - | let supplier = getStringValue(this, (item + "_supplier")) | |
15 | - | if ((price > payment.amount)) | |
16 | - | then throw("Too low") | |
17 | - | else if ((payment.amount > price)) | |
18 | - | then throw("Too high") | |
19 | - | else [IntegerEntry((item + "_counter"), (getIntegerValue(this, (item + "_counter")) + 1))] | |
20 | - | } | |
21 | - | } | |
22 | - | ||
23 | - | ||
24 | - | ||
25 | - | @Callable(i) | |
26 | - | func addItem (title,price,data) = { | |
27 | - | let supplierAddress = toBase58String(i.caller.bytes) | |
28 | - | let key = ((("item_" + supplierAddress) + "_") + title) | |
29 | - | if ((0 >= price)) | |
30 | - | then throw("Price cannot be lower than 0") | |
31 | - | else if (isDefined(getString(this, key))) | |
32 | - | then throw("Item exists") | |
33 | - | else [StringEntry((key + "_supplier"), supplierAddress), IntegerEntry((key + "_price"), price), StringEntry((key + "_data"), data), IntegerEntry((key + "_counter"), 0)] | |
34 | - | } | |
35 | 5 | ||
36 | 6 | ||
37 | 7 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | - | ||
6 | - | @Callable(i) | |
7 | - | func purchase (item) = { | |
8 | - | let payment = value(i.payments[0]) | |
9 | - | if (isDefined(payment.assetId)) | |
10 | - | then throw("Waves only") | |
11 | - | else { | |
12 | - | let userAddress = toBase58String(i.caller.bytes) | |
13 | - | let price = getIntegerValue(this, (item + "_price")) | |
14 | - | let supplier = getStringValue(this, (item + "_supplier")) | |
15 | - | if ((price > payment.amount)) | |
16 | - | then throw("Too low") | |
17 | - | else if ((payment.amount > price)) | |
18 | - | then throw("Too high") | |
19 | - | else [IntegerEntry((item + "_counter"), (getIntegerValue(this, (item + "_counter")) + 1))] | |
20 | - | } | |
21 | - | } | |
22 | - | ||
23 | - | ||
24 | - | ||
25 | - | @Callable(i) | |
26 | - | func addItem (title,price,data) = { | |
27 | - | let supplierAddress = toBase58String(i.caller.bytes) | |
28 | - | let key = ((("item_" + supplierAddress) + "_") + title) | |
29 | - | if ((0 >= price)) | |
30 | - | then throw("Price cannot be lower than 0") | |
31 | - | else if (isDefined(getString(this, key))) | |
32 | - | then throw("Item exists") | |
33 | - | else [StringEntry((key + "_supplier"), supplierAddress), IntegerEntry((key + "_price"), price), StringEntry((key + "_data"), data), IntegerEntry((key + "_counter"), 0)] | |
34 | - | } | |
35 | 5 | ||
36 | 6 | ||
37 | 7 | @Verifier(tx) | |
38 | 8 | func verify () = true | |
39 | 9 |
github/deemru/w8io/026f985 17.43 ms ◑