tx · GARX1sUMfwnJRBPF4DxCPxc5riSnjsrFj7P3P5iRFD4Q 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p: -0.01500000 Waves 2022.11.23 12:36 [2329569] smart account 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p > SELF 0.00000000 Waves
{ "type": 13, "id": "GARX1sUMfwnJRBPF4DxCPxc5riSnjsrFj7P3P5iRFD4Q", "fee": 1500000, "feeAssetId": null, "timestamp": 1669196230517, "version": 2, "chainId": 84, "sender": "3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p", "senderPublicKey": "Hh3eFP2XFetZSfTxQiM1Ps96f68zi8Zh5ghhCZdjgdFs", "proofs": [ "3ug4BmT69ZY2Ce5BSmJJkk74uxCCdzpQLif55ATMhhh58y2Rg7oyyCPY9SxpnRzoXRVeSuPabemVdo95YqGvZj7R" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgIMwEJZ2V0U3RyQnlLAQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAACHVuaXRUZXN0BwAJb3JhY2xlRmVlCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX29yYWNsZV9mZWUAC2ZlZVJlY2VpdmVyCQEJZ2V0U3RyQnlLAQIRY29uZl9mZWVfcmVjZWl2ZXIADGFydHdvcmtzRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQISY29uZl9hcnR3b3Jrc19kYXBwAAh1c2VyRGFwcAMFCHVuaXRUZXN0CQEFdmFsdWUBCQCmCAECIzNNdDRSR01FeWpTV1lBb2NUUHFkNTV3ZEhRUUIzUFUyVUNtCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX3VzZXJzX2RhcHAAC3NpZ25Bc3NldElkCQDZBAEJAQlnZXRTdHJCeUsBAhhj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XJPd25lcglzYWxlT3duZXIEDSR0MDE4NDk0MTg1NjkJAQxpZENhbGxlckRhdGUBBQFpBAJpZAgFDSR0MDE4NDk0MTg1NjkCXzEEBmNhbGxlcggFDSR0MDE4NDk0MTg1NjkCXzIEBGRhdGUIBQ0kdDAxODQ5NDE4NTY5Al8zAwMJAQIhPQIFBmNhbGxlcgUKb2ZmZXJPd25lcgkBAiE9AgUGY2FsbGVyBQlzYWxlT3duZXIHCQACAQIdWW91IGNhbm5vdCBjYW5jZWwgdGhpcyBvZmZlci4EBmJpZEtleQkBCWdldEJpZEtleQQFCm9mZmVyT3duZXIFBW5mdElkBQlzYWxlT3duZXIFB29mZmVySWQEDSR0MDE4NzQzMTg3OTgJAQpnZXRCaWREYXRhAQUGYmlkS2V5BApiaWREYXRhQXJyCAUNJHQwMTg3NDMxODc5OAJfMQQHYXNzZXRJZAgFDSR0MDE4NzQzMTg3OTgCXzIEB2JpZERhdGEIBQ0kdDAxODc0MzE4Nzk4Al8zCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgUGYmlkS2V5AgVfT1BFTgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFBmJpZEtleQIKX0NBTkNFTExFRAkArAICCQCsAgIJAKwCAgkArAICBQdiaWREYXRhAgtfQ0FOQ0VMTEVEXwkApAMBBQRkYXRlAgFfBQJpZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUKYmlkRGF0YUFycgABBQdhc3NldElkBQNuaWwAfN+5aQ==", "height": 2329569, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4CJtpADESBy9AqfrcAqKgRsZonsyqcpsvw5wzRrvf8uw Next: EnUCkh4DYVqfZuJs9GpfrRvASJscXVedWWoftG5b3AfE Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let VERSION = 111 | |
5 | - | ||
6 | 4 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
7 | 5 | ||
8 | 6 | ||
9 | 7 | let unitTest = false | |
10 | 8 | ||
11 | 9 | let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee"))) | |
12 | - | ||
13 | - | let signDapp = value(addressFromString(getStrByK("conf_signweb_dapp"))) | |
14 | 10 | ||
15 | 11 | let feeReceiver = getStrByK("conf_fee_receiver") | |
16 | 12 | ||
20 | 16 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
21 | 17 | else value(addressFromString(getStrByK("conf_users_dapp"))) | |
22 | 18 | ||
23 | - | let whitelistDapp = value(addressFromString(getStrByK("conf_whitelist_dapp"))) | |
24 | - | ||
25 | 19 | let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN")) | |
26 | 20 | ||
27 | 21 | let usdnAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDN")) | |
22 | + | ||
23 | + | let usdtAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDT")) | |
28 | 24 | ||
29 | 25 | let wavesAssetId = base58'' | |
30 | 26 | ||
119 | 115 | } | |
120 | 116 | ||
121 | 117 | ||
122 | - | func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId))) | |
118 | + | func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId))) | |
123 | 119 | then (assetId != toBase58String(wavesAssetId)) | |
124 | 120 | else false) | |
125 | 121 | then (assetId != "WAVES") | |
126 | 122 | else false) | |
127 | 123 | then (assetId != toBase58String(usdnAssetId)) | |
124 | + | else false) | |
125 | + | then (assetId != toBase58String(usdtAssetId)) | |
128 | 126 | else false) | |
129 | 127 | then false | |
130 | 128 | else true | |
192 | 190 | } | |
193 | 191 | ||
194 | 192 | ||
195 | - | func checkARTExist (artId,creatorAddr) = { | |
196 | - | let artSignID = getArtStrByK(keySignID(creatorAddr, artId)) | |
197 | - | if ((size(artSignID) == 0)) | |
198 | - | then throw("Artwork not found on SIGN Art") | |
199 | - | else if (if (!(checkArtStatus(creatorAddr, artId))) | |
200 | - | then !(checkArtistStatus(creatorAddr)) | |
201 | - | else false) | |
202 | - | then false | |
203 | - | else true | |
204 | - | } | |
205 | - | ||
206 | - | ||
207 | 193 | func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller) = { | |
208 | 194 | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
209 | 195 | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
233 | 219 | let minSellSign = if (unitTest) | |
234 | 220 | then 1 | |
235 | 221 | else (currentCertificationPrice * 2) | |
236 | - | if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
222 | + | if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
237 | 223 | then (minSellUsdn > price) | |
238 | 224 | else false) | |
239 | 225 | then (price != 0) | |
240 | 226 | else false) | |
227 | + | then true | |
228 | + | else if (if ((assetId == toBase58String(usdtAssetId))) | |
229 | + | then (minSellUsdn > price) | |
230 | + | else false) | |
231 | + | then (price != 0) | |
232 | + | else false) | |
241 | 233 | then true | |
242 | 234 | else if (if ((assetId == toBase58String(signAssetId))) | |
243 | 235 | then (minSellSign > price) | |
258 | 250 | ||
259 | 251 | ||
260 | 252 | func provideBaseData (i,nftId) = { | |
261 | - | let $ | |
262 | - | let id = $ | |
263 | - | let caller = $ | |
264 | - | let date = $ | |
265 | - | let $ | |
266 | - | let isValidNFT = $ | |
267 | - | let artId = $ | |
268 | - | let creatorAddr = $ | |
269 | - | let artSignID = $ | |
253 | + | let $t093049344 = idCallerDate(i) | |
254 | + | let id = $t093049344._1 | |
255 | + | let caller = $t093049344._2 | |
256 | + | let date = $t093049344._3 | |
257 | + | let $t093489417 = checkNFTInfo(nftId) | |
258 | + | let isValidNFT = $t093489417._1 | |
259 | + | let artId = $t093489417._2 | |
260 | + | let creatorAddr = $t093489417._3 | |
261 | + | let artSignID = $t093489417._4 | |
270 | 262 | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
271 | 263 | } | |
272 | 264 | ||
302 | 294 | ||
303 | 295 | @Callable(i) | |
304 | 296 | func sellNFT (price,asset) = { | |
305 | - | let $ | |
306 | - | let payment = $ | |
307 | - | let amount = $ | |
297 | + | let $t01052210558 = isPayment(i) | |
298 | + | let payment = $t01052210558._1 | |
299 | + | let amount = $t01052210558._2 | |
308 | 300 | if ((amount != 1)) | |
309 | 301 | then throw("No NFT attached") | |
310 | 302 | else { | |
313 | 305 | else false) | |
314 | 306 | then toBase58String(value(payment.assetId)) | |
315 | 307 | else throw("Only SIGN Art NFT accepted.") | |
316 | - | let $ | |
317 | - | let id = $ | |
318 | - | let caller = $ | |
319 | - | let date = $ | |
320 | - | let isValidNFT = $ | |
321 | - | let artId = $ | |
322 | - | let creatorAddr = $ | |
323 | - | let artSignID = $ | |
308 | + | let $t01079610889 = provideBaseData(i, nftId) | |
309 | + | let id = $t01079610889._1 | |
310 | + | let caller = $t01079610889._2 | |
311 | + | let date = $t01079610889._3 | |
312 | + | let isValidNFT = $t01079610889._4 | |
313 | + | let artId = $t01079610889._5 | |
314 | + | let creatorAddr = $t01079610889._6 | |
315 | + | let artSignID = $t01079610889._7 | |
324 | 316 | if ((size(artSignID) == 0)) | |
325 | 317 | then throw("Artwork not found on SIGN Art") | |
326 | 318 | else if (!(isValidNFT)) | |
327 | 319 | then throw("Not a valid nft") | |
328 | 320 | else if (!(acceptedAssetIds(asset))) | |
329 | - | then throw("Only SIGN, USDN or WAVES accepted") | |
321 | + | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
330 | 322 | else if (!(validateMinSell(asset, price))) | |
331 | 323 | then throw("Wrong minimum sell price") | |
332 | 324 | else [StringEntry((getSaleKey(caller, nftId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)] | |
337 | 329 | ||
338 | 330 | @Callable(i) | |
339 | 331 | func updateSalePrice (nftId,price,asset) = { | |
340 | - | let $ | |
341 | - | let id = $ | |
342 | - | let caller = $ | |
343 | - | let date = $ | |
344 | - | let isValidNFT = $ | |
345 | - | let artId = $ | |
346 | - | let creatorAddr = $ | |
347 | - | let artSignID = $ | |
332 | + | let $t01179311886 = provideBaseData(i, nftId) | |
333 | + | let id = $t01179311886._1 | |
334 | + | let caller = $t01179311886._2 | |
335 | + | let date = $t01179311886._3 | |
336 | + | let isValidNFT = $t01179311886._4 | |
337 | + | let artId = $t01179311886._5 | |
338 | + | let creatorAddr = $t01179311886._6 | |
339 | + | let artSignID = $t01179311886._7 | |
348 | 340 | if ((size(artSignID) == 0)) | |
349 | 341 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
350 | 342 | else if (!(isValidNFT)) | |
358 | 350 | if ((saleStatus != "OPEN")) | |
359 | 351 | then throw("Sale not active") | |
360 | 352 | else if (!(acceptedAssetIds(asset))) | |
361 | - | then throw("Only SIGN, USDN or WAVES accepted") | |
353 | + | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
362 | 354 | else if (!(validateMinSell(asset, price))) | |
363 | 355 | then throw("Wrong minimum sell price") | |
364 | 356 | else { | |
374 | 366 | ||
375 | 367 | @Callable(i) | |
376 | 368 | func cancelSale (nftId) = { | |
377 | - | let $ | |
378 | - | let id = $ | |
379 | - | let caller = $ | |
380 | - | let date = $ | |
381 | - | let isValidNFT = $ | |
382 | - | let artId = $ | |
383 | - | let creatorAddr = $ | |
384 | - | let artSignID = $ | |
369 | + | let $t01306313307 = provideBaseData(i, nftId) | |
370 | + | let id = $t01306313307._1 | |
371 | + | let caller = $t01306313307._2 | |
372 | + | let date = $t01306313307._3 | |
373 | + | let isValidNFT = $t01306313307._4 | |
374 | + | let artId = $t01306313307._5 | |
375 | + | let creatorAddr = $t01306313307._6 | |
376 | + | let artSignID = $t01306313307._7 | |
385 | 377 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
386 | 378 | if ((saleOwner != caller)) | |
387 | 379 | then throw("You don't own this NFT") | |
401 | 393 | ||
402 | 394 | @Callable(i) | |
403 | 395 | func buyNFT (nftId) = { | |
404 | - | let $ | |
405 | - | let id = $ | |
406 | - | let caller = $ | |
407 | - | let date = $ | |
408 | - | let isValidNFT = $ | |
409 | - | let artId = $ | |
410 | - | let creatorAddr = $ | |
411 | - | let artSignID = $ | |
396 | + | let $t01416114254 = provideBaseData(i, nftId) | |
397 | + | let id = $t01416114254._1 | |
398 | + | let caller = $t01416114254._2 | |
399 | + | let date = $t01416114254._3 | |
400 | + | let isValidNFT = $t01416114254._4 | |
401 | + | let artId = $t01416114254._5 | |
402 | + | let creatorAddr = $t01416114254._6 | |
403 | + | let artSignID = $t01416114254._7 | |
412 | 404 | if ((size(artSignID) == 0)) | |
413 | 405 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
414 | 406 | else if (!(isValidNFT)) | |
424 | 416 | if ((parseInt(saleInfoArray[1]) == 0)) | |
425 | 417 | then throw("Offer only") | |
426 | 418 | else { | |
427 | - | let $ | |
428 | - | let payment = $ | |
429 | - | let amount = $ | |
419 | + | let $t01476314799 = isPayment(i) | |
420 | + | let payment = $t01476314799._1 | |
421 | + | let amount = $t01476314799._2 | |
430 | 422 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
431 | 423 | then toBase58String(value(payment.assetId)) | |
432 | 424 | else "" | |
435 | 427 | else (saleInfoArray[2] != paymentAssetStr)) | |
436 | 428 | then throw("Payment infos don't match.") | |
437 | 429 | else { | |
438 | - | let $ | |
439 | - | let commissions = $ | |
440 | - | let creatorFee = $ | |
441 | - | let ownerFee = $ | |
442 | - | let collectorNFT = $ | |
430 | + | let $t01531315445 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller) | |
431 | + | let commissions = $t01531315445._1 | |
432 | + | let creatorFee = $t01531315445._2 | |
433 | + | let ownerFee = $t01531315445._3 | |
434 | + | let collectorNFT = $t01531315445._4 | |
443 | 435 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
444 | 436 | } | |
445 | 437 | } | |
451 | 443 | ||
452 | 444 | @Callable(i) | |
453 | 445 | func setOffer (nftId) = { | |
454 | - | let $ | |
455 | - | let id = $ | |
456 | - | let offerOwner = $ | |
457 | - | let date = $ | |
458 | - | let isValidNFT = $ | |
459 | - | let artId = $ | |
460 | - | let creatorAddr = $ | |
461 | - | let artSignID = $ | |
446 | + | let $t01587315970 = provideBaseData(i, nftId) | |
447 | + | let id = $t01587315970._1 | |
448 | + | let offerOwner = $t01587315970._2 | |
449 | + | let date = $t01587315970._3 | |
450 | + | let isValidNFT = $t01587315970._4 | |
451 | + | let artId = $t01587315970._5 | |
452 | + | let creatorAddr = $t01587315970._6 | |
453 | + | let artSignID = $t01587315970._7 | |
462 | 454 | if (!(isValidNFT)) | |
463 | 455 | then throw("Not a valid nft") | |
464 | 456 | else { | |
465 | - | let $ | |
466 | - | let payment = $ | |
467 | - | let amount = $ | |
457 | + | let $t01603416070 = isPayment(i) | |
458 | + | let payment = $t01603416070._1 | |
459 | + | let amount = $t01603416070._2 | |
468 | 460 | let assetId = if (!(isDefined(payment.assetId))) | |
469 | 461 | then "WAVES" | |
470 | 462 | else toBase58String(value(payment.assetId)) | |
485 | 477 | ||
486 | 478 | @Callable(i) | |
487 | 479 | func acceptOffer (nftId,offerId,offerOwner) = { | |
488 | - | let $ | |
489 | - | let id = $ | |
490 | - | let caller = $ | |
491 | - | let date = $ | |
492 | - | let isValidNFT = $ | |
493 | - | let artId = $ | |
494 | - | let creatorAddr = $ | |
495 | - | let artSignID = $ | |
480 | + | let $t01689116984 = provideBaseData(i, nftId) | |
481 | + | let id = $t01689116984._1 | |
482 | + | let caller = $t01689116984._2 | |
483 | + | let date = $t01689116984._3 | |
484 | + | let isValidNFT = $t01689116984._4 | |
485 | + | let artId = $t01689116984._5 | |
486 | + | let creatorAddr = $t01689116984._6 | |
487 | + | let artSignID = $t01689116984._7 | |
496 | 488 | if (!(isValidNFT)) | |
497 | 489 | then throw("Not a valid nft") | |
498 | 490 | else { | |
501 | 493 | then throw("Only sale owner can accept offer") | |
502 | 494 | else { | |
503 | 495 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
504 | - | let $ | |
505 | - | let bidDataArr = $ | |
506 | - | let assetId = $ | |
507 | - | let bidData = $ | |
496 | + | let $t01724517300 = getBidData(bidKey) | |
497 | + | let bidDataArr = $t01724517300._1 | |
498 | + | let assetId = $t01724517300._2 | |
499 | + | let bidData = $t01724517300._3 | |
508 | 500 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
509 | 501 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
510 | 502 | if ((size(saleInfo) == 0)) | |
511 | 503 | then throw("Sale Not found!") | |
512 | 504 | else { | |
513 | 505 | let amount = value(parseInt(bidDataArr[1])) | |
514 | - | let $ | |
515 | - | let commissions = $ | |
516 | - | let creatorFee = $ | |
517 | - | let ownerFee = $ | |
518 | - | let collectorNFT = $ | |
506 | + | let $t01754317674 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6]) | |
507 | + | let commissions = $t01754317674._1 | |
508 | + | let creatorFee = $t01754317674._2 | |
509 | + | let ownerFee = $t01754317674._3 | |
510 | + | let collectorNFT = $t01754317674._4 | |
519 | 511 | let assetIdStr = if (isDefined(assetId)) | |
520 | 512 | then toBase58String(value(assetId)) | |
521 | 513 | else "WAVES" | |
529 | 521 | ||
530 | 522 | @Callable(i) | |
531 | 523 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
532 | - | let $ | |
533 | - | let id = $ | |
534 | - | let caller = $ | |
535 | - | let date = $ | |
524 | + | let $t01849418569 = idCallerDate(i) | |
525 | + | let id = $t01849418569._1 | |
526 | + | let caller = $t01849418569._2 | |
527 | + | let date = $t01849418569._3 | |
536 | 528 | if (if ((caller != offerOwner)) | |
537 | 529 | then (caller != saleOwner) | |
538 | 530 | else false) | |
539 | 531 | then throw("You cannot cancel this offer.") | |
540 | 532 | else { | |
541 | 533 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
542 | - | let $ | |
543 | - | let bidDataArr = $ | |
544 | - | let assetId = $ | |
545 | - | let bidData = $ | |
534 | + | let $t01874318798 = getBidData(bidKey) | |
535 | + | let bidDataArr = $t01874318798._1 | |
536 | + | let assetId = $t01874318798._2 | |
537 | + | let bidData = $t01874318798._3 | |
546 | 538 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
547 | 539 | } | |
548 | 540 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let VERSION = 111 | |
5 | - | ||
6 | 4 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
7 | 5 | ||
8 | 6 | ||
9 | 7 | let unitTest = false | |
10 | 8 | ||
11 | 9 | let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee"))) | |
12 | - | ||
13 | - | let signDapp = value(addressFromString(getStrByK("conf_signweb_dapp"))) | |
14 | 10 | ||
15 | 11 | let feeReceiver = getStrByK("conf_fee_receiver") | |
16 | 12 | ||
17 | 13 | let artworksDapp = value(addressFromString(getStrByK("conf_artworks_dapp"))) | |
18 | 14 | ||
19 | 15 | let userDapp = if (unitTest) | |
20 | 16 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
21 | 17 | else value(addressFromString(getStrByK("conf_users_dapp"))) | |
22 | 18 | ||
23 | - | let whitelistDapp = value(addressFromString(getStrByK("conf_whitelist_dapp"))) | |
24 | - | ||
25 | 19 | let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN")) | |
26 | 20 | ||
27 | 21 | let usdnAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDN")) | |
22 | + | ||
23 | + | let usdtAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDT")) | |
28 | 24 | ||
29 | 25 | let wavesAssetId = base58'' | |
30 | 26 | ||
31 | 27 | let chris = getStrByK("conf_admin_1") | |
32 | 28 | ||
33 | 29 | let signCut = 3 | |
34 | 30 | ||
35 | 31 | let creatorCut = 10 | |
36 | 32 | ||
37 | 33 | let userSuspended = "SUSPENDED" | |
38 | 34 | ||
39 | 35 | let userRemoved = "REMOVED" | |
40 | 36 | ||
41 | 37 | let artIllegal = "ILLEGAL" | |
42 | 38 | ||
43 | 39 | let artSuspended = "SUSPENDED" | |
44 | 40 | ||
45 | 41 | let dappRunningKey = "conf_dapp_is_running" | |
46 | 42 | ||
47 | 43 | let maintenanceMSGKey = "conf_maintenance_msg" | |
48 | 44 | ||
49 | 45 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
50 | 46 | ||
51 | 47 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
52 | 48 | ||
53 | 49 | let numSalesK = "num_sales" | |
54 | 50 | ||
55 | 51 | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
56 | 52 | ||
57 | 53 | ||
58 | 54 | func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "") | |
59 | 55 | ||
60 | 56 | ||
61 | 57 | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
62 | 58 | ||
63 | 59 | ||
64 | 60 | func keyUserStatus (addr) = ("user_status_" + addr) | |
65 | 61 | ||
66 | 62 | ||
67 | 63 | func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr) | |
68 | 64 | ||
69 | 65 | ||
70 | 66 | func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr) | |
71 | 67 | ||
72 | 68 | ||
73 | 69 | func keyNFTData (id) = ("nft_" + id) | |
74 | 70 | ||
75 | 71 | ||
76 | 72 | func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) | |
77 | 73 | ||
78 | 74 | ||
79 | 75 | func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId) | |
80 | 76 | ||
81 | 77 | ||
82 | 78 | func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
83 | 79 | ||
84 | 80 | ||
85 | 81 | let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
86 | 82 | ||
87 | 83 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
88 | 84 | ||
89 | 85 | ||
90 | 86 | func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr) | |
91 | 87 | ||
92 | 88 | ||
93 | 89 | func idCallerDate (i) = if (!(dappRunning)) | |
94 | 90 | then throw(maintenanceMSG) | |
95 | 91 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
96 | 92 | ||
97 | 93 | ||
98 | 94 | func isPayment (i) = if ((size(i.payments) == 0)) | |
99 | 95 | then throw("No payment attached") | |
100 | 96 | else { | |
101 | 97 | let payment = value(i.payments[0]) | |
102 | 98 | let amount = value(payment.amount) | |
103 | 99 | $Tuple2(payment, amount) | |
104 | 100 | } | |
105 | 101 | ||
106 | 102 | ||
107 | 103 | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
108 | 104 | then (assetDetails.decimals == 0) | |
109 | 105 | else false) | |
110 | 106 | then (assetDetails.reissuable == false) | |
111 | 107 | else false) | |
112 | 108 | then (assetDetails.issuer == artworksDapp) | |
113 | 109 | else false | |
114 | 110 | ||
115 | 111 | ||
116 | 112 | func isSignArtNFT (id) = { | |
117 | 113 | let assetDetails = value(assetInfo(id)) | |
118 | 114 | assetIsValid(assetDetails) | |
119 | 115 | } | |
120 | 116 | ||
121 | 117 | ||
122 | - | func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId))) | |
118 | + | func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId))) | |
123 | 119 | then (assetId != toBase58String(wavesAssetId)) | |
124 | 120 | else false) | |
125 | 121 | then (assetId != "WAVES") | |
126 | 122 | else false) | |
127 | 123 | then (assetId != toBase58String(usdnAssetId)) | |
124 | + | else false) | |
125 | + | then (assetId != toBase58String(usdtAssetId)) | |
128 | 126 | else false) | |
129 | 127 | then false | |
130 | 128 | else true | |
131 | 129 | ||
132 | 130 | ||
133 | 131 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
134 | 132 | then unit | |
135 | 133 | else fromBase58String(assetId) | |
136 | 134 | ||
137 | 135 | ||
138 | 136 | func getSaleOwnerAndStatus (nftid) = { | |
139 | 137 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid)) | |
140 | 138 | if ((size(saleOwner) == 0)) | |
141 | 139 | then throw("NFT not found") | |
142 | 140 | else { | |
143 | 141 | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid)) | |
144 | 142 | if ((saleStatus != "OPEN")) | |
145 | 143 | then throw("NFT not for sale") | |
146 | 144 | else saleOwner | |
147 | 145 | } | |
148 | 146 | } | |
149 | 147 | ||
150 | 148 | ||
151 | 149 | func getBidData (key) = { | |
152 | 150 | let bidData = getStrByK((key + "_OPEN")) | |
153 | 151 | if ((bidData == "")) | |
154 | 152 | then throw("Offer not found") | |
155 | 153 | else { | |
156 | 154 | let bidDataArr = split(bidData, "_") | |
157 | 155 | let assetId = getBidAssetId(bidDataArr[2]) | |
158 | 156 | $Tuple3(bidDataArr, assetId, bidData) | |
159 | 157 | } | |
160 | 158 | } | |
161 | 159 | ||
162 | 160 | ||
163 | 161 | func artIsValid (artStatus) = if ((artStatus != artIllegal)) | |
164 | 162 | then (artStatus != artSuspended) | |
165 | 163 | else false | |
166 | 164 | ||
167 | 165 | ||
168 | 166 | func checkArtStatus (addr,id) = { | |
169 | 167 | let artStatus = getArtStrByK(keyFlag(addr, id)) | |
170 | 168 | if (artIsValid(artStatus)) | |
171 | 169 | then true | |
172 | 170 | else throw(("Original Artwork flagged as " + artStatus)) | |
173 | 171 | } | |
174 | 172 | ||
175 | 173 | ||
176 | 174 | func checkArtistStatus (addr) = { | |
177 | 175 | let artistStatus = getUserStrByK(keyUserStatus(addr)) | |
178 | 176 | if (containsElement([userSuspended, userRemoved], artistStatus)) | |
179 | 177 | then throw(("Original Artist " + artistStatus)) | |
180 | 178 | else true | |
181 | 179 | } | |
182 | 180 | ||
183 | 181 | ||
184 | 182 | func checkNFTInfo (assetId) = { | |
185 | 183 | let nftData = split(getArtStrByK(keyNFTData(assetId)), "_") | |
186 | 184 | let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5])) | |
187 | 185 | if (if (!(checkArtStatus(nftData[6], nftData[5]))) | |
188 | 186 | then !(checkArtistStatus(nftData[6])) | |
189 | 187 | else false) | |
190 | 188 | then $Tuple4(false, nftData[5], nftData[6], artSignID) | |
191 | 189 | else $Tuple4(true, nftData[5], nftData[6], artSignID) | |
192 | 190 | } | |
193 | 191 | ||
194 | 192 | ||
195 | - | func checkARTExist (artId,creatorAddr) = { | |
196 | - | let artSignID = getArtStrByK(keySignID(creatorAddr, artId)) | |
197 | - | if ((size(artSignID) == 0)) | |
198 | - | then throw("Artwork not found on SIGN Art") | |
199 | - | else if (if (!(checkArtStatus(creatorAddr, artId))) | |
200 | - | then !(checkArtistStatus(creatorAddr)) | |
201 | - | else false) | |
202 | - | then false | |
203 | - | else true | |
204 | - | } | |
205 | - | ||
206 | - | ||
207 | 193 | func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller) = { | |
208 | 194 | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
209 | 195 | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
210 | 196 | let amountForSign = fraction(amount, signCut, 100) | |
211 | 197 | let amountForCreator = fraction(amount, creatorCut, 100) | |
212 | 198 | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
213 | 199 | let amountForAgent = if (if ((agent != feeReceiver)) | |
214 | 200 | then (agentShare > 0) | |
215 | 201 | else false) | |
216 | 202 | then fraction(amount, agentShare, 100) | |
217 | 203 | else 0 | |
218 | 204 | let commissions = if ((amountForAgent != 0)) | |
219 | 205 | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
220 | 206 | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
221 | 207 | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
222 | 208 | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
223 | 209 | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
224 | 210 | $Tuple4(commissions, creatorFee, ownerFee, collectorNFT) | |
225 | 211 | } | |
226 | 212 | ||
227 | 213 | ||
228 | 214 | func validateMinSell (assetId,price) = { | |
229 | 215 | let minSellWaves = if (unitTest) | |
230 | 216 | then 10 | |
231 | 217 | else getIntByKFromOracle("waves_min_sell") | |
232 | 218 | let minSellUsdn = 1000000 | |
233 | 219 | let minSellSign = if (unitTest) | |
234 | 220 | then 1 | |
235 | 221 | else (currentCertificationPrice * 2) | |
236 | - | if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
222 | + | if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
237 | 223 | then (minSellUsdn > price) | |
238 | 224 | else false) | |
239 | 225 | then (price != 0) | |
240 | 226 | else false) | |
227 | + | then true | |
228 | + | else if (if ((assetId == toBase58String(usdtAssetId))) | |
229 | + | then (minSellUsdn > price) | |
230 | + | else false) | |
231 | + | then (price != 0) | |
232 | + | else false) | |
241 | 233 | then true | |
242 | 234 | else if (if ((assetId == toBase58String(signAssetId))) | |
243 | 235 | then (minSellSign > price) | |
244 | 236 | else false) | |
245 | 237 | then (price != 0) | |
246 | 238 | else false) | |
247 | 239 | then true | |
248 | 240 | else if (if (if ((assetId == toBase58String(wavesAssetId))) | |
249 | 241 | then true | |
250 | 242 | else (assetId == "WAVES")) | |
251 | 243 | then (minSellWaves > price) | |
252 | 244 | else false) | |
253 | 245 | then (price != 0) | |
254 | 246 | else false) | |
255 | 247 | then false | |
256 | 248 | else true | |
257 | 249 | } | |
258 | 250 | ||
259 | 251 | ||
260 | 252 | func provideBaseData (i,nftId) = { | |
261 | - | let $ | |
262 | - | let id = $ | |
263 | - | let caller = $ | |
264 | - | let date = $ | |
265 | - | let $ | |
266 | - | let isValidNFT = $ | |
267 | - | let artId = $ | |
268 | - | let creatorAddr = $ | |
269 | - | let artSignID = $ | |
253 | + | let $t093049344 = idCallerDate(i) | |
254 | + | let id = $t093049344._1 | |
255 | + | let caller = $t093049344._2 | |
256 | + | let date = $t093049344._3 | |
257 | + | let $t093489417 = checkNFTInfo(nftId) | |
258 | + | let isValidNFT = $t093489417._1 | |
259 | + | let artId = $t093489417._2 | |
260 | + | let creatorAddr = $t093489417._3 | |
261 | + | let artSignID = $t093489417._4 | |
270 | 262 | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
271 | 263 | } | |
272 | 264 | ||
273 | 265 | ||
274 | 266 | func updateNumSales () = { | |
275 | 267 | let numSales = getIntByK(numSalesK) | |
276 | 268 | IntegerEntry(numSalesK, (numSales + 1)) | |
277 | 269 | } | |
278 | 270 | ||
279 | 271 | ||
280 | 272 | @Callable(invoke) | |
281 | 273 | func setConf (key,val) = { | |
282 | 274 | let caller = toString(invoke.caller) | |
283 | 275 | if (containsElement([chris, toString(this)], caller)) | |
284 | 276 | then if (contains(key, "conf_")) | |
285 | 277 | then [StringEntry(key, val)] | |
286 | 278 | else throw("Entries starting with conf_ only") | |
287 | 279 | else throw("You are not allowed to change this") | |
288 | 280 | } | |
289 | 281 | ||
290 | 282 | ||
291 | 283 | ||
292 | 284 | @Callable(invoke) | |
293 | 285 | func appRunning (isLive,message) = { | |
294 | 286 | let caller = toString(invoke.caller) | |
295 | 287 | let id = toBase58String(invoke.transactionId) | |
296 | 288 | if (containsElement([chris, toString(this)], caller)) | |
297 | 289 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
298 | 290 | else throw("You are not allowed to change this") | |
299 | 291 | } | |
300 | 292 | ||
301 | 293 | ||
302 | 294 | ||
303 | 295 | @Callable(i) | |
304 | 296 | func sellNFT (price,asset) = { | |
305 | - | let $ | |
306 | - | let payment = $ | |
307 | - | let amount = $ | |
297 | + | let $t01052210558 = isPayment(i) | |
298 | + | let payment = $t01052210558._1 | |
299 | + | let amount = $t01052210558._2 | |
308 | 300 | if ((amount != 1)) | |
309 | 301 | then throw("No NFT attached") | |
310 | 302 | else { | |
311 | 303 | let nftId = if (if (isDefined(payment.assetId)) | |
312 | 304 | then isSignArtNFT(value(payment.assetId)) | |
313 | 305 | else false) | |
314 | 306 | then toBase58String(value(payment.assetId)) | |
315 | 307 | else throw("Only SIGN Art NFT accepted.") | |
316 | - | let $ | |
317 | - | let id = $ | |
318 | - | let caller = $ | |
319 | - | let date = $ | |
320 | - | let isValidNFT = $ | |
321 | - | let artId = $ | |
322 | - | let creatorAddr = $ | |
323 | - | let artSignID = $ | |
308 | + | let $t01079610889 = provideBaseData(i, nftId) | |
309 | + | let id = $t01079610889._1 | |
310 | + | let caller = $t01079610889._2 | |
311 | + | let date = $t01079610889._3 | |
312 | + | let isValidNFT = $t01079610889._4 | |
313 | + | let artId = $t01079610889._5 | |
314 | + | let creatorAddr = $t01079610889._6 | |
315 | + | let artSignID = $t01079610889._7 | |
324 | 316 | if ((size(artSignID) == 0)) | |
325 | 317 | then throw("Artwork not found on SIGN Art") | |
326 | 318 | else if (!(isValidNFT)) | |
327 | 319 | then throw("Not a valid nft") | |
328 | 320 | else if (!(acceptedAssetIds(asset))) | |
329 | - | then throw("Only SIGN, USDN or WAVES accepted") | |
321 | + | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
330 | 322 | else if (!(validateMinSell(asset, price))) | |
331 | 323 | then throw("Wrong minimum sell price") | |
332 | 324 | else [StringEntry((getSaleKey(caller, nftId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)] | |
333 | 325 | } | |
334 | 326 | } | |
335 | 327 | ||
336 | 328 | ||
337 | 329 | ||
338 | 330 | @Callable(i) | |
339 | 331 | func updateSalePrice (nftId,price,asset) = { | |
340 | - | let $ | |
341 | - | let id = $ | |
342 | - | let caller = $ | |
343 | - | let date = $ | |
344 | - | let isValidNFT = $ | |
345 | - | let artId = $ | |
346 | - | let creatorAddr = $ | |
347 | - | let artSignID = $ | |
332 | + | let $t01179311886 = provideBaseData(i, nftId) | |
333 | + | let id = $t01179311886._1 | |
334 | + | let caller = $t01179311886._2 | |
335 | + | let date = $t01179311886._3 | |
336 | + | let isValidNFT = $t01179311886._4 | |
337 | + | let artId = $t01179311886._5 | |
338 | + | let creatorAddr = $t01179311886._6 | |
339 | + | let artSignID = $t01179311886._7 | |
348 | 340 | if ((size(artSignID) == 0)) | |
349 | 341 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
350 | 342 | else if (!(isValidNFT)) | |
351 | 343 | then throw("Not a valid nft") | |
352 | 344 | else { | |
353 | 345 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
354 | 346 | if ((saleOwner != caller)) | |
355 | 347 | then throw("You don't own this NFT") | |
356 | 348 | else { | |
357 | 349 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
358 | 350 | if ((saleStatus != "OPEN")) | |
359 | 351 | then throw("Sale not active") | |
360 | 352 | else if (!(acceptedAssetIds(asset))) | |
361 | - | then throw("Only SIGN, USDN or WAVES accepted") | |
353 | + | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
362 | 354 | else if (!(validateMinSell(asset, price))) | |
363 | 355 | then throw("Wrong minimum sell price") | |
364 | 356 | else { | |
365 | 357 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
366 | 358 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
367 | 359 | [StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))] | |
368 | 360 | } | |
369 | 361 | } | |
370 | 362 | } | |
371 | 363 | } | |
372 | 364 | ||
373 | 365 | ||
374 | 366 | ||
375 | 367 | @Callable(i) | |
376 | 368 | func cancelSale (nftId) = { | |
377 | - | let $ | |
378 | - | let id = $ | |
379 | - | let caller = $ | |
380 | - | let date = $ | |
381 | - | let isValidNFT = $ | |
382 | - | let artId = $ | |
383 | - | let creatorAddr = $ | |
384 | - | let artSignID = $ | |
369 | + | let $t01306313307 = provideBaseData(i, nftId) | |
370 | + | let id = $t01306313307._1 | |
371 | + | let caller = $t01306313307._2 | |
372 | + | let date = $t01306313307._3 | |
373 | + | let isValidNFT = $t01306313307._4 | |
374 | + | let artId = $t01306313307._5 | |
375 | + | let creatorAddr = $t01306313307._6 | |
376 | + | let artSignID = $t01306313307._7 | |
385 | 377 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
386 | 378 | if ((saleOwner != caller)) | |
387 | 379 | then throw("You don't own this NFT") | |
388 | 380 | else { | |
389 | 381 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
390 | 382 | if ((saleStatus != "OPEN")) | |
391 | 383 | then throw("Sale not active") | |
392 | 384 | else { | |
393 | 385 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
394 | 386 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
395 | 387 | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + caller) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CANCELLED"), ((((saleInfo + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))] | |
396 | 388 | } | |
397 | 389 | } | |
398 | 390 | } | |
399 | 391 | ||
400 | 392 | ||
401 | 393 | ||
402 | 394 | @Callable(i) | |
403 | 395 | func buyNFT (nftId) = { | |
404 | - | let $ | |
405 | - | let id = $ | |
406 | - | let caller = $ | |
407 | - | let date = $ | |
408 | - | let isValidNFT = $ | |
409 | - | let artId = $ | |
410 | - | let creatorAddr = $ | |
411 | - | let artSignID = $ | |
396 | + | let $t01416114254 = provideBaseData(i, nftId) | |
397 | + | let id = $t01416114254._1 | |
398 | + | let caller = $t01416114254._2 | |
399 | + | let date = $t01416114254._3 | |
400 | + | let isValidNFT = $t01416114254._4 | |
401 | + | let artId = $t01416114254._5 | |
402 | + | let creatorAddr = $t01416114254._6 | |
403 | + | let artSignID = $t01416114254._7 | |
412 | 404 | if ((size(artSignID) == 0)) | |
413 | 405 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
414 | 406 | else if (!(isValidNFT)) | |
415 | 407 | then throw("Not a valid nft") | |
416 | 408 | else { | |
417 | 409 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
418 | 410 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
419 | 411 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
420 | 412 | if ((size(saleInfo) == 0)) | |
421 | 413 | then throw("Sale Not found!") | |
422 | 414 | else { | |
423 | 415 | let saleInfoArray = split(saleInfo, "_") | |
424 | 416 | if ((parseInt(saleInfoArray[1]) == 0)) | |
425 | 417 | then throw("Offer only") | |
426 | 418 | else { | |
427 | - | let $ | |
428 | - | let payment = $ | |
429 | - | let amount = $ | |
419 | + | let $t01476314799 = isPayment(i) | |
420 | + | let payment = $t01476314799._1 | |
421 | + | let amount = $t01476314799._2 | |
430 | 422 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
431 | 423 | then toBase58String(value(payment.assetId)) | |
432 | 424 | else "" | |
433 | 425 | if (if ((saleInfoArray[1] != toString(amount))) | |
434 | 426 | then true | |
435 | 427 | else (saleInfoArray[2] != paymentAssetStr)) | |
436 | 428 | then throw("Payment infos don't match.") | |
437 | 429 | else { | |
438 | - | let $ | |
439 | - | let commissions = $ | |
440 | - | let creatorFee = $ | |
441 | - | let ownerFee = $ | |
442 | - | let collectorNFT = $ | |
430 | + | let $t01531315445 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller) | |
431 | + | let commissions = $t01531315445._1 | |
432 | + | let creatorFee = $t01531315445._2 | |
433 | + | let ownerFee = $t01531315445._3 | |
434 | + | let collectorNFT = $t01531315445._4 | |
443 | 435 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
444 | 436 | } | |
445 | 437 | } | |
446 | 438 | } | |
447 | 439 | } | |
448 | 440 | } | |
449 | 441 | ||
450 | 442 | ||
451 | 443 | ||
452 | 444 | @Callable(i) | |
453 | 445 | func setOffer (nftId) = { | |
454 | - | let $ | |
455 | - | let id = $ | |
456 | - | let offerOwner = $ | |
457 | - | let date = $ | |
458 | - | let isValidNFT = $ | |
459 | - | let artId = $ | |
460 | - | let creatorAddr = $ | |
461 | - | let artSignID = $ | |
446 | + | let $t01587315970 = provideBaseData(i, nftId) | |
447 | + | let id = $t01587315970._1 | |
448 | + | let offerOwner = $t01587315970._2 | |
449 | + | let date = $t01587315970._3 | |
450 | + | let isValidNFT = $t01587315970._4 | |
451 | + | let artId = $t01587315970._5 | |
452 | + | let creatorAddr = $t01587315970._6 | |
453 | + | let artSignID = $t01587315970._7 | |
462 | 454 | if (!(isValidNFT)) | |
463 | 455 | then throw("Not a valid nft") | |
464 | 456 | else { | |
465 | - | let $ | |
466 | - | let payment = $ | |
467 | - | let amount = $ | |
457 | + | let $t01603416070 = isPayment(i) | |
458 | + | let payment = $t01603416070._1 | |
459 | + | let amount = $t01603416070._2 | |
468 | 460 | let assetId = if (!(isDefined(payment.assetId))) | |
469 | 461 | then "WAVES" | |
470 | 462 | else toBase58String(value(payment.assetId)) | |
471 | 463 | if (!(acceptedAssetIds(assetId))) | |
472 | 464 | then throw("asset not accepted") | |
473 | 465 | else if ((amount == 0)) | |
474 | 466 | then throw("Offer of 0 not allowed") | |
475 | 467 | else if (!(validateMinSell(assetId, amount))) | |
476 | 468 | then throw("Wrong minimum sell price") | |
477 | 469 | else { | |
478 | 470 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
479 | 471 | [StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + offerOwner) + "_") + id))] | |
480 | 472 | } | |
481 | 473 | } | |
482 | 474 | } | |
483 | 475 | ||
484 | 476 | ||
485 | 477 | ||
486 | 478 | @Callable(i) | |
487 | 479 | func acceptOffer (nftId,offerId,offerOwner) = { | |
488 | - | let $ | |
489 | - | let id = $ | |
490 | - | let caller = $ | |
491 | - | let date = $ | |
492 | - | let isValidNFT = $ | |
493 | - | let artId = $ | |
494 | - | let creatorAddr = $ | |
495 | - | let artSignID = $ | |
480 | + | let $t01689116984 = provideBaseData(i, nftId) | |
481 | + | let id = $t01689116984._1 | |
482 | + | let caller = $t01689116984._2 | |
483 | + | let date = $t01689116984._3 | |
484 | + | let isValidNFT = $t01689116984._4 | |
485 | + | let artId = $t01689116984._5 | |
486 | + | let creatorAddr = $t01689116984._6 | |
487 | + | let artSignID = $t01689116984._7 | |
496 | 488 | if (!(isValidNFT)) | |
497 | 489 | then throw("Not a valid nft") | |
498 | 490 | else { | |
499 | 491 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
500 | 492 | if ((caller != saleOwner)) | |
501 | 493 | then throw("Only sale owner can accept offer") | |
502 | 494 | else { | |
503 | 495 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
504 | - | let $ | |
505 | - | let bidDataArr = $ | |
506 | - | let assetId = $ | |
507 | - | let bidData = $ | |
496 | + | let $t01724517300 = getBidData(bidKey) | |
497 | + | let bidDataArr = $t01724517300._1 | |
498 | + | let assetId = $t01724517300._2 | |
499 | + | let bidData = $t01724517300._3 | |
508 | 500 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
509 | 501 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
510 | 502 | if ((size(saleInfo) == 0)) | |
511 | 503 | then throw("Sale Not found!") | |
512 | 504 | else { | |
513 | 505 | let amount = value(parseInt(bidDataArr[1])) | |
514 | - | let $ | |
515 | - | let commissions = $ | |
516 | - | let creatorFee = $ | |
517 | - | let ownerFee = $ | |
518 | - | let collectorNFT = $ | |
506 | + | let $t01754317674 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6]) | |
507 | + | let commissions = $t01754317674._1 | |
508 | + | let creatorFee = $t01754317674._2 | |
509 | + | let ownerFee = $t01754317674._3 | |
510 | + | let collectorNFT = $t01754317674._4 | |
519 | 511 | let assetIdStr = if (isDefined(assetId)) | |
520 | 512 | then toBase58String(value(assetId)) | |
521 | 513 | else "WAVES" | |
522 | 514 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
523 | 515 | } | |
524 | 516 | } | |
525 | 517 | } | |
526 | 518 | } | |
527 | 519 | ||
528 | 520 | ||
529 | 521 | ||
530 | 522 | @Callable(i) | |
531 | 523 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
532 | - | let $ | |
533 | - | let id = $ | |
534 | - | let caller = $ | |
535 | - | let date = $ | |
524 | + | let $t01849418569 = idCallerDate(i) | |
525 | + | let id = $t01849418569._1 | |
526 | + | let caller = $t01849418569._2 | |
527 | + | let date = $t01849418569._3 | |
536 | 528 | if (if ((caller != offerOwner)) | |
537 | 529 | then (caller != saleOwner) | |
538 | 530 | else false) | |
539 | 531 | then throw("You cannot cancel this offer.") | |
540 | 532 | else { | |
541 | 533 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
542 | - | let $ | |
543 | - | let bidDataArr = $ | |
544 | - | let assetId = $ | |
545 | - | let bidData = $ | |
534 | + | let $t01874318798 = getBidData(bidKey) | |
535 | + | let bidDataArr = $t01874318798._1 | |
536 | + | let assetId = $t01874318798._2 | |
537 | + | let bidData = $t01874318798._3 | |
546 | 538 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
547 | 539 | } | |
548 | 540 | } | |
549 | 541 | ||
550 | 542 |
github/deemru/w8io/026f985 107.38 ms ◑