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:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAVAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcACXRlc3RFcnJvcgkAAgECD1Rlc3QgZXJyb3IgaGVyZQETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQACGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQECZmMAAhMlc19fZmFjdG9yeUNvbnRyYWN0AA9mYWN0b3J5Q29udHJhY3QJARFAZXh0ck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XRQdWJsaWNLZXnQwURg", "chainId": 84, "height": 2429246, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4LDgK1DQT1SAcPwQ1cis7UAysoZz2dFoN5vPHTU98Nek Next: 3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | ||
15 | 15 | let g = throw("Slippage is too big") | |
16 | 16 | ||
17 | - | func h () = "%s__managerPublicKey" | |
17 | + | let h = throw("Test error here") | |
18 | + | ||
19 | + | func i () = "%s__managerPublicKey" | |
18 | 20 | ||
19 | 21 | ||
20 | - | func | |
22 | + | func j () = "%s__pendingManagerPublicKey" | |
21 | 23 | ||
22 | 24 | ||
23 | - | func | |
25 | + | func k () = "%s__factoryContract" | |
24 | 26 | ||
25 | 27 | ||
26 | - | let | |
28 | + | let l = addressFromStringValue(c(k())) | |
27 | 29 | ||
28 | - | func | |
30 | + | func m () = makeString(["%s", "feeLiquidityContractAddress"], a) | |
29 | 31 | ||
30 | 32 | ||
31 | - | func | |
33 | + | func n () = makeString(["%s", "feeLiquidity"], a) | |
32 | 34 | ||
33 | 35 | ||
34 | - | func | |
36 | + | func o () = makeString(["%s", "protocolFee"], a) | |
35 | 37 | ||
36 | 38 | ||
37 | - | func | |
38 | - | let | |
39 | - | if ($isInstanceOf( | |
39 | + | func p (q) = { | |
40 | + | let r = q | |
41 | + | if ($isInstanceOf(r, "Int")) | |
40 | 42 | then { | |
41 | - | let | |
42 | - | | |
43 | + | let s = r | |
44 | + | s | |
43 | 45 | } | |
44 | 46 | else throw("fail to cast into Int") | |
45 | 47 | } | |
46 | 48 | ||
47 | 49 | ||
48 | - | func | |
50 | + | func t (u,v) = makeString(["%d%d", toString(u), toString(v)], a) | |
49 | 51 | ||
50 | 52 | ||
51 | - | func | |
52 | - | let | |
53 | - | if ($isInstanceOf( | |
53 | + | func w () = { | |
54 | + | let r = getString(i()) | |
55 | + | if ($isInstanceOf(r, "String")) | |
54 | 56 | then { | |
55 | - | let | |
56 | - | fromBase58String( | |
57 | + | let x = r | |
58 | + | fromBase58String(x) | |
57 | 59 | } | |
58 | - | else if ($isInstanceOf( | |
60 | + | else if ($isInstanceOf(r, "Unit")) | |
59 | 61 | then unit | |
60 | 62 | else throw("Match error") | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | ||
64 | - | func | |
65 | - | let | |
66 | - | if ($isInstanceOf( | |
66 | + | func y () = { | |
67 | + | let r = getString(j()) | |
68 | + | if ($isInstanceOf(r, "String")) | |
67 | 69 | then { | |
68 | - | let | |
69 | - | fromBase58String( | |
70 | + | let x = r | |
71 | + | fromBase58String(x) | |
70 | 72 | } | |
71 | - | else if ($isInstanceOf( | |
73 | + | else if ($isInstanceOf(r, "Unit")) | |
72 | 74 | then unit | |
73 | 75 | else throw("Match error") | |
74 | 76 | } | |
75 | 77 | ||
76 | 78 | ||
77 | - | func | |
78 | - | let | |
79 | - | if ($isInstanceOf( | |
79 | + | func z (A) = { | |
80 | + | let r = w() | |
81 | + | if ($isInstanceOf(r, "ByteVector")) | |
80 | 82 | then { | |
81 | - | let | |
82 | - | ( | |
83 | + | let B = r | |
84 | + | (A.callerPublicKey == B) | |
83 | 85 | } | |
84 | - | else if ($isInstanceOf( | |
85 | - | then ( | |
86 | + | else if ($isInstanceOf(r, "Unit")) | |
87 | + | then (A.caller == this) | |
86 | 88 | else throw("Match error") | |
87 | 89 | } | |
88 | 90 | ||
89 | 91 | ||
90 | - | func | |
92 | + | func C (A) = if (z(A)) | |
91 | 93 | then true | |
92 | 94 | else throw("permission denied") | |
93 | 95 | ||
94 | 96 | ||
95 | - | func | |
97 | + | func D (E) = if ((E == "WAVES")) | |
96 | 98 | then wavesBalance(this).available | |
97 | - | else assetBalance(this, fromBase58String( | |
99 | + | else assetBalance(this, fromBase58String(E)) | |
98 | 100 | ||
99 | 101 | ||
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)) | |
110 | 115 | then { | |
111 | - | let | |
112 | - | let | |
113 | - | let | |
114 | - | if ($isInstanceOf( | |
115 | - | then | |
116 | - | else throw(($getType( | |
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")) | |
117 | 122 | } | |
118 | - | $Tuple2( | |
123 | + | $Tuple2(R, S) | |
119 | 124 | } | |
120 | - | else if (( | |
125 | + | else if ((O != unit)) | |
121 | 126 | then { | |
122 | - | let | |
123 | - | let | |
124 | - | $Tuple2( | |
127 | + | let R = true | |
128 | + | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
129 | + | $Tuple2(R, S) | |
125 | 130 | } | |
126 | 131 | else f | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | let | |
131 | - | if ($isInstanceOf( | |
132 | - | then | |
133 | - | else throw(($getType( | |
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")) | |
134 | 139 | } | |
135 | - | let | |
140 | + | let V = if (U) | |
136 | 141 | then true | |
137 | 142 | else e | |
138 | - | if (( | |
143 | + | if ((V == V)) | |
139 | 144 | then { | |
140 | - | let | |
141 | - | let | |
142 | - | let | |
143 | - | if ($isInstanceOf( | |
144 | - | then | |
145 | - | else throw(($getType( | |
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")) | |
146 | 151 | } | |
147 | - | $Tuple2(nil, | |
152 | + | $Tuple2(nil, X) | |
148 | 153 | } | |
149 | 154 | else throw("Strict value is not equal to itself.") | |
150 | 155 | } | |
151 | 156 | ||
152 | 157 | ||
153 | 158 | ||
154 | - | @Callable( | |
155 | - | func swap ( | |
156 | - | let | |
157 | - | let | |
159 | + | @Callable(A) | |
160 | + | func swap (Y,H,Z) = { | |
161 | + | let aa = value(A.payments[0]) | |
162 | + | let G = if ((aa.assetId == unit)) | |
158 | 163 | then toBytes("WAVES") | |
159 | - | else value( | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | let | |
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)) | |
167 | 172 | then true | |
168 | 173 | else throw("exactly 1 payment are expected")] | |
169 | - | if (( | |
174 | + | if ((ab == ab)) | |
170 | 175 | then { | |
171 | - | let | |
172 | - | let | |
173 | - | let | |
176 | + | let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil) | |
177 | + | let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil) | |
178 | + | let ac = if ((N != unit)) | |
174 | 179 | then { | |
175 | - | let | |
176 | - | let | |
177 | - | let | |
178 | - | if ($isInstanceOf( | |
179 | - | then | |
180 | - | else throw(($getType( | |
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")) | |
181 | 186 | } | |
182 | - | $Tuple2( | |
187 | + | $Tuple2(R, S) | |
183 | 188 | } | |
184 | - | else if (( | |
189 | + | else if ((O != unit)) | |
185 | 190 | then { | |
186 | - | let | |
187 | - | let | |
188 | - | $Tuple2( | |
191 | + | let R = true | |
192 | + | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
193 | + | $Tuple2(R, S) | |
189 | 194 | } | |
190 | 195 | else f | |
191 | - | let | |
192 | - | let | |
193 | - | let | |
194 | - | let | |
195 | - | if ($isInstanceOf( | |
196 | - | then | |
197 | - | else throw(($getType( | |
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")) | |
198 | 203 | } | |
199 | - | let | |
204 | + | let V = if (U) | |
200 | 205 | then true | |
201 | 206 | else e | |
202 | - | if (( | |
207 | + | if ((V == V)) | |
203 | 208 | then { | |
204 | - | let | |
205 | - | let | |
206 | - | let | |
207 | - | if ($isInstanceOf( | |
208 | - | then | |
209 | - | else throw(($getType( | |
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")) | |
210 | 215 | } | |
211 | - | $Tuple2(nil, | |
216 | + | $Tuple2(nil, X) | |
212 | 217 | } | |
213 | 218 | else throw("Strict value is not equal to itself.") | |
214 | 219 | } | |
217 | 222 | ||
218 | 223 | ||
219 | 224 | ||
220 | - | @Callable( | |
221 | - | func setManager ( | |
222 | - | let | |
223 | - | if (( | |
225 | + | @Callable(A) | |
226 | + | func setManager (ad) = { | |
227 | + | let ae = C(A) | |
228 | + | if ((ae == ae)) | |
224 | 229 | then { | |
225 | - | let | |
226 | - | if (( | |
227 | - | then [StringEntry( | |
230 | + | let af = fromBase58String(ad) | |
231 | + | if ((af == af)) | |
232 | + | then [StringEntry(j(), ad)] | |
228 | 233 | else throw("Strict value is not equal to itself.") | |
229 | 234 | } | |
230 | 235 | else throw("Strict value is not equal to itself.") | |
232 | 237 | ||
233 | 238 | ||
234 | 239 | ||
235 | - | @Callable( | |
240 | + | @Callable(A) | |
236 | 241 | func confirmManager () = { | |
237 | - | let | |
238 | - | let | |
242 | + | let ag = y() | |
243 | + | let ah = if (isDefined(ag)) | |
239 | 244 | then true | |
240 | 245 | else throw("no pending manager") | |
241 | - | if (( | |
246 | + | if ((ah == ah)) | |
242 | 247 | then { | |
243 | - | let | |
248 | + | let ai = if ((A.callerPublicKey == value(ag))) | |
244 | 249 | then true | |
245 | 250 | else throw("you are not pending manager") | |
246 | - | if (( | |
247 | - | then [StringEntry( | |
251 | + | if ((ai == ai)) | |
252 | + | then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())] | |
248 | 253 | else throw("Strict value is not equal to itself.") | |
249 | 254 | } | |
250 | 255 | else throw("Strict value is not equal to itself.") | |
251 | 256 | } | |
252 | 257 | ||
253 | 258 | ||
254 | - | @Verifier( | |
255 | - | func | |
256 | - | let | |
257 | - | let | |
258 | - | if ($isInstanceOf( | |
259 | + | @Verifier(aj) | |
260 | + | func ak () = { | |
261 | + | let al = { | |
262 | + | let r = w() | |
263 | + | if ($isInstanceOf(r, "ByteVector")) | |
259 | 264 | then { | |
260 | - | let | |
261 | - | | |
265 | + | let B = r | |
266 | + | B | |
262 | 267 | } | |
263 | - | else if ($isInstanceOf( | |
264 | - | then | |
268 | + | else if ($isInstanceOf(r, "Unit")) | |
269 | + | then aj.senderPublicKey | |
265 | 270 | else throw("Match error") | |
266 | 271 | } | |
267 | - | sigVerify( | |
272 | + | sigVerify(aj.bodyBytes, aj.proofs[0], al) | |
268 | 273 | } | |
269 | 274 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = toBigInt(100000) | |
7 | 7 | ||
8 | 8 | func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let e = throw("Pool disabled") | |
12 | 12 | ||
13 | 13 | let f = throw("Pool is not exist") | |
14 | 14 | ||
15 | 15 | let g = throw("Slippage is too big") | |
16 | 16 | ||
17 | - | func h () = "%s__managerPublicKey" | |
17 | + | let h = throw("Test error here") | |
18 | + | ||
19 | + | func i () = "%s__managerPublicKey" | |
18 | 20 | ||
19 | 21 | ||
20 | - | func | |
22 | + | func j () = "%s__pendingManagerPublicKey" | |
21 | 23 | ||
22 | 24 | ||
23 | - | func | |
25 | + | func k () = "%s__factoryContract" | |
24 | 26 | ||
25 | 27 | ||
26 | - | let | |
28 | + | let l = addressFromStringValue(c(k())) | |
27 | 29 | ||
28 | - | func | |
30 | + | func m () = makeString(["%s", "feeLiquidityContractAddress"], a) | |
29 | 31 | ||
30 | 32 | ||
31 | - | func | |
33 | + | func n () = makeString(["%s", "feeLiquidity"], a) | |
32 | 34 | ||
33 | 35 | ||
34 | - | func | |
36 | + | func o () = makeString(["%s", "protocolFee"], a) | |
35 | 37 | ||
36 | 38 | ||
37 | - | func | |
38 | - | let | |
39 | - | if ($isInstanceOf( | |
39 | + | func p (q) = { | |
40 | + | let r = q | |
41 | + | if ($isInstanceOf(r, "Int")) | |
40 | 42 | then { | |
41 | - | let | |
42 | - | | |
43 | + | let s = r | |
44 | + | s | |
43 | 45 | } | |
44 | 46 | else throw("fail to cast into Int") | |
45 | 47 | } | |
46 | 48 | ||
47 | 49 | ||
48 | - | func | |
50 | + | func t (u,v) = makeString(["%d%d", toString(u), toString(v)], a) | |
49 | 51 | ||
50 | 52 | ||
51 | - | func | |
52 | - | let | |
53 | - | if ($isInstanceOf( | |
53 | + | func w () = { | |
54 | + | let r = getString(i()) | |
55 | + | if ($isInstanceOf(r, "String")) | |
54 | 56 | then { | |
55 | - | let | |
56 | - | fromBase58String( | |
57 | + | let x = r | |
58 | + | fromBase58String(x) | |
57 | 59 | } | |
58 | - | else if ($isInstanceOf( | |
60 | + | else if ($isInstanceOf(r, "Unit")) | |
59 | 61 | then unit | |
60 | 62 | else throw("Match error") | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | ||
64 | - | func | |
65 | - | let | |
66 | - | if ($isInstanceOf( | |
66 | + | func y () = { | |
67 | + | let r = getString(j()) | |
68 | + | if ($isInstanceOf(r, "String")) | |
67 | 69 | then { | |
68 | - | let | |
69 | - | fromBase58String( | |
70 | + | let x = r | |
71 | + | fromBase58String(x) | |
70 | 72 | } | |
71 | - | else if ($isInstanceOf( | |
73 | + | else if ($isInstanceOf(r, "Unit")) | |
72 | 74 | then unit | |
73 | 75 | else throw("Match error") | |
74 | 76 | } | |
75 | 77 | ||
76 | 78 | ||
77 | - | func | |
78 | - | let | |
79 | - | if ($isInstanceOf( | |
79 | + | func z (A) = { | |
80 | + | let r = w() | |
81 | + | if ($isInstanceOf(r, "ByteVector")) | |
80 | 82 | then { | |
81 | - | let | |
82 | - | ( | |
83 | + | let B = r | |
84 | + | (A.callerPublicKey == B) | |
83 | 85 | } | |
84 | - | else if ($isInstanceOf( | |
85 | - | then ( | |
86 | + | else if ($isInstanceOf(r, "Unit")) | |
87 | + | then (A.caller == this) | |
86 | 88 | else throw("Match error") | |
87 | 89 | } | |
88 | 90 | ||
89 | 91 | ||
90 | - | func | |
92 | + | func C (A) = if (z(A)) | |
91 | 93 | then true | |
92 | 94 | else throw("permission denied") | |
93 | 95 | ||
94 | 96 | ||
95 | - | func | |
97 | + | func D (E) = if ((E == "WAVES")) | |
96 | 98 | then wavesBalance(this).available | |
97 | - | else assetBalance(this, fromBase58String( | |
99 | + | else assetBalance(this, fromBase58String(E)) | |
98 | 100 | ||
99 | 101 | ||
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)) | |
110 | 115 | then { | |
111 | - | let | |
112 | - | let | |
113 | - | let | |
114 | - | if ($isInstanceOf( | |
115 | - | then | |
116 | - | else throw(($getType( | |
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")) | |
117 | 122 | } | |
118 | - | $Tuple2( | |
123 | + | $Tuple2(R, S) | |
119 | 124 | } | |
120 | - | else if (( | |
125 | + | else if ((O != unit)) | |
121 | 126 | then { | |
122 | - | let | |
123 | - | let | |
124 | - | $Tuple2( | |
127 | + | let R = true | |
128 | + | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
129 | + | $Tuple2(R, S) | |
125 | 130 | } | |
126 | 131 | else f | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | let | |
131 | - | if ($isInstanceOf( | |
132 | - | then | |
133 | - | else throw(($getType( | |
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")) | |
134 | 139 | } | |
135 | - | let | |
140 | + | let V = if (U) | |
136 | 141 | then true | |
137 | 142 | else e | |
138 | - | if (( | |
143 | + | if ((V == V)) | |
139 | 144 | then { | |
140 | - | let | |
141 | - | let | |
142 | - | let | |
143 | - | if ($isInstanceOf( | |
144 | - | then | |
145 | - | else throw(($getType( | |
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")) | |
146 | 151 | } | |
147 | - | $Tuple2(nil, | |
152 | + | $Tuple2(nil, X) | |
148 | 153 | } | |
149 | 154 | else throw("Strict value is not equal to itself.") | |
150 | 155 | } | |
151 | 156 | ||
152 | 157 | ||
153 | 158 | ||
154 | - | @Callable( | |
155 | - | func swap ( | |
156 | - | let | |
157 | - | let | |
159 | + | @Callable(A) | |
160 | + | func swap (Y,H,Z) = { | |
161 | + | let aa = value(A.payments[0]) | |
162 | + | let G = if ((aa.assetId == unit)) | |
158 | 163 | then toBytes("WAVES") | |
159 | - | else value( | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | let | |
164 | - | let | |
165 | - | let | |
166 | - | let | |
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)) | |
167 | 172 | then true | |
168 | 173 | else throw("exactly 1 payment are expected")] | |
169 | - | if (( | |
174 | + | if ((ab == ab)) | |
170 | 175 | then { | |
171 | - | let | |
172 | - | let | |
173 | - | let | |
176 | + | let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil) | |
177 | + | let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil) | |
178 | + | let ac = if ((N != unit)) | |
174 | 179 | then { | |
175 | - | let | |
176 | - | let | |
177 | - | let | |
178 | - | if ($isInstanceOf( | |
179 | - | then | |
180 | - | else throw(($getType( | |
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")) | |
181 | 186 | } | |
182 | - | $Tuple2( | |
187 | + | $Tuple2(R, S) | |
183 | 188 | } | |
184 | - | else if (( | |
189 | + | else if ((O != unit)) | |
185 | 190 | then { | |
186 | - | let | |
187 | - | let | |
188 | - | $Tuple2( | |
191 | + | let R = true | |
192 | + | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
193 | + | $Tuple2(R, S) | |
189 | 194 | } | |
190 | 195 | else f | |
191 | - | let | |
192 | - | let | |
193 | - | let | |
194 | - | let | |
195 | - | if ($isInstanceOf( | |
196 | - | then | |
197 | - | else throw(($getType( | |
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")) | |
198 | 203 | } | |
199 | - | let | |
204 | + | let V = if (U) | |
200 | 205 | then true | |
201 | 206 | else e | |
202 | - | if (( | |
207 | + | if ((V == V)) | |
203 | 208 | then { | |
204 | - | let | |
205 | - | let | |
206 | - | let | |
207 | - | if ($isInstanceOf( | |
208 | - | then | |
209 | - | else throw(($getType( | |
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")) | |
210 | 215 | } | |
211 | - | $Tuple2(nil, | |
216 | + | $Tuple2(nil, X) | |
212 | 217 | } | |
213 | 218 | else throw("Strict value is not equal to itself.") | |
214 | 219 | } | |
215 | 220 | else throw("Strict value is not equal to itself.") | |
216 | 221 | } | |
217 | 222 | ||
218 | 223 | ||
219 | 224 | ||
220 | - | @Callable( | |
221 | - | func setManager ( | |
222 | - | let | |
223 | - | if (( | |
225 | + | @Callable(A) | |
226 | + | func setManager (ad) = { | |
227 | + | let ae = C(A) | |
228 | + | if ((ae == ae)) | |
224 | 229 | then { | |
225 | - | let | |
226 | - | if (( | |
227 | - | then [StringEntry( | |
230 | + | let af = fromBase58String(ad) | |
231 | + | if ((af == af)) | |
232 | + | then [StringEntry(j(), ad)] | |
228 | 233 | else throw("Strict value is not equal to itself.") | |
229 | 234 | } | |
230 | 235 | else throw("Strict value is not equal to itself.") | |
231 | 236 | } | |
232 | 237 | ||
233 | 238 | ||
234 | 239 | ||
235 | - | @Callable( | |
240 | + | @Callable(A) | |
236 | 241 | func confirmManager () = { | |
237 | - | let | |
238 | - | let | |
242 | + | let ag = y() | |
243 | + | let ah = if (isDefined(ag)) | |
239 | 244 | then true | |
240 | 245 | else throw("no pending manager") | |
241 | - | if (( | |
246 | + | if ((ah == ah)) | |
242 | 247 | then { | |
243 | - | let | |
248 | + | let ai = if ((A.callerPublicKey == value(ag))) | |
244 | 249 | then true | |
245 | 250 | else throw("you are not pending manager") | |
246 | - | if (( | |
247 | - | then [StringEntry( | |
251 | + | if ((ai == ai)) | |
252 | + | then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())] | |
248 | 253 | else throw("Strict value is not equal to itself.") | |
249 | 254 | } | |
250 | 255 | else throw("Strict value is not equal to itself.") | |
251 | 256 | } | |
252 | 257 | ||
253 | 258 | ||
254 | - | @Verifier( | |
255 | - | func | |
256 | - | let | |
257 | - | let | |
258 | - | if ($isInstanceOf( | |
259 | + | @Verifier(aj) | |
260 | + | func ak () = { | |
261 | + | let al = { | |
262 | + | let r = w() | |
263 | + | if ($isInstanceOf(r, "ByteVector")) | |
259 | 264 | then { | |
260 | - | let | |
261 | - | | |
265 | + | let B = r | |
266 | + | B | |
262 | 267 | } | |
263 | - | else if ($isInstanceOf( | |
264 | - | then | |
268 | + | else if ($isInstanceOf(r, "Unit")) | |
269 | + | then aj.senderPublicKey | |
265 | 270 | else throw("Match error") | |
266 | 271 | } | |
267 | - | sigVerify( | |
272 | + | sigVerify(aj.bodyBytes, aj.proofs[0], al) | |
268 | 273 | } | |
269 | 274 |
github/deemru/w8io/169f3d6 87.49 ms ◑