tx · JC2J2Zg3MfDDUpdDn7JszMujNB7G3peGGjuCLZEe2qQ2

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.01000000 Waves

2022.11.22 08:04 [2327886] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "JC2J2Zg3MfDDUpdDn7JszMujNB7G3peGGjuCLZEe2qQ2", "fee": 1000000, "feeAssetId": null, "timestamp": 1669093479294, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "x4gN4hsg8HJX5G1JTbQAFHz8vqrvZ6yHb5pzVTuvapP9MhTJqCPDaYavvJUjV7GxzSq57VxDuUywv46Sc64auGa" ], "script": "base64:BgIgCAISCwoJCAgICAgBCAgIEgMKAQESAwoBCBIDCgEIEgAGAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAFa1NlbGwCBHNlbGwABmtQcmljZQIFcHJpY2UACWRBcHBPd25lcgEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMJAAACCAUFdG9rZW4IZGVjaW1hbHMAAAkAAAIIBQV0b2tlbghxdWFudGl0eQABBwkAAAIIBQV0b2tlbgpyZWlzc3VhYmxlBwcHBQFpAQhpc3N1ZU5mdAkIbmZ0X25hbWUJbmZ0X293bmVyD25mdF9kQXBwQWRkcmVzcwhuZnRfdHlwZQhuZnRfdGFncxFuZnRfc2VsbGluZ19wcmljZQ9uZnRfZGVzY3JpcHRpb24KbmZ0X29uU2VsbAluZnRfaW1hZ2UEBHR4SWQIBQFpDXRyYW5zYWN0aW9uSWQEB2NyZWF0b3IJANgEAQ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 8UTmy6aw8tCw352T7Cx6sG5FjC6JHqex5877hsSWhvK3 Next: 6HCt4U7tmp9zB7tqJ3ZafukEeanwfLbPvtHRSbsUSEyz Diff:
OldNewDifferences
3131 let issueMetadata = (((((((("{creator: " + creator) + ",") + ("creator_name: " + creator_name)) + ",") + ("description: " + nft_description)) + ",") + ("nft_art_id" + toBase58String(txId))) + "}")
3232 let newToken = Issue(nft_name, issueMetadata, 1, 0, false)
3333 let issueId = calculateAssetId(newToken)
34-[newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_image"), nft_image), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), issueMetadata), StringEntry(((toBase58String(i.caller.bytes) + separator) + "nft_owner"), creator), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))]
34+[newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_image"), nft_image), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), issueMetadata), StringEntry(((toBase58String(i.caller.bytes) + separator) + "nft_owner"), creator), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))]
3535 }
3636
3737
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 kSell = "sell"
99
1010 let kPrice = "price"
1111
1212 let dAppOwner = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
1313
1414 func isNft (assetId) = match assetInfo(assetId) {
1515 case token: Asset =>
1616 if (if ((token.decimals == 0))
1717 then (token.quantity == 1)
1818 else false)
1919 then (token.reissuable == false)
2020 else false
2121 case _ =>
2222 false
2323 }
2424
2525
2626 @Callable(i)
2727 func issueNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_image) = {
2828 let txId = i.transactionId
2929 let creator = toBase58String(i.caller.bytes)
3030 let creator_name = nft_owner
3131 let issueMetadata = (((((((("{creator: " + creator) + ",") + ("creator_name: " + creator_name)) + ",") + ("description: " + nft_description)) + ",") + ("nft_art_id" + toBase58String(txId))) + "}")
3232 let newToken = Issue(nft_name, issueMetadata, 1, 0, false)
3333 let issueId = calculateAssetId(newToken)
34-[newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_image"), nft_image), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), issueMetadata), StringEntry(((toBase58String(i.caller.bytes) + separator) + "nft_owner"), creator), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))]
34+[newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_image"), nft_image), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), issueMetadata), StringEntry(((toBase58String(i.caller.bytes) + separator) + "nft_owner"), creator), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))]
3535 }
3636
3737
3838
3939 @Callable(i)
4040 func sellNFT (price) = {
4141 let token = i.payments[0].assetId
4242 let assetid = value(i.payments[0].assetId)
4343 let amount0 = value(i.payments[0].amount)
4444 if (!(isNft(assetid)))
4545 then throw("Token is not NFT")
4646 else [StringEntry((toBase58String(assetid) + "_owner"), toString(i.caller)), StringEntry((toBase58String(assetid) + "_nft_selling_price"), toString(price)), StringEntry((toBase58String(assetid) + "_onsell"), "true"), StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(assetid) + separator) + toString(amount0)))]
4747 }
4848
4949
5050
5151 @Callable(i)
5252 func buyNFTTesting (nftID) = {
5353 let caller = toBase64String(i.caller.bytes)
5454 let assetId = fromBase58String(nftID)
5555 let amount = value(i.payments[0].amount)
5656 let nftOwner = getStringValue((toBase58String(assetId) + "_owner"))
5757 let price = match getString(this, (toBase58String(assetId) + "_nft_selling_price")) {
5858 case a: String =>
5959 a
6060 case _ =>
6161 "0"
6262 }
6363 let issell = match getString(this, (toBase58String(assetId) + "_onsell")) {
6464 case a: String =>
6565 a
6666 case _ =>
6767 "false"
6868 }
6969 if ((i.payments[0].assetId != unit))
7070 then throw("Pay in waves")
7171 else if (if ((parseIntValue(price) != amount))
7272 then (parseIntValue(price) == 0)
7373 else false)
7474 then throw("Invalid payment")
7575 else if ((caller == nftOwner))
7676 then throw("NFT owner will not able to buy this")
7777 else if ((caller == toBase58String(dAppOwner)))
7878 then throw("You are not eligible due to owner account of app")
7979 else if ((issell != "true"))
8080 then throw("Not on sell")
8181 else [StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), StringEntry((((toString(i.caller) + separator) + kBuy) + "_from"), nftOwner), DeleteEntry((toBase58String(assetId) + "_owner")), DeleteEntry((toBase58String(assetId) + "_onsell")), ScriptTransfer(addressFromStringValue(nftOwner), parseIntValue(price), unit), ScriptTransfer(i.caller, 1, assetId)]
8282 }
8383
8484
8585
8686 @Callable(i)
8787 func buyNFT (nftID) = {
8888 let assetId = fromBase58String(nftID)
8989 let amount = value(i.payments[0].amount)
9090 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
9191 let issell = match getString(this, (toBase58String(assetId) + "_onsell")) {
9292 case a: String =>
9393 a
9494 case _ =>
9595 "false"
9696 }
9797 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
9898 if ((i.payments[0].assetId != unit))
9999 then throw("Pay in waves")
100100 else if ((parseIntValue(price) > amount))
101101 then throw("Invalid payment")
102102 else if ((issell != "true"))
103103 then throw("Not on sell")
104104 else [StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((toBase58String(assetId) + "_owner")), DeleteEntry((toBase58String(assetId) + "_onsell")), ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit)]
105105 }
106106
107107
108108
109109 @Callable(i)
110110 func deleteNFT () = {
111111 let token0 = i.payments[0].assetId
112112 [StringEntry(("delete_" + toBase58String(value(i.payments[0].assetId))), "token burn"), Burn(value(token0), 1)]
113113 }
114114
115115

github/deemru/w8io/026f985 
49.79 ms