tx · HTetfZZiA7vFeT91uCTDuxoUx13w4TWvkhDE1ZXZc9B1 3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n: -0.01000000 Waves 2019.07.03 06:28 [568690] smart account 3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n > SELF 0.00000000 Waves
{ "type": 13, "id": "HTetfZZiA7vFeT91uCTDuxoUx13w4TWvkhDE1ZXZc9B1", "fee": 1000000, "feeAssetId": null, "timestamp": 1562124532390, "version": 1, "sender": "3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n", "senderPublicKey": "GQuxeXLbjWe44XSJX8GXHEfPmd7e97QeNz3uvV5CVddH", "proofs": [ "4P7sgs8pgiZUYVq78bBjsBsBAhmY61BGbmowi9DLjeHpfwhaL67zh1FtgSYr4hSxo9EgPRmmpn1Eh1YG5CWQaUk4" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAAAAAAROT05FAgAAAARub25lAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAKZ2V0S2V5SXRlbQAAAAIAAAAIc3VwcGxpZXIAAAAFdGl0bGUJAAEsAAAAAgIAAAAFaXRlbV8JAAJYAAAAAQkAAfcAAAABCQABmwAAAAEJAAEsAAAAAgUAAAAIc3VwcGxpZXIFAAAABXRpdGxlAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAABRnZXRWYWx1ZUl0ZW1TdXBwbGllcgAAAAEAAAAEaXRlbQkBAAAAC2dldFN0ckJ5S2V5AAAAAQkBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEFAAAABGl0ZW0BAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAADmdldEtleUl0ZW1EYXRhAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABV9kYXRhAAAAAQAAAAFpAQAAAAdhZGRJdGVtAAAAAwAAAAV0aXRsZQAAAAVwcmljZQAAAARkYXRhBAAAAA9zdXBwbGllckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAEaXRlbQkBAAAACmdldEtleUl0ZW0AAAACBQAAAA9zdXBwbGllckFkZHJlc3MFAAAABXRpdGxlAwkAAGcAAAACAAAAAAAAAAAABQAAAAVwcmljZQkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHByaWNlAwkBAAAAAiE9AAAAAgkBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAETk9ORQkAAAIAAAABAgAAABhhbiBpdGVtIGlzIGFscmVhZHkgZXhpc3QJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABBQAAAARpdGVtBQAAAA9zdXBwbGllckFkZHJlc3MJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABBQAAAARpdGVtBQAAAAVwcmljZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADmdldEtleUl0ZW1EYXRhAAAAAQUAAAAEaXRlbQUAAAAEZGF0YQUAAAADbmlsAAAAAPHX5m0=", "chainId": 84, "height": 568690, "spentComplexity": 0 } View: original | compacted Prev: none Next: CQfmQUMaVRoA9ce4mFyzTwctbKk1EYxSEvKw6oyEfV3M Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let NONE = "none" | |
5 | + | ||
6 | + | func getStrByKey (key) = { | |
7 | + | let str = match getString(this, key) { | |
8 | + | case a: String => | |
9 | + | a | |
10 | + | case _ => | |
11 | + | NONE | |
12 | + | } | |
13 | + | str | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title))))) | |
18 | + | ||
19 | + | ||
20 | + | func getKeyItemSupplier (item) = (item + "_owner") | |
21 | + | ||
22 | + | ||
23 | + | func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item)) | |
24 | + | ||
25 | + | ||
26 | + | func getKeyItemPrice (item) = (item + "_price") | |
27 | + | ||
28 | + | ||
29 | + | func getKeyItemData (item) = (item + "_data") | |
30 | + | ||
31 | + | ||
32 | + | @Callable(i) | |
33 | + | func addItem (title,price,data) = { | |
34 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
35 | + | let item = getKeyItem(supplierAddress, title) | |
36 | + | if ((0 >= price)) | |
37 | + | then throw("purchase amount cannot be less than item price") | |
38 | + | else if ((getValueItemSupplier(item) != NONE)) | |
39 | + | then throw("an item is already exist") | |
40 | + | else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)]) | |
41 | + | } | |
42 | + | ||
43 | + |
github/deemru/w8io/026f985 23.28 ms ◑