tx · ErLZKPsS2yFuuFFBBLKyibzhrzBoPbCigYLrABfrnhr9

3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7:  -0.01400000 Waves

2021.08.02 17:14 [1640821] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves

{ "type": 13, "id": "ErLZKPsS2yFuuFFBBLKyibzhrzBoPbCigYLrABfrnhr9", "fee": 1400000, "feeAssetId": null, "timestamp": 1627913695700, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "4ZcUEm8zTLWr6GL8BieBUdVb4QdHdTV9iP27vVzE7WJDCFEHLtwLxB8UBaHmLe8eX87oEQLyKar7Yobjug24apKR" ], "script": "base64:AAIEAAAAAAAAADkIAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIFCgMICAgAAAA3AAAAAAROT05FAgAAAAROT05FAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAIRkVBVFVSRUQCAAAACGZlYXR1cmVkAAAAAAhERUxJU1RFRAIAAAAIZGVsaXN0ZWQAAAAABlZPVElORwIAAAAGdm90aW5nAAAAAAZSRVZFQUwCAAAABnJldmVhbAAAAAAIQVBQUk9WQUwCAAAACGFwcHJvdmFsAAAAAAhSRUpFQ1RFRAIAAAAIcmVqZWN0ZWQAAAAACEFDQ0VQVEVEAgAAAAhhY2NlcHRlZAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQEAAAAPZ2V0SW50Z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AAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B4A1V84=", "height": 1640821, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7D7FdnNhqE7tLfxXZX3ZJHoMrVt7UdHCeTRTBSn7aTWb Next: 4gToKbsJEKEGMMreUjCt2doApnvAthjzUwF6aT8tw6YC Diff:
OldNewDifferences
294294
295295
296296 @Callable(i)
297-func acceptPurchase (purchase,couponAssetId) = {
297+func acceptPurchase (purchase) = {
298298 let caller = toBase58String(i.caller.bytes)
299299 let status = getValuePurchaseStatus(purchase)
300300 let supplier = getValuePurchaseSupplier(purchase)
319319 let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
320320 let user = getValuePurchaseUser(purchase)
321321 let address = addressFromStringValue(user)
322-[IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter), ScriptTransfer(address, 1, fromBase58String(couponAssetId))]
322+[IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
323323 }
324324 }
325325
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "NONE"
55
66 let VOTERS = 3
77
88 let QUORUM = 2
99
1010 let FEATURED = "featured"
1111
1212 let DELISTED = "delisted"
1313
1414 let VOTING = "voting"
1515
1616 let REVEAL = "reveal"
1717
1818 let APPROVAL = "approval"
1919
2020 let REJECTED = "rejected"
2121
2222 let ACCEPTED = "accepted"
2323
2424 func getStringByKey (key) = match getString(this, key) {
2525 case a: String =>
2626 a
2727 case _ =>
2828 NONE
2929 }
3030
3131
3232 func getIntegerByKey (key) = match getInteger(this, key) {
3333 case a: Int =>
3434 a
3535 case _ =>
3636 0
3737 }
3838
3939
4040 func getKeySupplierAccount (account) = (account + "_account")
4141
4242
4343 func getSupplierAccount (account) = getStringByKey(getKeySupplierAccount(account))
4444
4545
4646 func getKeyItem (supplier,title) = {
4747 let supplierTitle = (supplier + title)
4848 ("item_" + toBase58String(sha256(toBytes(supplierTitle))))
4949 }
5050
5151
5252 func getKeyItemSupplier (item) = (item + "_owner")
5353
5454
5555 func getKeyItemTitle (item) = (item + "_title")
5656
5757
5858 func getKeyItemPrice (item) = (item + "_price")
5959
6060
6161 func getKeyItemData (item) = (item + "_data")
6262
6363
6464 func getKeyItemExpireDate (item) = (item + "_expiredate")
6565
6666
6767 func getKeyItemSoldCounter (item) = (item + "_sold")
6868
6969
7070 func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
7171
7272
7373 func getKeyCommitsCount (item) = (item + "_cmtcnt")
7474
7575
7676 func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
7777
7878
7979 func getKeyItemStatus (item) = (item + "_status")
8080
8181
8282 func getKeyVotesCount (item,vote) = ((item + "_res:") + vote)
8383
8484
8585 func getKeySupplierBalance (supplier) = (supplier + "_balance")
8686
8787
8888 func getKeyUserItemCounter (user,item) = (((user + "_") + item) + "_counter")
8989
9090
9191 func genPurchaseKey (supplier,item,user,counter) = ("purchase_" + toBase58String(sha256(toBytes(((((((supplier + "_") + item) + "_") + user) + "_") + toString(counter))))))
9292
9393
9494 func getKeyPurchaseStatus (purchase) = (purchase + "_status")
9595
9696
9797 func getKeyPurchaseItem (purchase) = (purchase + "_item")
9898
9999
100100 func getKeyPurchaseSupplier (purchase) = (purchase + "_supplier")
101101
102102
103103 func getKeyPurchaseUser (purchase) = (purchase + "_user")
104104
105105
106106 func getKeyPurchaseAmount (purchase) = (purchase + "_amount")
107107
108108
109109 func getKeyPurchaseTimestamp (purchase) = (purchase + "_timestamp")
110110
111111
112112 func getKeyCoupon (assetId) = ("coupon_" + assetId)
113113
114114
115115 func getKeyCouponItem (coupon) = (coupon + "_item")
116116
117117
118118 func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier))
119119
120120
121121 func getValueUserItemCounter (user,item) = getIntegerByKey(getKeyUserItemCounter(user, item))
122122
123123
124124 func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase))
125125
126126
127127 func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase))
128128
129129
130130 func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase))
131131
132132
133133 func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase))
134134
135135
136136 func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase))
137137
138138
139139 func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase))
140140
141141
142142 func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item))
143143
144144
145145 func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item))
146146
147147
148148 func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item))
149149
150150
151151 func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item))
152152
153153
154154 func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item))
155155
156156
157157 func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user))
158158
159159
160160 func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item))
161161
162162
163163 func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user))
164164
165165
166166 func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item))
167167
168168
169169 func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote))
170170
171171
172172 @Callable(i)
173173 func registerSupplier (data) = {
174174 let supplier = toBase58String(i.caller.bytes)
175175 let account = getSupplierAccount(supplier)
176176 if ((account != NONE))
177177 then throw("This address has already registred as supplier")
178178 else [StringEntry(getKeySupplierAccount(supplier), data)]
179179 }
180180
181181
182182
183183 @Callable(i)
184184 func addItem (title,price,data,expire) = {
185185 let supplier = toBase58String(i.caller.bytes)
186186 let account = getSupplierAccount(supplier)
187187 let item = getKeyItem(supplier, title)
188188 if ((account == NONE))
189189 then throw("You should register as supplier to add an item")
190190 else if ((0 >= price))
191191 then throw("Purchase amount cannot be less than item price")
192192 else if ((getValueItemSupplier(item) != NONE))
193193 then throw("An item already exists")
194194 else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
195195 }
196196
197197
198198
199199 @Callable(i)
200200 func updateItem (item,title,price,data,expire) = {
201201 let supplier = toBase58String(i.caller.bytes)
202202 let account = getSupplierAccount(supplier)
203203 let itemSupplier = getValueItemSupplier(item)
204204 if ((account == NONE))
205205 then throw("You should register as supplier to remove an item")
206206 else if (if ((item == NONE))
207207 then true
208208 else (supplier != itemSupplier))
209209 then throw(("You don't owned item " + item))
210210 else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
211211 }
212212
213213
214214
215215 @Callable(i)
216216 func removeItem (item) = {
217217 let supplier = toBase58String(i.caller.bytes)
218218 let account = getSupplierAccount(supplier)
219219 let itemSupplier = getValueItemSupplier(item)
220220 if ((account == NONE))
221221 then throw("You should register as supplier to remove an item")
222222 else if (if ((item == NONE))
223223 then true
224224 else (supplier != itemSupplier))
225225 then throw(("You don't owned item " + item))
226226 else [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))]
227227 }
228228
229229
230230
231231 @Callable(i)
232232 func purchase (item) = {
233233 let pmt = i.payments[0]
234234 if (isDefined(pmt.assetId))
235235 then throw("You can buy tokens only with Waves tokens")
236236 else {
237237 let user = toBase58String(i.caller.bytes)
238238 let price = getValueItemPrice(item)
239239 let supplier = getValueItemSupplier(item)
240240 let expire = getValueItemExpireTime(item)
241241 if (if ((expire > 0))
242242 then (lastBlock.timestamp >= expire)
243243 else false)
244244 then throw("Coupon expired")
245245 else if ((price > pmt.amount))
246246 then throw("Purchase amount cannot be less than item price")
247247 else if ((pmt.amount > price))
248248 then throw("Purchase amount cannot be higher than item price")
249249 else if ((supplier == NONE))
250250 then throw("Supplier does not exists")
251251 else {
252252 let keyUserItemCounter = getKeyUserItemCounter(user, item)
253253 let userItemCounter = (getValueUserItemCounter(user, item) + 1)
254254 let purchase = genPurchaseKey(supplier, item, user, userItemCounter)
255255 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
256256 let keyPurchaseItem = getKeyPurchaseItem(purchase)
257257 let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase)
258258 let keyPurchaseUser = getKeyPurchaseUser(purchase)
259259 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
260260 let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase)
261261 [IntegerEntry(keyUserItemCounter, userItemCounter), StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)]
262262 }
263263 }
264264 }
265265
266266
267267
268268 @Callable(i)
269269 func rejectPurchase (purchase) = {
270270 let caller = toBase58String(i.caller.bytes)
271271 let status = getValuePurchaseStatus(purchase)
272272 let supplier = getValuePurchaseSupplier(purchase)
273273 let item = getValuePurchaseItem(purchase)
274274 if (if ((supplier == NONE))
275275 then true
276276 else (caller != supplier))
277277 then throw("Your are not the owner of this item")
278278 else if ((status != APPROVAL))
279279 then throw("You cannot reject this purchased")
280280 else {
281281 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
282282 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
283283 let keySupplierBalance = getKeySupplierBalance(supplier)
284284 let keyItemSoldCounter = getKeyItemSoldCounter(item)
285285 let user = getValuePurchaseUser(purchase)
286286 let amount = getValuePurchaseAmount(purchase)
287287 let supplierBalance = (getValueSupplierBalance(supplier) - amount)
288288 let itemSoldCounter = (getValueItemSoldCounter(item) - 1)
289289 let address = addressFromStringValue(user)
290290 [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)]
291291 }
292292 }
293293
294294
295295
296296 @Callable(i)
297-func acceptPurchase (purchase,couponAssetId) = {
297+func acceptPurchase (purchase) = {
298298 let caller = toBase58String(i.caller.bytes)
299299 let status = getValuePurchaseStatus(purchase)
300300 let supplier = getValuePurchaseSupplier(purchase)
301301 let item = getValuePurchaseItem(purchase)
302302 let expire = getValueItemExpireTime(item)
303303 if (if ((supplier == NONE))
304304 then true
305305 else (caller != supplier))
306306 then throw("Your are not the owner of this item")
307307 else if ((status != APPROVAL))
308308 then throw("You cannot reject this purchased")
309309 else if (if ((expire > 0))
310310 then (lastBlock.timestamp >= expire)
311311 else false)
312312 then throw("Coupon expired")
313313 else {
314314 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
315315 let keySupplierBalance = getKeySupplierBalance(supplier)
316316 let keyItemSoldCounter = getKeyItemSoldCounter(item)
317317 let amount = getValuePurchaseAmount(purchase)
318318 let supplierBalance = (getValueSupplierBalance(supplier) + amount)
319319 let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
320320 let user = getValuePurchaseUser(purchase)
321321 let address = addressFromStringValue(user)
322-[IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter), ScriptTransfer(address, 1, fromBase58String(couponAssetId))]
322+[IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
323323 }
324324 }
325325
326326
327327
328328 @Callable(i)
329329 func voteCommit (item,hash) = {
330330 let user = toBase58String(i.caller.bytes)
331331 let commitsCount = getValueCommitsCount(item)
332332 let status = getValueItemStatus(item)
333333 if ((commitsCount >= VOTERS))
334334 then throw("Reached max number of voters")
335335 else if ((getValueCommit(item, user) != NONE))
336336 then throw("You voted already")
337337 else if ((getKeyItemSupplier(item) == NONE))
338338 then throw("Item does not exists")
339339 else if (if ((status != NONE))
340340 then (status != VOTING)
341341 else false)
342342 then throw("Voting is not active for this item now")
343343 else {
344344 let newStatus = if ((commitsCount == VOTERS))
345345 then REVEAL
346346 else VOTING
347347 [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)]
348348 }
349349 }
350350
351351
352352
353353 @Callable(i)
354354 func voteReveal (item,vote,salt) = {
355355 let user = toBase58String(i.caller.bytes)
356356 let status = getValueItemStatus(item)
357357 let newVotesCount = (getValueVotesCount(item, vote) + 1)
358358 let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt))))
359359 if ((saltedVote != getValueCommit(item, user)))
360360 then throw("Reveal data is not valid")
361361 else if ((VOTERS > getValueCommitsCount(item)))
362362 then throw("Max number of voters not reached")
363363 else if ((getValueReveal(item, user) != NONE))
364364 then throw("You voted already")
365365 else if (if ((status != VOTING))
366366 then (status != REVEAL)
367367 else false)
368368 then throw("Voting is not active for this item now")
369369 else if (if ((vote != FEATURED))
370370 then (vote != DELISTED)
371371 else false)
372372 then throw("Provided voting option is incorrect")
373373 else {
374374 let newStatus = if ((newVotesCount >= QUORUM))
375375 then vote
376376 else REVEAL
377377 [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)]
378378 }
379379 }
380380
381381
382382 @Verifier(tx)
383383 func verify () = match tx {
384384 case t: SetScriptTransaction =>
385385 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
386386 case t: IssueTransaction =>
387387 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
388388 case t: TransferTransaction =>
389389 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
390390 case _ =>
391391 false
392392 }
393393

github/deemru/w8io/169f3d6 
60.24 ms