tx · EBEDX1aWLVsTzv1S45YfMHBHU6J4vu6c19qPzYCzx6to 3Mx6Fhgx2b7Vrcg5cPwmcGx2UTrCsGy16hX: -0.01000000 Waves 2019.08.21 11:25 [640644] smart account 3Mx6Fhgx2b7Vrcg5cPwmcGx2UTrCsGy16hX > SELF 0.00000000 Waves
{ "type": 13, "id": "EBEDX1aWLVsTzv1S45YfMHBHU6J4vu6c19qPzYCzx6to", "fee": 1000000, "feeAssetId": null, "timestamp": 1566375780859, "version": 1, "sender": "3Mx6Fhgx2b7Vrcg5cPwmcGx2UTrCsGy16hX", "senderPublicKey": "rbQBcP925Nu3mB58D4Zw36LLDks2LgrcbshyaiSJSHy", "proofs": [ "3DNDDJze9P1U3685F4L48R9g3j5uPD3LQJPHcrC6KDcJsqSbjqRVEsBTCHMrQzYhniYgMDDXhhSTXEmqPM7FdevQ" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFuBQAAAAckbWF0Y2gwBQAAAAFuAAAAAAAAAAAAAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAAAROT05FAQAAAApnZXRLZXlJdGVtAAAAAgAAAAhzdXBwbGllcgAAAAV0aXRsZQkAASwAAAACAgAAAAVpdGVtXwkAAlgAAAABCQAB9wAAAAEJAAGbAAAAAQkAASwAAAACBQAAAAhzdXBwbGllcgUAAAAFdGl0bGUBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdG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AARpdGVtBQAAAARkYXRhBQAAAANuaWwAAAAAtsHUjQ==", "chainId": 84, "height": 640644, "spentComplexity": 0 } View: original | compacted Prev: none Next: C4Y9dZCGzspCU3mkj5WL2GPupYGkTG6ggYAZU6aT3h4k 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 getNumberByKey (key) = match getInteger(this, key) { | |
7 | + | case n: Int => | |
8 | + | n | |
9 | + | case _ => | |
10 | + | 0 | |
11 | + | } | |
12 | + | ||
13 | + | ||
14 | + | func getStrByKey (key) = match getString(this, key) { | |
15 | + | case s: String => | |
16 | + | s | |
17 | + | case _ => | |
18 | + | NONE | |
19 | + | } | |
20 | + | ||
21 | + | ||
22 | + | func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title))))) | |
23 | + | ||
24 | + | ||
25 | + | func getKeyItemSupplier (item) = (item + "_owner") | |
26 | + | ||
27 | + | ||
28 | + | func getKeyItemPrice (item) = (item + "_price") | |
29 | + | ||
30 | + | ||
31 | + | func getKeyItemData (item) = (item + "_data") | |
32 | + | ||
33 | + | ||
34 | + | func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item)) | |
35 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func addItem (title,price,data) = { | |
39 | + | let supplierAddress = toBase58String(i.caller.bytes) | |
40 | + | let item = getKeyItem(supplierAddress, title) | |
41 | + | if ((0 >= price)) | |
42 | + | then throw("purchase amount cannot be ess than item price") | |
43 | + | else if ((getValueItemSupplier(item) != NONE)) | |
44 | + | then throw("an item already exists") | |
45 | + | else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)]) | |
46 | + | } | |
47 | + | ||
48 | + |
github/deemru/w8io/169f3d6 39.54 ms ◑