tx · GPJEegx1E5uYGcgt5ufMgXKCyAzE842gLekm7bGM9bSV

3Mz9ndf12uVKYMqYmwUr81wcNLYEgr82ei6:  -0.01400000 Waves

2019.11.15 21:17 [766570] smart account 3Mz9ndf12uVKYMqYmwUr81wcNLYEgr82ei6 > SELF 0.00000000 Waves

{ "type": 13, "id": "GPJEegx1E5uYGcgt5ufMgXKCyAzE842gLekm7bGM9bSV", "fee": 1400000, "feeAssetId": null, "timestamp": 1573841894526, "version": 1, "sender": "3Mz9ndf12uVKYMqYmwUr81wcNLYEgr82ei6", "senderPublicKey": "8bmUdC19peGBa1TGeRZaZfpuDG6yKaGYBd8FQvcBLAXR", "proofs": [ "4ayebCDyHkGivh6eVWyUzsKgQ53MrxMhh65zbFQDijC99ABswGJ3UjxYyEYzpBNaEEFmBMDpcu5e21RM6r1cvmma" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMIAQgAAAAHAAAAAAROT05FAgAAAARub25lAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX3ByaWNlAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAVfZGF0YQEAAAAOZ2V0S2V5SXRlbVN1cHAAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAKZ2V0S2V5SXRlbQAAAAIAAAAEc3VwcAAAAAV0aXRsZQkAASwAAAACAgAAAAVpdGVtXwkAAlgAAAABCQAB9wAAAAEJAAGbAAAAAQkAASwAAAACBQAAAARzdXBwBQAAAAV0aXRsZQEAAAAQZ2V0VmFsdWVJdGVtU3VwcAAAAAEAAAAEaXRlbQkBAAAAC2dldFN0ckJ5S2V5AAAAAQkBAAAADmdldEtleUl0ZW1TdXBwAAAAAQUAAAAEaXRlbQAAAAEAAAABaQEAAAAHYWRkSXRlbQAAAAMAAAAFdGl0bGUAAAAFcHJpY2UAAAAEZGF0YQQAAAAHc3VwcEFkcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAARpdGVtCQEAAAAKZ2V0S2V5SXRlbQAAAAIFAAAAB3N1cHBBZHIFAAAABXRpdGxlAwkAAGcAAAACAAAAAAAAAAAABQAAAAVwcmljZQkAAAIAAAABAgAAACpwdXJjaGFzZSBhbW91bnQgY2FuIG5vdCBiZSBsZXNzIHRoYW4gcHJpY2UDCQEAAAACIT0AAAACCQEAAAAQZ2V0VmFsdWVJdGVtU3VwcAAAAAEFAAAABGl0ZW0FAAAABE5PTkUJAAACAAAAAQIAAAAYYW4gaXRlbSBpcyBhbHJlYWR5IGV4aXN0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAOZ2V0S2V5SXRlbVN1cHAAAAABBQAAAARpdGVtBQAAAAdzdXBwQWRyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQUAAAAEaXRlbQUAAAAFcHJpY2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEFAAAABGl0ZW0FAAAABGRhdGEFAAAAA25pbAAAAADPQqwj", "chainId": 84, "height": 766570, "spentComplexity": 0 } View: original | compacted Prev: none Next: BH8pWegCNZza68T5ffZRFCFWBFNyYy27VvA5VqfE6L6B Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let NONE = "none"
5+
6+func getKeyItemPrice (item) = (item + "_price")
7+
8+
9+func getKeyItemData (item) = (item + "_data")
10+
11+
12+func getKeyItemSupp (item) = (item + "_owner")
13+
14+
15+func getStrByKey (key) = {
16+ let str = match getString(this, key) {
17+ case a: String =>
18+ a
19+ case _ =>
20+ NONE
21+ }
22+ str
23+ }
24+
25+
26+func getKeyItem (supp,title) = ("item_" + toBase58String(sha256(toBytes((supp + title)))))
27+
28+
29+func getValueItemSupp (item) = getStrByKey(getKeyItemSupp(item))
30+
31+
32+@Callable(i)
33+func addItem (title,price,data) = {
34+ let suppAdr = toBase58String(i.caller.bytes)
35+ let item = getKeyItem(suppAdr, title)
36+ if ((0 >= price))
37+ then throw("purchase amount can not be less than price")
38+ else if ((getValueItemSupp(item) != NONE))
39+ then throw("an item is already exist")
40+ else WriteSet([DataEntry(getKeyItemSupp(item), suppAdr), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
41+ }
42+
43+

github/deemru/w8io/169f3d6 
21.60 ms