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