tx · 9Q8d3QbgcpJmesuFNLTtpXnhdtbQYiadWxL38QTfyLox

3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX:  -0.01000000 Waves

2022.02.02 00:15 [1905063] smart account 3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX > SELF 0.00000000 Waves

{ "type": 13, "id": "9Q8d3QbgcpJmesuFNLTtpXnhdtbQYiadWxL38QTfyLox", "fee": 1000000, "feeAssetId": null, "timestamp": 1643750184079, "version": 2, "chainId": 84, "sender": "3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX", "senderPublicKey": "2psiQevPvpc1FoG6bAPSTXVmPLJXVhCLMtqZZNnysMCQ", "proofs": [ "2rL76ocsBVfDb6zTWSd8DEYQmgFvyjg3Sn8GhgwiomBdcPjEC8XigWCPhd7mEQjDJTmrSiV3rR6hdSERej8EtQEu" ], "script": "base64:AAIFAAAAAAAAAOIIAhIDCgEIEgMKAQEaDQoBYRIIVEVTVFVTRE4aDgoBYhIJRFVDS0lTU1VFGg4KAWMSCWlzRHVja05GVBoKCgFkEgVhc3NldBoQCgFlEgtpc0R1Y2tJc3N1ZRoMCgFmEgckbWF0Y2gwGgYKAWcSAWEaBgoBaBIBaRoKCgFpEgVuZnRJZBoPCgFqEgpuZnRBc3NldElkGggKAWsSA3BtdBoQCgFsEgtidXlPdXRQcmljZRoKCgFtEgVvd25lchoGCgFuEgFvGgwKAW8SB2Fzc2V0SWQaDgoBcBIJYXNzZXROYW1lAAAAAwAAAAABYQEAAAAgbYSFV3tSzRlDC89daZ9Flzmir3q9rOEz2i3MMOnG/BUAAAAAAWIBAAAAGgFXjLVIn36eFdUYl44bd/sJf2di2uFtYyVJAQAAAAFjAAAAAQAAAAFkBAAAAAFlBAAAAAFmCAgFAAAAAWQAAAAGaXNzdWVyAAAABWJ5dGVzAwkAAAEAAAACBQAAAAFmAgAAAApCeXRlVmVjdG9yBAAAAAFnBQAAAAFmCQAAAAAAAAIFAAAAAWcFAAAA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AAAAAQIAAAAOQ2FuJ3QgZmluZCBORlQJAAACAAAAAQIAAAAQQ2FuJ3QgZmluZCBhc3NldAAAAAADdE4U", "height": 1905063, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AnTrucb6iuUBbCEZowFD8J2jxeDrVkJjt7PYtrdjQRvT Next: BbFGvXKGNCLSgV8VYzuxSNt9q8W8jv4hv8xMHe4vZqsZ Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let TESTUSDN = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
4+let TESTUSDN = base58'8NWeBwFuKEXpMqDpGyENuQat8nSKhy7KDReNPtkWqQyz'
55
66 let DUCKISSUE = base58'3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv'
77
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let TESTUSDN = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
4+let TESTUSDN = base58'8NWeBwFuKEXpMqDpGyENuQat8nSKhy7KDReNPtkWqQyz'
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 }
1515 if (if (if ((asset.decimals == 0))
1616 then (asset.reissuable == false)
1717 else false)
1818 then (asset.quantity == 1)
1919 else false)
2020 then contains(asset.name, "DUCK")
2121 else false
2222 }
2323
2424
2525 @Callable(i)
2626 func buyNFT (nftId) = {
2727 let nftAssetId = fromBase58String(nftId)
2828 let pmt = if ((size(i.payments) == 1))
2929 then i.payments[0]
3030 else throw("Attached payment is required")
3131 let buyOutPrice = match getInteger(this, ("buyOutPrice_" + nftId)) {
3232 case a: Int =>
3333 a
3434 case _ =>
3535 0
3636 }
3737 let owner = match getBinary(this, ("owner_" + nftId)) {
3838 case o: ByteVector =>
3939 o
4040 case _ =>
4141 throw("Can't find owner")
4242 }
4343 let asset = match assetInfo(nftAssetId) {
4444 case a: Asset =>
4545 a
4646 case _ =>
4747 throw("Can't find NFT")
4848 }
4949 if (!(if (if ((buyOutPrice > 0))
5050 then (pmt.amount >= buyOutPrice)
5151 else false)
5252 then (pmt.assetId == TESTUSDN)
5353 else false))
5454 then [ScriptTransfer(i.caller, 1, asset.id), ScriptTransfer(Address(owner), buyOutPrice, TESTUSDN), DeleteEntry(("owner_" + nftId)), DeleteEntry(("buyOutPrice_" + nftId))]
5555 else throw("Somthing is wrong")
5656 }
5757
5858
5959
6060 @Callable(i)
6161 func sellNFT (buyOutPrice) = {
6262 let pmt = if ((size(i.payments) == 1))
6363 then i.payments[0]
6464 else throw("Attached NFT is required")
6565 if (isDefined(pmt.assetId))
6666 then {
6767 let assetId = value(pmt.assetId)
6868 let asset = match assetInfo(assetId) {
6969 case a: Asset =>
7070 a
7171 case _ =>
7272 throw("Can't find asset")
7373 }
7474 if (if (isDuckNFT(asset))
7575 then (buyOutPrice > 0)
7676 else false)
7777 then {
7878 let assetName = toBase58String(asset.id)
7979 [IntegerEntry(("buyOutPrice_" + assetName), buyOutPrice), BinaryEntry(("owner_" + assetName), i.caller.bytes)]
8080 }
8181 else throw("Can't find NFT")
8282 }
8383 else throw("Can't find asset")
8484 }
8585
8686

github/deemru/w8io/169f3d6 
31.66 ms