tx · BbFGvXKGNCLSgV8VYzuxSNt9q8W8jv4hv8xMHe4vZqsZ

3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX:  -0.01000000 Waves

2022.02.02 00:49 [1905099] smart account 3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX > SELF 0.00000000 Waves

{ "type": 13, "id": "BbFGvXKGNCLSgV8VYzuxSNt9q8W8jv4hv8xMHe4vZqsZ", "fee": 1000000, "feeAssetId": null, "timestamp": 1643752170314, "version": 2, "chainId": 84, "sender": "3Mx2mQfjNt9bjMGLKeVEUqY18DfQE9zE6AX", "senderPublicKey": "2psiQevPvpc1FoG6bAPSTXVmPLJXVhCLMtqZZNnysMCQ", "proofs": [ "3Ewdej7KLzWJpSYCBT4BdqAntvMMnBUwx7EHjGrLbaGxX1nRHRxHgdg3x4kDzfcUjaAPJD22XMTyGvXgxR4wBToc" ], "script": "base64:AAIFAAAAAAAAAOIIAhIDCgEIEgMKAQEaDQoBYRIIVEVTVFVTRE4aDgoBYhIJRFVDS0lTU1VFGg4KAWMSCWlzRHVja05GVBoKCgFkEgVhc3NldBoQCgFlEgtpc0R1Y2tJc3N1ZRoMCgFmEgckbWF0Y2gwGgYKAWcSAWEaBgoBaBIBaRoKCgFpEgVuZnRJZBoPCgFqEgpuZnRBc3NldElkGggKAWsSA3BtdBoQCgFsEgtidXlPdXRQcmljZRoKCgFtEgVvd25lchoGCgFuEgFvGgwKAW8SB2Fzc2V0SWQaDgoBcBIJYXNzZXROYW1lAAAAAwAAAAABYQEAAAAgbYSFV3tSzRlDC89daZ9Flzmir3q9rOEz2i3MMOnG/BUAAAAAAWIBAAAAGgFXjLVIn36eFdUYl44bd/sJf2di2uFtYyVJAQAAAAFjAAAAAQAAAAFkBAAAAAFlBAAAAAFmCAgFAAAAAWQAAAAGaXNzdWVyAAAABWJ5dGVzAwkAAAEAAAACBQAAAAFmAgAAAApCeXRlVmVjdG9yBAAAAAFnBQAAAAFmCQAAAAAAAAIFAAAA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kZUCQAAAgAAAAECAAAAEENhbid0IGZpbmQgYXNzZXQAAAAABiIPRg==", "height": 1905099, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Q8d3QbgcpJmesuFNLTtpXnhdtbQYiadWxL38QTfyLox Next: none Diff:
OldNewDifferences
5858 }
5959 else throw("Can't find NFT")
6060 }
61- if (!(if (if ((l > 0))
61+ if (if (if ((l > 0))
6262 then (k.amount >= l)
6363 else false)
6464 then (k.assetId == a)
65- else false))
65+ else false)
6666 then [ScriptTransfer(h.caller, 1, d.id), ScriptTransfer(Address(m), l, a), DeleteEntry(("owner_" + i)), DeleteEntry(("buyOutPrice_" + i))]
6767 else throw("Somthing is wrong")
6868 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'8NWeBwFuKEXpMqDpGyENuQat8nSKhy7KDReNPtkWqQyz'
55
66 let b = base58'3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv'
77
88 func c (d) = {
99 let e = {
1010 let f = d.issuer.bytes
1111 if ($isInstanceOf(f, "ByteVector"))
1212 then {
1313 let g = f
1414 (g == b)
1515 }
1616 else false
1717 }
1818 if (if (if ((d.decimals == 0))
1919 then (d.reissuable == false)
2020 else false)
2121 then (d.quantity == 1)
2222 else false)
2323 then contains(d.name, "DUCK")
2424 else false
2525 }
2626
2727
2828 @Callable(h)
2929 func buyNFT (i) = {
3030 let j = fromBase58String(i)
3131 let k = if ((size(h.payments) == 1))
3232 then h.payments[0]
3333 else throw("Attached payment is required")
3434 let l = {
3535 let f = getInteger(this, ("buyOutPrice_" + i))
3636 if ($isInstanceOf(f, "Int"))
3737 then {
3838 let g = f
3939 g
4040 }
4141 else 0
4242 }
4343 let m = {
4444 let f = getBinary(this, ("owner_" + i))
4545 if ($isInstanceOf(f, "ByteVector"))
4646 then {
4747 let n = f
4848 n
4949 }
5050 else throw("Can't find owner")
5151 }
5252 let d = {
5353 let f = assetInfo(j)
5454 if ($isInstanceOf(f, "Asset"))
5555 then {
5656 let g = f
5757 g
5858 }
5959 else throw("Can't find NFT")
6060 }
61- if (!(if (if ((l > 0))
61+ if (if (if ((l > 0))
6262 then (k.amount >= l)
6363 else false)
6464 then (k.assetId == a)
65- else false))
65+ else false)
6666 then [ScriptTransfer(h.caller, 1, d.id), ScriptTransfer(Address(m), l, a), DeleteEntry(("owner_" + i)), DeleteEntry(("buyOutPrice_" + i))]
6767 else throw("Somthing is wrong")
6868 }
6969
7070
7171
7272 @Callable(h)
7373 func sellNFT (l) = {
7474 let k = if ((size(h.payments) == 1))
7575 then h.payments[0]
7676 else throw("Attached NFT is required")
7777 if (isDefined(k.assetId))
7878 then {
7979 let o = value(k.assetId)
8080 let d = {
8181 let f = assetInfo(o)
8282 if ($isInstanceOf(f, "Asset"))
8383 then {
8484 let g = f
8585 g
8686 }
8787 else throw("Can't find asset")
8888 }
8989 if (if (c(d))
9090 then (l > 0)
9191 else false)
9292 then {
9393 let p = toBase58String(d.id)
9494 [IntegerEntry(("buyOutPrice_" + p), l), BinaryEntry(("owner_" + p), h.caller.bytes)]
9595 }
9696 else throw("Can't find NFT")
9797 }
9898 else throw("Can't find asset")
9999 }
100100
101101

github/deemru/w8io/169f3d6 
27.20 ms