tx · 8kE6jpJGwLU2848SwtVhDrXhMCa7K5mY6WUSpf98YY24

3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7:  -0.01400000 Waves

2021.08.02 17:50 [1640854] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves

{ "type": 13, "id": "8kE6jpJGwLU2848SwtVhDrXhMCa7K5mY6WUSpf98YY24", "fee": 1400000, "feeAssetId": null, "timestamp": 1627915850000, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "3Gixz2LZu6XreNTuxQzQABmrrAqutb4kQnmKxzdLamYoXYN1f58xy9tqDUiK3jVDumXWpBhGfGz3jBX4WzSttJaa" ], "script": "base64:AAIEAAAAAAAAADoIAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgSBQoDCAgIAAAAOQAAAAAETk9ORQIAAAAETk9ORQAAAAAGVk9URVJTAAAAAAAAAAADAAAAAAZRVU9SVU0AAAAAAAAAAAIAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEFQUFJPVkFMAgAAAAhhcHByb3ZhbAAAAAAIUkVKRUNURUQCAAAACHJlamVjdGVkAAAAAAhBQ0NFUFRFRAIAAAAIYWNjZXB0ZWQBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUBAAAAD2dldEludG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AAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQcrCzQm", "height": 1640854, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4gToKbsJEKEGMMreUjCt2doApnvAthjzUwF6aT8tw6YC Next: CBJELgWWyxoNjRhtLfdxVeuKF1VifSZhtiaJumbTTL1Y Diff:
OldNewDifferences
113113
114114
115115 func getKeyCouponPurchase (assetId) = (("coupon_" + assetId) + "_purchase")
116+
117+
118+func getKeyCouponItem (assetId) = (("coupon_" + assetId) + "_item")
116119
117120
118121 func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier))
309312 then throw("Your are not the owner of this item")
310313 else if ((status != APPROVAL))
311314 then throw("You cannot reject this purchased")
312- else if (if ((expire > 0))
313- then (lastBlock.timestamp >= expire)
314- else false)
315- then throw("Coupon expired")
316- else {
317- let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
318- let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase)
319- let keySupplierBalance = getKeySupplierBalance(supplier)
320- let keyItemSoldCounter = getKeyItemSoldCounter(item)
321- let keyCouponPurchase = getKeyCouponPurchase(couponAssetId)
322- let amount = getValuePurchaseAmount(purchase)
323- let supplierBalance = (getValueSupplierBalance(supplier) + amount)
324- let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
325- let user = getValuePurchaseUser(purchase)
326- let address = addressFromStringValue(user)
327-[StringEntry(keyCouponPurchase, purchase), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
328- }
315+ else if ((item == NONE))
316+ then throw("Unexpected error [ tem not found ]")
317+ else if (if ((expire > 0))
318+ then (lastBlock.timestamp >= expire)
319+ else false)
320+ then throw("Coupon expired")
321+ else {
322+ let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
323+ let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase)
324+ let keySupplierBalance = getKeySupplierBalance(supplier)
325+ let keyItemSoldCounter = getKeyItemSoldCounter(item)
326+ let keyCouponPurchase = getKeyCouponPurchase(couponAssetId)
327+ let keyCouponItem = getKeyCouponItem(couponAssetId)
328+ let amount = getValuePurchaseAmount(purchase)
329+ let supplierBalance = (getValueSupplierBalance(supplier) + amount)
330+ let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
331+ let user = getValuePurchaseUser(purchase)
332+ let address = addressFromStringValue(user)
333+[StringEntry(keyCouponPurchase, purchase), StringEntry(keyCouponItem, item), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
334+ }
329335 }
330336
331337
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 getKeyPurchaseAssetId (purchase) = (purchase + "_assetId")
113113
114114
115115 func getKeyCouponPurchase (assetId) = (("coupon_" + assetId) + "_purchase")
116+
117+
118+func getKeyCouponItem (assetId) = (("coupon_" + assetId) + "_item")
116119
117120
118121 func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier))
119122
120123
121124 func getValueUserItemCounter (user,item) = getIntegerByKey(getKeyUserItemCounter(user, item))
122125
123126
124127 func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase))
125128
126129
127130 func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase))
128131
129132
130133 func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase))
131134
132135
133136 func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase))
134137
135138
136139 func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase))
137140
138141
139142 func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase))
140143
141144
142145 func getValuePurchaseAssetId (purchase) = getStringByKey(getKeyPurchaseAssetId(purchase))
143146
144147
145148 func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item))
146149
147150
148151 func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item))
149152
150153
151154 func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item))
152155
153156
154157 func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item))
155158
156159
157160 func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item))
158161
159162
160163 func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user))
161164
162165
163166 func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item))
164167
165168
166169 func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user))
167170
168171
169172 func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item))
170173
171174
172175 func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote))
173176
174177
175178 @Callable(i)
176179 func registerSupplier (data) = {
177180 let supplier = toBase58String(i.caller.bytes)
178181 let account = getSupplierAccount(supplier)
179182 if ((account != NONE))
180183 then throw("This address has already registred as supplier")
181184 else [StringEntry(getKeySupplierAccount(supplier), data)]
182185 }
183186
184187
185188
186189 @Callable(i)
187190 func addItem (title,price,data,expire) = {
188191 let supplier = toBase58String(i.caller.bytes)
189192 let account = getSupplierAccount(supplier)
190193 let item = getKeyItem(supplier, title)
191194 if ((account == NONE))
192195 then throw("You should register as supplier to add an item")
193196 else if ((0 >= price))
194197 then throw("Purchase amount cannot be less than item price")
195198 else if ((getValueItemSupplier(item) != NONE))
196199 then throw("An item already exists")
197200 else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
198201 }
199202
200203
201204
202205 @Callable(i)
203206 func updateItem (item,title,price,data,expire) = {
204207 let supplier = toBase58String(i.caller.bytes)
205208 let account = getSupplierAccount(supplier)
206209 let itemSupplier = getValueItemSupplier(item)
207210 if ((account == NONE))
208211 then throw("You should register as supplier to remove an item")
209212 else if (if ((item == NONE))
210213 then true
211214 else (supplier != itemSupplier))
212215 then throw(("You don't owned item " + item))
213216 else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
214217 }
215218
216219
217220
218221 @Callable(i)
219222 func removeItem (item) = {
220223 let supplier = toBase58String(i.caller.bytes)
221224 let account = getSupplierAccount(supplier)
222225 let itemSupplier = getValueItemSupplier(item)
223226 if ((account == NONE))
224227 then throw("You should register as supplier to remove an item")
225228 else if (if ((item == NONE))
226229 then true
227230 else (supplier != itemSupplier))
228231 then throw(("You don't owned item " + item))
229232 else [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))]
230233 }
231234
232235
233236
234237 @Callable(i)
235238 func purchase (item) = {
236239 let pmt = i.payments[0]
237240 if (isDefined(pmt.assetId))
238241 then throw("You can buy tokens only with Waves tokens")
239242 else {
240243 let user = toBase58String(i.caller.bytes)
241244 let price = getValueItemPrice(item)
242245 let supplier = getValueItemSupplier(item)
243246 let expire = getValueItemExpireTime(item)
244247 if (if ((expire > 0))
245248 then (lastBlock.timestamp >= expire)
246249 else false)
247250 then throw("Coupon expired")
248251 else if ((price > pmt.amount))
249252 then throw("Purchase amount cannot be less than item price")
250253 else if ((pmt.amount > price))
251254 then throw("Purchase amount cannot be higher than item price")
252255 else if ((supplier == NONE))
253256 then throw("Supplier does not exists")
254257 else {
255258 let keyUserItemCounter = getKeyUserItemCounter(user, item)
256259 let userItemCounter = (getValueUserItemCounter(user, item) + 1)
257260 let purchase = genPurchaseKey(supplier, item, user, userItemCounter)
258261 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
259262 let keyPurchaseItem = getKeyPurchaseItem(purchase)
260263 let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase)
261264 let keyPurchaseUser = getKeyPurchaseUser(purchase)
262265 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
263266 let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase)
264267 [IntegerEntry(keyUserItemCounter, userItemCounter), StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)]
265268 }
266269 }
267270 }
268271
269272
270273
271274 @Callable(i)
272275 func rejectPurchase (purchase) = {
273276 let caller = toBase58String(i.caller.bytes)
274277 let status = getValuePurchaseStatus(purchase)
275278 let supplier = getValuePurchaseSupplier(purchase)
276279 let item = getValuePurchaseItem(purchase)
277280 if (if ((supplier == NONE))
278281 then true
279282 else (caller != supplier))
280283 then throw("Your are not the owner of this item")
281284 else if ((status != APPROVAL))
282285 then throw("You cannot reject this purchased")
283286 else {
284287 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
285288 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
286289 let keySupplierBalance = getKeySupplierBalance(supplier)
287290 let keyItemSoldCounter = getKeyItemSoldCounter(item)
288291 let user = getValuePurchaseUser(purchase)
289292 let amount = getValuePurchaseAmount(purchase)
290293 let supplierBalance = (getValueSupplierBalance(supplier) - amount)
291294 let itemSoldCounter = (getValueItemSoldCounter(item) - 1)
292295 let address = addressFromStringValue(user)
293296 [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)]
294297 }
295298 }
296299
297300
298301
299302 @Callable(i)
300303 func acceptPurchase (purchase,couponAssetId) = {
301304 let caller = toBase58String(i.caller.bytes)
302305 let status = getValuePurchaseStatus(purchase)
303306 let supplier = getValuePurchaseSupplier(purchase)
304307 let item = getValuePurchaseItem(purchase)
305308 let expire = getValueItemExpireTime(item)
306309 if (if ((supplier == NONE))
307310 then true
308311 else (caller != supplier))
309312 then throw("Your are not the owner of this item")
310313 else if ((status != APPROVAL))
311314 then throw("You cannot reject this purchased")
312- else if (if ((expire > 0))
313- then (lastBlock.timestamp >= expire)
314- else false)
315- then throw("Coupon expired")
316- else {
317- let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
318- let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase)
319- let keySupplierBalance = getKeySupplierBalance(supplier)
320- let keyItemSoldCounter = getKeyItemSoldCounter(item)
321- let keyCouponPurchase = getKeyCouponPurchase(couponAssetId)
322- let amount = getValuePurchaseAmount(purchase)
323- let supplierBalance = (getValueSupplierBalance(supplier) + amount)
324- let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
325- let user = getValuePurchaseUser(purchase)
326- let address = addressFromStringValue(user)
327-[StringEntry(keyCouponPurchase, purchase), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
328- }
315+ else if ((item == NONE))
316+ then throw("Unexpected error [ tem not found ]")
317+ else if (if ((expire > 0))
318+ then (lastBlock.timestamp >= expire)
319+ else false)
320+ then throw("Coupon expired")
321+ else {
322+ let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
323+ let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase)
324+ let keySupplierBalance = getKeySupplierBalance(supplier)
325+ let keyItemSoldCounter = getKeyItemSoldCounter(item)
326+ let keyCouponPurchase = getKeyCouponPurchase(couponAssetId)
327+ let keyCouponItem = getKeyCouponItem(couponAssetId)
328+ let amount = getValuePurchaseAmount(purchase)
329+ let supplierBalance = (getValueSupplierBalance(supplier) + amount)
330+ let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
331+ let user = getValuePurchaseUser(purchase)
332+ let address = addressFromStringValue(user)
333+[StringEntry(keyCouponPurchase, purchase), StringEntry(keyCouponItem, item), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
334+ }
329335 }
330336
331337
332338
333339 @Callable(i)
334340 func voteCommit (item,hash) = {
335341 let user = toBase58String(i.caller.bytes)
336342 let commitsCount = getValueCommitsCount(item)
337343 let status = getValueItemStatus(item)
338344 if ((commitsCount >= VOTERS))
339345 then throw("Reached max number of voters")
340346 else if ((getValueCommit(item, user) != NONE))
341347 then throw("You voted already")
342348 else if ((getKeyItemSupplier(item) == NONE))
343349 then throw("Item does not exists")
344350 else if (if ((status != NONE))
345351 then (status != VOTING)
346352 else false)
347353 then throw("Voting is not active for this item now")
348354 else {
349355 let newStatus = if ((commitsCount == VOTERS))
350356 then REVEAL
351357 else VOTING
352358 [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)]
353359 }
354360 }
355361
356362
357363
358364 @Callable(i)
359365 func voteReveal (item,vote,salt) = {
360366 let user = toBase58String(i.caller.bytes)
361367 let status = getValueItemStatus(item)
362368 let newVotesCount = (getValueVotesCount(item, vote) + 1)
363369 let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt))))
364370 if ((saltedVote != getValueCommit(item, user)))
365371 then throw("Reveal data is not valid")
366372 else if ((VOTERS > getValueCommitsCount(item)))
367373 then throw("Max number of voters not reached")
368374 else if ((getValueReveal(item, user) != NONE))
369375 then throw("You voted already")
370376 else if (if ((status != VOTING))
371377 then (status != REVEAL)
372378 else false)
373379 then throw("Voting is not active for this item now")
374380 else if (if ((vote != FEATURED))
375381 then (vote != DELISTED)
376382 else false)
377383 then throw("Provided voting option is incorrect")
378384 else {
379385 let newStatus = if ((newVotesCount >= QUORUM))
380386 then vote
381387 else REVEAL
382388 [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)]
383389 }
384390 }
385391
386392
387393 @Verifier(tx)
388394 func verify () = match tx {
389395 case t: SetScriptTransaction =>
390396 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
391397 case t: IssueTransaction =>
392398 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
393399 case t: TransferTransaction =>
394400 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
395401 case _ =>
396402 false
397403 }
398404

github/deemru/w8io/026f985 
46.20 ms