tx · 3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.01.31 17:37 [2429251] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W", "fee": 1300000, "feeAssetId": null, "timestamp": 1675175867944, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "uWTV6usqYKSRuzj5XfsGrx4ud7N8YyLLt3fc5jfvSnpACCCx83pPQYDr5AWXf6gzuG2bmMZC6hjTf8ZWfhSSXnh" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAVAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcACXRlc3RFcnJvcgkAAgECD1Rlc3QgZXJyb3IgaGVyZQETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQACGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQECZmMAAhMlc19fZmFjdG9yeUNvbnRyYWN0AA9mYWN0b3J5Q29udHJhY3QJARFAZXh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ZXRQdWJsaWNLZXkis2EU", "chainId": 84, "height": 2429251, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A7H6RqSs3FWyF4erSDHv8qyoE2kLqHs7ZLpxhZFrapMQ Next: 8fyTTicxNy8FUm7EdqywTq3einNg2xS3SFpygPNt2VnA Diff:
OldNewDifferences
128128 let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
129129 $Tuple2(R, S)
130130 }
131- else f
131+ else h
132132 let R = Q._1
133133 let S = Q._2
134134 let U = {
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 let h = throw("Test error here")
1818
1919 func i () = "%s__managerPublicKey"
2020
2121
2222 func j () = "%s__pendingManagerPublicKey"
2323
2424
2525 func k () = "%s__factoryContract"
2626
2727
2828 let l = addressFromStringValue(c(k()))
2929
3030 func m () = makeString(["%s", "feeLiquidityContractAddress"], a)
3131
3232
3333 func n () = makeString(["%s", "feeLiquidity"], a)
3434
3535
3636 func o () = makeString(["%s", "protocolFee"], a)
3737
3838
3939 func p (q) = {
4040 let r = q
4141 if ($isInstanceOf(r, "Int"))
4242 then {
4343 let s = r
4444 s
4545 }
4646 else throw("fail to cast into Int")
4747 }
4848
4949
5050 func t (u,v) = makeString(["%d%d", toString(u), toString(v)], a)
5151
5252
5353 func w () = {
5454 let r = getString(i())
5555 if ($isInstanceOf(r, "String"))
5656 then {
5757 let x = r
5858 fromBase58String(x)
5959 }
6060 else if ($isInstanceOf(r, "Unit"))
6161 then unit
6262 else throw("Match error")
6363 }
6464
6565
6666 func y () = {
6767 let r = getString(j())
6868 if ($isInstanceOf(r, "String"))
6969 then {
7070 let x = r
7171 fromBase58String(x)
7272 }
7373 else if ($isInstanceOf(r, "Unit"))
7474 then unit
7575 else throw("Match error")
7676 }
7777
7878
7979 func z (A) = {
8080 let r = w()
8181 if ($isInstanceOf(r, "ByteVector"))
8282 then {
8383 let B = r
8484 (A.callerPublicKey == B)
8585 }
8686 else if ($isInstanceOf(r, "Unit"))
8787 then (A.caller == this)
8888 else throw("Match error")
8989 }
9090
9191
9292 func C (A) = if (z(A))
9393 then true
9494 else throw("permission denied")
9595
9696
9797 func D (E) = if ((E == "WAVES"))
9898 then wavesBalance(this).available
9999 else assetBalance(this, fromBase58String(E))
100100
101101
102102 @Callable(A)
103103 func swapCalculateREADONLY (F,G,H) = {
104104 let I = value(getInteger(o()))
105105 let J = fraction(toBigInt(F), toBigInt(I), b)
106106 let K = fraction(toBigInt(F), toBigInt(I), b)
107107 let L = (toBigInt(F) - J)
108108 let M = (L - K)
109109 let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
110110 let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
111111 let P = if ((0 == 0))
112112 then h
113113 else h
114114 let Q = if ((N != unit))
115115 then {
116116 let R = false
117117 let S = {
118118 let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
119119 if ($isInstanceOf(T, "Address"))
120120 then T
121121 else throw(($getType(T) + " couldn't be cast to Address"))
122122 }
123123 $Tuple2(R, S)
124124 }
125125 else if ((O != unit))
126126 then {
127127 let R = true
128128 let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
129129 $Tuple2(R, S)
130130 }
131- else f
131+ else h
132132 let R = Q._1
133133 let S = Q._2
134134 let U = {
135135 let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil)
136136 if ($isInstanceOf(T, "Boolean"))
137137 then T
138138 else throw(($getType(T) + " couldn't be cast to Boolean"))
139139 }
140140 let V = if (U)
141141 then true
142142 else e
143143 if ((V == V))
144144 then {
145145 let W = addressFromStringValue(valueOrElse(S, ""))
146146 let X = {
147147 let T = invoke(W, "calculateAmountOutForSwapREADONLY", [M, R], nil)
148148 if ($isInstanceOf(T, "Int"))
149149 then T
150150 else throw(($getType(T) + " couldn't be cast to Int"))
151151 }
152152 $Tuple2(nil, X)
153153 }
154154 else throw("Strict value is not equal to itself.")
155155 }
156156
157157
158158
159159 @Callable(A)
160160 func swap (Y,H,Z) = {
161161 let aa = value(A.payments[0])
162162 let G = if ((aa.assetId == unit))
163163 then toBytes("WAVES")
164164 else value(aa.assetId)
165165 let F = value(aa.amount)
166166 let I = value(getInteger(o()))
167167 let J = fraction(toBigInt(F), toBigInt(I), b)
168168 let K = fraction(toBigInt(F), toBigInt(I), b)
169169 let L = (toBigInt(F) - J)
170170 let M = (L - K)
171171 let ab = [if ((size(A.payments) == 1))
172172 then true
173173 else throw("exactly 1 payment are expected")]
174174 if ((ab == ab))
175175 then {
176176 let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
177177 let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
178178 let ac = if ((N != unit))
179179 then {
180180 let R = false
181181 let S = {
182182 let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
183183 if ($isInstanceOf(T, "Address"))
184184 then T
185185 else throw(($getType(T) + " couldn't be cast to Address"))
186186 }
187187 $Tuple2(R, S)
188188 }
189189 else if ((O != unit))
190190 then {
191191 let R = true
192192 let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
193193 $Tuple2(R, S)
194194 }
195195 else f
196196 let R = ac._1
197197 let S = ac._2
198198 let U = {
199199 let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil)
200200 if ($isInstanceOf(T, "Boolean"))
201201 then T
202202 else throw(($getType(T) + " couldn't be cast to Boolean"))
203203 }
204204 let V = if (U)
205205 then true
206206 else e
207207 if ((V == V))
208208 then {
209209 let W = addressFromStringValue(valueOrElse(S, ""))
210210 let X = {
211211 let T = invoke(W, "calculateAmountOutForSwapAndSendTokens", [M, R, Y, Z], [AttachedPayment(G, toInt(L))])
212212 if ($isInstanceOf(T, "Boolean"))
213213 then T
214214 else throw(($getType(T) + " couldn't be cast to Boolean"))
215215 }
216216 $Tuple2(nil, X)
217217 }
218218 else throw("Strict value is not equal to itself.")
219219 }
220220 else throw("Strict value is not equal to itself.")
221221 }
222222
223223
224224
225225 @Callable(A)
226226 func setManager (ad) = {
227227 let ae = C(A)
228228 if ((ae == ae))
229229 then {
230230 let af = fromBase58String(ad)
231231 if ((af == af))
232232 then [StringEntry(j(), ad)]
233233 else throw("Strict value is not equal to itself.")
234234 }
235235 else throw("Strict value is not equal to itself.")
236236 }
237237
238238
239239
240240 @Callable(A)
241241 func confirmManager () = {
242242 let ag = y()
243243 let ah = if (isDefined(ag))
244244 then true
245245 else throw("no pending manager")
246246 if ((ah == ah))
247247 then {
248248 let ai = if ((A.callerPublicKey == value(ag)))
249249 then true
250250 else throw("you are not pending manager")
251251 if ((ai == ai))
252252 then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())]
253253 else throw("Strict value is not equal to itself.")
254254 }
255255 else throw("Strict value is not equal to itself.")
256256 }
257257
258258
259259 @Verifier(aj)
260260 func ak () = {
261261 let al = {
262262 let r = w()
263263 if ($isInstanceOf(r, "ByteVector"))
264264 then {
265265 let B = r
266266 B
267267 }
268268 else if ($isInstanceOf(r, "Unit"))
269269 then aj.senderPublicKey
270270 else throw("Match error")
271271 }
272272 sigVerify(aj.bodyBytes, aj.proofs[0], al)
273273 }
274274

github/deemru/w8io/026f985 
34.90 ms