tx · BzahxzYZFuNh5PvUKJKQGB4KxPVgrYQC937ZQE1sMCQM

3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt:  -0.01400000 Waves

2020.11.18 16:42 [1270858] smart account 3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt > SELF 0.00000000 Waves

{ "type": 13, "id": "BzahxzYZFuNh5PvUKJKQGB4KxPVgrYQC937ZQE1sMCQM", "fee": 1400000, "feeAssetId": null, "timestamp": 1605707018481, "version": 2, "chainId": 84, "sender": "3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt", "senderPublicKey": "iRqJrgq4rS2ndNGFJoZtKcoTfskkxr3zfTesPWqtKzp", "proofs": [ "LQaRtFSSvXkrEQ3pgBauit2JLueLXuCE2vJGSvm2dT571QxjLcU6uUkDx3GWEQYwVDPajnVXFPiXcZZrfRXgKaA" ], "script": "base64:AAIEAAAAAAAAAA4IAhIDCgEIEgUKAwgBCAAAAAAAAAACAAAAAWkBAAAACHB1cmNoYXNlAAAAAQAAAARpdGVtBAAAAAdwYXltZW50CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAKV2F2ZXMgb25seQQAAAALdXNlckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEaXRlbQIAAAAGX3ByaWNlBAAAAAhzdXBwbGllcgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAARpdGVtAgAAAAlfc3VwcGxpZXIDCQAAZgAAAAIFAAAABXByaWNlCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAAACAAAAAQIA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AUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAZyu/uJ", "height": 1270858, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EH3rjfx3jQY3oymHJnWF263qfCuqGB6a9BsYjwNEikZv Next: 4ppnnPcbAokg66apjxWC9sX6gGmFbkGz9CShCiExuNu5 Diff:
OldNewDifferences
77 func purchase (b) = {
88 let c = value(a.payments[0])
99 if (isDefined(c.assetId))
10- then throw("Only Waves are accepted")
10+ then throw("Waves only")
1111 else {
1212 let d = toBase58String(a.caller.bytes)
13- let e = {
14- let f = getInteger(this, (b + "_coupon_price"))
15- if ($isInstanceOf(f, "Int"))
16- then {
17- let g = f
18- (g * 100000000)
19- }
20- else throw("Item not found")
21- }
13+ let e = getIntegerValue(this, (b + "_price"))
14+ let f = getStringValue(this, (b + "_supplier"))
2215 if ((e > c.amount))
23- then throw("Purchase amount is too low")
16+ then throw("Too low")
2417 else if ((c.amount > e))
25- then throw("Purchase amount is too high")
26- else [StringEntry(("status:purchase_item_A_customer" + d), "true"), IntegerEntry(("price:purchase_item_A_customer" + d), e)]
18+ then throw("Too high")
19+ else [IntegerEntry((b + "_counter"), (getIntegerValue(this, (b + "_counter")) + 1))]
2720 }
2821 }
2922
3023
3124
3225 @Callable(a)
33-func addItem (h,e,i) = {
34- let j = toBase58String(a.caller.bytes)
35- let k = ((("item_" + j) + "_") + h)
26+func addItem (g,e,h) = {
27+ let i = toBase58String(a.caller.bytes)
28+ let j = ((("item_" + i) + "_") + g)
3629 if ((0 >= e))
3730 then throw("Price cannot be lower than 0")
38- else if (isDefined(getString(this, k)))
31+ else if (isDefined(getString(this, j)))
3932 then throw("Item exists")
40- else [StringEntry((k + "_supplier"), j), IntegerEntry((k + "_price"), e), StringEntry((k + "_data"), i)]
33+ else [StringEntry((j + "_supplier"), i), IntegerEntry((j + "_price"), e), StringEntry((j + "_data"), h), IntegerEntry((j + "_counter"), 0)]
4134 }
4235
4336
44-@Verifier(l)
45-func m () = true
37+@Verifier(k)
38+func l () = true
4639
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func purchase (b) = {
88 let c = value(a.payments[0])
99 if (isDefined(c.assetId))
10- then throw("Only Waves are accepted")
10+ then throw("Waves only")
1111 else {
1212 let d = toBase58String(a.caller.bytes)
13- let e = {
14- let f = getInteger(this, (b + "_coupon_price"))
15- if ($isInstanceOf(f, "Int"))
16- then {
17- let g = f
18- (g * 100000000)
19- }
20- else throw("Item not found")
21- }
13+ let e = getIntegerValue(this, (b + "_price"))
14+ let f = getStringValue(this, (b + "_supplier"))
2215 if ((e > c.amount))
23- then throw("Purchase amount is too low")
16+ then throw("Too low")
2417 else if ((c.amount > e))
25- then throw("Purchase amount is too high")
26- else [StringEntry(("status:purchase_item_A_customer" + d), "true"), IntegerEntry(("price:purchase_item_A_customer" + d), e)]
18+ then throw("Too high")
19+ else [IntegerEntry((b + "_counter"), (getIntegerValue(this, (b + "_counter")) + 1))]
2720 }
2821 }
2922
3023
3124
3225 @Callable(a)
33-func addItem (h,e,i) = {
34- let j = toBase58String(a.caller.bytes)
35- let k = ((("item_" + j) + "_") + h)
26+func addItem (g,e,h) = {
27+ let i = toBase58String(a.caller.bytes)
28+ let j = ((("item_" + i) + "_") + g)
3629 if ((0 >= e))
3730 then throw("Price cannot be lower than 0")
38- else if (isDefined(getString(this, k)))
31+ else if (isDefined(getString(this, j)))
3932 then throw("Item exists")
40- else [StringEntry((k + "_supplier"), j), IntegerEntry((k + "_price"), e), StringEntry((k + "_data"), i)]
33+ else [StringEntry((j + "_supplier"), i), IntegerEntry((j + "_price"), e), StringEntry((j + "_data"), h), IntegerEntry((j + "_counter"), 0)]
4134 }
4235
4336
44-@Verifier(l)
45-func m () = true
37+@Verifier(k)
38+func l () = true
4639

github/deemru/w8io/026f985 
36.02 ms