tx · 7BZYhv6bFir3Log5Vu21xoHFyKUULaL1qUkgGpjTUoda

3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw:  -0.01000000 Waves

2023.01.24 13:48 [2418945] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves

{ "type": 13, "id": "7BZYhv6bFir3Log5Vu21xoHFyKUULaL1qUkgGpjTUoda", "fee": 1000000, "feeAssetId": null, "timestamp": 1674557456827, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "4nZSzcBHQ3pYcnpoMUYZNQE6UBVmtLMoxtob5CUYHZNfGh5TQvLy7cz3iFicV2HmCMoqnKXWtLW1SyQ5RXerS2NE" ], "script": "base64:BgIfCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgSAwoBCAsACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAZrUHJpY2UCBXByaWNlAAVrU2VsbAIEc2VsbAAFdGVhbXMBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+AAV3YXZlcwEAABJtYXhBdWN0aW9uRHVyYXRpb24ABwAEa0JpZAIDYmlkAAxzdGF0dXNGb3JORlQJAJYKBAIET1BFTgIGQ0xPU0VEAghSRVdBUkRFRAIIQ0FOQ0VMRUQAC2RBcHBBZGRyZXNzARoBVEq4T2zewtqT7fSO6Uo2+NVPf5XVVVtdoAEFaXNOZnQBB2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQFdG9rZW4FByRtYXRjaDADAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwcEAWkBCWNyZWF0ZU5mdAkIbmZ0X25h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ApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUEa0J1eQkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3IJAKQDAQUGYW1vdW50CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUFbmZ0SUQFCXNlcGFyYXRvcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgUDbmlsAWkBCmNhbmNlbFNlbGwBBW5mdElkBAR0eElkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQEBmNhbGxlcggIBQFpBmNhbGxlcgVieXRlcwQIbmZ0T3duZXIJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMJAKwCAgUFbmZ0SWQCCl9uZnRfb3duZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIFBHR4SWQFBW5mdElkAgtfbmZ0X3N0YXR1cwIIQ0FOQ0VMRUQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFCG5mdE93bmVyAAEJANkEAQUFbmZ0SWQFA25pbAAEN2gw", "height": 2418945, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EsfxQBViRrTj1h7CuRstCtcmRT9pfYTSmMTsxd1hFVRL Next: A84xmV8ZhYe7eFsP7TTmXktkb6MLAYDtvxfy2NyHQhr2 Diff:
OldNewDifferences
6767 case _ =>
6868 false
6969 }
70- let $t025892674 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
71- let token0 = $t025892674._1
72- let amount0 = $t025892674._2
7370 let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
7471 if ((current_nft_owner == toString(i.caller)))
7572 then throw("current Owner of NFT not able to purchase")
76- else if (!(isNft(token0)))
77- then throw("Token is not NFT")
78- else if ((i.payments[0].assetId == teams))
79- then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, teams), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
80- else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
73+ else if ((i.payments[0].assetId == teams))
74+ then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, teams), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
75+ else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
8176 }
8277
8378
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "_"
55
66 let kBuy = "buy"
77
88 let kPrice = "price"
99
1010 let kSell = "sell"
1111
1212 let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
1313
1414 let waves = base58''
1515
1616 let maxAuctionDuration = 7
1717
1818 let kBid = "bid"
1919
2020 let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
2121
2222 let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
2323
2424 func isNft (assetId) = match assetInfo(assetId) {
2525 case token: Asset =>
2626 if (if ((token.decimals == 0))
2727 then (token.quantity == 1)
2828 else false)
2929 then (token.reissuable == false)
3030 else false
3131 case _ =>
3232 false
3333 }
3434
3535
3636 @Callable(i)
3737 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
3838 let newToken = Issue(nft_name, nft_description, 1, 0, false)
3939 let issueId = calculateAssetId(newToken)
4040 let txId = i.transactionId
4141 [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(issueId) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), nft_data), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))]
4242 }
4343
4444
4545
4646 @Callable(i)
4747 func sellNFT (price) = {
4848 let txId = i.transactionId
4949 let seller = i.caller.bytes
5050 let $t018801965 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
5151 let token0 = $t018801965._1
5252 let amount0 = $t018801965._2
5353 if (!(isNft(token0)))
5454 then throw("Token is not NFT")
5555 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
5656 }
5757
5858
5959
6060 @Callable(i)
6161 func buyNFT (nftID,current_nft_owner) = {
6262 let assetId = fromBase58String(nftID)
6363 let amount = value(i.payments[0].amount)
6464 let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) {
6565 case a: String =>
6666 a
6767 case _ =>
6868 false
6969 }
70- let $t025892674 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
71- let token0 = $t025892674._1
72- let amount0 = $t025892674._2
7370 let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
7471 if ((current_nft_owner == toString(i.caller)))
7572 then throw("current Owner of NFT not able to purchase")
76- else if (!(isNft(token0)))
77- then throw("Token is not NFT")
78- else if ((i.payments[0].assetId == teams))
79- then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, teams), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
80- else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
73+ else if ((i.payments[0].assetId == teams))
74+ then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, teams), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
75+ else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
8176 }
8277
8378
8479
8580 @Callable(i)
8681 func cancelSell (nftId) = {
8782 let txId = toBase58String(i.transactionId)
8883 let caller = i.caller.bytes
8984 let nftOwner = getStringValue(this, (nftId + "_nft_owner"))
9085 [StringEntry(((txId + nftId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId))]
9186 }
9287
9388

github/deemru/w8io/026f985 
23.09 ms