tx · Ca54uLDM9RY2i7g3QrdYDWAomvZQEQaZjoMJoBvyRCzR

3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7:  -0.01400000 Waves

2021.08.02 03:50 [1640014] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves

{ "type": 13, "id": "Ca54uLDM9RY2i7g3QrdYDWAomvZQEQaZjoMJoBvyRCzR", "fee": 1400000, "feeAssetId": null, "timestamp": 1627865437467, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "5RxQnmfXRXP4CXuojwQkjcrLns38zpvXmc2HdwP1CcZnK6SYfAukAxaLFSrmhujr6wY3d8b9Xd3KFkMcsXEARSTh" ], "script": "base64:AAIEAAAAAAAAADoIAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgSBQoDCAgIAAAANQAAAAAETk9ORQIAAAAETk9ORQAAAAAGVk9URVJTAAAAAAAAAAADAAAAAAZRVU9SVU0AAAAAAAAAAAIAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEFQUFJPVkFMAgAAAAhhcHByb3ZhbAAAAAAIUkVKRUNURUQCAAAACHJlamVjdGVkAAAAAAhBQ0NFUFRFRAIAAAAIYWNjZXB0ZWQBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUBAAAAD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FAAAACW5ld1N0YXR1cwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAQSXNzdWVUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B3NOhaE=", "height": 1640014, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: KCF2fX7EBAzrGinNGMZuUe5SWH8xZKfZSJVnW3dPzEE Next: 5n9u3MMwMgLhRkpGoPjB2Hh9W8WnqnxTCDiPSPx3STwc Diff:
OldNewDifferences
223223
224224
225225 @Callable(i)
226-func purchase (item,assetId) = {
226+func purchase (item) = {
227227 let pmt = i.payments[0]
228228 if (isDefined(pmt.assetId))
229229 then throw("You can buy tokens only with Waves tokens")
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 getPurchase (supplier,item,user) = ("purchase_" + toBase58String(sha256(toBytes(((((supplier + "_") + item) + "_") + user)))))
8989
9090
9191 func getKeyPurchaseStatus (purchase) = (purchase + "_status")
9292
9393
9494 func getKeyPurchaseItem (purchase) = (purchase + "_item")
9595
9696
9797 func getKeyPurchaseSupplier (purchase) = (purchase + "_supplier")
9898
9999
100100 func getKeyPurchaseUser (purchase) = (purchase + "_user")
101101
102102
103103 func getKeyPurchaseAmount (purchase) = (purchase + "_amount")
104104
105105
106106 func getKeyPurchaseTimestamp (purchase) = (purchase + "_timestamp")
107107
108108
109109 func getKeyCoupon (assetId) = ("coupon_" + assetId)
110110
111111
112112 func getKeyCouponItem (coupon) = (coupon + "_item")
113113
114114
115115 func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier))
116116
117117
118118 func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase))
119119
120120
121121 func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase))
122122
123123
124124 func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase))
125125
126126
127127 func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase))
128128
129129
130130 func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase))
131131
132132
133133 func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase))
134134
135135
136136 func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item))
137137
138138
139139 func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item))
140140
141141
142142 func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item))
143143
144144
145145 func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item))
146146
147147
148148 func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item))
149149
150150
151151 func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user))
152152
153153
154154 func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item))
155155
156156
157157 func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user))
158158
159159
160160 func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item))
161161
162162
163163 func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote))
164164
165165
166166 @Callable(i)
167167 func registerSupplier (data) = {
168168 let supplier = toBase58String(i.caller.bytes)
169169 let account = getSupplierAccount(supplier)
170170 if ((account != NONE))
171171 then throw("This address has already registred as supplier")
172172 else [StringEntry(getKeySupplierAccount(supplier), data)]
173173 }
174174
175175
176176
177177 @Callable(i)
178178 func addItem (title,price,data,expire) = {
179179 let supplier = toBase58String(i.caller.bytes)
180180 let account = getSupplierAccount(supplier)
181181 let item = getKeyItem(supplier, title)
182182 if ((account == NONE))
183183 then throw("You should register as supplier to add an item")
184184 else if ((0 >= price))
185185 then throw("Purchase amount cannot be less than item price")
186186 else if ((getValueItemSupplier(item) != NONE))
187187 then throw("An item already exists")
188188 else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
189189 }
190190
191191
192192
193193 @Callable(i)
194194 func updateItem (item,title,price,data,expire) = {
195195 let supplier = toBase58String(i.caller.bytes)
196196 let account = getSupplierAccount(supplier)
197197 let itemSupplier = getValueItemSupplier(item)
198198 if ((account == NONE))
199199 then throw("You should register as supplier to remove an item")
200200 else if (if ((item == NONE))
201201 then true
202202 else (supplier != itemSupplier))
203203 then throw(("You don't owned item " + item))
204204 else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
205205 }
206206
207207
208208
209209 @Callable(i)
210210 func removeItem (item) = {
211211 let supplier = toBase58String(i.caller.bytes)
212212 let account = getSupplierAccount(supplier)
213213 let itemSupplier = getValueItemSupplier(item)
214214 if ((account == NONE))
215215 then throw("You should register as supplier to remove an item")
216216 else if (if ((item == NONE))
217217 then true
218218 else (supplier != itemSupplier))
219219 then throw(("You don't owned item " + item))
220220 else [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))]
221221 }
222222
223223
224224
225225 @Callable(i)
226-func purchase (item,assetId) = {
226+func purchase (item) = {
227227 let pmt = i.payments[0]
228228 if (isDefined(pmt.assetId))
229229 then throw("You can buy tokens only with Waves tokens")
230230 else {
231231 let user = toBase58String(i.caller.bytes)
232232 let price = getValueItemPrice(item)
233233 let supplier = getValueItemSupplier(item)
234234 let expire = getValueItemExpireTime(item)
235235 if (if ((expire > 0))
236236 then (lastBlock.timestamp >= expire)
237237 else false)
238238 then throw("Coupon expired")
239239 else if ((price > pmt.amount))
240240 then throw("Purchase amount cannot be less than item price")
241241 else if ((pmt.amount > price))
242242 then throw("Purchase amount cannot be higher than item price")
243243 else if ((supplier == NONE))
244244 then throw("Supplier does not exists")
245245 else {
246246 let purchase = getPurchase(supplier, item, user)
247247 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
248248 let keyPurchaseItem = getKeyPurchaseItem(purchase)
249249 let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase)
250250 let keyPurchaseUser = getKeyPurchaseUser(purchase)
251251 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
252252 let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase)
253253 [StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)]
254254 }
255255 }
256256 }
257257
258258
259259
260260 @Callable(i)
261261 func rejectPurchase (purchase) = {
262262 let caller = toBase58String(i.caller.bytes)
263263 let status = getValuePurchaseStatus(purchase)
264264 let supplier = getValuePurchaseSupplier(purchase)
265265 let item = getValuePurchaseItem(purchase)
266266 if (if ((supplier == NONE))
267267 then true
268268 else (caller != supplier))
269269 then throw("Your are not the owner of this item")
270270 else if ((status != APPROVAL))
271271 then throw("You cannot reject this purchased")
272272 else {
273273 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
274274 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
275275 let keySupplierBalance = getKeySupplierBalance(supplier)
276276 let keyItemSoldCounter = getKeyItemSoldCounter(item)
277277 let user = getValuePurchaseUser(purchase)
278278 let amount = getValuePurchaseAmount(purchase)
279279 let supplierBalance = (getValueSupplierBalance(supplier) - amount)
280280 let itemSoldCounter = (getValueItemSoldCounter(item) - 1)
281281 let address = addressFromStringValue(user)
282282 [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)]
283283 }
284284 }
285285
286286
287287
288288 @Callable(i)
289289 func acceptPurchase (purchase,couponAssetId) = {
290290 let caller = toBase58String(i.caller.bytes)
291291 let status = getValuePurchaseStatus(purchase)
292292 let supplier = getValuePurchaseSupplier(purchase)
293293 let item = getValuePurchaseItem(purchase)
294294 let expire = getValueItemExpireTime(item)
295295 if (if ((supplier == NONE))
296296 then true
297297 else (caller != supplier))
298298 then throw("Your are not the owner of this item")
299299 else if ((status != APPROVAL))
300300 then throw("You cannot reject this purchased")
301301 else if (if ((expire > 0))
302302 then (lastBlock.timestamp >= expire)
303303 else false)
304304 then throw("Coupon expired")
305305 else {
306306 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
307307 let keySupplierBalance = getKeySupplierBalance(supplier)
308308 let keyItemSoldCounter = getKeyItemSoldCounter(item)
309309 let amount = getValuePurchaseAmount(purchase)
310310 let supplierBalance = (getValueSupplierBalance(supplier) + amount)
311311 let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
312312 let user = getValuePurchaseUser(purchase)
313313 let address = addressFromStringValue(user)
314314 [IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter), ScriptTransfer(address, 1, fromBase58String(couponAssetId))]
315315 }
316316 }
317317
318318
319319
320320 @Callable(i)
321321 func voteCommit (item,hash) = {
322322 let user = toBase58String(i.caller.bytes)
323323 let commitsCount = getValueCommitsCount(item)
324324 let status = getValueItemStatus(item)
325325 if ((commitsCount >= VOTERS))
326326 then throw("Reached max number of voters")
327327 else if ((getValueCommit(item, user) != NONE))
328328 then throw("You voted already")
329329 else if ((getKeyItemSupplier(item) == NONE))
330330 then throw("Item does not exists")
331331 else if (if ((status != NONE))
332332 then (status != VOTING)
333333 else false)
334334 then throw("Voting is not active for this item now")
335335 else {
336336 let newStatus = if ((commitsCount == VOTERS))
337337 then REVEAL
338338 else VOTING
339339 [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)]
340340 }
341341 }
342342
343343
344344
345345 @Callable(i)
346346 func voteReveal (item,vote,salt) = {
347347 let user = toBase58String(i.caller.bytes)
348348 let status = getValueItemStatus(item)
349349 let newVotesCount = (getValueVotesCount(item, vote) + 1)
350350 let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt))))
351351 if ((saltedVote != getValueCommit(item, user)))
352352 then throw("Reveal data is not valid")
353353 else if ((VOTERS > getValueCommitsCount(item)))
354354 then throw("Max number of voters not reached")
355355 else if ((getValueReveal(item, user) != NONE))
356356 then throw("You voted already")
357357 else if (if ((status != VOTING))
358358 then (status != REVEAL)
359359 else false)
360360 then throw("Voting is not active for this item now")
361361 else if (if ((vote != FEATURED))
362362 then (vote != DELISTED)
363363 else false)
364364 then throw("Provided voting option is incorrect")
365365 else {
366366 let newStatus = if ((newVotesCount >= QUORUM))
367367 then vote
368368 else REVEAL
369369 [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)]
370370 }
371371 }
372372
373373
374374 @Verifier(tx)
375375 func verify () = match tx {
376376 case t: SetScriptTransaction =>
377377 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
378378 case t: IssueTransaction =>
379379 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
380380 case t: TransferTransaction =>
381381 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
382382 case _ =>
383383 false
384384 }
385385

github/deemru/w8io/026f985 
55.64 ms