tx · DT2aCS1mTAmfrKMhapDJndivF5LgvTWKe8bajCt89yFm

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.02.03 13:57 [2433349] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "DT2aCS1mTAmfrKMhapDJndivF5LgvTWKe8bajCt89yFm", "fee": 1300000, "feeAssetId": null, "timestamp": 1675421857311, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "2H9oXWA52Hm3n1PKAa32WXxbmGNs2iA1xGpVYcrLFszxtiM1FxBRdtbuULwS6xb4GJ5mp9QzsJ6JMDqKvsrVbf9i" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAUAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBAmZjAAITJXNfX2ZhY3RvcnlDb250cmFjdAAPZmFjdG9yeUNvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBCQEPZ2V0U3RyaW5nT3JGYWlsAQk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YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQ5jb25maXJtTWFuYWdlcgAEAnBtCQEdcGVuZGluZ01hbmFnZXJQdWJsaWNLZXlPclVuaXQABAVoYXNQTQMJAQlpc0RlZmluZWQBBQJwbQYJAAIBAhJubyBwZW5kaW5nIG1hbmFnZXIDCQAAAgUFaGFzUE0FBWhhc1BNBAdjaGVja1BNAwkAAAIIBQFpD2NhbGxlclB1YmxpY0tleQkBBXZhbHVlAQUCcG0GCQACAQIbeW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAIFB2NoZWNrUE0FB2NoZWNrUE0JAMwIAgkBC1N0cmluZ0VudHJ5AgkBE2tleU1hbmFnZXJQdWJsaWNLZXkACQDYBAEJAQV2YWx1ZQEFAnBtCQDMCAIJAQtEZWxldGVFbnRyeQEJARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleakjeXo=", "chainId": 84, "height": 2433349, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D4gE1QToDk9m8N56ZWVvZiZ6t7uXjAFkWPziCE8m9ocB Next: CYveEyXg122kvNYytWzqKoXJ79TFPNMt5wCDRzsHM8kG Diff:
OldNewDifferences
121121 else f
122122 let P = O._1
123123 let Q = O._2
124- let R = {
125- let S = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
126- if ($isInstanceOf(S, "Boolean"))
127- then S
128- else throw(($getType(S) + " couldn't be cast to Boolean"))
129- }
130- let T = if (R)
124+ let R = if (false)
131125 then true
132126 else e
133- if ((T == T))
127+ if ((R == R))
134128 then {
135- let U = addressFromStringValue(valueOrElse(Q, ""))
136- let V = if (false)
129+ let S = {
130+ let T = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
131+ if ($isInstanceOf(T, "Boolean"))
132+ then T
133+ else throw(($getType(T) + " couldn't be cast to Boolean"))
134+ }
135+ let U = if (S)
137136 then true
138137 else e
139- if ((V == V))
138+ if ((U == U))
140139 then {
140+ let V = addressFromStringValue(valueOrElse(Q, ""))
141141 let W = {
142- let S = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil)
143- if ($isInstanceOf(S, "Int"))
144- then S
145- else throw(($getType(S) + " couldn't be cast to Int"))
142+ let T = invoke(V, "calculateAmountOutForSwapREADONLY", [L, P], nil)
143+ if ($isInstanceOf(T, "Int"))
144+ then T
145+ else throw(($getType(T) + " couldn't be cast to Int"))
146146 }
147147 $Tuple2(nil, W)
148148 }
176176 then {
177177 let P = false
178178 let Q = {
179- let S = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
180- if ($isInstanceOf(S, "Address"))
181- then S
182- else throw(($getType(S) + " couldn't be cast to Address"))
179+ let T = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
180+ if ($isInstanceOf(T, "Address"))
181+ then T
182+ else throw(($getType(T) + " couldn't be cast to Address"))
183183 }
184184 $Tuple2(P, Q)
185185 }
192192 else f
193193 let P = ab._1
194194 let Q = ab._2
195- let R = {
196- let S = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
197- if ($isInstanceOf(S, "Boolean"))
198- then S
199- else throw(($getType(S) + " couldn't be cast to Boolean"))
195+ let S = {
196+ let T = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
197+ if ($isInstanceOf(T, "Boolean"))
198+ then T
199+ else throw(($getType(T) + " couldn't be cast to Boolean"))
200200 }
201- let T = if (R)
201+ let U = if (S)
202202 then true
203203 else e
204- if ((T == T))
204+ if ((U == U))
205205 then {
206- let U = addressFromStringValue(valueOrElse(Q, ""))
206+ let V = addressFromStringValue(valueOrElse(Q, ""))
207207 let W = {
208- let S = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, X, Y], [AttachedPayment(F, toInt(K))])
209- if ($isInstanceOf(S, "Boolean"))
210- then S
211- else throw(($getType(S) + " couldn't be cast to Boolean"))
208+ let T = invoke(V, "calculateAmountOutForSwapAndSendTokens", [L, P, X, Y], [AttachedPayment(F, toInt(K))])
209+ if ($isInstanceOf(T, "Boolean"))
210+ then T
211+ else throw(($getType(T) + " couldn't be cast to Boolean"))
212212 }
213213 $Tuple2(nil, W)
214214 }
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", "feeLiquidityContractAddress"], a)
2929
3030
3131 func m () = makeString(["%s", "feeLiquidity"], a)
3232
3333
3434 func n () = makeString(["%s", "protocolFee"], a)
3535
3636
3737 func o (p) = {
3838 let q = p
3939 if ($isInstanceOf(q, "Int"))
4040 then {
4141 let r = q
4242 r
4343 }
4444 else throw("fail to cast into Int")
4545 }
4646
4747
4848 func s (t,u) = makeString(["%d%d", toString(t), toString(u)], a)
4949
5050
5151 func v () = {
5252 let q = getString(h())
5353 if ($isInstanceOf(q, "String"))
5454 then {
5555 let w = q
5656 fromBase58String(w)
5757 }
5858 else if ($isInstanceOf(q, "Unit"))
5959 then unit
6060 else throw("Match error")
6161 }
6262
6363
6464 func x () = {
6565 let q = getString(i())
6666 if ($isInstanceOf(q, "String"))
6767 then {
6868 let w = q
6969 fromBase58String(w)
7070 }
7171 else if ($isInstanceOf(q, "Unit"))
7272 then unit
7373 else throw("Match error")
7474 }
7575
7676
7777 func y (z) = {
7878 let q = v()
7979 if ($isInstanceOf(q, "ByteVector"))
8080 then {
8181 let A = q
8282 (z.callerPublicKey == A)
8383 }
8484 else if ($isInstanceOf(q, "Unit"))
8585 then (z.caller == this)
8686 else throw("Match error")
8787 }
8888
8989
9090 func B (z) = if (y(z))
9191 then true
9292 else throw("permission denied")
9393
9494
9595 func C (D) = if ((D == "WAVES"))
9696 then wavesBalance(this).available
9797 else assetBalance(this, fromBase58String(D))
9898
9999
100100 @Callable(z)
101101 func swapCalculateREADONLY (E,F,G) = {
102102 let H = value(getInteger(n()))
103103 let I = fraction(toBigInt(E), toBigInt(H), b)
104104 let J = fraction(toBigInt(E), toBigInt(H), b)
105105 let K = (toBigInt(E) - I)
106106 let L = (K - J)
107107 let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
108108 let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
109109 let O = if ((M != unit))
110110 then {
111111 let P = false
112112 let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
113113 $Tuple2(P, Q)
114114 }
115115 else if ((N != unit))
116116 then {
117117 let P = true
118118 let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
119119 $Tuple2(P, Q)
120120 }
121121 else f
122122 let P = O._1
123123 let Q = O._2
124- let R = {
125- let S = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
126- if ($isInstanceOf(S, "Boolean"))
127- then S
128- else throw(($getType(S) + " couldn't be cast to Boolean"))
129- }
130- let T = if (R)
124+ let R = if (false)
131125 then true
132126 else e
133- if ((T == T))
127+ if ((R == R))
134128 then {
135- let U = addressFromStringValue(valueOrElse(Q, ""))
136- let V = if (false)
129+ let S = {
130+ let T = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
131+ if ($isInstanceOf(T, "Boolean"))
132+ then T
133+ else throw(($getType(T) + " couldn't be cast to Boolean"))
134+ }
135+ let U = if (S)
137136 then true
138137 else e
139- if ((V == V))
138+ if ((U == U))
140139 then {
140+ let V = addressFromStringValue(valueOrElse(Q, ""))
141141 let W = {
142- let S = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil)
143- if ($isInstanceOf(S, "Int"))
144- then S
145- else throw(($getType(S) + " couldn't be cast to Int"))
142+ let T = invoke(V, "calculateAmountOutForSwapREADONLY", [L, P], nil)
143+ if ($isInstanceOf(T, "Int"))
144+ then T
145+ else throw(($getType(T) + " couldn't be cast to Int"))
146146 }
147147 $Tuple2(nil, W)
148148 }
149149 else throw("Strict value is not equal to itself.")
150150 }
151151 else throw("Strict value is not equal to itself.")
152152 }
153153
154154
155155
156156 @Callable(z)
157157 func swap (X,G,Y) = {
158158 let Z = value(z.payments[0])
159159 let F = if ((Z.assetId == unit))
160160 then toBytes("WAVES")
161161 else value(Z.assetId)
162162 let E = value(Z.amount)
163163 let H = value(getInteger(n()))
164164 let I = fraction(toBigInt(E), toBigInt(H), b)
165165 let J = fraction(toBigInt(E), toBigInt(H), b)
166166 let K = (toBigInt(E) - I)
167167 let L = (K - J)
168168 let aa = [if ((size(z.payments) == 1))
169169 then true
170170 else throw("exactly 1 payment are expected")]
171171 if ((aa == aa))
172172 then {
173173 let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
174174 let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
175175 let ab = if ((M != unit))
176176 then {
177177 let P = false
178178 let Q = {
179- let S = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
180- if ($isInstanceOf(S, "Address"))
181- then S
182- else throw(($getType(S) + " couldn't be cast to Address"))
179+ let T = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
180+ if ($isInstanceOf(T, "Address"))
181+ then T
182+ else throw(($getType(T) + " couldn't be cast to Address"))
183183 }
184184 $Tuple2(P, Q)
185185 }
186186 else if ((N != unit))
187187 then {
188188 let P = true
189189 let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
190190 $Tuple2(P, Q)
191191 }
192192 else f
193193 let P = ab._1
194194 let Q = ab._2
195- let R = {
196- let S = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
197- if ($isInstanceOf(S, "Boolean"))
198- then S
199- else throw(($getType(S) + " couldn't be cast to Boolean"))
195+ let S = {
196+ let T = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
197+ if ($isInstanceOf(T, "Boolean"))
198+ then T
199+ else throw(($getType(T) + " couldn't be cast to Boolean"))
200200 }
201- let T = if (R)
201+ let U = if (S)
202202 then true
203203 else e
204- if ((T == T))
204+ if ((U == U))
205205 then {
206- let U = addressFromStringValue(valueOrElse(Q, ""))
206+ let V = addressFromStringValue(valueOrElse(Q, ""))
207207 let W = {
208- let S = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, X, Y], [AttachedPayment(F, toInt(K))])
209- if ($isInstanceOf(S, "Boolean"))
210- then S
211- else throw(($getType(S) + " couldn't be cast to Boolean"))
208+ let T = invoke(V, "calculateAmountOutForSwapAndSendTokens", [L, P, X, Y], [AttachedPayment(F, toInt(K))])
209+ if ($isInstanceOf(T, "Boolean"))
210+ then T
211+ else throw(($getType(T) + " couldn't be cast to Boolean"))
212212 }
213213 $Tuple2(nil, W)
214214 }
215215 else throw("Strict value is not equal to itself.")
216216 }
217217 else throw("Strict value is not equal to itself.")
218218 }
219219
220220
221221
222222 @Callable(z)
223223 func setManager (ac) = {
224224 let ad = B(z)
225225 if ((ad == ad))
226226 then {
227227 let ae = fromBase58String(ac)
228228 if ((ae == ae))
229229 then [StringEntry(i(), ac)]
230230 else throw("Strict value is not equal to itself.")
231231 }
232232 else throw("Strict value is not equal to itself.")
233233 }
234234
235235
236236
237237 @Callable(z)
238238 func confirmManager () = {
239239 let af = x()
240240 let ag = if (isDefined(af))
241241 then true
242242 else throw("no pending manager")
243243 if ((ag == ag))
244244 then {
245245 let ah = if ((z.callerPublicKey == value(af)))
246246 then true
247247 else throw("you are not pending manager")
248248 if ((ah == ah))
249249 then [StringEntry(h(), toBase58String(value(af))), DeleteEntry(i())]
250250 else throw("Strict value is not equal to itself.")
251251 }
252252 else throw("Strict value is not equal to itself.")
253253 }
254254
255255
256256 @Verifier(ai)
257257 func aj () = {
258258 let ak = {
259259 let q = v()
260260 if ($isInstanceOf(q, "ByteVector"))
261261 then {
262262 let A = q
263263 A
264264 }
265265 else if ($isInstanceOf(q, "Unit"))
266266 then ai.senderPublicKey
267267 else throw("Match error")
268268 }
269269 sigVerify(ai.bodyBytes, ai.proofs[0], ak)
270270 }
271271

github/deemru/w8io/169f3d6 
66.50 ms