tx · A7H6RqSs3FWyF4erSDHv8qyoE2kLqHs7ZLpxhZFrapMQ

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.01.31 17:33 [2429246] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "A7H6RqSs3FWyF4erSDHv8qyoE2kLqHs7ZLpxhZFrapMQ", "fee": 1300000, "feeAssetId": null, "timestamp": 1675175669971, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "28daFo7Yk7RHpCjxbdBk38yXGEa1c6X1oaPYv2TD7MGWtf9wuD7iGQ1RrbTAeapYfWUXtKaEd5RfiDmNMcA6AmWf" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAVAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcACXRlc3RFcnJvcgkAAgECD1Rlc3QgZXJyb3IgaGVyZQETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQACGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQECZmMAAhMlc19fZmFjdG9yeUNvbnRyYWN0AA9mYWN0b3J5Q29udHJhY3QJARFAZXh0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ZXRQdWJsaWNLZXnQwURg", "chainId": 84, "height": 2429246, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4LDgK1DQT1SAcPwQ1cis7UAysoZz2dFoN5vPHTU98Nek Next: 3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W Diff:
OldNewDifferences
1414
1515 let g = throw("Slippage is too big")
1616
17-func h () = "%s__managerPublicKey"
17+let h = throw("Test error here")
18+
19+func i () = "%s__managerPublicKey"
1820
1921
20-func i () = "%s__pendingManagerPublicKey"
22+func j () = "%s__pendingManagerPublicKey"
2123
2224
23-func j () = "%s__factoryContract"
25+func k () = "%s__factoryContract"
2426
2527
26-let k = addressFromStringValue(c(j()))
28+let l = addressFromStringValue(c(k()))
2729
28-func l () = makeString(["%s", "feeLiquidityContractAddress"], a)
30+func m () = makeString(["%s", "feeLiquidityContractAddress"], a)
2931
3032
31-func m () = makeString(["%s", "feeLiquidity"], a)
33+func n () = makeString(["%s", "feeLiquidity"], a)
3234
3335
34-func n () = makeString(["%s", "protocolFee"], a)
36+func o () = makeString(["%s", "protocolFee"], a)
3537
3638
37-func o (p) = {
38- let q = p
39- if ($isInstanceOf(q, "Int"))
39+func p (q) = {
40+ let r = q
41+ if ($isInstanceOf(r, "Int"))
4042 then {
41- let r = q
42- r
43+ let s = r
44+ s
4345 }
4446 else throw("fail to cast into Int")
4547 }
4648
4749
48-func s (t,u) = makeString(["%d%d", toString(t), toString(u)], a)
50+func t (u,v) = makeString(["%d%d", toString(u), toString(v)], a)
4951
5052
51-func v () = {
52- let q = getString(h())
53- if ($isInstanceOf(q, "String"))
53+func w () = {
54+ let r = getString(i())
55+ if ($isInstanceOf(r, "String"))
5456 then {
55- let w = q
56- fromBase58String(w)
57+ let x = r
58+ fromBase58String(x)
5759 }
58- else if ($isInstanceOf(q, "Unit"))
60+ else if ($isInstanceOf(r, "Unit"))
5961 then unit
6062 else throw("Match error")
6163 }
6264
6365
64-func x () = {
65- let q = getString(i())
66- if ($isInstanceOf(q, "String"))
66+func y () = {
67+ let r = getString(j())
68+ if ($isInstanceOf(r, "String"))
6769 then {
68- let w = q
69- fromBase58String(w)
70+ let x = r
71+ fromBase58String(x)
7072 }
71- else if ($isInstanceOf(q, "Unit"))
73+ else if ($isInstanceOf(r, "Unit"))
7274 then unit
7375 else throw("Match error")
7476 }
7577
7678
77-func y (z) = {
78- let q = v()
79- if ($isInstanceOf(q, "ByteVector"))
79+func z (A) = {
80+ let r = w()
81+ if ($isInstanceOf(r, "ByteVector"))
8082 then {
81- let A = q
82- (z.callerPublicKey == A)
83+ let B = r
84+ (A.callerPublicKey == B)
8385 }
84- else if ($isInstanceOf(q, "Unit"))
85- then (z.caller == this)
86+ else if ($isInstanceOf(r, "Unit"))
87+ then (A.caller == this)
8688 else throw("Match error")
8789 }
8890
8991
90-func B (z) = if (y(z))
92+func C (A) = if (z(A))
9193 then true
9294 else throw("permission denied")
9395
9496
95-func C (D) = if ((D == "WAVES"))
97+func D (E) = if ((E == "WAVES"))
9698 then wavesBalance(this).available
97- else assetBalance(this, fromBase58String(D))
99+ else assetBalance(this, fromBase58String(E))
98100
99101
100-@Callable(z)
101-func swapCalculateREADONLY (E,F,G) = {
102- let H = value(getInteger(n()))
103- let I = fraction(toBigInt(E), toBigInt(H), b)
104- let J = fraction(toBigInt(E), toBigInt(H), b)
105- let K = (toBigInt(E) - I)
106- let L = (K - J)
107- let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
108- let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
109- let O = if ((M != unit))
102+@Callable(A)
103+func swapCalculateREADONLY (F,G,H) = {
104+ let I = value(getInteger(o()))
105+ let J = fraction(toBigInt(F), toBigInt(I), b)
106+ let K = fraction(toBigInt(F), toBigInt(I), b)
107+ let L = (toBigInt(F) - J)
108+ let M = (L - K)
109+ let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
110+ 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))
110115 then {
111- 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"))
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"))
117122 }
118- $Tuple2(P, Q)
123+ $Tuple2(R, S)
119124 }
120- else if ((N != unit))
125+ else if ((O != unit))
121126 then {
122- let P = true
123- let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
124- $Tuple2(P, Q)
127+ let R = true
128+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
129+ $Tuple2(R, S)
125130 }
126131 else f
127- let P = O._1
128- 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"))
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"))
134139 }
135- let T = if (S)
140+ let V = if (U)
136141 then true
137142 else e
138- if ((T == T))
143+ if ((V == V))
139144 then {
140- let U = addressFromStringValue(valueOrElse(Q, ""))
141- 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"))
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"))
146151 }
147- $Tuple2(nil, V)
152+ $Tuple2(nil, X)
148153 }
149154 else throw("Strict value is not equal to itself.")
150155 }
151156
152157
153158
154-@Callable(z)
155-func swap (W,G,X) = {
156- let Y = value(z.payments[0])
157- let F = if ((Y.assetId == unit))
159+@Callable(A)
160+func swap (Y,H,Z) = {
161+ let aa = value(A.payments[0])
162+ let G = if ((aa.assetId == unit))
158163 then toBytes("WAVES")
159- else value(Y.assetId)
160- let E = value(Y.amount)
161- let H = value(getInteger(n()))
162- let I = fraction(toBigInt(E), toBigInt(H), b)
163- let J = fraction(toBigInt(E), toBigInt(H), b)
164- let K = (toBigInt(E) - I)
165- let L = (K - J)
166- let Z = [if ((size(z.payments) == 1))
164+ else value(aa.assetId)
165+ let F = value(aa.amount)
166+ let I = value(getInteger(o()))
167+ let J = fraction(toBigInt(F), toBigInt(I), b)
168+ let K = fraction(toBigInt(F), toBigInt(I), b)
169+ let L = (toBigInt(F) - J)
170+ let M = (L - K)
171+ let ab = [if ((size(A.payments) == 1))
167172 then true
168173 else throw("exactly 1 payment are expected")]
169- if ((Z == Z))
174+ if ((ab == ab))
170175 then {
171- let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
172- let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
173- let aa = if ((M != unit))
176+ let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
177+ let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
178+ let ac = if ((N != unit))
174179 then {
175- let P = false
176- 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"))
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"))
181186 }
182- $Tuple2(P, Q)
187+ $Tuple2(R, S)
183188 }
184- else if ((N != unit))
189+ else if ((O != unit))
185190 then {
186- let P = true
187- let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
188- $Tuple2(P, Q)
191+ let R = true
192+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
193+ $Tuple2(R, S)
189194 }
190195 else f
191- let P = aa._1
192- 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"))
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"))
198203 }
199- let T = if (S)
204+ let V = if (U)
200205 then true
201206 else e
202- if ((T == T))
207+ if ((V == V))
203208 then {
204- let U = addressFromStringValue(valueOrElse(Q, ""))
205- 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"))
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"))
210215 }
211- $Tuple2(nil, V)
216+ $Tuple2(nil, X)
212217 }
213218 else throw("Strict value is not equal to itself.")
214219 }
217222
218223
219224
220-@Callable(z)
221-func setManager (ab) = {
222- let ac = B(z)
223- if ((ac == ac))
225+@Callable(A)
226+func setManager (ad) = {
227+ let ae = C(A)
228+ if ((ae == ae))
224229 then {
225- let ad = fromBase58String(ab)
226- if ((ad == ad))
227- then [StringEntry(i(), ab)]
230+ let af = fromBase58String(ad)
231+ if ((af == af))
232+ then [StringEntry(j(), ad)]
228233 else throw("Strict value is not equal to itself.")
229234 }
230235 else throw("Strict value is not equal to itself.")
232237
233238
234239
235-@Callable(z)
240+@Callable(A)
236241 func confirmManager () = {
237- let ae = x()
238- let af = if (isDefined(ae))
242+ let ag = y()
243+ let ah = if (isDefined(ag))
239244 then true
240245 else throw("no pending manager")
241- if ((af == af))
246+ if ((ah == ah))
242247 then {
243- let ag = if ((z.callerPublicKey == value(ae)))
248+ let ai = if ((A.callerPublicKey == value(ag)))
244249 then true
245250 else throw("you are not pending manager")
246- if ((ag == ag))
247- then [StringEntry(h(), toBase58String(value(ae))), DeleteEntry(i())]
251+ if ((ai == ai))
252+ then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())]
248253 else throw("Strict value is not equal to itself.")
249254 }
250255 else throw("Strict value is not equal to itself.")
251256 }
252257
253258
254-@Verifier(ah)
255-func ai () = {
256- let aj = {
257- let q = v()
258- if ($isInstanceOf(q, "ByteVector"))
259+@Verifier(aj)
260+func ak () = {
261+ let al = {
262+ let r = w()
263+ if ($isInstanceOf(r, "ByteVector"))
259264 then {
260- let A = q
261- A
265+ let B = r
266+ B
262267 }
263- else if ($isInstanceOf(q, "Unit"))
264- then ah.senderPublicKey
268+ else if ($isInstanceOf(r, "Unit"))
269+ then aj.senderPublicKey
265270 else throw("Match error")
266271 }
267- sigVerify(ah.bodyBytes, ah.proofs[0], aj)
272+ sigVerify(aj.bodyBytes, aj.proofs[0], al)
268273 }
269274
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
17-func h () = "%s__managerPublicKey"
17+let h = throw("Test error here")
18+
19+func i () = "%s__managerPublicKey"
1820
1921
20-func i () = "%s__pendingManagerPublicKey"
22+func j () = "%s__pendingManagerPublicKey"
2123
2224
23-func j () = "%s__factoryContract"
25+func k () = "%s__factoryContract"
2426
2527
26-let k = addressFromStringValue(c(j()))
28+let l = addressFromStringValue(c(k()))
2729
28-func l () = makeString(["%s", "feeLiquidityContractAddress"], a)
30+func m () = makeString(["%s", "feeLiquidityContractAddress"], a)
2931
3032
31-func m () = makeString(["%s", "feeLiquidity"], a)
33+func n () = makeString(["%s", "feeLiquidity"], a)
3234
3335
34-func n () = makeString(["%s", "protocolFee"], a)
36+func o () = makeString(["%s", "protocolFee"], a)
3537
3638
37-func o (p) = {
38- let q = p
39- if ($isInstanceOf(q, "Int"))
39+func p (q) = {
40+ let r = q
41+ if ($isInstanceOf(r, "Int"))
4042 then {
41- let r = q
42- r
43+ let s = r
44+ s
4345 }
4446 else throw("fail to cast into Int")
4547 }
4648
4749
48-func s (t,u) = makeString(["%d%d", toString(t), toString(u)], a)
50+func t (u,v) = makeString(["%d%d", toString(u), toString(v)], a)
4951
5052
51-func v () = {
52- let q = getString(h())
53- if ($isInstanceOf(q, "String"))
53+func w () = {
54+ let r = getString(i())
55+ if ($isInstanceOf(r, "String"))
5456 then {
55- let w = q
56- fromBase58String(w)
57+ let x = r
58+ fromBase58String(x)
5759 }
58- else if ($isInstanceOf(q, "Unit"))
60+ else if ($isInstanceOf(r, "Unit"))
5961 then unit
6062 else throw("Match error")
6163 }
6264
6365
64-func x () = {
65- let q = getString(i())
66- if ($isInstanceOf(q, "String"))
66+func y () = {
67+ let r = getString(j())
68+ if ($isInstanceOf(r, "String"))
6769 then {
68- let w = q
69- fromBase58String(w)
70+ let x = r
71+ fromBase58String(x)
7072 }
71- else if ($isInstanceOf(q, "Unit"))
73+ else if ($isInstanceOf(r, "Unit"))
7274 then unit
7375 else throw("Match error")
7476 }
7577
7678
77-func y (z) = {
78- let q = v()
79- if ($isInstanceOf(q, "ByteVector"))
79+func z (A) = {
80+ let r = w()
81+ if ($isInstanceOf(r, "ByteVector"))
8082 then {
81- let A = q
82- (z.callerPublicKey == A)
83+ let B = r
84+ (A.callerPublicKey == B)
8385 }
84- else if ($isInstanceOf(q, "Unit"))
85- then (z.caller == this)
86+ else if ($isInstanceOf(r, "Unit"))
87+ then (A.caller == this)
8688 else throw("Match error")
8789 }
8890
8991
90-func B (z) = if (y(z))
92+func C (A) = if (z(A))
9193 then true
9294 else throw("permission denied")
9395
9496
95-func C (D) = if ((D == "WAVES"))
97+func D (E) = if ((E == "WAVES"))
9698 then wavesBalance(this).available
97- else assetBalance(this, fromBase58String(D))
99+ else assetBalance(this, fromBase58String(E))
98100
99101
100-@Callable(z)
101-func swapCalculateREADONLY (E,F,G) = {
102- let H = value(getInteger(n()))
103- let I = fraction(toBigInt(E), toBigInt(H), b)
104- let J = fraction(toBigInt(E), toBigInt(H), b)
105- let K = (toBigInt(E) - I)
106- let L = (K - J)
107- let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
108- let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
109- let O = if ((M != unit))
102+@Callable(A)
103+func swapCalculateREADONLY (F,G,H) = {
104+ let I = value(getInteger(o()))
105+ let J = fraction(toBigInt(F), toBigInt(I), b)
106+ let K = fraction(toBigInt(F), toBigInt(I), b)
107+ let L = (toBigInt(F) - J)
108+ let M = (L - K)
109+ let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
110+ 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))
110115 then {
111- 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"))
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"))
117122 }
118- $Tuple2(P, Q)
123+ $Tuple2(R, S)
119124 }
120- else if ((N != unit))
125+ else if ((O != unit))
121126 then {
122- let P = true
123- let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
124- $Tuple2(P, Q)
127+ let R = true
128+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
129+ $Tuple2(R, S)
125130 }
126131 else f
127- let P = O._1
128- 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"))
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"))
134139 }
135- let T = if (S)
140+ let V = if (U)
136141 then true
137142 else e
138- if ((T == T))
143+ if ((V == V))
139144 then {
140- let U = addressFromStringValue(valueOrElse(Q, ""))
141- 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"))
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"))
146151 }
147- $Tuple2(nil, V)
152+ $Tuple2(nil, X)
148153 }
149154 else throw("Strict value is not equal to itself.")
150155 }
151156
152157
153158
154-@Callable(z)
155-func swap (W,G,X) = {
156- let Y = value(z.payments[0])
157- let F = if ((Y.assetId == unit))
159+@Callable(A)
160+func swap (Y,H,Z) = {
161+ let aa = value(A.payments[0])
162+ let G = if ((aa.assetId == unit))
158163 then toBytes("WAVES")
159- else value(Y.assetId)
160- let E = value(Y.amount)
161- let H = value(getInteger(n()))
162- let I = fraction(toBigInt(E), toBigInt(H), b)
163- let J = fraction(toBigInt(E), toBigInt(H), b)
164- let K = (toBigInt(E) - I)
165- let L = (K - J)
166- let Z = [if ((size(z.payments) == 1))
164+ else value(aa.assetId)
165+ let F = value(aa.amount)
166+ let I = value(getInteger(o()))
167+ let J = fraction(toBigInt(F), toBigInt(I), b)
168+ let K = fraction(toBigInt(F), toBigInt(I), b)
169+ let L = (toBigInt(F) - J)
170+ let M = (L - K)
171+ let ab = [if ((size(A.payments) == 1))
167172 then true
168173 else throw("exactly 1 payment are expected")]
169- if ((Z == Z))
174+ if ((ab == ab))
170175 then {
171- let M = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [F, G], nil)
172- let N = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [G, F], nil)
173- let aa = if ((M != unit))
176+ let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil)
177+ let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil)
178+ let ac = if ((N != unit))
174179 then {
175- let P = false
176- 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"))
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"))
181186 }
182- $Tuple2(P, Q)
187+ $Tuple2(R, S)
183188 }
184- else if ((N != unit))
189+ else if ((O != unit))
185190 then {
186- let P = true
187- let Q = invoke(k, "getPoolAddressFromLpAssetREADONLY", [N], nil)
188- $Tuple2(P, Q)
191+ let R = true
192+ let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil)
193+ $Tuple2(R, S)
189194 }
190195 else f
191- let P = aa._1
192- 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"))
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"))
198203 }
199- let T = if (S)
204+ let V = if (U)
200205 then true
201206 else e
202- if ((T == T))
207+ if ((V == V))
203208 then {
204- let U = addressFromStringValue(valueOrElse(Q, ""))
205- 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"))
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"))
210215 }
211- $Tuple2(nil, V)
216+ $Tuple2(nil, X)
212217 }
213218 else throw("Strict value is not equal to itself.")
214219 }
215220 else throw("Strict value is not equal to itself.")
216221 }
217222
218223
219224
220-@Callable(z)
221-func setManager (ab) = {
222- let ac = B(z)
223- if ((ac == ac))
225+@Callable(A)
226+func setManager (ad) = {
227+ let ae = C(A)
228+ if ((ae == ae))
224229 then {
225- let ad = fromBase58String(ab)
226- if ((ad == ad))
227- then [StringEntry(i(), ab)]
230+ let af = fromBase58String(ad)
231+ if ((af == af))
232+ then [StringEntry(j(), ad)]
228233 else throw("Strict value is not equal to itself.")
229234 }
230235 else throw("Strict value is not equal to itself.")
231236 }
232237
233238
234239
235-@Callable(z)
240+@Callable(A)
236241 func confirmManager () = {
237- let ae = x()
238- let af = if (isDefined(ae))
242+ let ag = y()
243+ let ah = if (isDefined(ag))
239244 then true
240245 else throw("no pending manager")
241- if ((af == af))
246+ if ((ah == ah))
242247 then {
243- let ag = if ((z.callerPublicKey == value(ae)))
248+ let ai = if ((A.callerPublicKey == value(ag)))
244249 then true
245250 else throw("you are not pending manager")
246- if ((ag == ag))
247- then [StringEntry(h(), toBase58String(value(ae))), DeleteEntry(i())]
251+ if ((ai == ai))
252+ then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())]
248253 else throw("Strict value is not equal to itself.")
249254 }
250255 else throw("Strict value is not equal to itself.")
251256 }
252257
253258
254-@Verifier(ah)
255-func ai () = {
256- let aj = {
257- let q = v()
258- if ($isInstanceOf(q, "ByteVector"))
259+@Verifier(aj)
260+func ak () = {
261+ let al = {
262+ let r = w()
263+ if ($isInstanceOf(r, "ByteVector"))
259264 then {
260- let A = q
261- A
265+ let B = r
266+ B
262267 }
263- else if ($isInstanceOf(q, "Unit"))
264- then ah.senderPublicKey
268+ else if ($isInstanceOf(r, "Unit"))
269+ then aj.senderPublicKey
265270 else throw("Match error")
266271 }
267- sigVerify(ah.bodyBytes, ah.proofs[0], aj)
272+ sigVerify(aj.bodyBytes, aj.proofs[0], al)
268273 }
269274

github/deemru/w8io/169f3d6 
87.49 ms