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/sJf2di2uFtYyVJAQAAAAFjAAAAAQAAAAFkBAAAAAFlBAAAAAFmCAgFAAAAAWQAAAAGaXNzdWVyAAAABWJ5dGVzAwkAAAEAAAACBQAAAAFmAgAAAApCeXRlVmVjdG9yBAAAAAFnBQAAAAFmCQAAAAAAAAIFAAAAA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ZUCQAAAgAAAAECAAAAEENhbid0IGZpbmQgYXNzZXQAAAAABiIPRg==", "height": 1905099, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Q8d3QbgcpJmesuFNLTtpXnhdtbQYiadWxL38QTfyLox Next: none Diff:
Old | New | Differences | |
---|---|---|---|
58 | 58 | } | |
59 | 59 | else throw("Can't find NFT") | |
60 | 60 | } | |
61 | - | if | |
61 | + | if (if (if ((l > 0)) | |
62 | 62 | then (k.amount >= l) | |
63 | 63 | else false) | |
64 | 64 | then (k.assetId == a) | |
65 | - | else false) | |
65 | + | else false) | |
66 | 66 | then [ScriptTransfer(h.caller, 1, d.id), ScriptTransfer(Address(m), l, a), DeleteEntry(("owner_" + i)), DeleteEntry(("buyOutPrice_" + i))] | |
67 | 67 | else throw("Somthing is wrong") | |
68 | 68 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'8NWeBwFuKEXpMqDpGyENuQat8nSKhy7KDReNPtkWqQyz' | |
5 | 5 | ||
6 | 6 | let b = base58'3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv' | |
7 | 7 | ||
8 | 8 | func c (d) = { | |
9 | 9 | let e = { | |
10 | 10 | let f = d.issuer.bytes | |
11 | 11 | if ($isInstanceOf(f, "ByteVector")) | |
12 | 12 | then { | |
13 | 13 | let g = f | |
14 | 14 | (g == b) | |
15 | 15 | } | |
16 | 16 | else false | |
17 | 17 | } | |
18 | 18 | if (if (if ((d.decimals == 0)) | |
19 | 19 | then (d.reissuable == false) | |
20 | 20 | else false) | |
21 | 21 | then (d.quantity == 1) | |
22 | 22 | else false) | |
23 | 23 | then contains(d.name, "DUCK") | |
24 | 24 | else false | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Callable(h) | |
29 | 29 | func buyNFT (i) = { | |
30 | 30 | let j = fromBase58String(i) | |
31 | 31 | let k = if ((size(h.payments) == 1)) | |
32 | 32 | then h.payments[0] | |
33 | 33 | else throw("Attached payment is required") | |
34 | 34 | let l = { | |
35 | 35 | let f = getInteger(this, ("buyOutPrice_" + i)) | |
36 | 36 | if ($isInstanceOf(f, "Int")) | |
37 | 37 | then { | |
38 | 38 | let g = f | |
39 | 39 | g | |
40 | 40 | } | |
41 | 41 | else 0 | |
42 | 42 | } | |
43 | 43 | let m = { | |
44 | 44 | let f = getBinary(this, ("owner_" + i)) | |
45 | 45 | if ($isInstanceOf(f, "ByteVector")) | |
46 | 46 | then { | |
47 | 47 | let n = f | |
48 | 48 | n | |
49 | 49 | } | |
50 | 50 | else throw("Can't find owner") | |
51 | 51 | } | |
52 | 52 | let d = { | |
53 | 53 | let f = assetInfo(j) | |
54 | 54 | if ($isInstanceOf(f, "Asset")) | |
55 | 55 | then { | |
56 | 56 | let g = f | |
57 | 57 | g | |
58 | 58 | } | |
59 | 59 | else throw("Can't find NFT") | |
60 | 60 | } | |
61 | - | if | |
61 | + | if (if (if ((l > 0)) | |
62 | 62 | then (k.amount >= l) | |
63 | 63 | else false) | |
64 | 64 | then (k.assetId == a) | |
65 | - | else false) | |
65 | + | else false) | |
66 | 66 | then [ScriptTransfer(h.caller, 1, d.id), ScriptTransfer(Address(m), l, a), DeleteEntry(("owner_" + i)), DeleteEntry(("buyOutPrice_" + i))] | |
67 | 67 | else throw("Somthing is wrong") | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(h) | |
73 | 73 | func sellNFT (l) = { | |
74 | 74 | let k = if ((size(h.payments) == 1)) | |
75 | 75 | then h.payments[0] | |
76 | 76 | else throw("Attached NFT is required") | |
77 | 77 | if (isDefined(k.assetId)) | |
78 | 78 | then { | |
79 | 79 | let o = value(k.assetId) | |
80 | 80 | let d = { | |
81 | 81 | let f = assetInfo(o) | |
82 | 82 | if ($isInstanceOf(f, "Asset")) | |
83 | 83 | then { | |
84 | 84 | let g = f | |
85 | 85 | g | |
86 | 86 | } | |
87 | 87 | else throw("Can't find asset") | |
88 | 88 | } | |
89 | 89 | if (if (c(d)) | |
90 | 90 | then (l > 0) | |
91 | 91 | else false) | |
92 | 92 | then { | |
93 | 93 | let p = toBase58String(d.id) | |
94 | 94 | [IntegerEntry(("buyOutPrice_" + p), l), BinaryEntry(("owner_" + p), h.caller.bytes)] | |
95 | 95 | } | |
96 | 96 | else throw("Can't find NFT") | |
97 | 97 | } | |
98 | 98 | else throw("Can't find asset") | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 |
github/deemru/w8io/169f3d6 27.20 ms ◑