tx · F7WLkbPxZwuAt7Btq8SbePaDv8FYY42x9hzTKfVnfb3C

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.11.16 14:16 [2319597] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "F7WLkbPxZwuAt7Btq8SbePaDv8FYY42x9hzTKfVnfb3C", "fee": 1000000, "feeAssetId": null, "timestamp": 1668597095013, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "xZyxsaPQcTR8vBFuwKFeZ4ac6dHuTu4paKz5RL6WymNtLS1ApJfBJvJM4cn4esN97sAaJf3Qr9rM3KXgo18yyBy" ], "script": "base64:BgIPCAISCwoJCAgICAgBCAgIBQAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABWtTZWxsAgRzZWxsAAZrUHJpY2UCBXByaWNlAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwEBaQEIaXNzdWVOZnQJCG5mdF9uYW1lCW5mdF9vd25lcg9uZnRfZEFwcEFkZHJlc3MIbmZ0X3R5cGUIbmZ0X3RhZ3MRbmZ0X3NlbGxpbmdfcHJpY2UPbmZ0X2Rlc2NyaXB0aW9uCm5mdF9vblNlbGwIbmZ0X2RhdGEECG5ld1Rva2VuCQDCCAUFCG5mdF9uYW1lBQ9uZnRfZGVzY3JpcHRpb24AAQAABwQHaXNzdWVJZAkAuAgBBQhuZXdUb2tlbgkAzAgCBQhuZXdUb2tlbgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkA2AQBBQdpc3N1ZUlkBQlzZXBhcmF0b3ICCW5mdF9vd25lcgkApQgBCAUBaQZjYWxsZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAghuZnRfdHlwZQUIbmZ0X3R5cGUJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAghuZnRfdGFncwUIbmZ0X3RhZ3MJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAg9uZnRfZEFwcEFkZHJlc3MFD25mdF9kQXBwQWRkcmVzcwkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAhFuZnRfc2VsbGluZ19wcmljZQURbmZ0X3NlbGxpbmdfcHJpY2UJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAgpuZnRfb25TZWxsBQpuZnRfb25TZWxsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQDYBAEFB2lzc3VlSWQFCXNlcGFyYXRvcgIIbmZ0X2RhdGEFCG5mdF9kYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQDYBAEFB2lzc3VlSWQFCXNlcGFyYXRvcgIOaXNzdWVOZnRUb1VzZXIJANwEAQUHaXNzdWVJZAUDbmlsAD9OagY=", "height": 2319597, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9xZ3FGXVbxNqSkDzPTjUS1S1UhUiq9DcnGLbuAGPkzks Next: H59DAQKCN8HtqrBsTMMiDFFwwUa3fdjnPVU1bMXUnhw2 Diff:
OldNewDifferences
2222
2323
2424 @Callable(i)
25-func issueNft (name,meta,price) = {
26- let newToken = Issue(name, meta, 1, 0, false)
25+func issueNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
26+ let newToken = Issue(nft_name, nft_description, 1, 0, false)
2727 let issueId = calculateAssetId(newToken)
28-[newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price))]
29- }
30-
31-
32-
33-@Callable(i)
34-func buyNFT (nftID) = {
35- let assetId = fromBase58String(nftID)
36- let amount = value(i.payments[0].amount)
37- let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this nft")
38- if ((i.payments[0].assetId != unit))
39- then throw("pay in waves")
40- else if ((parseIntValue(price) > amount))
41- then throw("Invalid payment")
42- else [ScriptTransfer(i.caller, 1, assetId), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
43- }
44-
45-
46-
47-@Callable(i)
48-func sellNFT () = {
49- let $t011731258 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
50- let token0 = $t011731258._1
51- let amount0 = $t011731258._2
52- let price = getStringValue(((kPrice + separator) + valueOrErrorMessage(toBase58String(token0), "There is no price for this nft")))
53- if (!(isNft(token0)))
54- then throw("Token is not NFT")
55- else [ScriptTransfer(i.caller, parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
28+[newToken, 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), 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(issueId) + separator) + "issueNftToUser"), toBase16String(issueId))]
5629 }
5730
5831
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 func isNft (assetId) = match assetInfo(assetId) {
1313 case token: Asset =>
1414 if (if ((token.decimals == 0))
1515 then (token.quantity == 1)
1616 else false)
1717 then (token.reissuable == false)
1818 else false
1919 case _ =>
2020 false
2121 }
2222
2323
2424 @Callable(i)
25-func issueNft (name,meta,price) = {
26- let newToken = Issue(name, meta, 1, 0, false)
25+func issueNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
26+ let newToken = Issue(nft_name, nft_description, 1, 0, false)
2727 let issueId = calculateAssetId(newToken)
28-[newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price))]
29- }
30-
31-
32-
33-@Callable(i)
34-func buyNFT (nftID) = {
35- let assetId = fromBase58String(nftID)
36- let amount = value(i.payments[0].amount)
37- let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this nft")
38- if ((i.payments[0].assetId != unit))
39- then throw("pay in waves")
40- else if ((parseIntValue(price) > amount))
41- then throw("Invalid payment")
42- else [ScriptTransfer(i.caller, 1, assetId), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
43- }
44-
45-
46-
47-@Callable(i)
48-func sellNFT () = {
49- let $t011731258 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
50- let token0 = $t011731258._1
51- let amount0 = $t011731258._2
52- let price = getStringValue(((kPrice + separator) + valueOrErrorMessage(toBase58String(token0), "There is no price for this nft")))
53- if (!(isNft(token0)))
54- then throw("Token is not NFT")
55- else [ScriptTransfer(i.caller, parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
28+[newToken, 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), 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(issueId) + separator) + "issueNftToUser"), toBase16String(issueId))]
5629 }
5730
5831

github/deemru/w8io/026f985 
36.07 ms