tx · EH3rjfx3jQY3oymHJnWF263qfCuqGB6a9BsYjwNEikZv

3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt:  -0.01400000 Waves

2020.11.18 16:15 [1270836] smart account 3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt > SELF 0.00000000 Waves

{ "type": 13, "id": "EH3rjfx3jQY3oymHJnWF263qfCuqGB6a9BsYjwNEikZv", "fee": 1400000, "feeAssetId": null, "timestamp": 1605705318587, "version": 2, "chainId": 84, "sender": "3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt", "senderPublicKey": "iRqJrgq4rS2ndNGFJoZtKcoTfskkxr3zfTesPWqtKzp", "proofs": [ "5TeZkmwSs9VrfnwmptXq618xRCzyjf5asgnpbFUhKmpzoEAdhEpK2edkNYuW3yg8totYCP13xM6c7ACWXue9ekxV" ], "script": "base64:AAIEAAAAAAAAAA4IAhIDCgEIEgUKAwgBCAAAAAAAAAACAAAAAWkBAAAACHB1cmNoYXNlAAAAAQAAAAhpdGVtTmFtZQQAAAAHcGF5bWVudAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAAHcGF5bWVudAAAAAdhc3NldElkCQAAAgAAAAECAAAAF09ubHkgV2F2ZXMgYXJlIGFjY2VwdGVkBAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAhpdGVtTmFtZQIAAAANX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwCQAAaAAAAAIFAAAAAWEAAAAAAAX14QAJAAACAAAAAQIAAAAOSXRlbSBub3QgZm91bmQDCQAAZgAAAAIFAAAABXByaWN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AABl9wcmljZQUAAAAFcHJpY2UJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACBQAAAANrZXkCAAAABV9kYXRhBQAAAARkYXRhBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABnHXXVE=", "height": 1270836, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: b9niW7Wp4DXFaiyp3ZKavC26bKpupahBrbcUfu3TdVh Next: BzahxzYZFuNh5PvUKJKQGB4KxPVgrYQC937ZQE1sMCQM Diff:
OldNewDifferences
2929 @Callable(i)
3030 func addItem (title,price,data) = {
3131 let supplierAddress = toBase58String(i.caller.bytes)
32- let key = ("item_" + toBase58String(sha256(toBytes((supplierAddress + title)))))
32+ let key = ((("item_" + supplierAddress) + "_") + title)
3333 if ((0 >= price))
3434 then throw("Price cannot be lower than 0")
35- else if (isDefined(getStringValue(this, key)))
35+ else if (isDefined(getString(this, key)))
3636 then throw("Item exists")
3737 else [StringEntry((key + "_supplier"), supplierAddress), IntegerEntry((key + "_price"), price), StringEntry((key + "_data"), data)]
3838 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func purchase (itemName) = {
88 let payment = value(i.payments[0])
99 if (isDefined(payment.assetId))
1010 then throw("Only Waves are accepted")
1111 else {
1212 let customerAddress = toBase58String(i.caller.bytes)
1313 let price = match getInteger(this, (itemName + "_coupon_price")) {
1414 case a: Int =>
1515 (a * 100000000)
1616 case _ =>
1717 throw("Item not found")
1818 }
1919 if ((price > payment.amount))
2020 then throw("Purchase amount is too low")
2121 else if ((payment.amount > price))
2222 then throw("Purchase amount is too high")
2323 else [StringEntry(("status:purchase_item_A_customer" + customerAddress), "true"), IntegerEntry(("price:purchase_item_A_customer" + customerAddress), price)]
2424 }
2525 }
2626
2727
2828
2929 @Callable(i)
3030 func addItem (title,price,data) = {
3131 let supplierAddress = toBase58String(i.caller.bytes)
32- let key = ("item_" + toBase58String(sha256(toBytes((supplierAddress + title)))))
32+ let key = ((("item_" + supplierAddress) + "_") + title)
3333 if ((0 >= price))
3434 then throw("Price cannot be lower than 0")
35- else if (isDefined(getStringValue(this, key)))
35+ else if (isDefined(getString(this, key)))
3636 then throw("Item exists")
3737 else [StringEntry((key + "_supplier"), supplierAddress), IntegerEntry((key + "_price"), price), StringEntry((key + "_data"), data)]
3838 }
3939
4040
4141 @Verifier(tx)
4242 func verify () = true
4343

github/deemru/w8io/c3f4982 
27.82 ms