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:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
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- }
355
366
377 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
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- }
355
366
377 @Verifier(tx)
388 func verify () = true
399

github/deemru/w8io/873ac7e 
35.24 ms