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:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAUAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBAmZjAAITJXNfX2ZhY3RvcnlDb250cmFjdAAPZmFjdG9yeUNvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBCQEPZ2V0U3RyaW5nT3JG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KZ3u7KPK3dWF Next: GjoAa61M4wMsoaaCAQmkJrPFH7jnphpWm2td6uGXJE83 Diff:
OldNewDifferences
177177 let N = false
178178 let O = {
179179 let P = invoke(k, "getPoolAddressFromLpAssetREADONLY", [K], nil)
180- if ($isInstanceOf(P, "Address"))
180+ if ($isInstanceOf(P, "String"))
181181 then P
182- else throw(($getType(P) + " couldn't be cast to Address"))
182+ else throw(($getType(P) + " couldn't be cast to String"))
183183 }
184184 $Tuple2(N, O)
185185 }
186186 else if ((L != unit))
187187 then {
188188 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+ }
190195 $Tuple2(N, O)
191196 }
192197 else f
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "__"
55
66 let b = toBigInt(100000)
77
88 func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d))
99
1010
1111 let e = throw("Pool disabled")
1212
1313 let f = throw("Pool is not exist")
1414
1515 let g = throw("Slippage is too big")
1616
1717 func h () = "%s__managerPublicKey"
1818
1919
2020 func i () = "%s__pendingManagerPublicKey"
2121
2222
2323 func j () = "%s__factoryContract"
2424
2525
2626 let k = addressFromStringValue(c(j()))
2727
2828 func l () = makeString(["%s", "feeProtocolContractAddress"], a)
2929
3030
3131 let m = addressFromStringValue(c(l()))
3232
3333 func n () = makeString(["%s", "protocolFee"], a)
3434
3535
3636 func o (p) = {
3737 let q = p
3838 if ($isInstanceOf(q, "Int"))
3939 then {
4040 let r = q
4141 r
4242 }
4343 else throw("fail to cast into Int")
4444 }
4545
4646
4747 func s (t,u) = makeString(["%d%d", toString(t), toString(u)], a)
4848
4949
5050 func v () = {
5151 let q = getString(h())
5252 if ($isInstanceOf(q, "String"))
5353 then {
5454 let w = q
5555 fromBase58String(w)
5656 }
5757 else if ($isInstanceOf(q, "Unit"))
5858 then unit
5959 else throw("Match error")
6060 }
6161
6262
6363 func x () = {
6464 let q = getString(i())
6565 if ($isInstanceOf(q, "String"))
6666 then {
6767 let w = q
6868 fromBase58String(w)
6969 }
7070 else if ($isInstanceOf(q, "Unit"))
7171 then unit
7272 else throw("Match error")
7373 }
7474
7575
7676 func y (z) = {
7777 let q = v()
7878 if ($isInstanceOf(q, "ByteVector"))
7979 then {
8080 let A = q
8181 (z.callerPublicKey == A)
8282 }
8383 else if ($isInstanceOf(q, "Unit"))
8484 then (z.caller == this)
8585 else throw("Match error")
8686 }
8787
8888
8989 func B (z) = if (y(z))
9090 then true
9191 else throw("permission denied")
9292
9393
9494 func C (D) = if ((D == "WAVES"))
9595 then wavesBalance(this).available
9696 else assetBalance(this, fromBase58String(D))
9797
9898
9999 @Callable(z)
100100 func swapCalculateREADONLY (E,F,G) = {
101101 let H = value(getInteger(n()))
102102 let I = fraction(toBigInt(E), toBigInt(H), b)
103103 let J = if ((toInt(I) == 0))
104104 then toBigInt(1)
105105 else (toBigInt(E) - I)
106106 let K = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
107107 let L = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
108108 let M = if ((K != unit))
109109 then {
110110 let N = false
111111 let O = {
112112 let P = invoke(k, "getPoolAddressFromLpAssetREADONLY", [K], nil)
113113 if ($isInstanceOf(P, "String"))
114114 then P
115115 else throw(($getType(P) + " couldn't be cast to String"))
116116 }
117117 $Tuple2(N, O)
118118 }
119119 else if ((L != unit))
120120 then {
121121 let N = true
122122 let O = {
123123 let P = invoke(k, "getPoolAddressFromLpAssetREADONLY", [L], nil)
124124 if ($isInstanceOf(P, "String"))
125125 then P
126126 else throw(($getType(P) + " couldn't be cast to String"))
127127 }
128128 $Tuple2(N, O)
129129 }
130130 else f
131131 let N = M._1
132132 let O = M._2
133133 let Q = {
134134 let P = invoke(k, "getPoolStatusREADONLY", [O], nil)
135135 if ($isInstanceOf(P, "Int"))
136136 then P
137137 else throw(($getType(P) + " couldn't be cast to Int"))
138138 }
139139 let R = if ((Q == 1))
140140 then true
141141 else e
142142 if ((R == R))
143143 then {
144144 let S = addressFromStringValue(valueOrElse(O, ""))
145145 let T = {
146146 let P = invoke(S, "calculateAmountOutForSwapREADONLY", [toInt(J), N], nil)
147147 if ($isInstanceOf(P, "Int"))
148148 then P
149149 else throw(($getType(P) + " couldn't be cast to Int"))
150150 }
151151 $Tuple2(nil, T)
152152 }
153153 else throw("Strict value is not equal to itself.")
154154 }
155155
156156
157157
158158 @Callable(z)
159159 func swap (U,G,V) = {
160160 let W = value(z.payments[0])
161161 let F = if ((W.assetId == unit))
162162 then toBytes("WAVES")
163163 else value(W.assetId)
164164 let E = value(W.amount)
165165 let H = value(getInteger(n()))
166166 let I = fraction(toBigInt(E), toBigInt(H), b)
167167 let J = (toBigInt(E) - I)
168168 let X = [if ((size(z.payments) == 1))
169169 then true
170170 else throw("exactly 1 payment are expected")]
171171 if ((X == X))
172172 then {
173173 let K = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [toBase58String(F), G], nil)
174174 let L = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, toBase58String(F)], nil)
175175 let Y = if ((K != unit))
176176 then {
177177 let N = false
178178 let O = {
179179 let P = invoke(k, "getPoolAddressFromLpAssetREADONLY", [K], nil)
180- if ($isInstanceOf(P, "Address"))
180+ if ($isInstanceOf(P, "String"))
181181 then P
182- else throw(($getType(P) + " couldn't be cast to Address"))
182+ else throw(($getType(P) + " couldn't be cast to String"))
183183 }
184184 $Tuple2(N, O)
185185 }
186186 else if ((L != unit))
187187 then {
188188 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+ }
190195 $Tuple2(N, O)
191196 }
192197 else f
193198 let N = Y._1
194199 let O = Y._2
195200 let Z = {
196201 let P = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [O], nil)
197202 if ($isInstanceOf(P, "Boolean"))
198203 then P
199204 else throw(($getType(P) + " couldn't be cast to Boolean"))
200205 }
201206 let R = if (Z)
202207 then true
203208 else e
204209 if ((R == R))
205210 then {
206211 let S = addressFromStringValue(valueOrElse(O, ""))
207212 let T = {
208213 let P = invoke(S, "calculateAmountOutForSwapAndSendTokens", [toInt(J), N, U, V], [AttachedPayment(F, toInt(J))])
209214 if ($isInstanceOf(P, "Boolean"))
210215 then P
211216 else throw(($getType(P) + " couldn't be cast to Boolean"))
212217 }
213218 $Tuple2([ScriptTransfer(m, toInt(I), F)], T)
214219 }
215220 else throw("Strict value is not equal to itself.")
216221 }
217222 else throw("Strict value is not equal to itself.")
218223 }
219224
220225
221226
222227 @Callable(z)
223228 func setManager (aa) = {
224229 let ab = B(z)
225230 if ((ab == ab))
226231 then {
227232 let ac = fromBase58String(aa)
228233 if ((ac == ac))
229234 then [StringEntry(i(), aa)]
230235 else throw("Strict value is not equal to itself.")
231236 }
232237 else throw("Strict value is not equal to itself.")
233238 }
234239
235240
236241
237242 @Callable(z)
238243 func confirmManager () = {
239244 let ad = x()
240245 let ae = if (isDefined(ad))
241246 then true
242247 else throw("no pending manager")
243248 if ((ae == ae))
244249 then {
245250 let af = if ((z.callerPublicKey == value(ad)))
246251 then true
247252 else throw("you are not pending manager")
248253 if ((af == af))
249254 then [StringEntry(h(), toBase58String(value(ad))), DeleteEntry(i())]
250255 else throw("Strict value is not equal to itself.")
251256 }
252257 else throw("Strict value is not equal to itself.")
253258 }
254259
255260
256261 @Verifier(ag)
257262 func ah () = {
258263 let ai = {
259264 let q = v()
260265 if ($isInstanceOf(q, "ByteVector"))
261266 then {
262267 let A = q
263268 A
264269 }
265270 else if ($isInstanceOf(q, "Unit"))
266271 then ag.senderPublicKey
267272 else throw("Match error")
268273 }
269274 sigVerify(ag.bodyBytes, ag.proofs[0], ai)
270275 }
271276

github/deemru/w8io/169f3d6 
39.87 ms