tx · 6YxgizRCCbShFd1bGnNgNqoZZUqAAwgNhsZ2R3Va2H1K

3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX:  -0.01000000 Waves

2022.02.01 23:52 [1905044] smart account 3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX > SELF 0.00000000 Waves

{ "type": 13, "id": "6YxgizRCCbShFd1bGnNgNqoZZUqAAwgNhsZ2R3Va2H1K", "fee": 1000000, "feeAssetId": null, "timestamp": 1643748802826, "version": 2, "chainId": 84, "sender": "3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX", "senderPublicKey": "2psiQevPvpc1FoG6bAPSTXVmPLJXVhCLMtqZZNnysMCQ", "proofs": [ "zyS8eaMZy8pi5fwjKCvWHREPrw4g8zyd8TQcWXXZT6FvNMqq4bFQFwhtuu8m9VWAKu5Jk2gsRA2dNWDqj7QASuV" ], "script": "base64:AAIFAAAAAAAAAOIIAhIDCgEIEgMKAQEaDQoBYRIIVEVTVFVTRE4aDgoBYhIJRFVDS0lTU1VFGg4KAWMSCWlzRHVja05GVBoKCgFkEgVhc3NldBoQCgFlEgtpc0R1Y2tJc3N1ZRoMCgFmEgckbWF0Y2gwGgYKAWcSAWEaBgoBaBIBaRoKCgFpEgVuZnRJZBoPCgFqEgpuZnRBc3NldElkGggKAWsSA3BtdBoQCgFsEgtidXlPdXRQcmljZRoKCgFtEgVvd25lchoGCgFuEgFvGgwKAW8SB2Fzc2V0SWQaDgoBcBIJYXNzZXROYW1lAAAAAwAAAAABYQEAAAAgAIUpTOkTLqoXmGxvzdEleYQFDyLlDcuqJGsbsu9ZirwAAAAAAWIBAAAAGgFXjLVIn36eFdUYl44bd/sJf2di2uFtYyVJAQAAAAFjAAAAAQAAAAFkBAAAAAFlBAAAAAFmCAgFAAAAAWQAAAAGaXNzdWVyAAAABWJ5dGVzAwkAAAEAAAACBQAAAAFmAgAAAApCeXRlVmVjdG9yBAAAAAFnBQAAAAFmCQAAAAAAAAIFAAAAA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uaWwJAAACAAAAAQIAAAAOQ2FuJ3QgZmluZCBORlQJAAACAAAAAQIAAAAQQ2FuJ3QgZmluZCBhc3NldAAAAAAKdm+G", "height": 1905044, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DLM19xYSccAKZEvRAu9EGn2ZBeR9nPFNVdPUZSQom8RU Next: ErvGY6qkjo1jCWvng87k95gAs6b18dzHRSib95t2EjD Diff:
OldNewDifferences
1212 case _ =>
1313 false
1414 }
15- if (if (if (if (isDuckIssue)
16- then (asset.decimals == 0)
17- else false)
15+ if (if (if ((asset.decimals == 0))
1816 then (asset.reissuable == false)
1917 else false)
2018 then (asset.quantity == 1)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let TESTUSDN = base58'132maRL3uF35tc2bpRih9D6MYq5DR6H28zkop786dKyu'
55
66 let DUCKISSUE = base58'3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv'
77
88 func isDuckNFT (asset) = {
99 let isDuckIssue = match asset.issuer.bytes {
1010 case a: ByteVector =>
1111 (a == DUCKISSUE)
1212 case _ =>
1313 false
1414 }
15- if (if (if (if (isDuckIssue)
16- then (asset.decimals == 0)
17- else false)
15+ if (if (if ((asset.decimals == 0))
1816 then (asset.reissuable == false)
1917 else false)
2018 then (asset.quantity == 1)
2119 else false)
2220 then contains(asset.name, "DUCK")
2321 else false
2422 }
2523
2624
2725 @Callable(i)
2826 func buyNFT (nftId) = {
2927 let nftAssetId = fromBase58String(nftId)
3028 let pmt = if ((size(i.payments) == 1))
3129 then i.payments[0]
3230 else throw("Attached payment is required")
3331 let buyOutPrice = match getInteger(this, ("buyOutPrice_" + nftId)) {
3432 case a: Int =>
3533 a
3634 case _ =>
3735 0
3836 }
3937 let owner = match getBinary(this, ("owner_" + nftId)) {
4038 case o: ByteVector =>
4139 o
4240 case _ =>
4341 throw("Can't find owner")
4442 }
4543 let asset = match assetInfo(nftAssetId) {
4644 case a: Asset =>
4745 a
4846 case _ =>
4947 throw("Can't find NFT")
5048 }
5149 if (!(if (if ((buyOutPrice > 0))
5250 then (buyOutPrice == pmt.amount)
5351 else false)
5452 then (pmt.assetId == TESTUSDN)
5553 else false))
5654 then [ScriptTransfer(i.caller, 1, asset.id), ScriptTransfer(Address(owner), buyOutPrice, TESTUSDN), DeleteEntry(("owner_" + nftId)), DeleteEntry(("buyOutPrice_" + nftId))]
5755 else throw("Somthing is wrong")
5856 }
5957
6058
6159
6260 @Callable(i)
6361 func sellNFT (buyOutPrice) = {
6462 let pmt = if ((size(i.payments) == 1))
6563 then i.payments[0]
6664 else throw("Attached NFT is required")
6765 if (isDefined(pmt.assetId))
6866 then {
6967 let assetId = value(pmt.assetId)
7068 let asset = match assetInfo(assetId) {
7169 case a: Asset =>
7270 a
7371 case _ =>
7472 throw("Can't find asset")
7573 }
7674 if (if (isDuckNFT(asset))
7775 then (buyOutPrice > 0)
7876 else false)
7977 then {
8078 let assetName = toBase58String(asset.id)
8179 [IntegerEntry(("buyOutPrice_" + assetName), buyOutPrice), BinaryEntry(("owner_" + assetName), i.caller.bytes)]
8280 }
8381 else throw("Can't find NFT")
8482 }
8583 else throw("Can't find asset")
8684 }
8785
8886

github/deemru/w8io/169f3d6 
27.50 ms