tx · HneYaxY5kQ5AcxHTqRmfH1avhNSsPk7m2sr4Hn7GFYiW

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.02.10 18:09 [2443699] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "HneYaxY5kQ5AcxHTqRmfH1avhNSsPk7m2sr4Hn7GFYiW", "fee": 1300000, "feeAssetId": null, "timestamp": 1676041823163, "version": 2, "chainId": 84, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "3pvzyDNzXAES7h3bSPmF3iLAEsyzxFDzbwiYzGrbf7JCT8BMBv53w1MZw5EJUGEkDGJA4DLdn5FfQqUUgkmgyxiM" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAWAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAIDC1y8BD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5CQCsAgICFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUDa2V5AAxwb29sRGlzYWJsZWQJAAIBAg1Qb29sIGRpc2FibGVkAAxwb29sTm90RXhpc3QJAAIBAhFQb29sIGlzIG5vdCBleGlzdAAOc2xpcHBhZ2VUb29CaWcJAAIBAhNTbGlwcGFnZSBpcyB0b28gYmlnARNrZXlNYW5hZ2VyUHVibGljS2V5AAIUJXNfX21hbmFnZXJQdWJsaWNLZXkBGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAIbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQJmYwACEyVzX19mYWN0b3J5Q29udHJhY3QAD2ZhY3RvcnlDb250cmFjdAkBEUBleHRyTmF0aXZlKDEwNjIpAQkBD2dldFN0cmluZ09y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MAAAUPdGFyZ2V0UHVibGljS2V5C1hT6A==", "height": 2443699, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9vnSnznJu69UUXtsX2NnvoyBFyoFBCVV8ctQMf9STgLm Next: Ex3yP4fpy6K8gL1QAdsxKbXPJ9BvbET2VWDKGewvBKrA Diff:
OldNewDifferences
170170 func swap (ab,J,ac) = {
171171 let ad = value(C.payments[0])
172172 let I = if ((ad.assetId == unit))
173- then toBytes("WAVES")
174- else value(ad.assetId)
173+ then "WAVES"
174+ else toBase58String(value(ad.assetId))
175175 let H = value(ad.amount)
176176 let K = value(getInteger(l()))
177177 let L = fraction(toBigInt(H), toBigInt(K), b)
190190 if ((ae == ae))
191191 then {
192192 let R = {
193- let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [toBase58String(I), J], nil)
193+ let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [I, J], nil)
194194 if ($isInstanceOf(W, "String"))
195195 then W
196196 else unit
197197 }
198198 let S = {
199- let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, toBase58String(I)], nil)
199+ let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, I], nil)
200200 if ($isInstanceOf(W, "String"))
201201 then W
202202 else unit
238238 if ((Y == Y))
239239 then {
240240 let Z = addressFromStringValue(V)
241- let ag = {
242- let W = invoke(Z, "calculateAmountOutForSwapAndSendTokens", [toInt(Q), U, ab, ac], [AttachedPayment(I, toInt(Q))])
241+ let ag = if ((I == "WAVES"))
242+ then unit
243+ else fromBase58String(I)
244+ let ah = {
245+ let W = invoke(Z, "calculateAmountOutForSwapAndSendTokens", [toInt(Q), U, ab, ac], [AttachedPayment(ag, toInt(Q))])
243246 if ($isInstanceOf(W, "Int"))
244247 then W
245248 else throw(($getType(W) + " couldn't be cast to Int"))
246249 }
247- $Tuple2([ScriptTransfer(q, toInt(O), I), ScriptTransfer(Z, toInt(P), I)], ag)
250+ $Tuple2([ScriptTransfer(q, toInt(O), ag), ScriptTransfer(Z, toInt(P), ag)], ah)
248251 }
249252 else throw("Strict value is not equal to itself.")
250253 }
254257
255258
256259 @Callable(C)
257-func setManager (ah) = {
258- let ai = E(C)
259- if ((ai == ai))
260+func setManager (ai) = {
261+ let aj = E(C)
262+ if ((aj == aj))
260263 then {
261- let aj = fromBase58String(ah)
262- if ((aj == aj))
263- then [StringEntry(i(), ah)]
264+ let ak = fromBase58String(ai)
265+ if ((ak == ak))
266+ then [StringEntry(i(), ai)]
264267 else throw("Strict value is not equal to itself.")
265268 }
266269 else throw("Strict value is not equal to itself.")
270273
271274 @Callable(C)
272275 func confirmManager () = {
273- let ak = A()
274- let al = if (isDefined(ak))
276+ let al = A()
277+ let am = if (isDefined(al))
275278 then true
276279 else throw("no pending manager")
277- if ((al == al))
280+ if ((am == am))
278281 then {
279- let am = if ((C.callerPublicKey == value(ak)))
282+ let an = if ((C.callerPublicKey == value(al)))
280283 then true
281284 else throw("you are not pending manager")
282- if ((am == am))
283- then [StringEntry(h(), toBase58String(value(ak))), DeleteEntry(i())]
285+ if ((an == an))
286+ then [StringEntry(h(), toBase58String(value(al))), DeleteEntry(i())]
284287 else throw("Strict value is not equal to itself.")
285288 }
286289 else throw("Strict value is not equal to itself.")
287290 }
288291
289292
290-@Verifier(an)
291-func ao () = {
292- let ap = {
293+@Verifier(ao)
294+func ap () = {
295+ let aq = {
293296 let t = y()
294297 if ($isInstanceOf(t, "ByteVector"))
295298 then {
297300 D
298301 }
299302 else if ($isInstanceOf(t, "Unit"))
300- then an.senderPublicKey
303+ then ao.senderPublicKey
301304 else throw("Match error")
302305 }
303- sigVerify(an.bodyBytes, an.proofs[0], ap)
306+ sigVerify(ao.bodyBytes, ao.proofs[0], aq)
304307 }
305308
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "__"
55
66 let b = toBigInt(100000000)
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", "protocolFee"], a)
2929
3030
3131 func m () = makeString(["%s", "poolFee"], a)
3232
3333
3434 func n (o,d) = valueOrErrorMessage(getString(o, d), makeString(["mandatory ", toString(o), ".", d, " is not defined"], ""))
3535
3636
3737 let p = "%s__feeCollectorAddress"
3838
3939 let q = addressFromStringValue(n(k, p))
4040
4141 func r (s) = {
4242 let t = s
4343 if ($isInstanceOf(t, "Int"))
4444 then {
4545 let u = t
4646 u
4747 }
4848 else throw("fail to cast into Int")
4949 }
5050
5151
5252 func v (w,x) = makeString(["%d%d", toString(w), toString(x)], a)
5353
5454
5555 func y () = {
5656 let t = getString(h())
5757 if ($isInstanceOf(t, "String"))
5858 then {
5959 let z = t
6060 fromBase58String(z)
6161 }
6262 else if ($isInstanceOf(t, "Unit"))
6363 then unit
6464 else throw("Match error")
6565 }
6666
6767
6868 func A () = {
6969 let t = getString(i())
7070 if ($isInstanceOf(t, "String"))
7171 then {
7272 let z = t
7373 fromBase58String(z)
7474 }
7575 else if ($isInstanceOf(t, "Unit"))
7676 then unit
7777 else throw("Match error")
7878 }
7979
8080
8181 func B (C) = {
8282 let t = y()
8383 if ($isInstanceOf(t, "ByteVector"))
8484 then {
8585 let D = t
8686 (C.callerPublicKey == D)
8787 }
8888 else if ($isInstanceOf(t, "Unit"))
8989 then (C.caller == this)
9090 else throw("Match error")
9191 }
9292
9393
9494 func E (C) = if (B(C))
9595 then true
9696 else throw("permission denied")
9797
9898
9999 func F (G) = if ((G == "WAVES"))
100100 then wavesBalance(this).available
101101 else assetBalance(this, fromBase58String(G))
102102
103103
104104 @Callable(C)
105105 func swapCalculateREADONLY (H,I,J) = {
106106 let K = value(getInteger(l()))
107107 let L = fraction(toBigInt(H), toBigInt(K), b)
108108 let M = value(getInteger(m()))
109109 let N = fraction(toBigInt(H), toBigInt(M), b)
110110 let O = if ((toInt(L) == 0))
111111 then toBigInt(1)
112112 else L
113113 let P = if ((toInt(N) == 0))
114114 then toBigInt(1)
115115 else N
116116 let Q = ((toBigInt(H) - O) - N)
117117 let R = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [I, J], nil)
118118 let S = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, I], nil)
119119 let T = if ((R != unit))
120120 then {
121121 let U = false
122122 let V = {
123123 let W = invoke(k, "getPoolAddressFromLpAssetREADONLY", [R], nil)
124124 if ($isInstanceOf(W, "String"))
125125 then W
126126 else throw(($getType(W) + " couldn't be cast to String"))
127127 }
128128 $Tuple2(U, V)
129129 }
130130 else if ((S != unit))
131131 then {
132132 let U = true
133133 let V = {
134134 let W = invoke(k, "getPoolAddressFromLpAssetREADONLY", [S], nil)
135135 if ($isInstanceOf(W, "String"))
136136 then W
137137 else throw(($getType(W) + " couldn't be cast to String"))
138138 }
139139 $Tuple2(U, V)
140140 }
141141 else f
142142 let U = T._1
143143 let V = T._2
144144 let X = {
145145 let W = invoke(k, "getPoolStatusREADONLY", [V], nil)
146146 if ($isInstanceOf(W, "Int"))
147147 then W
148148 else throw(($getType(W) + " couldn't be cast to Int"))
149149 }
150150 let Y = if ((X == 1))
151151 then true
152152 else e
153153 if ((Y == Y))
154154 then {
155155 let Z = addressFromStringValue(valueOrElse(V, ""))
156156 let aa = {
157157 let W = invoke(Z, "calculateAmountOutForSwapREADONLY", [toInt(Q), U], nil)
158158 if ($isInstanceOf(W, "Int"))
159159 then W
160160 else throw(($getType(W) + " couldn't be cast to Int"))
161161 }
162162 $Tuple2(nil, aa)
163163 }
164164 else throw("Strict value is not equal to itself.")
165165 }
166166
167167
168168
169169 @Callable(C)
170170 func swap (ab,J,ac) = {
171171 let ad = value(C.payments[0])
172172 let I = if ((ad.assetId == unit))
173- then toBytes("WAVES")
174- else value(ad.assetId)
173+ then "WAVES"
174+ else toBase58String(value(ad.assetId))
175175 let H = value(ad.amount)
176176 let K = value(getInteger(l()))
177177 let L = fraction(toBigInt(H), toBigInt(K), b)
178178 let M = value(getInteger(m()))
179179 let N = fraction(toBigInt(H), toBigInt(M), b)
180180 let O = if ((toInt(L) == 0))
181181 then toBigInt(1)
182182 else L
183183 let P = if ((toInt(N) == 0))
184184 then toBigInt(1)
185185 else N
186186 let Q = ((toBigInt(H) - O) - N)
187187 let ae = [if ((size(C.payments) == 1))
188188 then true
189189 else throw("exactly 1 payment are expected")]
190190 if ((ae == ae))
191191 then {
192192 let R = {
193- let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [toBase58String(I), J], nil)
193+ let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [I, J], nil)
194194 if ($isInstanceOf(W, "String"))
195195 then W
196196 else unit
197197 }
198198 let S = {
199- let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, toBase58String(I)], nil)
199+ let W = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, I], nil)
200200 if ($isInstanceOf(W, "String"))
201201 then W
202202 else unit
203203 }
204204 let af = if ((R != unit))
205205 then {
206206 let U = false
207207 let V = {
208208 let W = invoke(k, "getPoolAddressFromLpAssetREADONLY", [value(R)], nil)
209209 if ($isInstanceOf(W, "String"))
210210 then W
211211 else throw(($getType(W) + " couldn't be cast to String"))
212212 }
213213 $Tuple2(U, V)
214214 }
215215 else if ((S != unit))
216216 then {
217217 let U = true
218218 let V = {
219219 let W = invoke(k, "getPoolAddressFromLpAssetREADONLY", [value(S)], nil)
220220 if ($isInstanceOf(W, "String"))
221221 then W
222222 else throw(($getType(W) + " couldn't be cast to String"))
223223 }
224224 $Tuple2(U, V)
225225 }
226226 else f
227227 let U = af._1
228228 let V = af._2
229229 let X = {
230230 let W = invoke(k, "getPoolStatusREADONLY", [V], nil)
231231 if ($isInstanceOf(W, "Int"))
232232 then W
233233 else throw(($getType(W) + " couldn't be cast to Int"))
234234 }
235235 let Y = if ((X == 1))
236236 then true
237237 else e
238238 if ((Y == Y))
239239 then {
240240 let Z = addressFromStringValue(V)
241- let ag = {
242- let W = invoke(Z, "calculateAmountOutForSwapAndSendTokens", [toInt(Q), U, ab, ac], [AttachedPayment(I, toInt(Q))])
241+ let ag = if ((I == "WAVES"))
242+ then unit
243+ else fromBase58String(I)
244+ let ah = {
245+ let W = invoke(Z, "calculateAmountOutForSwapAndSendTokens", [toInt(Q), U, ab, ac], [AttachedPayment(ag, toInt(Q))])
243246 if ($isInstanceOf(W, "Int"))
244247 then W
245248 else throw(($getType(W) + " couldn't be cast to Int"))
246249 }
247- $Tuple2([ScriptTransfer(q, toInt(O), I), ScriptTransfer(Z, toInt(P), I)], ag)
250+ $Tuple2([ScriptTransfer(q, toInt(O), ag), ScriptTransfer(Z, toInt(P), ag)], ah)
248251 }
249252 else throw("Strict value is not equal to itself.")
250253 }
251254 else throw("Strict value is not equal to itself.")
252255 }
253256
254257
255258
256259 @Callable(C)
257-func setManager (ah) = {
258- let ai = E(C)
259- if ((ai == ai))
260+func setManager (ai) = {
261+ let aj = E(C)
262+ if ((aj == aj))
260263 then {
261- let aj = fromBase58String(ah)
262- if ((aj == aj))
263- then [StringEntry(i(), ah)]
264+ let ak = fromBase58String(ai)
265+ if ((ak == ak))
266+ then [StringEntry(i(), ai)]
264267 else throw("Strict value is not equal to itself.")
265268 }
266269 else throw("Strict value is not equal to itself.")
267270 }
268271
269272
270273
271274 @Callable(C)
272275 func confirmManager () = {
273- let ak = A()
274- let al = if (isDefined(ak))
276+ let al = A()
277+ let am = if (isDefined(al))
275278 then true
276279 else throw("no pending manager")
277- if ((al == al))
280+ if ((am == am))
278281 then {
279- let am = if ((C.callerPublicKey == value(ak)))
282+ let an = if ((C.callerPublicKey == value(al)))
280283 then true
281284 else throw("you are not pending manager")
282- if ((am == am))
283- then [StringEntry(h(), toBase58String(value(ak))), DeleteEntry(i())]
285+ if ((an == an))
286+ then [StringEntry(h(), toBase58String(value(al))), DeleteEntry(i())]
284287 else throw("Strict value is not equal to itself.")
285288 }
286289 else throw("Strict value is not equal to itself.")
287290 }
288291
289292
290-@Verifier(an)
291-func ao () = {
292- let ap = {
293+@Verifier(ao)
294+func ap () = {
295+ let aq = {
293296 let t = y()
294297 if ($isInstanceOf(t, "ByteVector"))
295298 then {
296299 let D = t
297300 D
298301 }
299302 else if ($isInstanceOf(t, "Unit"))
300- then an.senderPublicKey
303+ then ao.senderPublicKey
301304 else throw("Match error")
302305 }
303- sigVerify(an.bodyBytes, an.proofs[0], ap)
306+ sigVerify(ao.bodyBytes, ao.proofs[0], aq)
304307 }
305308

github/deemru/w8io/169f3d6 
41.93 ms