tx · 27oWiqu31qw6PhgYKEt3iskg2NuFbxdp9hSFLzHjHJL5

3N81Dk1WuUv7UKt3inqWVYN81J8VHjoV3MC:  -0.01400000 Waves

2022.02.17 18:25 [1927789] smart account 3N81Dk1WuUv7UKt3inqWVYN81J8VHjoV3MC > SELF 0.00000000 Waves

{ "type": 13, "id": "27oWiqu31qw6PhgYKEt3iskg2NuFbxdp9hSFLzHjHJL5", "fee": 1400000, "feeAssetId": null, "timestamp": 1645111575091, "version": 2, "chainId": 84, "sender": "3N81Dk1WuUv7UKt3inqWVYN81J8VHjoV3MC", "senderPublicKey": "5vXdNgZ1TR8AAzcnLumQTQYzcU3AwHj91bZTtiE3roBE", "proofs": [ "51pvJ12NynQGKsNdD8gTus1fdJfAxi35TAF7cdGv9ae8SovKEheVyyZdTM4G8wBm8xuMwWgok3dt2YQ7SK8AnXHr" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMIAQgAAAAHAAAAAAROT05FAgAAAAROT05FAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAACmdldEtleUl0ZW0AAAACAAAACHN1cHBsaWVyAAAABXRpdGxlBAAAAA5zdXBwbGllclRpdHRsZQkAASwAAAACBQAAAAhzdXBwbGllcgUAAAAFdGl0bGUJAAEsAAAAAgIAAAAFaXRlbV8JAAJYAAAAAQkAAfcAAAABCQABmwAAAAEFAAAADnN1cHBsaWVyVGl0dGxlAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAAA5nZXR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PO7", "height": 1927789, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6VL7wY7M7pfKXQMWAmES1pD1CAaSiLC5wyGzqRp1RfxR Next: 68ihjaaAahY2XytQLUGTa8A7Ksjhtxhc2JnfGB9qaTsP Diff:
OldNewDifferences
2626 func getKeyItemData (item) = (item + "_data")
2727
2828
29-func getValueItemSupplier (account) = account
29+func getValueItemSupplier (account) = match getString(this, account) {
30+ case a: String =>
31+ a
32+ case _ =>
33+ "NONE"
34+}
3035
3136
3237 @Callable(i)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "NONE"
55
66 func getStringByKey (key) = match getString(this, key) {
77 case a: String =>
88 a
99 case _ =>
1010 ""
1111 }
1212
1313
1414 func getKeyItem (supplier,title) = {
1515 let supplierTittle = (supplier + title)
1616 ("item_" + toBase58String(sha256(toBytes(supplierTittle))))
1717 }
1818
1919
2020 func getKeyItemSupplier (item) = (item + "_owner")
2121
2222
2323 func getKeyItemPrice (item) = (item + "_owner")
2424
2525
2626 func getKeyItemData (item) = (item + "_data")
2727
2828
29-func getValueItemSupplier (account) = account
29+func getValueItemSupplier (account) = match getString(this, account) {
30+ case a: String =>
31+ a
32+ case _ =>
33+ "NONE"
34+}
3035
3136
3237 @Callable(i)
3338 func addItem (title,price,data) = {
3439 let supplierAddress = toBase58String(i.caller.bytes)
3540 let item = getKeyItem(supplierAddress, title)
3641 if ((0 >= price))
3742 then throw("Purchase amount cannot be less than item price")
3843 else if ((getValueItemSupplier(item) != NONE))
3944 then throw("An item is already exists")
4045 else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
4146 }
4247
4348

github/deemru/w8io/169f3d6 
38.12 ms