tx · FeCn91Huva978WYSG2fmc8VYh9bS1K41Xq5G2AUns7Ty

3MyZK369zK9TujEoTKi3ard4f4J1ZaABZqy:  -0.01000000 Waves

2023.03.02 02:23 [2471662] smart account 3MyZK369zK9TujEoTKi3ard4f4J1ZaABZqy > SELF 0.00000000 Waves

{ "type": 13, "id": "FeCn91Huva978WYSG2fmc8VYh9bS1K41Xq5G2AUns7Ty", "fee": 1000000, "feeAssetId": null, "timestamp": 1677712978084, "version": 2, "chainId": 84, "sender": "3MyZK369zK9TujEoTKi3ard4f4J1ZaABZqy", "senderPublicKey": "8cWUc4iZbxGrPxnn2M8iDhdyEUKrRS9Ue8nPdb9cWQ57", "proofs": [ "5mXfg7ncG9FD3tTJp5RWx5j12uQ21Ecj1crYtG2QZA6agQS2dv7mkGqkjDdgr8rCW62dokqhejtZS6yurPygR4VQ" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMIAQgAAAAHAAAAAAROT05FAgAAAARub25lAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FAQAAAApnZXRLZXlJdGVtAAAAAgAAAAhzdXBwbGllcgAAAAV0aXRsZQkAASwAAAACAgAAAAVpdGVtXwkAAlgAAAABCQAB9wAAAAEJAAGbAAAAAQkAASwAAAACBQAAAAhzdXBwbGllcgUAAAAFdGl0bGUBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfb3duZXIBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQAAAARpdGVtCQEAAAALZ2V0U3RyQnlLZXkAAAABCQEAAAASZ2V0S2V5SXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABl9wcmljZQEAAAAOZ2V0S2V5SXRlbURhdGEAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAFX2RhdGEAAAABAAAAAWkBAAAAB2FkZEl0ZW0AAAADAAAABXRpdGxlAAAABXByaWNlAAAABGRhdGEEAAAAD3N1cHBsaWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAARpdGVtCQEAAAAKZ2V0S2V5SXRlbQAAAAIFAAAAD3N1cHBsaWVyQWRkcmVzcwUAAAAFdGl0bGUDCQAAZgAAAAIAAAAAAAAAAAAFAAAABXByaWNlCQAAAgAAAAECAAAAInB1cmNoYWNlIGNhbm5vdCBiZSBsZXNzIHRoZW4gcHJpY2UDCQEAAAACIT0AAAACCQEAAAAUZ2V0VmFsdWVJdGVtU3VwcGxpZXIAAAABBQAAAARpdGVtBQAAAAROT05FCQAAAgAAAAECAAAAGUFuIGl0ZW0gaXMgYWxyZWFkeSBleGlzdHMJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABBQAAAARpdGVtBQAAAA9zdXBwbGllckFkZHJlc3MJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABBQAAAARpdGVtBQAAAAVwcmljZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADmdldEtleUl0ZW1EYXRhAAAAAQUAAAAEaXRlbQUAAAAEZGF0YQUAAAADbmlsAAAAABt5QuU=", "height": 2471662, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HXS4NqLqtRhiZMbtYozgbVpdzDCHbw4uKEySapwkmEhH Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let NONE = "none"
5+
6+func getStrByKey (key) = match getString(this, key) {
7+ case a: String =>
8+ a
9+ case _ =>
10+ NONE
11+}
412
513
14+func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
615
7-@Verifier(tx)
8-func verify () = match tx {
9- case d: SetScriptTransaction =>
10- true
11- case d: DataTransaction =>
12- true
13- case _ =>
14- false
15-}
16+
17+func getKeyItemSupplier (item) = (item + "_owner")
18+
19+
20+func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
21+
22+
23+func getKeyItemPrice (item) = (item + "_price")
24+
25+
26+func getKeyItemData (item) = (item + "_data")
27+
28+
29+@Callable(i)
30+func addItem (title,price,data) = {
31+ let supplierAddress = toBase58String(i.caller.bytes)
32+ let item = getKeyItem(supplierAddress, title)
33+ if ((0 > price))
34+ then throw("purchace cannot be less then price")
35+ else if ((getValueItemSupplier(item) != NONE))
36+ then throw("An item is already exists")
37+ else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
38+ }
39+
1640

github/deemru/w8io/169f3d6 
21.75 ms