tx · 5bq5NkSiE3SWs6UHTq1wsW81fjJPZaDZncFvcznv4hv9

3Mrik3RqY2jPfkkG7R7UiHLBXGGa3jfMpyT:  -0.01000000 Waves

2019.08.27 23:38 [650088] smart account 3Mrik3RqY2jPfkkG7R7UiHLBXGGa3jfMpyT > SELF 0.00000000 Waves

{ "type": 13, "id": "5bq5NkSiE3SWs6UHTq1wsW81fjJPZaDZncFvcznv4hv9", "fee": 1000000, "feeAssetId": null, "timestamp": 1566938330925, "version": 1, "sender": "3Mrik3RqY2jPfkkG7R7UiHLBXGGa3jfMpyT", "senderPublicKey": "Di8Ucr8vDr6jZNa27iAQxGMYEW9WSuF6MCBaM3fe9coP", "proofs": [ "xcj6PrCbWqGLzNqJQbH37sK6DnBrn5vC1gX1CR3haBAbBQ11emSX1RVL1zGgiS86pcmn7v4Lc6R6G38ZF35dJmF" ], "script": "base64:AAIDAAAAAAAAAAAAAAANAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAACmdldEtleUl0ZW0AAAACAAAACHN1cHBsaWVyAAAABXRpdGxlCQABLAAAAAICAAAABWl0ZW1fCQACWAAAAAEJAAH3AAAAAQkAAZsAAAABCQABLAAAAAIFAAAACHN1cHBsaWVyBQAAAAV0aXRsZQEAAAAPZ2V0S2V5SXRlbVByaWNlAAA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hBAAAAA9zdXBwbGllckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAEaXRlbQkBAAAACmdldEtleUl0ZW0AAAACBQAAAA9zdXBwbGllckFkZHJlc3MFAAAABXRpdGxlAwkAAGcAAAACAAAAAAAAAAAABQAAAAVwcmljZQkAAAIAAAABAgAAAC5QdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBvciBlcXVhbCAwAwkBAAAAAiE9AAAAAgkBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAETk9ORQkAAAIAAAABAgAAABNJdGVtIGV4aXN0cyBhbHJlYWR5CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAASZ2V0S2V5SXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAPc3VwcGxpZXJBZGRyZXNzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQUAAAAEaXRlbQUAAAAFcHJpY2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEFAAAABGl0ZW0FAAAABGRhdGEFAAAAA25pbAAAAADURmEO", "chainId": 84, "height": 650088, "spentComplexity": 0 } View: original | compacted Prev: none Next: DQAWG7fJRq7ZtBTLVYQiKNkmSA3Bgg15KF3VYHB3Nrti Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let NONE = "none"
5+
6+func getNumberByKey (key) = {
7+ let num = match getInteger(this, key) {
8+ case a: Int =>
9+ a
10+ case _ =>
11+ 0
12+ }
13+ num
14+ }
15+
16+
17+func getStrByKey (key) = {
18+ let str = match getString(this, key) {
19+ case a: String =>
20+ a
21+ case _ =>
22+ NONE
23+ }
24+ str
25+ }
26+
27+
28+func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
29+
30+
31+func getKeyItemPrice (item) = (item + "_price")
32+
33+
34+func getKeyItemData (item) = (item + "_data")
35+
36+
37+func getKeyItemSupplier (item) = (item + "_owner")
38+
39+
40+func getKeySupplierBalance (account) = (account + "_balance")
41+
42+
43+func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
44+
45+
46+func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item))
47+
48+
49+func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
50+
51+
52+func getValueSupplierBalance (account) = getNumberByKey(getKeySupplierBalance(account))
53+
54+
55+func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
56+
57+
58+@Callable(i)
59+func addItem (title,price,data) = {
60+ let supplierAddress = toBase58String(i.caller.bytes)
61+ let item = getKeyItem(supplierAddress, title)
62+ if ((0 >= price))
63+ then throw("Purchase amount cannot be less than or equal 0")
64+ else if ((getValueItemSupplier(item) != NONE))
65+ then throw("Item exists already")
66+ else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
67+ }
68+
69+

github/deemru/w8io/026f985 
14.99 ms