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