tx · 3g5NcMPY9HAShJa14jcya7jbSGYd2nEV69qgeRrpajxG

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.02.03 13:50 [2433343] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "3g5NcMPY9HAShJa14jcya7jbSGYd2nEV69qgeRrpajxG", "fee": 1300000, "feeAssetId": null, "timestamp": 1675421476152, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "5Yf8ZiHaseqdRh5yHUvLmPyzQXhF2GHUMRQmt8r46wiCDs3NAXMdPorDPbkJ68JyN9ZMk6hYEvtQCW92kdFdJRoQ" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAUAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBAmZjAAITJXNfX2ZhY3RvcnlDb250cmFjdAAPZmFjdG9yeUNvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBCQEPZ2V0U3RyaW5nT3JGYWlsA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diff:
OldNewDifferences
109109 let O = if ((M != unit))
110110 then {
111111 let P = false
112- let Q = {
113- let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
114- if ($isInstanceOf(R, "Address"))
115- then R
116- else throw(($getType(R) + " couldn't be cast to Address"))
117- }
112+ let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
118113 $Tuple2(P, Q)
119114 }
120115 else if ((N != unit))
126121 else f
127122 let P = O._1
128123 let Q = O._2
129- let S = {
130- let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
131- if ($isInstanceOf(R, "Boolean"))
132- then R
133- else throw(($getType(R) + " couldn't be cast to Boolean"))
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"))
134129 }
135- let T = if (S)
130+ let T = if (R)
136131 then true
137132 else e
138133 if ((T == T))
139134 then {
140135 let U = addressFromStringValue(valueOrElse(Q, ""))
141136 let V = {
142- let R = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil)
143- if ($isInstanceOf(R, "Int"))
144- then R
145- else throw(($getType(R) + " couldn't be cast to Int"))
137+ let S = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil)
138+ if ($isInstanceOf(S, "Int"))
139+ then S
140+ else throw(($getType(S) + " couldn't be cast to Int"))
146141 }
147142 $Tuple2(nil, V)
148143 }
174169 then {
175170 let P = false
176171 let Q = {
177- let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
178- if ($isInstanceOf(R, "Address"))
179- then R
180- else throw(($getType(R) + " couldn't be cast to Address"))
172+ let S = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
173+ if ($isInstanceOf(S, "Address"))
174+ then S
175+ else throw(($getType(S) + " couldn't be cast to Address"))
181176 }
182177 $Tuple2(P, Q)
183178 }
190185 else f
191186 let P = aa._1
192187 let Q = aa._2
193- let S = {
194- let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
195- if ($isInstanceOf(R, "Boolean"))
196- then R
197- else throw(($getType(R) + " couldn't be cast to Boolean"))
188+ let R = {
189+ let S = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
190+ if ($isInstanceOf(S, "Boolean"))
191+ then S
192+ else throw(($getType(S) + " couldn't be cast to Boolean"))
198193 }
199- let T = if (S)
194+ let T = if (R)
200195 then true
201196 else e
202197 if ((T == T))
203198 then {
204199 let U = addressFromStringValue(valueOrElse(Q, ""))
205200 let V = {
206- let R = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, W, X], [AttachedPayment(F, toInt(K))])
207- if ($isInstanceOf(R, "Boolean"))
208- then R
209- else throw(($getType(R) + " couldn't be cast to Boolean"))
201+ let S = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, W, X], [AttachedPayment(F, toInt(K))])
202+ if ($isInstanceOf(S, "Boolean"))
203+ then S
204+ else throw(($getType(S) + " couldn't be cast to Boolean"))
210205 }
211206 $Tuple2(nil, V)
212207 }
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
112- let Q = {
113- let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
114- if ($isInstanceOf(R, "Address"))
115- then R
116- else throw(($getType(R) + " couldn't be cast to Address"))
117- }
112+ let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
118113 $Tuple2(P, Q)
119114 }
120115 else if ((N != unit))
121116 then {
122117 let P = true
123118 let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
124119 $Tuple2(P, Q)
125120 }
126121 else f
127122 let P = O._1
128123 let Q = O._2
129- let S = {
130- let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
131- if ($isInstanceOf(R, "Boolean"))
132- then R
133- else throw(($getType(R) + " couldn't be cast to Boolean"))
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"))
134129 }
135- let T = if (S)
130+ let T = if (R)
136131 then true
137132 else e
138133 if ((T == T))
139134 then {
140135 let U = addressFromStringValue(valueOrElse(Q, ""))
141136 let V = {
142- let R = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil)
143- if ($isInstanceOf(R, "Int"))
144- then R
145- else throw(($getType(R) + " couldn't be cast to Int"))
137+ let S = invoke(U, "calculateAmountOutForSwapREADONLY", [L, P], nil)
138+ if ($isInstanceOf(S, "Int"))
139+ then S
140+ else throw(($getType(S) + " couldn't be cast to Int"))
146141 }
147142 $Tuple2(nil, V)
148143 }
149144 else throw("Strict value is not equal to itself.")
150145 }
151146
152147
153148
154149 @Callable(z)
155150 func swap (W,G,X) = {
156151 let Y = value(z.payments[0])
157152 let F = if ((Y.assetId == unit))
158153 then toBytes("WAVES")
159154 else value(Y.assetId)
160155 let E = value(Y.amount)
161156 let H = value(getInteger(n()))
162157 let I = fraction(toBigInt(E), toBigInt(H), b)
163158 let J = fraction(toBigInt(E), toBigInt(H), b)
164159 let K = (toBigInt(E) - I)
165160 let L = (K - J)
166161 let Z = [if ((size(z.payments) == 1))
167162 then true
168163 else throw("exactly 1 payment are expected")]
169164 if ((Z == Z))
170165 then {
171166 let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
172167 let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
173168 let aa = if ((M != unit))
174169 then {
175170 let P = false
176171 let Q = {
177- let R = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
178- if ($isInstanceOf(R, "Address"))
179- then R
180- else throw(($getType(R) + " couldn't be cast to Address"))
172+ let S = invoke(k, "getPoolAddressFromLpAssetREADONLY", [M], nil)
173+ if ($isInstanceOf(S, "Address"))
174+ then S
175+ else throw(($getType(S) + " couldn't be cast to Address"))
181176 }
182177 $Tuple2(P, Q)
183178 }
184179 else if ((N != unit))
185180 then {
186181 let P = true
187182 let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
188183 $Tuple2(P, Q)
189184 }
190185 else f
191186 let P = aa._1
192187 let Q = aa._2
193- let S = {
194- let R = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
195- if ($isInstanceOf(R, "Boolean"))
196- then R
197- else throw(($getType(R) + " couldn't be cast to Boolean"))
188+ let R = {
189+ let S = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [Q], nil)
190+ if ($isInstanceOf(S, "Boolean"))
191+ then S
192+ else throw(($getType(S) + " couldn't be cast to Boolean"))
198193 }
199- let T = if (S)
194+ let T = if (R)
200195 then true
201196 else e
202197 if ((T == T))
203198 then {
204199 let U = addressFromStringValue(valueOrElse(Q, ""))
205200 let V = {
206- let R = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, W, X], [AttachedPayment(F, toInt(K))])
207- if ($isInstanceOf(R, "Boolean"))
208- then R
209- else throw(($getType(R) + " couldn't be cast to Boolean"))
201+ let S = invoke(U, "calculateAmountOutForSwapAndSendTokens", [L, P, W, X], [AttachedPayment(F, toInt(K))])
202+ if ($isInstanceOf(S, "Boolean"))
203+ then S
204+ else throw(($getType(S) + " couldn't be cast to Boolean"))
210205 }
211206 $Tuple2(nil, V)
212207 }
213208 else throw("Strict value is not equal to itself.")
214209 }
215210 else throw("Strict value is not equal to itself.")
216211 }
217212
218213
219214
220215 @Callable(z)
221216 func setManager (ab) = {
222217 let ac = B(z)
223218 if ((ac == ac))
224219 then {
225220 let ad = fromBase58String(ab)
226221 if ((ad == ad))
227222 then [StringEntry(i(), ab)]
228223 else throw("Strict value is not equal to itself.")
229224 }
230225 else throw("Strict value is not equal to itself.")
231226 }
232227
233228
234229
235230 @Callable(z)
236231 func confirmManager () = {
237232 let ae = x()
238233 let af = if (isDefined(ae))
239234 then true
240235 else throw("no pending manager")
241236 if ((af == af))
242237 then {
243238 let ag = if ((z.callerPublicKey == value(ae)))
244239 then true
245240 else throw("you are not pending manager")
246241 if ((ag == ag))
247242 then [StringEntry(h(), toBase58String(value(ae))), DeleteEntry(i())]
248243 else throw("Strict value is not equal to itself.")
249244 }
250245 else throw("Strict value is not equal to itself.")
251246 }
252247
253248
254249 @Verifier(ah)
255250 func ai () = {
256251 let aj = {
257252 let q = v()
258253 if ($isInstanceOf(q, "ByteVector"))
259254 then {
260255 let A = q
261256 A
262257 }
263258 else if ($isInstanceOf(q, "Unit"))
264259 then ah.senderPublicKey
265260 else throw("Match error")
266261 }
267262 sigVerify(ah.bodyBytes, ah.proofs[0], aj)
268263 }
269264

github/deemru/w8io/169f3d6 
48.14 ms