tx · Hk5vVWZFa4gLdkX9AcmvxJfo8nKvfkDUvbsaMfShuRLq

3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H:  -0.01000000 Waves

2022.11.04 18:44 [2302560] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves

{ "type": 13, "id": "Hk5vVWZFa4gLdkX9AcmvxJfo8nKvfkDUvbsaMfShuRLq", "fee": 1000000, "feeAssetId": null, "timestamp": 1667576697903, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "617dJEwjvLBA2KNRtKyVo3TKe9zkkb7eUewiGrPqtccaz4Mr5cWPA7mwhiyijtLKHHicbfxQkZW5U24NinnxMPZz" ], "script": "base64:BgIQCAISBQoDCAgBEgMKAQISAAUACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAVrU2VsbAIEc2VsbAAGa1ByaWNlAgVwcmljZQEFaXNOZnQBB2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQFdG9rZW4FByRtYXRjaDADAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwcDAWkBCGlzc3VlTmZ0AwRuYW1lBG1ldGEFcHJpY2UECG5ld1Rva2VuCQDCCAUFBG5hbWUFBG1ldGEAAQAABwQHaXNzdWVJZAkAuAgBBQhuZXdUb2tlbgkAzAgCBQhuZXdUb2tlbgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUGa1ByaWNlBQlzZXBhcmF0b3IJANgEAQUHaXNzdWVJZAkApAMBBQVwcmljZQkAzAgCCQELQmluYXJ5RW50cnkCAghieXl5eXl0ZQUHaXNzdWVJZAUDbmlsAWkB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wCAgkA2AQBBQZ0b2tlbjAFCXNlcGFyYXRvcgkApAMBBQdhbW91bnQwBQNuaWwAUvqRpw==", "height": 2302560, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CJRMNDRoCC1JP24tpC3kSPYCyBBsxJA3esNsavNyBgSn Next: 7kAzQdS8JYDqaw1JVDdEKAmUMksr6zsuEMNzU98SwG3q Diff:
OldNewDifferences
2525 func issueNft (name,meta,price) = {
2626 let newToken = Issue(name, meta, 1, 0, false)
2727 let issueId = calculateAssetId(newToken)
28-[newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price))]
28+[newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price)), BinaryEntry("byyyyyte", issueId)]
2929 }
3030
3131
3232
3333 @Callable(i)
3434 func buyNFT (nftID) = {
35- let $t0710795 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
36- let token0 = $t0710795._1
37- let amount0 = $t0710795._2
35+ let $t0750835 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
36+ let token0 = $t0750835._1
37+ let amount0 = $t0750835._2
3838 [ScriptTransfer(i.caller, 1, nftID), StringEntry(((toString(i.caller) + separator) + kBuy), ((toBase58String(nftID) + separator) + toString(amount0)))]
3939 }
4040
4242
4343 @Callable(i)
4444 func sellNFT () = {
45- let $t010041089 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
46- let token0 = $t010041089._1
47- let amount0 = $t010041089._2
45+ let $t010441129 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
46+ let token0 = $t010441129._1
47+ let amount0 = $t010441129._2
4848 let price = getStringValue(((kPrice + separator) + valueOrErrorMessage(toBase58String(token0), "There is no price for this NFT")))
4949 if (!(isNft(token0)))
5050 then throw("Token is not NFT")
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)
2525 func issueNft (name,meta,price) = {
2626 let newToken = Issue(name, meta, 1, 0, false)
2727 let issueId = calculateAssetId(newToken)
28-[newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price))]
28+[newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price)), BinaryEntry("byyyyyte", issueId)]
2929 }
3030
3131
3232
3333 @Callable(i)
3434 func buyNFT (nftID) = {
35- let $t0710795 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
36- let token0 = $t0710795._1
37- let amount0 = $t0710795._2
35+ let $t0750835 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
36+ let token0 = $t0750835._1
37+ let amount0 = $t0750835._2
3838 [ScriptTransfer(i.caller, 1, nftID), StringEntry(((toString(i.caller) + separator) + kBuy), ((toBase58String(nftID) + separator) + toString(amount0)))]
3939 }
4040
4141
4242
4343 @Callable(i)
4444 func sellNFT () = {
45- let $t010041089 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
46- let token0 = $t010041089._1
47- let amount0 = $t010041089._2
45+ let $t010441129 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
46+ let token0 = $t010441129._1
47+ let amount0 = $t010441129._2
4848 let price = getStringValue(((kPrice + separator) + valueOrErrorMessage(toBase58String(token0), "There is no price for this NFT")))
4949 if (!(isNft(token0)))
5050 then throw("Token is not NFT")
5151 else [ScriptTransfer(i.caller, (parseIntValue(price) * amount0), unit), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
5252 }
5353
5454

github/deemru/w8io/026f985 
32.87 ms