tx · 8fyTTicxNy8FUm7EdqywTq3einNg2xS3SFpygPNt2VnA

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.01.31 17:40 [2429253] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "8fyTTicxNy8FUm7EdqywTq3einNg2xS3SFpygPNt2VnA", "fee": 1300000, "feeAssetId": null, "timestamp": 1675176068530, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "iZZWEtRD4hLebGmJK2DmMGf43sq96qtmXB2Crvx5Fc4PZgyvC8rBH9FQu8aqshVeobWK8zrsASqbaAyk6C3Yo5K" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAVAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcACXRlc3RFcnJvcgkAAgECD1Rlc3QgZXJyb3IgaGVyZQETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQACGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQECZmMAAhMlc19fZmFjdG9yeUNvbnRyYWN0AA9mYWN0b3J5Q29udHJhY3QJARFAZXh0ck5hdGl2ZSgx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429253, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W Next: 7fwdKZDFUwdE91XzWuwWaoYBDXXNTyU9zxYKDdkRUBhn Diff:
OldNewDifferences
108108 let M = (L - K)
109109 let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
110110 let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
111- let P = if ((0 == 0))
112- then h
113- else h
114- let Q = if ((N != unit))
111+ let P = if ((N != unit))
115112 then {
116- let R = false
117- let S = {
118- let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
119- if ($isInstanceOf(T, "Address"))
120- then T
121- else throw(($getType(T) + " couldn't be cast to Address"))
113+ let Q = false
114+ let R = {
115+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
116+ if ($isInstanceOf(S, "Address"))
117+ then S
118+ else throw(($getType(S) + " couldn't be cast to Address"))
122119 }
123- $Tuple2(R, S)
120+ $Tuple2(Q, R)
124121 }
125122 else if ((O != unit))
126123 then {
127- let R = true
128- let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
129- $Tuple2(R, S)
124+ let Q = true
125+ let R = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
126+ $Tuple2(Q, R)
130127 }
131128 else h
132- let R = Q._1
133- let S = Q._2
134- let U = {
135- let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil)
136- if ($isInstanceOf(T, "Boolean"))
137- then T
138- else throw(($getType(T) + " couldn't be cast to Boolean"))
129+ let Q = P._1
130+ let R = P._2
131+ let T = {
132+ let S = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [R], nil)
133+ if ($isInstanceOf(S, "Boolean"))
134+ then S
135+ else throw(($getType(S) + " couldn't be cast to Boolean"))
139136 }
140- let V = if (U)
137+ let U = if (T)
141138 then true
142139 else e
143- if ((V == V))
140+ if ((U == U))
144141 then {
145- let W = addressFromStringValue(valueOrElse(S, ""))
146- let X = {
147- let T = invoke(W, "calculateAmountOutForSwapREADONLY", [M, R], nil)
148- if ($isInstanceOf(T, "Int"))
149- then T
150- else throw(($getType(T) + " couldn't be cast to Int"))
142+ let V = addressFromStringValue(valueOrElse(R, ""))
143+ let W = {
144+ let S = invoke(V, "calculateAmountOutForSwapREADONLY", [M, Q], nil)
145+ if ($isInstanceOf(S, "Int"))
146+ then S
147+ else throw(($getType(S) + " couldn't be cast to Int"))
151148 }
152- $Tuple2(nil, X)
149+ $Tuple2(nil, W)
153150 }
154151 else throw("Strict value is not equal to itself.")
155152 }
157154
158155
159156 @Callable(A)
160-func swap (Y,H,Z) = {
161- let aa = value(A.payments[0])
162- let G = if ((aa.assetId == unit))
157+func swap (X,H,Y) = {
158+ let Z = value(A.payments[0])
159+ let G = if ((Z.assetId == unit))
163160 then toBytes("WAVES")
164- else value(aa.assetId)
165- let F = value(aa.amount)
161+ else value(Z.assetId)
162+ let F = value(Z.amount)
166163 let I = value(getInteger(o()))
167164 let J = fraction(toBigInt(F), toBigInt(I), b)
168165 let K = fraction(toBigInt(F), toBigInt(I), b)
169166 let L = (toBigInt(F) - J)
170167 let M = (L - K)
171- let ab = [if ((size(A.payments) == 1))
168+ let aa = [if ((size(A.payments) == 1))
172169 then true
173170 else throw("exactly 1 payment are expected")]
174- if ((ab == ab))
171+ if ((aa == aa))
175172 then {
176173 let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
177174 let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
178- let ac = if ((N != unit))
175+ let ab = if ((N != unit))
179176 then {
180- let R = false
181- let S = {
182- let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
183- if ($isInstanceOf(T, "Address"))
184- then T
185- else throw(($getType(T) + " couldn't be cast to Address"))
177+ let Q = false
178+ let R = {
179+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
180+ if ($isInstanceOf(S, "Address"))
181+ then S
182+ else throw(($getType(S) + " couldn't be cast to Address"))
186183 }
187- $Tuple2(R, S)
184+ $Tuple2(Q, R)
188185 }
189186 else if ((O != unit))
190187 then {
191- let R = true
192- let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
193- $Tuple2(R, S)
188+ let Q = true
189+ let R = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
190+ $Tuple2(Q, R)
194191 }
195192 else f
196- let R = ac._1
197- let S = ac._2
198- let U = {
199- let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil)
200- if ($isInstanceOf(T, "Boolean"))
201- then T
202- else throw(($getType(T) + " couldn't be cast to Boolean"))
193+ let Q = ab._1
194+ let R = ab._2
195+ let T = {
196+ let S = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [R], nil)
197+ if ($isInstanceOf(S, "Boolean"))
198+ then S
199+ else throw(($getType(S) + " couldn't be cast to Boolean"))
203200 }
204- let V = if (U)
201+ let U = if (T)
205202 then true
206203 else e
207- if ((V == V))
204+ if ((U == U))
208205 then {
209- let W = addressFromStringValue(valueOrElse(S, ""))
210- let X = {
211- let T = invoke(W, "calculateAmountOutForSwapAndSendTokens", [M, R, Y, Z], [AttachedPayment(G, toInt(L))])
212- if ($isInstanceOf(T, "Boolean"))
213- then T
214- else throw(($getType(T) + " couldn't be cast to Boolean"))
206+ let V = addressFromStringValue(valueOrElse(R, ""))
207+ let W = {
208+ let S = invoke(V, "calculateAmountOutForSwapAndSendTokens", [M, Q, X, Y], [AttachedPayment(G, toInt(L))])
209+ if ($isInstanceOf(S, "Boolean"))
210+ then S
211+ else throw(($getType(S) + " couldn't be cast to Boolean"))
215212 }
216- $Tuple2(nil, X)
213+ $Tuple2(nil, W)
217214 }
218215 else throw("Strict value is not equal to itself.")
219216 }
223220
224221
225222 @Callable(A)
226-func setManager (ad) = {
227- let ae = C(A)
228- if ((ae == ae))
223+func setManager (ac) = {
224+ let ad = C(A)
225+ if ((ad == ad))
229226 then {
230- let af = fromBase58String(ad)
231- if ((af == af))
232- then [StringEntry(j(), ad)]
227+ let ae = fromBase58String(ac)
228+ if ((ae == ae))
229+ then [StringEntry(j(), ac)]
233230 else throw("Strict value is not equal to itself.")
234231 }
235232 else throw("Strict value is not equal to itself.")
239236
240237 @Callable(A)
241238 func confirmManager () = {
242- let ag = y()
243- let ah = if (isDefined(ag))
239+ let af = y()
240+ let ag = if (isDefined(af))
244241 then true
245242 else throw("no pending manager")
246- if ((ah == ah))
243+ if ((ag == ag))
247244 then {
248- let ai = if ((A.callerPublicKey == value(ag)))
245+ let ah = if ((A.callerPublicKey == value(af)))
249246 then true
250247 else throw("you are not pending manager")
251- if ((ai == ai))
252- then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())]
248+ if ((ah == ah))
249+ then [StringEntry(i(), toBase58String(value(af))), DeleteEntry(j())]
253250 else throw("Strict value is not equal to itself.")
254251 }
255252 else throw("Strict value is not equal to itself.")
256253 }
257254
258255
259-@Verifier(aj)
260-func ak () = {
261- let al = {
256+@Verifier(ai)
257+func aj () = {
258+ let ak = {
262259 let r = w()
263260 if ($isInstanceOf(r, "ByteVector"))
264261 then {
266263 B
267264 }
268265 else if ($isInstanceOf(r, "Unit"))
269- then aj.senderPublicKey
266+ then ai.senderPublicKey
270267 else throw("Match error")
271268 }
272- sigVerify(aj.bodyBytes, aj.proofs[0], al)
269+ sigVerify(ai.bodyBytes, ai.proofs[0], ak)
273270 }
274271
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)
111- let P = if ((0 == 0))
112- then h
113- else h
114- let Q = if ((N != unit))
111+ let P = if ((N != unit))
115112 then {
116- let R = false
117- let S = {
118- let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
119- if ($isInstanceOf(T, "Address"))
120- then T
121- else throw(($getType(T) + " couldn't be cast to Address"))
113+ let Q = false
114+ let R = {
115+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
116+ if ($isInstanceOf(S, "Address"))
117+ then S
118+ else throw(($getType(S) + " couldn't be cast to Address"))
122119 }
123- $Tuple2(R, S)
120+ $Tuple2(Q, R)
124121 }
125122 else if ((O != unit))
126123 then {
127- let R = true
128- let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
129- $Tuple2(R, S)
124+ let Q = true
125+ let R = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
126+ $Tuple2(Q, R)
130127 }
131128 else h
132- let R = Q._1
133- let S = Q._2
134- let U = {
135- let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil)
136- if ($isInstanceOf(T, "Boolean"))
137- then T
138- else throw(($getType(T) + " couldn't be cast to Boolean"))
129+ let Q = P._1
130+ let R = P._2
131+ let T = {
132+ let S = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [R], nil)
133+ if ($isInstanceOf(S, "Boolean"))
134+ then S
135+ else throw(($getType(S) + " couldn't be cast to Boolean"))
139136 }
140- let V = if (U)
137+ let U = if (T)
141138 then true
142139 else e
143- if ((V == V))
140+ if ((U == U))
144141 then {
145- let W = addressFromStringValue(valueOrElse(S, ""))
146- let X = {
147- let T = invoke(W, "calculateAmountOutForSwapREADONLY", [M, R], nil)
148- if ($isInstanceOf(T, "Int"))
149- then T
150- else throw(($getType(T) + " couldn't be cast to Int"))
142+ let V = addressFromStringValue(valueOrElse(R, ""))
143+ let W = {
144+ let S = invoke(V, "calculateAmountOutForSwapREADONLY", [M, Q], nil)
145+ if ($isInstanceOf(S, "Int"))
146+ then S
147+ else throw(($getType(S) + " couldn't be cast to Int"))
151148 }
152- $Tuple2(nil, X)
149+ $Tuple2(nil, W)
153150 }
154151 else throw("Strict value is not equal to itself.")
155152 }
156153
157154
158155
159156 @Callable(A)
160-func swap (Y,H,Z) = {
161- let aa = value(A.payments[0])
162- let G = if ((aa.assetId == unit))
157+func swap (X,H,Y) = {
158+ let Z = value(A.payments[0])
159+ let G = if ((Z.assetId == unit))
163160 then toBytes("WAVES")
164- else value(aa.assetId)
165- let F = value(aa.amount)
161+ else value(Z.assetId)
162+ let F = value(Z.amount)
166163 let I = value(getInteger(o()))
167164 let J = fraction(toBigInt(F), toBigInt(I), b)
168165 let K = fraction(toBigInt(F), toBigInt(I), b)
169166 let L = (toBigInt(F) - J)
170167 let M = (L - K)
171- let ab = [if ((size(A.payments) == 1))
168+ let aa = [if ((size(A.payments) == 1))
172169 then true
173170 else throw("exactly 1 payment are expected")]
174- if ((ab == ab))
171+ if ((aa == aa))
175172 then {
176173 let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
177174 let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
178- let ac = if ((N != unit))
175+ let ab = if ((N != unit))
179176 then {
180- let R = false
181- let S = {
182- let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
183- if ($isInstanceOf(T, "Address"))
184- then T
185- else throw(($getType(T) + " couldn't be cast to Address"))
177+ let Q = false
178+ let R = {
179+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil)
180+ if ($isInstanceOf(S, "Address"))
181+ then S
182+ else throw(($getType(S) + " couldn't be cast to Address"))
186183 }
187- $Tuple2(R, S)
184+ $Tuple2(Q, R)
188185 }
189186 else if ((O != unit))
190187 then {
191- let R = true
192- let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
193- $Tuple2(R, S)
188+ let Q = true
189+ let R = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
190+ $Tuple2(Q, R)
194191 }
195192 else f
196- let R = ac._1
197- let S = ac._2
198- let U = {
199- let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil)
200- if ($isInstanceOf(T, "Boolean"))
201- then T
202- else throw(($getType(T) + " couldn't be cast to Boolean"))
193+ let Q = ab._1
194+ let R = ab._2
195+ let T = {
196+ let S = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [R], nil)
197+ if ($isInstanceOf(S, "Boolean"))
198+ then S
199+ else throw(($getType(S) + " couldn't be cast to Boolean"))
203200 }
204- let V = if (U)
201+ let U = if (T)
205202 then true
206203 else e
207- if ((V == V))
204+ if ((U == U))
208205 then {
209- let W = addressFromStringValue(valueOrElse(S, ""))
210- let X = {
211- let T = invoke(W, "calculateAmountOutForSwapAndSendTokens", [M, R, Y, Z], [AttachedPayment(G, toInt(L))])
212- if ($isInstanceOf(T, "Boolean"))
213- then T
214- else throw(($getType(T) + " couldn't be cast to Boolean"))
206+ let V = addressFromStringValue(valueOrElse(R, ""))
207+ let W = {
208+ let S = invoke(V, "calculateAmountOutForSwapAndSendTokens", [M, Q, X, Y], [AttachedPayment(G, toInt(L))])
209+ if ($isInstanceOf(S, "Boolean"))
210+ then S
211+ else throw(($getType(S) + " couldn't be cast to Boolean"))
215212 }
216- $Tuple2(nil, X)
213+ $Tuple2(nil, W)
217214 }
218215 else throw("Strict value is not equal to itself.")
219216 }
220217 else throw("Strict value is not equal to itself.")
221218 }
222219
223220
224221
225222 @Callable(A)
226-func setManager (ad) = {
227- let ae = C(A)
228- if ((ae == ae))
223+func setManager (ac) = {
224+ let ad = C(A)
225+ if ((ad == ad))
229226 then {
230- let af = fromBase58String(ad)
231- if ((af == af))
232- then [StringEntry(j(), ad)]
227+ let ae = fromBase58String(ac)
228+ if ((ae == ae))
229+ then [StringEntry(j(), ac)]
233230 else throw("Strict value is not equal to itself.")
234231 }
235232 else throw("Strict value is not equal to itself.")
236233 }
237234
238235
239236
240237 @Callable(A)
241238 func confirmManager () = {
242- let ag = y()
243- let ah = if (isDefined(ag))
239+ let af = y()
240+ let ag = if (isDefined(af))
244241 then true
245242 else throw("no pending manager")
246- if ((ah == ah))
243+ if ((ag == ag))
247244 then {
248- let ai = if ((A.callerPublicKey == value(ag)))
245+ let ah = if ((A.callerPublicKey == value(af)))
249246 then true
250247 else throw("you are not pending manager")
251- if ((ai == ai))
252- then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())]
248+ if ((ah == ah))
249+ then [StringEntry(i(), toBase58String(value(af))), DeleteEntry(j())]
253250 else throw("Strict value is not equal to itself.")
254251 }
255252 else throw("Strict value is not equal to itself.")
256253 }
257254
258255
259-@Verifier(aj)
260-func ak () = {
261- let al = {
256+@Verifier(ai)
257+func aj () = {
258+ let ak = {
262259 let r = w()
263260 if ($isInstanceOf(r, "ByteVector"))
264261 then {
265262 let B = r
266263 B
267264 }
268265 else if ($isInstanceOf(r, "Unit"))
269- then aj.senderPublicKey
266+ then ai.senderPublicKey
270267 else throw("Match error")
271268 }
272- sigVerify(aj.bodyBytes, aj.proofs[0], al)
269+ sigVerify(ai.bodyBytes, ai.proofs[0], ak)
273270 }
274271

github/deemru/w8io/169f3d6 
65.39 ms