tx · A112PUstuUFk6AZBXzvqiAPqYjPdJdosZ63qvimexPF7

3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR:  -0.01400000 Waves

2019.07.14 04:09 [584737] smart account 3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR > SELF 0.00000000 Waves

{ "type": 13, "id": "A112PUstuUFk6AZBXzvqiAPqYjPdJdosZ63qvimexPF7", "fee": 1400000, "feeAssetId": null, "timestamp": 1563066654089, "version": 1, "sender": "3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR", "senderPublicKey": "Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV", "proofs": [ "JDgqSGAEK9pb78gN1cDhPZHGSf2uWPYpp5jx6GaU3WuSA4hAYnjqvhLgCHW5uautyUzptmkiD1SPSXsde9RS6H5" ], "script": "base64:AAIDAAAAAAAAAAAAAAAeAAAAAA5vd25lclB1YmxpY0tleQEAAAAgAnfP9tCFuj2k2BUY5PW9DVGxrCHBHKJwugv8WyiaGXIAAAAABE5PTkUCAAAABG5vbmUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1h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cm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgeYrMVo", "chainId": 84, "height": 584737, "spentComplexity": 0 } View: original | compacted Prev: 894iPjxFqLcpYsmtd9R8mtGehzij8DQbRaKRQFUjnSr2 Next: GYnxM71YvMp6wtjcJX9KgVWNT4jdQUBBf6zVSZ5XRAsT Diff:
OldNewDifferences
44 let ownerPublicKey = base58'Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV'
55
66 let NONE = "none"
7+
8+let VOTERS = 3
9+
10+let QUORUM = 2
11+
12+let VOTING = "voting"
13+
14+let REVEAL = "reveal"
15+
16+let FEATURED = "featured"
17+
18+let DELISTED = "delisted"
719
820 func getNumberByKey (key) = {
921 let num = match getInteger(this, key) {
2537 }
2638 str
2739 }
40+
41+
42+func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
43+
44+
45+func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user))
46+
47+
48+func getKeyCommitsCount (item) = (item + "_comcnt")
49+
50+
51+func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item))
52+
53+
54+func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
55+
56+
57+func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user))
58+
59+
60+func getKeyItemStatus (item) = (item + "_status")
61+
62+
63+func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item))
64+
65+
66+func getKeyVoteCount (item,vote) = ((item + "_res:") + vote)
67+
68+
69+func getValueVoteCount (item,vote) = getNumberByKey(getKeyVoteCount(item, vote))
2870
2971
3072 func getKeyItemPrice (item) = (item + "_price")
5597
5698
5799 func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
58-
59-
60-func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
61-
62-
63-func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user))
64-
65-
66-func getKeyCommitsCount (item) = (item + "_comcnt")
67-
68-
69-func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item))
70-
71-
72-func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
73-
74-
75-func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user))
76-
77-
78-func getKeyItemStatus (item) = (item + "_status")
79-
80-
81-func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item))
82-
83-
84-func getKeyVoteCount (item,vote) = ((item + "_res:") + vote)
85100
86101
87102 @Callable(i)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerPublicKey = base58'Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV'
55
66 let NONE = "none"
7+
8+let VOTERS = 3
9+
10+let QUORUM = 2
11+
12+let VOTING = "voting"
13+
14+let REVEAL = "reveal"
15+
16+let FEATURED = "featured"
17+
18+let DELISTED = "delisted"
719
820 func getNumberByKey (key) = {
921 let num = match getInteger(this, key) {
1022 case a: Int =>
1123 a
1224 case _ =>
1325 0
1426 }
1527 num
1628 }
1729
1830
1931 func getStrByKey (key) = {
2032 let str = match getString(this, key) {
2133 case a: String =>
2234 a
2335 case _ =>
2436 NONE
2537 }
2638 str
2739 }
40+
41+
42+func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
43+
44+
45+func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user))
46+
47+
48+func getKeyCommitsCount (item) = (item + "_comcnt")
49+
50+
51+func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item))
52+
53+
54+func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
55+
56+
57+func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user))
58+
59+
60+func getKeyItemStatus (item) = (item + "_status")
61+
62+
63+func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item))
64+
65+
66+func getKeyVoteCount (item,vote) = ((item + "_res:") + vote)
67+
68+
69+func getValueVoteCount (item,vote) = getNumberByKey(getKeyVoteCount(item, vote))
2870
2971
3072 func getKeyItemPrice (item) = (item + "_price")
3173
3274
3375 func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item))
3476
3577
3678 func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
3779
3880
3981 func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
4082
4183
4284 func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
4385
4486
4587 func getKeyItemData (item) = (item + "_data")
4688
4789
4890 func getKeyItemSupplier (item) = (item + "_owner")
4991
5092
5193 func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
5294
5395
5496 func getKeyBalanceSupplier (account) = (account + "_balance")
5597
5698
5799 func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
58-
59-
60-func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
61-
62-
63-func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user))
64-
65-
66-func getKeyCommitsCount (item) = (item + "_comcnt")
67-
68-
69-func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item))
70-
71-
72-func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
73-
74-
75-func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user))
76-
77-
78-func getKeyItemStatus (item) = (item + "_status")
79-
80-
81-func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item))
82-
83-
84-func getKeyVoteCount (item,vote) = ((item + "_res:") + vote)
85100
86101
87102 @Callable(i)
88103 func purchase (item) = {
89104 let pmt = extract(i.payment)
90105 if (isDefined(pmt.assetId))
91106 then throw("can use WAVES only at the moment")
92107 else {
93108 let userAddress = toBase58String(i.caller.bytes)
94109 let price = getValueItemPrice(item)
95110 let supplierAddress = getValueItemSupplier(item)
96111 if ((price > pmt.amount))
97112 then throw("purchase amount cannot be less than item price")
98113 else if ((pmt.amount > price))
99114 then throw("purchase amount cannot be higher than item price")
100115 else if ((supplierAddress == NONE))
101116 then throw("supplier does not exist")
102117 else WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))])
103118 }
104119 }
105120
106121
107122
108123 @Callable(i)
109124 func withdraw () = {
110125 let supplierAddress = toBase58String(i.caller.bytes)
111126 let balance = getValueBalanceSupplier(supplierAddress)
112127 if ((0 >= balance))
113128 then throw("insufficient balance")
114129 else ScriptResult(WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)]))
115130 }
116131
117132
118133
119134 @Callable(i)
120135 func addItem (title,price,data) = {
121136 let supplierAddress = toBase58String(i.caller.bytes)
122137 let item = getKeyItem(supplierAddress, title)
123138 if ((0 >= price))
124139 then throw("purchase amount cannot be less than item price")
125140 else if ((getValueItemSupplier(item) != NONE))
126141 then throw("an item is already exist")
127142 else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
128143 }
129144
130145
131146 @Verifier(tx)
132147 func verify () = match tx {
133148 case d: SetScriptTransaction =>
134149 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
135150 case d: DataTransaction =>
136151 true
137152 case d: TransferTransaction =>
138153 true
139154 case _ =>
140155 false
141156 }
142157

github/deemru/w8io/169f3d6 
42.36 ms