tx · Fuhqu4tfnX2mAgBY8AnwK7jfX2RrmnBN82hzetXaKqVb 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.09.18 22:13 [2761243] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "Fuhqu4tfnX2mAgBY8AnwK7jfX2RrmnBN82hzetXaKqVb", "fee": 1000000, "feeAssetId": null, "timestamp": 1695064435452, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "tcNWt3KeT21dyNA2uAyeYVT7FW8vU5dtcyaYLzysbU3cJSp5N8YaYEj7U4v46emhrkJCsUAXPHK8gjvhZ6sXtsV" ], "script": "base64:BgILCAISABIAEgMKAQEHAAZ1c2RuSWQBIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AA53YXZlczJMVG9rZW5JZAEg5M0p6rvBF5U2UTZL5Gl9iE5RU627hhSF/AmO2XdvzrEADHB1enpsZUxlbmRTQwIjM04zRG5WZmZuVXladHoyTVJiazVVN2dpTjExMldlbXBNTmQAEGZha2VQdXp6bGVTd2FwU0MCIzNNczhmcWJYTTRSaG1NNkNQVHI0NGhVd0hlMkNDbVZDZlZBAA51c2RuQWRkcmVzc1N0cgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQAD3dhdmVzMkxUb2tlblN0cgIsR1E5UU5WTEdmWVNiTlo0ZFM4TlJ5dkdHRUxaTDRzV1BLaVZqODhDVjFySkwBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAADAWkBCW1pbnRMb25nMgADAwkBAiE9AgkAkAMBCAUBaQ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wNjIpAQUQZmFrZVB1enpsZVN3YXBTQwIKc3dhcFRvVVNETgkAzAgCBQt3YXZlc0Ftb3VudAkAzAgCBQt1c2VyQWRkcmVzcwUDbmlsBQNuaWwDCQAAAgUScmVkZWVtZWRVU0ROQW1vdW50BRJyZWRlZW1lZFVTRE5BbW91bnQEByRtYXRjaDAFEnJlZGVlbWVkVVNETkFtb3VudAMJAAECBQckbWF0Y2gwAgNJbnQEE3JlZGVlbWVkQW1vdW50VmFsdWUFByRtYXRjaDAJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgULdXNlckFkZHJlc3MCCV9yZWRlZW1lZAUTcmVkZWVtZWRBbW91bnRWYWx1ZQUDbmlsCQACAQIXSW5jb3JyZWN0IGludm9rZSByZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BRAKyg==", "height": 2761243, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9XZnxdVYMmJAx5XHTLa9tAUHrNQmauDT4K4uGmZhNKzo Next: 6LQ842oK4K9JRvCq7uWYBbuwvpSkKsPJrGdgkjHRqdfX Diff:
Old | New | Differences | |
---|---|---|---|
54 | 54 | if ($isInstanceOf(w, "Int")) | |
55 | 55 | then { | |
56 | 56 | let x = w | |
57 | - | let y = invoke(addressFromStringValue(c), "supply", nil, [AttachedPayment(unit, x)]) | |
58 | - | if ((y == y)) | |
59 | - | then (s + t) | |
60 | - | else throw("Strict value is not equal to itself.") | |
57 | + | (s + t) | |
61 | 58 | } | |
62 | 59 | else throw("Incorrect invoke result") | |
63 | 60 | } | |
66 | 63 | else throw("Strict value is not equal to itself.") | |
67 | 64 | } | |
68 | 65 | ||
69 | - | let | |
70 | - | let | |
71 | - | let | |
72 | - | let | |
73 | - | func | |
74 | - | then | |
75 | - | else r( | |
66 | + | let y = { | |
67 | + | let z = q | |
68 | + | let A = size(z) | |
69 | + | let B = 0 | |
70 | + | func C (D,E) = if ((E >= A)) | |
71 | + | then D | |
72 | + | else r(D, z[E]) | |
76 | 73 | ||
77 | - | func | |
78 | - | then | |
74 | + | func F (D,E) = if ((E >= A)) | |
75 | + | then D | |
79 | 76 | else throw("List size exceeds 5") | |
80 | 77 | ||
81 | - | | |
78 | + | F(C(C(C(C(C(B, 0), 1), 2), 3), 4), 5) | |
82 | 79 | } | |
83 | - | [ScriptTransfer(k.caller, ((o * | |
80 | + | [ScriptTransfer(k.caller, ((o * y) / 100), b)] | |
84 | 81 | } | |
85 | 82 | else throw("Strict value is not equal to itself.") | |
86 | 83 | } | |
112 | 109 | let q = [70, 49, 34, 24, 17] | |
113 | 110 | func r (s,t) = (s + t) | |
114 | 111 | ||
115 | - | let | |
116 | - | let | |
117 | - | let | |
118 | - | let | |
119 | - | func | |
120 | - | then | |
121 | - | else r( | |
112 | + | let y = { | |
113 | + | let z = q | |
114 | + | let A = size(z) | |
115 | + | let B = 0 | |
116 | + | func C (D,E) = if ((E >= A)) | |
117 | + | then D | |
118 | + | else r(D, z[E]) | |
122 | 119 | ||
123 | - | func | |
124 | - | then | |
120 | + | func F (D,E) = if ((E >= A)) | |
121 | + | then D | |
125 | 122 | else throw("List size exceeds 5") | |
126 | 123 | ||
127 | - | | |
124 | + | F(C(C(C(C(C(B, 0), 1), 2), 3), 4), 5) | |
128 | 125 | } | |
129 | - | [IntegerEntry("res", | |
126 | + | [IntegerEntry("res", y), IntegerEntry("firstAmountIn", l), IntegerEntry("firstSwappedAmountValue", o), ScriptTransfer(k.caller, ((o * y) / 100), b)] | |
130 | 127 | } | |
131 | 128 | else throw("Strict value is not equal to itself.") | |
132 | 129 | } | |
138 | 135 | ||
139 | 136 | ||
140 | 137 | @Callable(k) | |
141 | - | func redeem ( | |
142 | - | let | |
143 | - | let | |
144 | - | if (( | |
138 | + | func redeem (G) = { | |
139 | + | let H = toString(k.caller) | |
140 | + | let I = invoke(addressFromStringValue(d), "swapToUSDN", [G, H], nil) | |
141 | + | if ((I == I)) | |
145 | 142 | then { | |
146 | - | let i = | |
143 | + | let i = I | |
147 | 144 | if ($isInstanceOf(i, "Int")) | |
148 | 145 | then { | |
149 | - | let | |
150 | - | [IntegerEntry(( | |
146 | + | let J = i | |
147 | + | [IntegerEntry((H + "_redeemed"), J)] | |
151 | 148 | } | |
152 | 149 | else throw("Incorrect invoke result") | |
153 | 150 | } | |
155 | 152 | } | |
156 | 153 | ||
157 | 154 | ||
158 | - | @Verifier( | |
159 | - | func | |
155 | + | @Verifier(K) | |
156 | + | func L () = sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey) | |
160 | 157 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | let b = base58'GQ9QNVLGfYSbNZ4dS8NRyvGGELZL4sWPKiVj88CV1rJL' | |
7 | 7 | ||
8 | 8 | let c = "3N3DnVffnUyZtz2MRbk5U7giN112WempMNd" | |
9 | 9 | ||
10 | 10 | let d = "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA" | |
11 | 11 | ||
12 | 12 | let e = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
13 | 13 | ||
14 | 14 | let f = "GQ9QNVLGfYSbNZ4dS8NRyvGGELZL4sWPKiVj88CV1rJL" | |
15 | 15 | ||
16 | 16 | func g (h) = { | |
17 | 17 | let i = getInteger(this, h) | |
18 | 18 | if ($isInstanceOf(i, "Int")) | |
19 | 19 | then { | |
20 | 20 | let j = i | |
21 | 21 | j | |
22 | 22 | } | |
23 | 23 | else 0 | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(k) | |
28 | 28 | func mintLong2 () = if (if ((size(k.payments) != 1)) | |
29 | 29 | then true | |
30 | 30 | else (k.payments[0].amount == 0)) | |
31 | 31 | then throw("1 payment has to be attached mint") | |
32 | 32 | else { | |
33 | 33 | let l = k.payments[0].amount | |
34 | 34 | let m = toString(k.caller) | |
35 | 35 | let n = invoke(addressFromStringValue(d), "swapToWaves", [toString(k.caller), l], nil) | |
36 | 36 | if ((n == n)) | |
37 | 37 | then { | |
38 | 38 | let i = n | |
39 | 39 | if ($isInstanceOf(i, "Int")) | |
40 | 40 | then { | |
41 | 41 | let o = i | |
42 | 42 | let p = invoke(addressFromStringValue(c), "supply", nil, [AttachedPayment(unit, o)]) | |
43 | 43 | if ((p == p)) | |
44 | 44 | then { | |
45 | 45 | let q = [70, 49, 34, 24, 17] | |
46 | 46 | func r (s,t) = { | |
47 | 47 | let u = invoke(addressFromStringValue(c), "borrow", [e, ((l * s) / 100)], nil) | |
48 | 48 | if ((u == u)) | |
49 | 49 | then { | |
50 | 50 | let v = invoke(addressFromStringValue(d), "swapToWaves", [toString(k.caller), ((o * s) / 100)], nil) | |
51 | 51 | if ((v == v)) | |
52 | 52 | then { | |
53 | 53 | let w = v | |
54 | 54 | if ($isInstanceOf(w, "Int")) | |
55 | 55 | then { | |
56 | 56 | let x = w | |
57 | - | let y = invoke(addressFromStringValue(c), "supply", nil, [AttachedPayment(unit, x)]) | |
58 | - | if ((y == y)) | |
59 | - | then (s + t) | |
60 | - | else throw("Strict value is not equal to itself.") | |
57 | + | (s + t) | |
61 | 58 | } | |
62 | 59 | else throw("Incorrect invoke result") | |
63 | 60 | } | |
64 | 61 | else throw("Strict value is not equal to itself.") | |
65 | 62 | } | |
66 | 63 | else throw("Strict value is not equal to itself.") | |
67 | 64 | } | |
68 | 65 | ||
69 | - | let | |
70 | - | let | |
71 | - | let | |
72 | - | let | |
73 | - | func | |
74 | - | then | |
75 | - | else r( | |
66 | + | let y = { | |
67 | + | let z = q | |
68 | + | let A = size(z) | |
69 | + | let B = 0 | |
70 | + | func C (D,E) = if ((E >= A)) | |
71 | + | then D | |
72 | + | else r(D, z[E]) | |
76 | 73 | ||
77 | - | func | |
78 | - | then | |
74 | + | func F (D,E) = if ((E >= A)) | |
75 | + | then D | |
79 | 76 | else throw("List size exceeds 5") | |
80 | 77 | ||
81 | - | | |
78 | + | F(C(C(C(C(C(B, 0), 1), 2), 3), 4), 5) | |
82 | 79 | } | |
83 | - | [ScriptTransfer(k.caller, ((o * | |
80 | + | [ScriptTransfer(k.caller, ((o * y) / 100), b)] | |
84 | 81 | } | |
85 | 82 | else throw("Strict value is not equal to itself.") | |
86 | 83 | } | |
87 | 84 | else throw("Incorrect invoke result") | |
88 | 85 | } | |
89 | 86 | else throw("Strict value is not equal to itself.") | |
90 | 87 | } | |
91 | 88 | ||
92 | 89 | ||
93 | 90 | ||
94 | 91 | @Callable(k) | |
95 | 92 | func mintLong2_test () = if (if ((size(k.payments) != 1)) | |
96 | 93 | then true | |
97 | 94 | else (k.payments[0].amount == 0)) | |
98 | 95 | then throw("1 payment has to be attached mint") | |
99 | 96 | else { | |
100 | 97 | let l = k.payments[0].amount | |
101 | 98 | let m = toString(k.caller) | |
102 | 99 | let n = invoke(addressFromStringValue(d), "swapToWaves", [toString(k.caller), l], nil) | |
103 | 100 | if ((n == n)) | |
104 | 101 | then { | |
105 | 102 | let i = n | |
106 | 103 | if ($isInstanceOf(i, "Int")) | |
107 | 104 | then { | |
108 | 105 | let o = i | |
109 | 106 | let p = invoke(addressFromStringValue(c), "supply", nil, [AttachedPayment(unit, o)]) | |
110 | 107 | if ((p == p)) | |
111 | 108 | then { | |
112 | 109 | let q = [70, 49, 34, 24, 17] | |
113 | 110 | func r (s,t) = (s + t) | |
114 | 111 | ||
115 | - | let | |
116 | - | let | |
117 | - | let | |
118 | - | let | |
119 | - | func | |
120 | - | then | |
121 | - | else r( | |
112 | + | let y = { | |
113 | + | let z = q | |
114 | + | let A = size(z) | |
115 | + | let B = 0 | |
116 | + | func C (D,E) = if ((E >= A)) | |
117 | + | then D | |
118 | + | else r(D, z[E]) | |
122 | 119 | ||
123 | - | func | |
124 | - | then | |
120 | + | func F (D,E) = if ((E >= A)) | |
121 | + | then D | |
125 | 122 | else throw("List size exceeds 5") | |
126 | 123 | ||
127 | - | | |
124 | + | F(C(C(C(C(C(B, 0), 1), 2), 3), 4), 5) | |
128 | 125 | } | |
129 | - | [IntegerEntry("res", | |
126 | + | [IntegerEntry("res", y), IntegerEntry("firstAmountIn", l), IntegerEntry("firstSwappedAmountValue", o), ScriptTransfer(k.caller, ((o * y) / 100), b)] | |
130 | 127 | } | |
131 | 128 | else throw("Strict value is not equal to itself.") | |
132 | 129 | } | |
133 | 130 | else throw("Incorrect invoke result") | |
134 | 131 | } | |
135 | 132 | else throw("Strict value is not equal to itself.") | |
136 | 133 | } | |
137 | 134 | ||
138 | 135 | ||
139 | 136 | ||
140 | 137 | @Callable(k) | |
141 | - | func redeem ( | |
142 | - | let | |
143 | - | let | |
144 | - | if (( | |
138 | + | func redeem (G) = { | |
139 | + | let H = toString(k.caller) | |
140 | + | let I = invoke(addressFromStringValue(d), "swapToUSDN", [G, H], nil) | |
141 | + | if ((I == I)) | |
145 | 142 | then { | |
146 | - | let i = | |
143 | + | let i = I | |
147 | 144 | if ($isInstanceOf(i, "Int")) | |
148 | 145 | then { | |
149 | - | let | |
150 | - | [IntegerEntry(( | |
146 | + | let J = i | |
147 | + | [IntegerEntry((H + "_redeemed"), J)] | |
151 | 148 | } | |
152 | 149 | else throw("Incorrect invoke result") | |
153 | 150 | } | |
154 | 151 | else throw("Strict value is not equal to itself.") | |
155 | 152 | } | |
156 | 153 | ||
157 | 154 | ||
158 | - | @Verifier( | |
159 | - | func | |
155 | + | @Verifier(K) | |
156 | + | func L () = sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey) | |
160 | 157 |
github/deemru/w8io/169f3d6 52.40 ms ◑