tx · 82u5VUX7c5386UDHzoJ8j66gSVS68Rsb8SnMyUe3YFbC 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq: -0.01300000 Waves 2023.02.03 14:37 [2433393] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves
{ "type": 13, "id": "82u5VUX7c5386UDHzoJ8j66gSVS68Rsb8SnMyUe3YFbC", "fee": 1300000, "feeAssetId": null, "timestamp": 1675424285874, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "2LaN8RAynYnZamUpdCG3ibr32nuRkrVsAB8BYRdXF4bD7DpYdGnvQgFkteqzsmcwz9pbsjSumVWqfWEmoorkgqFy" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAUAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBAmZjAAITJXNfX2ZhY3RvcnlDb250cmFjdAAPZmFjdG9yeUNvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBCQEPZ2V0U3RyaW5nT3JGYWlsAQkB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JYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5HUQLjQ==", "chainId": 84, "height": 2433393, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9spceC5GdKUF8EFrx13Xapd9npas5JwbJQ5QyLxroBjP Next: sFW4Lnewh68RQPhByb6LEKLMUDmUhtSb7yMb6Koz9qP Diff:
Old | New | Differences | |
---|---|---|---|
132 | 132 | let P = O._1 | |
133 | 133 | let Q = O._2 | |
134 | 134 | let S = { | |
135 | - | let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [ | |
135 | + | let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", ["3MqGtuaL3yJbKHqUxnSihJmYroyPf6QDp1x_"], nil) | |
136 | 136 | if ($isInstanceOf(R, "Boolean")) | |
137 | 137 | then R | |
138 | 138 | else throw(($getType(R) + " couldn't be cast to Boolean")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = toBigInt(100000) | |
7 | 7 | ||
8 | 8 | func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let e = throw("Pool disabled") | |
12 | 12 | ||
13 | 13 | let f = throw("Pool is not exist") | |
14 | 14 | ||
15 | 15 | let g = throw("Slippage is too big") | |
16 | 16 | ||
17 | 17 | func h () = "%s__managerPublicKey" | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func i () = "%s__pendingManagerPublicKey" | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func j () = "%s__factoryContract" | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | let k = addressFromStringValue(c(j())) | |
27 | 27 | ||
28 | 28 | func l () = makeString(["%s", "feeLiquidityContractAddress"], a) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func m () = makeString(["%s", "feeLiquidity"], a) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func n () = makeString(["%s", "protocolFee"], a) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func o (p) = { | |
38 | 38 | let q = p | |
39 | 39 | if ($isInstanceOf(q, "Int")) | |
40 | 40 | then { | |
41 | 41 | let r = q | |
42 | 42 | r | |
43 | 43 | } | |
44 | 44 | else throw("fail to cast into Int") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func s (t,u) = makeString(["%d%d", toString(t), toString(u)], a) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func v () = { | |
52 | 52 | let q = getString(h()) | |
53 | 53 | if ($isInstanceOf(q, "String")) | |
54 | 54 | then { | |
55 | 55 | let w = q | |
56 | 56 | fromBase58String(w) | |
57 | 57 | } | |
58 | 58 | else if ($isInstanceOf(q, "Unit")) | |
59 | 59 | then unit | |
60 | 60 | else throw("Match error") | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func x () = { | |
65 | 65 | let q = getString(i()) | |
66 | 66 | if ($isInstanceOf(q, "String")) | |
67 | 67 | then { | |
68 | 68 | let w = q | |
69 | 69 | fromBase58String(w) | |
70 | 70 | } | |
71 | 71 | else if ($isInstanceOf(q, "Unit")) | |
72 | 72 | then unit | |
73 | 73 | else throw("Match error") | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func y (z) = { | |
78 | 78 | let q = v() | |
79 | 79 | if ($isInstanceOf(q, "ByteVector")) | |
80 | 80 | then { | |
81 | 81 | let A = q | |
82 | 82 | (z.callerPublicKey == A) | |
83 | 83 | } | |
84 | 84 | else if ($isInstanceOf(q, "Unit")) | |
85 | 85 | then (z.caller == this) | |
86 | 86 | else throw("Match error") | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func B (z) = if (y(z)) | |
91 | 91 | then true | |
92 | 92 | else throw("permission denied") | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func C (D) = if ((D == "WAVES")) | |
96 | 96 | then wavesBalance(this).available | |
97 | 97 | else assetBalance(this, fromBase58String(D)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Callable(z) | |
101 | 101 | func swapCalculateREADONLY (E,F,G) = { | |
102 | 102 | let H = value(getInteger(n())) | |
103 | 103 | let I = fraction(toBigInt(E), toBigInt(H), b) | |
104 | 104 | let J = fraction(toBigInt(E), toBigInt(H), b) | |
105 | 105 | let K = (toBigInt(E) - I) | |
106 | 106 | let L = (K - J) | |
107 | 107 | let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil) | |
108 | 108 | let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil) | |
109 | 109 | let O = if ((M != unit)) | |
110 | 110 | then { | |
111 | 111 | let P = false | |
112 | 112 | let Q = { | |
113 | 113 | let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil) | |
114 | 114 | if ($isInstanceOf(R, "String")) | |
115 | 115 | then R | |
116 | 116 | else throw(($getType(R) + " couldn't be cast to String")) | |
117 | 117 | } | |
118 | 118 | $Tuple2(P, Q) | |
119 | 119 | } | |
120 | 120 | else if ((N != unit)) | |
121 | 121 | then { | |
122 | 122 | let P = true | |
123 | 123 | let Q = { | |
124 | 124 | let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil) | |
125 | 125 | if ($isInstanceOf(R, "String")) | |
126 | 126 | then R | |
127 | 127 | else throw(($getType(R) + " couldn't be cast to String")) | |
128 | 128 | } | |
129 | 129 | $Tuple2(P, Q) | |
130 | 130 | } | |
131 | 131 | else f | |
132 | 132 | let P = O._1 | |
133 | 133 | let Q = O._2 | |
134 | 134 | let S = { | |
135 | - | let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [ | |
135 | + | let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", ["3MqGtuaL3yJbKHqUxnSihJmYroyPf6QDp1x_"], nil) | |
136 | 136 | if ($isInstanceOf(R, "Boolean")) | |
137 | 137 | then R | |
138 | 138 | else throw(($getType(R) + " couldn't be cast to Boolean")) | |
139 | 139 | } | |
140 | 140 | let T = if (S) | |
141 | 141 | then true | |
142 | 142 | else e | |
143 | 143 | if ((T == T)) | |
144 | 144 | then { | |
145 | 145 | let U = addressFromStringValue(valueOrElse(Q, "")) | |
146 | 146 | let V = { | |
147 | 147 | let R = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil) | |
148 | 148 | if ($isInstanceOf(R, "Int")) | |
149 | 149 | then R | |
150 | 150 | else throw(($getType(R) + " couldn't be cast to Int")) | |
151 | 151 | } | |
152 | 152 | $Tuple2(nil, V) | |
153 | 153 | } | |
154 | 154 | else throw("Strict value is not equal to itself.") | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(z) | |
160 | 160 | func swap (W,G,X) = { | |
161 | 161 | let Y = value(z.payments[0]) | |
162 | 162 | let F = if ((Y.assetId == unit)) | |
163 | 163 | then toBytes("WAVES") | |
164 | 164 | else value(Y.assetId) | |
165 | 165 | let E = value(Y.amount) | |
166 | 166 | let H = value(getInteger(n())) | |
167 | 167 | let I = fraction(toBigInt(E), toBigInt(H), b) | |
168 | 168 | let J = fraction(toBigInt(E), toBigInt(H), b) | |
169 | 169 | let K = (toBigInt(E) - I) | |
170 | 170 | let L = (K - J) | |
171 | 171 | let Z = [if ((size(z.payments) == 1)) | |
172 | 172 | then true | |
173 | 173 | else throw("exactly 1 payment are expected")] | |
174 | 174 | if ((Z == Z)) | |
175 | 175 | then { | |
176 | 176 | let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil) | |
177 | 177 | let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil) | |
178 | 178 | let aa = if ((M != unit)) | |
179 | 179 | then { | |
180 | 180 | let P = false | |
181 | 181 | let Q = { | |
182 | 182 | let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil) | |
183 | 183 | if ($isInstanceOf(R, "Address")) | |
184 | 184 | then R | |
185 | 185 | else throw(($getType(R) + " couldn't be cast to Address")) | |
186 | 186 | } | |
187 | 187 | $Tuple2(P, Q) | |
188 | 188 | } | |
189 | 189 | else if ((N != unit)) | |
190 | 190 | then { | |
191 | 191 | let P = true | |
192 | 192 | let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil) | |
193 | 193 | $Tuple2(P, Q) | |
194 | 194 | } | |
195 | 195 | else f | |
196 | 196 | let P = aa._1 | |
197 | 197 | let Q = aa._2 | |
198 | 198 | let S = { | |
199 | 199 | let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil) | |
200 | 200 | if ($isInstanceOf(R, "Boolean")) | |
201 | 201 | then R | |
202 | 202 | else throw(($getType(R) + " couldn't be cast to Boolean")) | |
203 | 203 | } | |
204 | 204 | let T = if (S) | |
205 | 205 | then true | |
206 | 206 | else e | |
207 | 207 | if ((T == T)) | |
208 | 208 | then { | |
209 | 209 | let U = addressFromStringValue(valueOrElse(Q, "")) | |
210 | 210 | let V = { | |
211 | 211 | let R = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, W, X], [AttachedPayment(F, toInt(K))]) | |
212 | 212 | if ($isInstanceOf(R, "Boolean")) | |
213 | 213 | then R | |
214 | 214 | else throw(($getType(R) + " couldn't be cast to Boolean")) | |
215 | 215 | } | |
216 | 216 | $Tuple2(nil, V) | |
217 | 217 | } | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | else throw("Strict value is not equal to itself.") | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | ||
225 | 225 | @Callable(z) | |
226 | 226 | func setManager (ab) = { | |
227 | 227 | let ac = B(z) | |
228 | 228 | if ((ac == ac)) | |
229 | 229 | then { | |
230 | 230 | let ad = fromBase58String(ab) | |
231 | 231 | if ((ad == ad)) | |
232 | 232 | then [StringEntry(i(), ab)] | |
233 | 233 | else throw("Strict value is not equal to itself.") | |
234 | 234 | } | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | ||
240 | 240 | @Callable(z) | |
241 | 241 | func confirmManager () = { | |
242 | 242 | let ae = x() | |
243 | 243 | let af = if (isDefined(ae)) | |
244 | 244 | then true | |
245 | 245 | else throw("no pending manager") | |
246 | 246 | if ((af == af)) | |
247 | 247 | then { | |
248 | 248 | let ag = if ((z.callerPublicKey == value(ae))) | |
249 | 249 | then true | |
250 | 250 | else throw("you are not pending manager") | |
251 | 251 | if ((ag == ag)) | |
252 | 252 | then [StringEntry(h(), toBase58String(value(ae))), DeleteEntry(i())] | |
253 | 253 | else throw("Strict value is not equal to itself.") | |
254 | 254 | } | |
255 | 255 | else throw("Strict value is not equal to itself.") | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | @Verifier(ah) | |
260 | 260 | func ai () = { | |
261 | 261 | let aj = { | |
262 | 262 | let q = v() | |
263 | 263 | if ($isInstanceOf(q, "ByteVector")) | |
264 | 264 | then { | |
265 | 265 | let A = q | |
266 | 266 | A | |
267 | 267 | } | |
268 | 268 | else if ($isInstanceOf(q, "Unit")) | |
269 | 269 | then ah.senderPublicKey | |
270 | 270 | else throw("Match error") | |
271 | 271 | } | |
272 | 272 | sigVerify(ah.bodyBytes, ah.proofs[0], aj) | |
273 | 273 | } | |
274 | 274 |
github/deemru/w8io/169f3d6 62.24 ms ◑