tx · Dw5HPqqhBvepzspaCV3PuvhK4BHpbVxt84H7oiRYqVi8 3N3PoX8z2Mvu5YbaqZmtyF3dRFjqvhRkB3M: -0.01400000 Waves 2022.03.10 17:50 [1957993] smart account 3N3PoX8z2Mvu5YbaqZmtyF3dRFjqvhRkB3M > SELF 0.00000000 Waves
{ "type": 13, "id": "Dw5HPqqhBvepzspaCV3PuvhK4BHpbVxt84H7oiRYqVi8", "fee": 1400000, "feeAssetId": null, "timestamp": 1646923828876, "version": 2, "chainId": 84, "sender": "3N3PoX8z2Mvu5YbaqZmtyF3dRFjqvhRkB3M", "senderPublicKey": "FWZMxrtn6KRrWMPXmQPqDg5eRzwB2YvHhMjMJpwnLmBi", "proofs": [ "2iSL6zsw2HtdmcpW2gx4UErtsfSh3b5uqw42adJt1Dnh7GVDLX9hYLoQAQvmYkDKicb4whnTLUCGdHYdFeBoaa95" ], "script": "base64:AAIFAAAAAAAAB4oIAhIDCgEIEgASAwoBCBIDCgEIEgAaFgoBQRIRaW50ZXJuYWxCYXNlQXNzZXQaEgoBQhINa2V5UG9vbENvbmZpZxoOCgFDEglpQW10QXNzZXQaEAoBRBILaVByaWNlQXNzZXQaGAoBRRITa2V5QWxsUG9vbHNTaHV0ZG93bhoSCgFGEg1rZXlQb29sV2VpZ2h0GhQKAUcSD2NvbnRyYWN0QWRkcmVzcxoYCgFIEhNrZXlNYW5hZ2VyUHVibGljS2V5Gh8KAUkSGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5GhQKAUoSD2ZhY3RvcnlDb250cmFjdBoTCgFLEg5jb252ZXJ0QXNzZXRJZBoWCgFMEhFkYXRhUHV0QWN0aW9uSW5mbxoOCgFNEglpbkFzc2V0SWQaDwoBThIKaW5Bc3NldEFtdBoNCgFPEgh0eEhlaWdodBoQCgFQEgt0eFRpbWVzdGFtcBoZCgFREhRkYXRhSW52ZXN0QWN0aW9uSW5mbxoWCgFSEhFvdXRBbW91bnRBc3NldEFtdBoVCgFTEhBvdXRQc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8gaXRzZWxmLgAAAAJhZgEAAAAOY29uZmlybU1hbmFnZXIAAAAABAAAAAJhTgkBAAAAAmFkAAAAAAQAAAACYU8DCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAACYU4GCQAAAgAAAAECAAAAEk5vIHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACYU8FAAAAAmFPBAAAAAJhUAMJAAAAAAAAAggFAAAAAmFmAAAAD2NhbGxlclB1YmxpY0tleQkBAAAABXZhbHVlAAAAAQUAAAACYU4GCQAAAgAAAAECAAAAG1lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACYVAFAAAAAmFQCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAFIAAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJhTgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAABSQAAAAAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJhUQEAAAACYVIAAAAABAAAAAJhUwQAAAABVgkBAAAAAmFiAAAAAAMJAAABAAAAAgUAAAABVgIAAAAKQnl0ZVZlY3RvcgQAAAACYWgFAAAAAVYFAAAAAmFoAwkAAAEAAAACBQAAAAFWAgAAAARVbml0CAUAAAACYVEAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJhUQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmFRAAAABnByb29mcwAAAAAAAAAAAAUAAAACYVP9P6oS", "height": 1957993, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6yAo28f4tA5JpJof7PCMZ2ipYSe24GhZLhVwkZnvPN9k Next: 12fwpVRbQWHR5SK2n69N2w7uASeGUsMqxMHAUhRGWKZA Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = 4 | |
9 | 9 | ||
10 | - | let d = | |
10 | + | let d = 1 | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 2 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 3 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 4 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 5 | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = 6 | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 7 | |
23 | 23 | ||
24 | - | let k = | |
24 | + | let k = 8 | |
25 | 25 | ||
26 | - | let l = | |
26 | + | let l = 9 | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = 10 | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 11 | |
31 | 31 | ||
32 | - | let o = 8 | |
33 | - | ||
34 | - | let p = 9 | |
35 | - | ||
36 | - | let q = 10 | |
37 | - | ||
38 | - | func r (s) = valueOrErrorMessage(getString(s), (("mandatory this." + s) + " is not defined")) | |
32 | + | func o (p,q) = ((("%s%s%s__P__" + p) + "__") + q) | |
39 | 33 | ||
40 | 34 | ||
41 | - | func | |
35 | + | func r (p,q) = ((("%s%s%s__invest__" + p) + "__") + q) | |
42 | 36 | ||
43 | 37 | ||
44 | - | func | |
38 | + | func s (p,t) = ((("%s%s%s__total__" + p) + "__") + t) | |
45 | 39 | ||
46 | 40 | ||
47 | - | func | |
41 | + | func u () = "%s__factoryContract" | |
48 | 42 | ||
49 | 43 | ||
50 | - | func x (y) = { | |
51 | - | let z = y | |
52 | - | if ($isInstanceOf(z, "List[Any]")) | |
53 | - | then { | |
54 | - | let A = z | |
55 | - | A | |
56 | - | } | |
57 | - | else throw("fail to cast into List[Any]") | |
58 | - | } | |
44 | + | func v (p,t) = (((("%s%s%s__" + p) + "__") + t) + "__slippageCumulative") | |
59 | 45 | ||
60 | 46 | ||
61 | - | func B (y) = { | |
62 | - | let z = y | |
63 | - | if ($isInstanceOf(z, "Int")) | |
64 | - | then { | |
65 | - | let C = z | |
66 | - | C | |
67 | - | } | |
68 | - | else throw("fail to cast into Int") | |
69 | - | } | |
47 | + | func w () = "%s__factoryConfig" | |
70 | 48 | ||
71 | 49 | ||
72 | - | func D (y) = { | |
73 | - | let z = y | |
74 | - | if ($isInstanceOf(z, "String")) | |
50 | + | func x (y) = (("%s%s%s__" + y) + "__mappings__poolContract2PoolAssets") | |
51 | + | ||
52 | + | ||
53 | + | func z (A) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(A)) | |
54 | + | ||
55 | + | ||
56 | + | func B (C,D) = (((("%d%d%s__" + C) + "__") + D) + "__config") | |
57 | + | ||
58 | + | ||
59 | + | func E () = "%s__shutdown" | |
60 | + | ||
61 | + | ||
62 | + | func F (G) = ("%s%s__poolWeight__" + G) | |
63 | + | ||
64 | + | ||
65 | + | func H () = "%s__managerPublicKey" | |
66 | + | ||
67 | + | ||
68 | + | func I () = "%s__pendingManagerPublicKey" | |
69 | + | ||
70 | + | ||
71 | + | let J = addressFromStringValue(valueOrErrorMessage(getString(this, u()), "No Factory Acc found.")) | |
72 | + | ||
73 | + | func K (t) = if (!(isDefined(t))) | |
74 | + | then "WAVES" | |
75 | + | else t | |
76 | + | ||
77 | + | ||
78 | + | func L (M,N,O,P) = makeString(["%s%d%d%d", M, toString(N), toString(O), toString(P)], a) | |
79 | + | ||
80 | + | ||
81 | + | func Q (R,S,O,P) = makeString(["%d%d%d%d", toString(R), toString(S), toString(O), toString(P)], a) | |
82 | + | ||
83 | + | ||
84 | + | func T (U) = { | |
85 | + | let V = U | |
86 | + | if ($isInstanceOf(V, "String")) | |
75 | 87 | then { | |
76 | - | let | |
77 | - | | |
88 | + | let W = V | |
89 | + | W | |
78 | 90 | } | |
79 | 91 | else throw("fail to cast into String") | |
80 | 92 | } | |
81 | 93 | ||
82 | 94 | ||
83 | - | func | |
95 | + | func X (Y,Z,aa) = fraction(Y, Z, aa) | |
84 | 96 | ||
85 | 97 | ||
86 | - | func G () = "%s__managerPublicKey" | |
87 | - | ||
88 | - | ||
89 | - | func H () = "%s__pendingManagerPublicKey" | |
90 | - | ||
91 | - | ||
92 | - | let I = 1 | |
93 | - | ||
94 | - | let J = 2 | |
95 | - | ||
96 | - | let K = 3 | |
97 | - | ||
98 | - | let L = 4 | |
99 | - | ||
100 | - | let M = 5 | |
101 | - | ||
102 | - | let N = 6 | |
103 | - | ||
104 | - | let O = 7 | |
105 | - | ||
106 | - | let P = 8 | |
107 | - | ||
108 | - | func Q () = "%s__factoryConfig" | |
109 | - | ||
110 | - | ||
111 | - | func R (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e) | |
112 | - | ||
113 | - | ||
114 | - | func T () = "%s__lpTokensList" | |
115 | - | ||
116 | - | ||
117 | - | func U (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e) | |
118 | - | ||
119 | - | ||
120 | - | func V (W) = makeString(["%s%s", "poolWeight", W], e) | |
121 | - | ||
122 | - | ||
123 | - | func X () = addressFromStringValue(r(F())) | |
124 | - | ||
125 | - | ||
126 | - | func Y () = split(valueOrElse(getString(X(), T()), ""), e) | |
127 | - | ||
128 | - | ||
129 | - | func Z (aa) = split(t(aa, Q()), e) | |
130 | - | ||
131 | - | ||
132 | - | func ab (ac) = addressFromStringValue(ac[J]) | |
133 | - | ||
134 | - | ||
135 | - | func ad (ac) = addressFromStringValue(ac[M]) | |
136 | - | ||
137 | - | ||
138 | - | func ae (ac) = addressFromStringValue(ac[I]) | |
139 | - | ||
140 | - | ||
141 | - | func af (ac) = addressFromStringValue(ac[P]) | |
142 | - | ||
143 | - | ||
144 | - | func ag () = "%s__config" | |
145 | - | ||
146 | - | ||
147 | - | func ah () = "%s%s__stats__activeTotalLocked" | |
148 | - | ||
149 | - | ||
150 | - | func ai () = "%s%s__stats__locksDurationSumInBlocks" | |
151 | - | ||
152 | - | ||
153 | - | func aj () = "%s%s__stats__locksCount" | |
154 | - | ||
155 | - | ||
156 | - | func ak () = "%s%s__stats__activeUsersCount" | |
157 | - | ||
158 | - | ||
159 | - | func al (am) = makeString(["%s%s%s__mapping__user2num", am], e) | |
160 | - | ||
161 | - | ||
162 | - | func an (ao) = makeString(["%s%s%s__mapping__num2user", ao], e) | |
163 | - | ||
164 | - | ||
165 | - | func ap (aq) = makeString(["%s%d%s__paramByUserNum", aq, "amount"], e) | |
166 | - | ||
167 | - | ||
168 | - | func ar (aq) = makeString(["%s%d%s__paramByUserNum", aq, "start"], e) | |
169 | - | ||
170 | - | ||
171 | - | func as (aq) = makeString(["%s%d%s__paramByUserNum", aq, "duration"], e) | |
172 | - | ||
173 | - | ||
174 | - | func at (aq) = makeString(["%s%d%s__paramByUserNum", aq, "k"], e) | |
175 | - | ||
176 | - | ||
177 | - | func au (aq) = makeString(["%s%d%s__paramByUserNum", aq, "b"], e) | |
178 | - | ||
179 | - | ||
180 | - | func av (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "k", aw], e) | |
181 | - | ||
182 | - | ||
183 | - | func ax (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "b", aw], e) | |
184 | - | ||
185 | - | ||
186 | - | func ay (aq) = makeString(["%s%d__userBoostEmissionLastInt", aq], e) | |
187 | - | ||
188 | - | ||
189 | - | func az (aq) = makeString(["%s%d__maxBoostInt", aq], e) | |
190 | - | ||
191 | - | ||
192 | - | func aA () = "%s%s__maxBoostInt__total" | |
193 | - | ||
194 | - | ||
195 | - | func aB (aq) = makeString(["%s%d__userBoostAvaliableToClaimTotal", aq], e) | |
196 | - | ||
197 | - | ||
198 | - | func aC (aq) = makeString(["%s%d__userBoostClaimed", aq], e) | |
199 | - | ||
200 | - | ||
201 | - | func aD () = "%s%s__gwxCached__total" | |
202 | - | ||
203 | - | ||
204 | - | func aE (aF,aG) = makeString(["%s%s%s__staked", aF, aG], e) | |
205 | - | ||
206 | - | ||
207 | - | func aH (aG) = ("%s%s%s__staked__total__" + aG) | |
208 | - | ||
209 | - | ||
210 | - | func aI (aG,aF) = makeString(["%s%s%s__claimed", aF, aG], e) | |
211 | - | ||
212 | - | ||
213 | - | func aJ (aG,aF) = makeString(["%s%s%s__claimedMinReward", aF, aG], e) | |
214 | - | ||
215 | - | ||
216 | - | func aK (aG,aF) = makeString(["%s%s%s__claimedBoostReward", aF, aG], e) | |
217 | - | ||
218 | - | ||
219 | - | func aL (aM,s) = valueOrElse(getInteger(aM, s), 0) | |
220 | - | ||
221 | - | ||
222 | - | func aN () = "%s%s__ratePerBlock__current" | |
223 | - | ||
224 | - | ||
225 | - | func aO () = "%s%s__ratePerBlockMax__current" | |
226 | - | ||
227 | - | ||
228 | - | func aP () = "%s%s__emission__startBlock" | |
229 | - | ||
230 | - | ||
231 | - | func aQ () = "%s%s__emission__duration" | |
232 | - | ||
233 | - | ||
234 | - | func aR () = "%s%s__emission__endBlock" | |
235 | - | ||
236 | - | ||
237 | - | let aS = X() | |
238 | - | ||
239 | - | let aT = Z(aS) | |
240 | - | ||
241 | - | let aU = ad(aT) | |
242 | - | ||
243 | - | let aM = ae(aT) | |
244 | - | ||
245 | - | let aV = af(aT) | |
246 | - | ||
247 | - | let aW = ab(aT) | |
248 | - | ||
249 | - | func aX (aY) = { | |
250 | - | let aZ = t(aS, U(aY)) | |
251 | - | let ba = b | |
252 | - | let bb = getIntegerValue(aS, V(aZ)) | |
253 | - | let bc = w(aU, aN()) | |
254 | - | let bd = w(aU, aO()) | |
255 | - | let be = 3 | |
256 | - | let bf = (fraction(bc, bb, ba) / be) | |
257 | - | let bg = fraction(bd, bb, ba) | |
258 | - | let bh = (be * b) | |
259 | - | let bi = v(aM, aH(aY)) | |
260 | - | [bf, bh, bi] | |
261 | - | } | |
262 | - | ||
263 | - | ||
264 | - | func bj (bk,bl,bm) = { | |
265 | - | let bn = fraction(bl, b, bm) | |
266 | - | let bo = fraction(bk, bn, b) | |
267 | - | [bo] | |
268 | - | } | |
269 | - | ||
270 | - | ||
271 | - | func bp () = { | |
272 | - | let z = getString(G()) | |
273 | - | if ($isInstanceOf(z, "String")) | |
98 | + | func ab () = { | |
99 | + | let V = getString(H()) | |
100 | + | if ($isInstanceOf(V, "String")) | |
274 | 101 | then { | |
275 | - | let | |
276 | - | fromBase58String( | |
102 | + | let ac = V | |
103 | + | fromBase58String(ac) | |
277 | 104 | } | |
278 | - | else if ($isInstanceOf( | |
105 | + | else if ($isInstanceOf(V, "Unit")) | |
279 | 106 | then unit | |
280 | 107 | else throw("Match error") | |
281 | 108 | } | |
282 | 109 | ||
283 | 110 | ||
284 | - | func | |
285 | - | let | |
286 | - | if ($isInstanceOf( | |
111 | + | func ad () = { | |
112 | + | let V = getString(I()) | |
113 | + | if ($isInstanceOf(V, "String")) | |
287 | 114 | then { | |
288 | - | let | |
289 | - | fromBase58String( | |
115 | + | let ac = V | |
116 | + | fromBase58String(ac) | |
290 | 117 | } | |
291 | - | else if ($isInstanceOf( | |
118 | + | else if ($isInstanceOf(V, "Unit")) | |
292 | 119 | then unit | |
293 | 120 | else throw("Match error") | |
294 | 121 | } | |
295 | 122 | ||
296 | 123 | ||
297 | - | func | |
298 | - | let | |
299 | - | let | |
300 | - | if ($isInstanceOf( | |
124 | + | func ae (af) = { | |
125 | + | let ag = throw("Permission denied") | |
126 | + | let V = ab() | |
127 | + | if ($isInstanceOf(V, "ByteVector")) | |
301 | 128 | then { | |
302 | - | let | |
303 | - | if (( | |
129 | + | let ah = V | |
130 | + | if ((af.callerPublicKey == ah)) | |
304 | 131 | then true | |
305 | - | else | |
132 | + | else ag | |
306 | 133 | } | |
307 | - | else if ($isInstanceOf( | |
308 | - | then if (( | |
134 | + | else if ($isInstanceOf(V, "Unit")) | |
135 | + | then if ((af.caller == this)) | |
309 | 136 | then true | |
310 | - | else | |
137 | + | else ag | |
311 | 138 | else throw("Match error") | |
312 | 139 | } | |
313 | 140 | ||
314 | 141 | ||
315 | - | @Callable(bt) | |
316 | - | func constructor (bw) = if ((bt.caller != this)) | |
317 | - | then throw("not authorized") | |
318 | - | else [StringEntry(F(), bw)] | |
319 | - | ||
320 | - | ||
321 | - | ||
322 | - | @Callable(bt) | |
323 | - | func currentRewardRateREADONLY (aY) = { | |
324 | - | let bx = aX(aY) | |
325 | - | let bc = bx[0] | |
326 | - | let bh = bx[1] | |
327 | - | let bi = bx[2] | |
328 | - | $Tuple2(nil, makeString(["%d%d%d", toString(bc), toString(bh), toString(bi)], e)) | |
142 | + | @Callable(af) | |
143 | + | func constructor (J) = { | |
144 | + | let ai = ae(af) | |
145 | + | if ((ai == ai)) | |
146 | + | then [StringEntry(u(), J)] | |
147 | + | else throw("Strict value is not equal to itself.") | |
329 | 148 | } | |
330 | 149 | ||
331 | 150 | ||
332 | 151 | ||
333 | - | @Callable(bt) | |
334 | - | func currentUserRewardRateREADONLY (aY,am) = { | |
335 | - | let bx = aX(aY) | |
336 | - | let bc = bx[0] | |
337 | - | let bh = bx[1] | |
338 | - | let bi = bx[2] | |
339 | - | let by = v(aM, aE(am, aY)) | |
340 | - | let bz = split(D(invoke(aM, "claimWxREADONLY", [aY, am], nil)), e) | |
341 | - | let bA = valueOrErrorMessage(parseInt(bz[5]), "couldn't parse minRewardPart") | |
342 | - | let bB = valueOrErrorMessage(parseInt(bz[6]), "couldn't parse boostRewardPart") | |
343 | - | let bC = bz[7] | |
344 | - | let bD = if ((bB == 0)) | |
345 | - | then (1 * b) | |
346 | - | else fraction((bA + bB), b, bA) | |
347 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(bc), toString(bh), toString(bi), toString(by), toString(bD), bC], e)) | |
152 | + | @Callable(af) | |
153 | + | func put () = { | |
154 | + | let aj = toString(af.caller) | |
155 | + | let ak = value(af.payments[0]) | |
156 | + | let al = if (!(isDefined(ak.assetId))) | |
157 | + | then "WAVES" | |
158 | + | else toBase58String(value(ak.assetId)) | |
159 | + | let am = ak.amount | |
160 | + | let an = split(valueOrErrorMessage(getString(J, x(aj)), "Invalid caller"), a) | |
161 | + | let ao = parseIntValue(an[1]) | |
162 | + | let ap = parseIntValue(an[2]) | |
163 | + | let aq = valueOrErrorMessage(getString(J, z(ao)), "Cannot find asset") | |
164 | + | let ar = valueOrErrorMessage(getString(J, z(ap)), "Cannot find asset") | |
165 | + | let as = valueOrElse(getInteger(this, s(aj, al)), 0) | |
166 | + | let at = valueOrElse(getInteger(this, v(aj, al)), 0) | |
167 | + | [StringEntry(o(aj, toBase58String(af.transactionId)), L(al, am, height, lastBlock.timestamp)), IntegerEntry(s(aj, al), (as + am)), IntegerEntry(v(aj, al), (at + am))] | |
348 | 168 | } | |
349 | 169 | ||
350 | 170 | ||
351 | 171 | ||
352 | - | @Callable(bt) | |
353 | - | func claimedRewardREADONLY (am) = { | |
354 | - | let bE = Y() | |
355 | - | let bF = "%s%d%d%d%s" | |
356 | - | func bG (bH,bI) = { | |
357 | - | let bJ = aJ(bI, am) | |
358 | - | let bK = aK(bI, am) | |
359 | - | let bL = valueOrElse(getInteger(aM, bJ), 0) | |
360 | - | let bM = valueOrElse(getInteger(aM, bK), 0) | |
361 | - | let bN = 0 | |
362 | - | makeString([(bF + bH), bI, toString(bL), toString(bM), toString(bN), "end"], e) | |
363 | - | } | |
364 | - | ||
365 | - | let bO = { | |
366 | - | let bP = bE | |
367 | - | let bQ = size(bP) | |
368 | - | let bR = "%s" | |
369 | - | func bS (bT,bU) = if ((bU >= bQ)) | |
370 | - | then bT | |
371 | - | else bG(bT, bP[bU]) | |
372 | - | ||
373 | - | func bV (bT,bU) = if ((bU >= bQ)) | |
374 | - | then bT | |
375 | - | else throw("List size exceeds 10") | |
376 | - | ||
377 | - | bV(bS(bS(bS(bS(bS(bS(bS(bS(bS(bS(bR, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
378 | - | } | |
379 | - | $Tuple2(nil, ((bO + e) + am)) | |
172 | + | @Callable(af) | |
173 | + | func invest (au) = { | |
174 | + | let p = valueOrErrorMessage(addressFromString(au), "invalid pool address") | |
175 | + | let an = split(valueOrErrorMessage(getString(J, x(au)), "Invalid pool passed."), a) | |
176 | + | let av = valueOrErrorMessage(getString(J, z(parseIntValue(an[1]))), "No asset mapping found") | |
177 | + | let aw = valueOrErrorMessage(getString(J, z(parseIntValue(an[2]))), "No asset mapping found") | |
178 | + | let ax = valueOrElse(getInteger(this, s(au, av)), 0) | |
179 | + | let ay = valueOrElse(getInteger(this, s(au, aw)), 0) | |
180 | + | let az = invoke(p, "evaluatePutByPriceAssetREADONLY", [ay], nil) | |
181 | + | let aA = invoke(p, "evaluatePutByAmountAssetREADONLY", [ax], nil) | |
182 | + | let aB = 7 | |
183 | + | let aC = 8 | |
184 | + | let aD = valueOrErrorMessage(parseIntValue(split(T(az), a)[aB]), "fail to parse estimated amAsset amount") | |
185 | + | let aE = valueOrErrorMessage(parseIntValue(split(T(aA), a)[aC]), "fail to parse estimated prAsset amount") | |
186 | + | let aF = if ((ax >= aD)) | |
187 | + | then $Tuple2(aD, ay) | |
188 | + | else $Tuple2(ax, aE) | |
189 | + | let aG = aF._1 | |
190 | + | let aH = aF._2 | |
191 | + | let aI = if ((av == "WAVES")) | |
192 | + | then unit | |
193 | + | else fromBase58String(av) | |
194 | + | let aJ = if ((aw == "WAVES")) | |
195 | + | then unit | |
196 | + | else fromBase58String(aw) | |
197 | + | let aK = invoke(p, "putForFree", [1000], [AttachedPayment(aI, aG), AttachedPayment(aJ, aH)]) | |
198 | + | if ((aK == aK)) | |
199 | + | then [StringEntry(r(au, toBase58String(af.transactionId)), Q(aG, aH, height, lastBlock.timestamp)), IntegerEntry(s(au, av), (ax - aG)), IntegerEntry(s(au, aw), (ay - aH))] | |
200 | + | else throw("Strict value is not equal to itself.") | |
380 | 201 | } | |
381 | 202 | ||
382 | 203 | ||
383 | 204 | ||
384 | - | @Callable(bt) | |
385 | - | func calcBoostREADONLY (bW,bX,bY,bZ,ca) = { | |
386 | - | let cb = aV | |
387 | - | let cc = "empty" | |
388 | - | let cd = parseIntValue(split(t(aW, ag()), e)[4]) | |
389 | - | let aG = if ((bZ == "")) | |
390 | - | then cc | |
391 | - | else bZ | |
392 | - | let aF = if ((ca == "")) | |
393 | - | then cc | |
394 | - | else ca | |
395 | - | let ce = valueOrElse(getString(aW, al(ca)), cc) | |
396 | - | let cf = valueOrElse(getInteger(aW, ap(ce)), 0) | |
397 | - | let cg = valueOrElse(getInteger(aW, ar(ce)), height) | |
398 | - | let bl = valueOrElse(getInteger(aW, as(ce)), 0) | |
399 | - | let ch = (cg + bl) | |
400 | - | let ci = max([(ch - height), 0]) | |
401 | - | let cj = (cf + bW) | |
402 | - | let ck = min([(ci + bX), cd]) | |
403 | - | let cl = B(x(invoke(aW, "gwxUserInfoREADONLY", [aF], nil))[0]) | |
404 | - | let cm = bj(cj, ck, cd)[0] | |
405 | - | let cn = x(invoke(cb, "calcGwxParamsREADONLY", [cm, height, ck], nil)) | |
406 | - | let co = (cm - cl) | |
407 | - | let cp = B(cn[0]) | |
408 | - | let cq = B(cn[1]) | |
409 | - | let aw = toString(B(cn[2])) | |
410 | - | let cr = aA() | |
411 | - | let cs = aD() | |
412 | - | let ct = ((cm * ck) / 2) | |
413 | - | let cu = v(aW, cr) | |
414 | - | let cv = valueOrElse(getInteger(aW, cs), 0) | |
415 | - | let cw = 1000 | |
416 | - | let cx = (w(aU, aN()) * cw) | |
417 | - | let cy = aE(aF, aG) | |
418 | - | let cz = aH(aG) | |
419 | - | let cA = aL(aM, cy) | |
420 | - | let cB = aL(aM, cz) | |
421 | - | let cC = (cA + bY) | |
422 | - | let cD = (cB + bY) | |
423 | - | let bb = if ((aG != cc)) | |
205 | + | @Callable(af) | |
206 | + | func setManager (aL) = { | |
207 | + | let ai = ae(af) | |
208 | + | if ((ai == ai)) | |
424 | 209 | then { | |
425 | - | let aZ = valueOrErrorMessage(getString(aS, R(aG)), ("unsupported lp asset " + aG)) | |
426 | - | getIntegerValue(aS, V(aZ)) | |
427 | - | } | |
428 | - | else 0 | |
429 | - | let cE = fraction(cx, bb, (f * 3)) | |
430 | - | let cF = if ((cD != 0)) | |
431 | - | then fraction(cE, b, cD) | |
432 | - | else 0 | |
433 | - | let cG = fraction(cF, cC, b) | |
434 | - | let cH = (cE * 2) | |
435 | - | let cI = fraction(cm, cH, (cv + co)) | |
436 | - | let cJ = min([cI, (cG * 2)]) | |
437 | - | let cK = if ((cG == 0)) | |
438 | - | then (1 * b) | |
439 | - | else fraction((cJ + cG), b, cG) | |
440 | - | let bC = makeString([("lpAssetIdStr=" + aG), ("userAddressStr=" + aF), ("userNumStr=" + ce), ("userAmount=" + toString(cf)), ("userAmountNew=" + toString(cj)), ("lockDurationNew=" + toString(ck)), ("gWxAmountStart=" + toString(cm)), ("tmpUserBoostPerBlockX3=" + toString(cI)), ("stakedByUserNew=" + toString(cC)), ("stakedTotalNew=" + toString(cD)), ("poolWeight=" + toString(bb)), ("wxPerLpX3=" + toString(cF)), ("poolWxEmissionPerBlockX3=" + toString(cE)), ("userWxPerBlockX3=" + toString(cG)), ("gWxAmountDiff=" + toString(co)), ("totalCachedGwx=" + toString(cv)), ("userCurrgWxAmount=" + toString(cl))], "::") | |
441 | - | $Tuple2(nil, makeString(["%d%d%s", toString(cm), toString(cK), bC], e)) | |
442 | - | } | |
443 | - | ||
444 | - | ||
445 | - | ||
446 | - | @Callable(bt) | |
447 | - | func wxEmissionStatsREADONLY () = { | |
448 | - | let cL = toString(b) | |
449 | - | let cM = "1" | |
450 | - | let bc = w(aU, aN()) | |
451 | - | let cN = w(aU, aP()) | |
452 | - | let cO = if ((cN > height)) | |
453 | - | then 0 | |
454 | - | else (height - cN) | |
455 | - | let cP = (1440 * 365) | |
456 | - | let cQ = (201000000 * b) | |
457 | - | let cR = if ((cO > cP)) | |
458 | - | then cQ | |
459 | - | else fraction(cQ, cO, cP) | |
460 | - | let cS = ((bc * cO) + cR) | |
461 | - | let cT = v(aW, ah()) | |
462 | - | let cU = v(aW, ai()) | |
463 | - | let cV = v(aW, aj()) | |
464 | - | $Tuple2(nil, makeString(["%d%d%d%d", toString(cS), toString(cT), toString(cU), toString(cV)], e)) | |
465 | - | } | |
466 | - | ||
467 | - | ||
468 | - | ||
469 | - | @Callable(bt) | |
470 | - | func poolStatsREADONLY (cW) = { | |
471 | - | let cX = addressFromStringValue(t(aS, U(cW))) | |
472 | - | let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil)) | |
473 | - | let aY = fromBase58String(D(cY[j])) | |
474 | - | let cZ = D(cY[k]) | |
475 | - | let da = D(cY[l]) | |
476 | - | let db = D(cY[o]) | |
477 | - | let dc = D(cY[p]) | |
478 | - | let dd = parseIntValue(D(cY[m])) | |
479 | - | let de = parseIntValue(D(cY[n])) | |
480 | - | let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity | |
481 | - | let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [cZ], nil)) | |
482 | - | let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [da], nil)) | |
483 | - | let di = if ((df == 0)) | |
484 | - | then [toString(g), toString(g), toString(g)] | |
485 | - | else x(invoke(cX, "calcPricesWrapperREADONLY", [dg, dh, df], nil)) | |
486 | - | let dj = 0 | |
487 | - | let dk = B(invoke(cX, "fromX18WrapperREADONLY", [di[1], b], nil)) | |
488 | - | let dl = B(invoke(cX, "fromX18WrapperREADONLY", [di[2], b], nil)) | |
489 | - | let bb = getIntegerValue(aS, V(toString(cX))) | |
490 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dg), toString(dh), toString(df), toString(dj), toString(dk), toString(dl), toString(bb)], e)) | |
491 | - | } | |
492 | - | ||
493 | - | ||
494 | - | ||
495 | - | @Callable(bt) | |
496 | - | func poolEvaluatePutByAmountAssetREADONLY (cW,dm) = { | |
497 | - | let cX = addressFromStringValue(t(aS, U(cW))) | |
498 | - | let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil)) | |
499 | - | let aY = fromBase58String(D(cY[j])) | |
500 | - | let dn = D(cY[k]) | |
501 | - | let do = fromBase58String(dn) | |
502 | - | let dp = D(cY[l]) | |
503 | - | let dq = fromBase58String(dp) | |
504 | - | let dd = parseIntValue(D(cY[m])) | |
505 | - | let de = parseIntValue(D(cY[n])) | |
506 | - | let dr = D(cY[i]) | |
507 | - | let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity | |
508 | - | let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil)) | |
509 | - | let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil)) | |
510 | - | let ds = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dg, dd], nil))) | |
511 | - | let dt = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dh, de], nil))) | |
512 | - | let du = if ((df == 0)) | |
513 | - | then g | |
514 | - | else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dt), toString(ds)], nil))) | |
515 | - | let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil)) | |
516 | - | let dv = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dm, dd], nil))) | |
517 | - | let dw = fraction(dv, du, d) | |
518 | - | let dx = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dw), de], nil)) | |
519 | - | let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil) | |
520 | - | let dz = { | |
521 | - | let z = dy | |
522 | - | if (if ($isInstanceOf(z._1, "Int")) | |
523 | - | then if ($isInstanceOf(z._3, "Int")) | |
524 | - | then if ($isInstanceOf(z._4, "Int")) | |
525 | - | then if ($isInstanceOf(z._5, "Int")) | |
526 | - | then $isInstanceOf(z._6, "Int") | |
527 | - | else false | |
528 | - | else false | |
529 | - | else false | |
530 | - | else false) | |
531 | - | then { | |
532 | - | let dA = z._1 | |
533 | - | let dB = z._3 | |
534 | - | let dC = z._4 | |
535 | - | let dD = z._5 | |
536 | - | let dE = z._6 | |
537 | - | $Tuple5(dA, dB, dC, dD, dE) | |
538 | - | } | |
539 | - | else throw("Couldn't cast types") | |
540 | - | } | |
541 | - | let dA = dz._1 | |
542 | - | let dB = dz._2 | |
543 | - | let dC = dz._3 | |
544 | - | let dD = dz._4 | |
545 | - | let dE = dz._5 | |
546 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e)) | |
547 | - | } | |
548 | - | ||
549 | - | ||
550 | - | ||
551 | - | @Callable(bt) | |
552 | - | func poolEvaluatePutByPriceAssetREADONLY (cW,dx) = { | |
553 | - | let cX = addressFromStringValue(t(aS, U(cW))) | |
554 | - | let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil)) | |
555 | - | let aY = fromBase58String(D(cY[j])) | |
556 | - | let dn = D(cY[k]) | |
557 | - | let do = fromBase58String(dn) | |
558 | - | let dp = D(cY[l]) | |
559 | - | let dq = fromBase58String(dp) | |
560 | - | let dd = parseIntValue(D(cY[m])) | |
561 | - | let de = parseIntValue(D(cY[n])) | |
562 | - | let dr = D(cY[i]) | |
563 | - | let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity | |
564 | - | let dF = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil)) | |
565 | - | let dG = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil)) | |
566 | - | let dH = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dF, dd], nil))) | |
567 | - | let dI = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dG, de], nil))) | |
568 | - | let du = if ((df == 0)) | |
569 | - | then g | |
570 | - | else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dI), toString(dH)], nil))) | |
571 | - | let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil)) | |
572 | - | let dw = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dx, de], nil))) | |
573 | - | let dv = fraction(dw, d, du) | |
574 | - | let dm = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dv), dd], nil)) | |
575 | - | let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil) | |
576 | - | let dJ = { | |
577 | - | let z = dy | |
578 | - | if (if ($isInstanceOf(z._1, "Int")) | |
579 | - | then if ($isInstanceOf(z._3, "Int")) | |
580 | - | then if ($isInstanceOf(z._4, "Int")) | |
581 | - | then if ($isInstanceOf(z._5, "Int")) | |
582 | - | then $isInstanceOf(z._6, "Int") | |
583 | - | else false | |
584 | - | else false | |
585 | - | else false | |
586 | - | else false) | |
587 | - | then { | |
588 | - | let dA = z._1 | |
589 | - | let dB = z._3 | |
590 | - | let dC = z._4 | |
591 | - | let dD = z._5 | |
592 | - | let dE = z._6 | |
593 | - | $Tuple5(dA, dB, dC, dD, dE) | |
594 | - | } | |
595 | - | else throw("Couldn't cast types") | |
596 | - | } | |
597 | - | let dA = dJ._1 | |
598 | - | let dB = dJ._2 | |
599 | - | let dC = dJ._3 | |
600 | - | let dD = dJ._4 | |
601 | - | let dE = dJ._5 | |
602 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e)) | |
603 | - | } | |
604 | - | ||
605 | - | ||
606 | - | ||
607 | - | @Callable(bt) | |
608 | - | func poolEvaluateGetREADONLY (dK,dL) = { | |
609 | - | let cX = addressFromStringValue(t(aS, U(dK))) | |
610 | - | let dy = invoke(cX, "estimateGetOperationWrapperREADONLY", ["", dK, dL, toString(cX)], nil) | |
611 | - | let dM = { | |
612 | - | let z = dy | |
613 | - | if (if ($isInstanceOf(z._1, "Int")) | |
614 | - | then if ($isInstanceOf(z._2, "Int")) | |
615 | - | then if ($isInstanceOf(z._5, "Int")) | |
616 | - | then if ($isInstanceOf(z._6, "Int")) | |
617 | - | then if ($isInstanceOf(z._7, "Int")) | |
618 | - | then if ($isInstanceOf(z._8, "String")) | |
619 | - | then $isInstanceOf(z._9, "String") | |
620 | - | else false | |
621 | - | else false | |
622 | - | else false | |
623 | - | else false | |
624 | - | else false | |
625 | - | else false) | |
626 | - | then { | |
627 | - | let dN = z._1 | |
628 | - | let dO = z._2 | |
629 | - | let dC = z._5 | |
630 | - | let dD = z._6 | |
631 | - | let dE = z._7 | |
632 | - | let dj = z._8 | |
633 | - | let dr = z._9 | |
634 | - | $Tuple7(dN, dO, dC, dD, dE, dj, dr) | |
635 | - | } | |
636 | - | else throw("Couldn't cast types") | |
637 | - | } | |
638 | - | let dN = dM._1 | |
639 | - | let dO = dM._2 | |
640 | - | let dC = dM._3 | |
641 | - | let dD = dM._4 | |
642 | - | let dE = dM._5 | |
643 | - | let dj = dM._6 | |
644 | - | let dr = dM._7 | |
645 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dN), toString(dO), toString(dC), toString(dD), toString(dE), dj, dr], e)) | |
646 | - | } | |
647 | - | ||
648 | - | ||
649 | - | ||
650 | - | @Callable(bt) | |
651 | - | func gwxUserInfoREADONLY (am) = { | |
652 | - | let dP = x(invoke(aW, "gwxUserInfoREADONLY", [am], nil)) | |
653 | - | let dQ = B(dP[0]) | |
654 | - | $Tuple2(nil, makeString(["%d", toString(dQ)], e)) | |
655 | - | } | |
656 | - | ||
657 | - | ||
658 | - | ||
659 | - | @Callable(bt) | |
660 | - | func setManager (dR) = { | |
661 | - | let dS = bs(bt) | |
662 | - | if ((dS == dS)) | |
663 | - | then { | |
664 | - | let dT = fromBase58String(dR) | |
665 | - | if ((dT == dT)) | |
666 | - | then [StringEntry(H(), dR)] | |
210 | + | let aM = fromBase58String(aL) | |
211 | + | if ((aM == aM)) | |
212 | + | then [StringEntry(I(), aL)] | |
667 | 213 | else throw("Strict value is not equal to itself.") | |
668 | 214 | } | |
669 | 215 | else throw("Strict value is not equal to itself.") | |
671 | 217 | ||
672 | 218 | ||
673 | 219 | ||
674 | - | @Callable( | |
220 | + | @Callable(af) | |
675 | 221 | func confirmManager () = { | |
676 | - | let | |
677 | - | let | |
222 | + | let aN = ad() | |
223 | + | let aO = if (isDefined(aN)) | |
678 | 224 | then true | |
679 | 225 | else throw("No pending manager") | |
680 | - | if (( | |
226 | + | if ((aO == aO)) | |
681 | 227 | then { | |
682 | - | let | |
228 | + | let aP = if ((af.callerPublicKey == value(aN))) | |
683 | 229 | then true | |
684 | 230 | else throw("You are not pending manager") | |
685 | - | if (( | |
686 | - | then [StringEntry( | |
231 | + | if ((aP == aP)) | |
232 | + | then [StringEntry(H(), toBase58String(value(aN))), DeleteEntry(I())] | |
687 | 233 | else throw("Strict value is not equal to itself.") | |
688 | 234 | } | |
689 | 235 | else throw("Strict value is not equal to itself.") | |
690 | 236 | } | |
691 | 237 | ||
692 | 238 | ||
693 | - | @Verifier( | |
694 | - | func | |
695 | - | let | |
696 | - | let | |
697 | - | if ($isInstanceOf( | |
239 | + | @Verifier(aQ) | |
240 | + | func aR () = { | |
241 | + | let aS = { | |
242 | + | let V = ab() | |
243 | + | if ($isInstanceOf(V, "ByteVector")) | |
698 | 244 | then { | |
699 | - | let | |
700 | - | | |
245 | + | let ah = V | |
246 | + | ah | |
701 | 247 | } | |
702 | - | else if ($isInstanceOf( | |
703 | - | then | |
248 | + | else if ($isInstanceOf(V, "Unit")) | |
249 | + | then aQ.senderPublicKey | |
704 | 250 | else throw("Match error") | |
705 | 251 | } | |
706 | - | sigVerify( | |
252 | + | sigVerify(aQ.bodyBytes, aQ.proofs[0], aS) | |
707 | 253 | } | |
708 | 254 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = 4 | |
9 | 9 | ||
10 | - | let d = | |
10 | + | let d = 1 | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 2 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 3 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 4 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 5 | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = 6 | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 7 | |
23 | 23 | ||
24 | - | let k = | |
24 | + | let k = 8 | |
25 | 25 | ||
26 | - | let l = | |
26 | + | let l = 9 | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = 10 | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 11 | |
31 | 31 | ||
32 | - | let o = 8 | |
33 | - | ||
34 | - | let p = 9 | |
35 | - | ||
36 | - | let q = 10 | |
37 | - | ||
38 | - | func r (s) = valueOrErrorMessage(getString(s), (("mandatory this." + s) + " is not defined")) | |
32 | + | func o (p,q) = ((("%s%s%s__P__" + p) + "__") + q) | |
39 | 33 | ||
40 | 34 | ||
41 | - | func | |
35 | + | func r (p,q) = ((("%s%s%s__invest__" + p) + "__") + q) | |
42 | 36 | ||
43 | 37 | ||
44 | - | func | |
38 | + | func s (p,t) = ((("%s%s%s__total__" + p) + "__") + t) | |
45 | 39 | ||
46 | 40 | ||
47 | - | func | |
41 | + | func u () = "%s__factoryContract" | |
48 | 42 | ||
49 | 43 | ||
50 | - | func x (y) = { | |
51 | - | let z = y | |
52 | - | if ($isInstanceOf(z, "List[Any]")) | |
53 | - | then { | |
54 | - | let A = z | |
55 | - | A | |
56 | - | } | |
57 | - | else throw("fail to cast into List[Any]") | |
58 | - | } | |
44 | + | func v (p,t) = (((("%s%s%s__" + p) + "__") + t) + "__slippageCumulative") | |
59 | 45 | ||
60 | 46 | ||
61 | - | func B (y) = { | |
62 | - | let z = y | |
63 | - | if ($isInstanceOf(z, "Int")) | |
64 | - | then { | |
65 | - | let C = z | |
66 | - | C | |
67 | - | } | |
68 | - | else throw("fail to cast into Int") | |
69 | - | } | |
47 | + | func w () = "%s__factoryConfig" | |
70 | 48 | ||
71 | 49 | ||
72 | - | func D (y) = { | |
73 | - | let z = y | |
74 | - | if ($isInstanceOf(z, "String")) | |
50 | + | func x (y) = (("%s%s%s__" + y) + "__mappings__poolContract2PoolAssets") | |
51 | + | ||
52 | + | ||
53 | + | func z (A) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(A)) | |
54 | + | ||
55 | + | ||
56 | + | func B (C,D) = (((("%d%d%s__" + C) + "__") + D) + "__config") | |
57 | + | ||
58 | + | ||
59 | + | func E () = "%s__shutdown" | |
60 | + | ||
61 | + | ||
62 | + | func F (G) = ("%s%s__poolWeight__" + G) | |
63 | + | ||
64 | + | ||
65 | + | func H () = "%s__managerPublicKey" | |
66 | + | ||
67 | + | ||
68 | + | func I () = "%s__pendingManagerPublicKey" | |
69 | + | ||
70 | + | ||
71 | + | let J = addressFromStringValue(valueOrErrorMessage(getString(this, u()), "No Factory Acc found.")) | |
72 | + | ||
73 | + | func K (t) = if (!(isDefined(t))) | |
74 | + | then "WAVES" | |
75 | + | else t | |
76 | + | ||
77 | + | ||
78 | + | func L (M,N,O,P) = makeString(["%s%d%d%d", M, toString(N), toString(O), toString(P)], a) | |
79 | + | ||
80 | + | ||
81 | + | func Q (R,S,O,P) = makeString(["%d%d%d%d", toString(R), toString(S), toString(O), toString(P)], a) | |
82 | + | ||
83 | + | ||
84 | + | func T (U) = { | |
85 | + | let V = U | |
86 | + | if ($isInstanceOf(V, "String")) | |
75 | 87 | then { | |
76 | - | let | |
77 | - | | |
88 | + | let W = V | |
89 | + | W | |
78 | 90 | } | |
79 | 91 | else throw("fail to cast into String") | |
80 | 92 | } | |
81 | 93 | ||
82 | 94 | ||
83 | - | func | |
95 | + | func X (Y,Z,aa) = fraction(Y, Z, aa) | |
84 | 96 | ||
85 | 97 | ||
86 | - | func G () = "%s__managerPublicKey" | |
87 | - | ||
88 | - | ||
89 | - | func H () = "%s__pendingManagerPublicKey" | |
90 | - | ||
91 | - | ||
92 | - | let I = 1 | |
93 | - | ||
94 | - | let J = 2 | |
95 | - | ||
96 | - | let K = 3 | |
97 | - | ||
98 | - | let L = 4 | |
99 | - | ||
100 | - | let M = 5 | |
101 | - | ||
102 | - | let N = 6 | |
103 | - | ||
104 | - | let O = 7 | |
105 | - | ||
106 | - | let P = 8 | |
107 | - | ||
108 | - | func Q () = "%s__factoryConfig" | |
109 | - | ||
110 | - | ||
111 | - | func R (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e) | |
112 | - | ||
113 | - | ||
114 | - | func T () = "%s__lpTokensList" | |
115 | - | ||
116 | - | ||
117 | - | func U (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e) | |
118 | - | ||
119 | - | ||
120 | - | func V (W) = makeString(["%s%s", "poolWeight", W], e) | |
121 | - | ||
122 | - | ||
123 | - | func X () = addressFromStringValue(r(F())) | |
124 | - | ||
125 | - | ||
126 | - | func Y () = split(valueOrElse(getString(X(), T()), ""), e) | |
127 | - | ||
128 | - | ||
129 | - | func Z (aa) = split(t(aa, Q()), e) | |
130 | - | ||
131 | - | ||
132 | - | func ab (ac) = addressFromStringValue(ac[J]) | |
133 | - | ||
134 | - | ||
135 | - | func ad (ac) = addressFromStringValue(ac[M]) | |
136 | - | ||
137 | - | ||
138 | - | func ae (ac) = addressFromStringValue(ac[I]) | |
139 | - | ||
140 | - | ||
141 | - | func af (ac) = addressFromStringValue(ac[P]) | |
142 | - | ||
143 | - | ||
144 | - | func ag () = "%s__config" | |
145 | - | ||
146 | - | ||
147 | - | func ah () = "%s%s__stats__activeTotalLocked" | |
148 | - | ||
149 | - | ||
150 | - | func ai () = "%s%s__stats__locksDurationSumInBlocks" | |
151 | - | ||
152 | - | ||
153 | - | func aj () = "%s%s__stats__locksCount" | |
154 | - | ||
155 | - | ||
156 | - | func ak () = "%s%s__stats__activeUsersCount" | |
157 | - | ||
158 | - | ||
159 | - | func al (am) = makeString(["%s%s%s__mapping__user2num", am], e) | |
160 | - | ||
161 | - | ||
162 | - | func an (ao) = makeString(["%s%s%s__mapping__num2user", ao], e) | |
163 | - | ||
164 | - | ||
165 | - | func ap (aq) = makeString(["%s%d%s__paramByUserNum", aq, "amount"], e) | |
166 | - | ||
167 | - | ||
168 | - | func ar (aq) = makeString(["%s%d%s__paramByUserNum", aq, "start"], e) | |
169 | - | ||
170 | - | ||
171 | - | func as (aq) = makeString(["%s%d%s__paramByUserNum", aq, "duration"], e) | |
172 | - | ||
173 | - | ||
174 | - | func at (aq) = makeString(["%s%d%s__paramByUserNum", aq, "k"], e) | |
175 | - | ||
176 | - | ||
177 | - | func au (aq) = makeString(["%s%d%s__paramByUserNum", aq, "b"], e) | |
178 | - | ||
179 | - | ||
180 | - | func av (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "k", aw], e) | |
181 | - | ||
182 | - | ||
183 | - | func ax (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "b", aw], e) | |
184 | - | ||
185 | - | ||
186 | - | func ay (aq) = makeString(["%s%d__userBoostEmissionLastInt", aq], e) | |
187 | - | ||
188 | - | ||
189 | - | func az (aq) = makeString(["%s%d__maxBoostInt", aq], e) | |
190 | - | ||
191 | - | ||
192 | - | func aA () = "%s%s__maxBoostInt__total" | |
193 | - | ||
194 | - | ||
195 | - | func aB (aq) = makeString(["%s%d__userBoostAvaliableToClaimTotal", aq], e) | |
196 | - | ||
197 | - | ||
198 | - | func aC (aq) = makeString(["%s%d__userBoostClaimed", aq], e) | |
199 | - | ||
200 | - | ||
201 | - | func aD () = "%s%s__gwxCached__total" | |
202 | - | ||
203 | - | ||
204 | - | func aE (aF,aG) = makeString(["%s%s%s__staked", aF, aG], e) | |
205 | - | ||
206 | - | ||
207 | - | func aH (aG) = ("%s%s%s__staked__total__" + aG) | |
208 | - | ||
209 | - | ||
210 | - | func aI (aG,aF) = makeString(["%s%s%s__claimed", aF, aG], e) | |
211 | - | ||
212 | - | ||
213 | - | func aJ (aG,aF) = makeString(["%s%s%s__claimedMinReward", aF, aG], e) | |
214 | - | ||
215 | - | ||
216 | - | func aK (aG,aF) = makeString(["%s%s%s__claimedBoostReward", aF, aG], e) | |
217 | - | ||
218 | - | ||
219 | - | func aL (aM,s) = valueOrElse(getInteger(aM, s), 0) | |
220 | - | ||
221 | - | ||
222 | - | func aN () = "%s%s__ratePerBlock__current" | |
223 | - | ||
224 | - | ||
225 | - | func aO () = "%s%s__ratePerBlockMax__current" | |
226 | - | ||
227 | - | ||
228 | - | func aP () = "%s%s__emission__startBlock" | |
229 | - | ||
230 | - | ||
231 | - | func aQ () = "%s%s__emission__duration" | |
232 | - | ||
233 | - | ||
234 | - | func aR () = "%s%s__emission__endBlock" | |
235 | - | ||
236 | - | ||
237 | - | let aS = X() | |
238 | - | ||
239 | - | let aT = Z(aS) | |
240 | - | ||
241 | - | let aU = ad(aT) | |
242 | - | ||
243 | - | let aM = ae(aT) | |
244 | - | ||
245 | - | let aV = af(aT) | |
246 | - | ||
247 | - | let aW = ab(aT) | |
248 | - | ||
249 | - | func aX (aY) = { | |
250 | - | let aZ = t(aS, U(aY)) | |
251 | - | let ba = b | |
252 | - | let bb = getIntegerValue(aS, V(aZ)) | |
253 | - | let bc = w(aU, aN()) | |
254 | - | let bd = w(aU, aO()) | |
255 | - | let be = 3 | |
256 | - | let bf = (fraction(bc, bb, ba) / be) | |
257 | - | let bg = fraction(bd, bb, ba) | |
258 | - | let bh = (be * b) | |
259 | - | let bi = v(aM, aH(aY)) | |
260 | - | [bf, bh, bi] | |
261 | - | } | |
262 | - | ||
263 | - | ||
264 | - | func bj (bk,bl,bm) = { | |
265 | - | let bn = fraction(bl, b, bm) | |
266 | - | let bo = fraction(bk, bn, b) | |
267 | - | [bo] | |
268 | - | } | |
269 | - | ||
270 | - | ||
271 | - | func bp () = { | |
272 | - | let z = getString(G()) | |
273 | - | if ($isInstanceOf(z, "String")) | |
98 | + | func ab () = { | |
99 | + | let V = getString(H()) | |
100 | + | if ($isInstanceOf(V, "String")) | |
274 | 101 | then { | |
275 | - | let | |
276 | - | fromBase58String( | |
102 | + | let ac = V | |
103 | + | fromBase58String(ac) | |
277 | 104 | } | |
278 | - | else if ($isInstanceOf( | |
105 | + | else if ($isInstanceOf(V, "Unit")) | |
279 | 106 | then unit | |
280 | 107 | else throw("Match error") | |
281 | 108 | } | |
282 | 109 | ||
283 | 110 | ||
284 | - | func | |
285 | - | let | |
286 | - | if ($isInstanceOf( | |
111 | + | func ad () = { | |
112 | + | let V = getString(I()) | |
113 | + | if ($isInstanceOf(V, "String")) | |
287 | 114 | then { | |
288 | - | let | |
289 | - | fromBase58String( | |
115 | + | let ac = V | |
116 | + | fromBase58String(ac) | |
290 | 117 | } | |
291 | - | else if ($isInstanceOf( | |
118 | + | else if ($isInstanceOf(V, "Unit")) | |
292 | 119 | then unit | |
293 | 120 | else throw("Match error") | |
294 | 121 | } | |
295 | 122 | ||
296 | 123 | ||
297 | - | func | |
298 | - | let | |
299 | - | let | |
300 | - | if ($isInstanceOf( | |
124 | + | func ae (af) = { | |
125 | + | let ag = throw("Permission denied") | |
126 | + | let V = ab() | |
127 | + | if ($isInstanceOf(V, "ByteVector")) | |
301 | 128 | then { | |
302 | - | let | |
303 | - | if (( | |
129 | + | let ah = V | |
130 | + | if ((af.callerPublicKey == ah)) | |
304 | 131 | then true | |
305 | - | else | |
132 | + | else ag | |
306 | 133 | } | |
307 | - | else if ($isInstanceOf( | |
308 | - | then if (( | |
134 | + | else if ($isInstanceOf(V, "Unit")) | |
135 | + | then if ((af.caller == this)) | |
309 | 136 | then true | |
310 | - | else | |
137 | + | else ag | |
311 | 138 | else throw("Match error") | |
312 | 139 | } | |
313 | 140 | ||
314 | 141 | ||
315 | - | @Callable(bt) | |
316 | - | func constructor (bw) = if ((bt.caller != this)) | |
317 | - | then throw("not authorized") | |
318 | - | else [StringEntry(F(), bw)] | |
319 | - | ||
320 | - | ||
321 | - | ||
322 | - | @Callable(bt) | |
323 | - | func currentRewardRateREADONLY (aY) = { | |
324 | - | let bx = aX(aY) | |
325 | - | let bc = bx[0] | |
326 | - | let bh = bx[1] | |
327 | - | let bi = bx[2] | |
328 | - | $Tuple2(nil, makeString(["%d%d%d", toString(bc), toString(bh), toString(bi)], e)) | |
142 | + | @Callable(af) | |
143 | + | func constructor (J) = { | |
144 | + | let ai = ae(af) | |
145 | + | if ((ai == ai)) | |
146 | + | then [StringEntry(u(), J)] | |
147 | + | else throw("Strict value is not equal to itself.") | |
329 | 148 | } | |
330 | 149 | ||
331 | 150 | ||
332 | 151 | ||
333 | - | @Callable(bt) | |
334 | - | func currentUserRewardRateREADONLY (aY,am) = { | |
335 | - | let bx = aX(aY) | |
336 | - | let bc = bx[0] | |
337 | - | let bh = bx[1] | |
338 | - | let bi = bx[2] | |
339 | - | let by = v(aM, aE(am, aY)) | |
340 | - | let bz = split(D(invoke(aM, "claimWxREADONLY", [aY, am], nil)), e) | |
341 | - | let bA = valueOrErrorMessage(parseInt(bz[5]), "couldn't parse minRewardPart") | |
342 | - | let bB = valueOrErrorMessage(parseInt(bz[6]), "couldn't parse boostRewardPart") | |
343 | - | let bC = bz[7] | |
344 | - | let bD = if ((bB == 0)) | |
345 | - | then (1 * b) | |
346 | - | else fraction((bA + bB), b, bA) | |
347 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(bc), toString(bh), toString(bi), toString(by), toString(bD), bC], e)) | |
152 | + | @Callable(af) | |
153 | + | func put () = { | |
154 | + | let aj = toString(af.caller) | |
155 | + | let ak = value(af.payments[0]) | |
156 | + | let al = if (!(isDefined(ak.assetId))) | |
157 | + | then "WAVES" | |
158 | + | else toBase58String(value(ak.assetId)) | |
159 | + | let am = ak.amount | |
160 | + | let an = split(valueOrErrorMessage(getString(J, x(aj)), "Invalid caller"), a) | |
161 | + | let ao = parseIntValue(an[1]) | |
162 | + | let ap = parseIntValue(an[2]) | |
163 | + | let aq = valueOrErrorMessage(getString(J, z(ao)), "Cannot find asset") | |
164 | + | let ar = valueOrErrorMessage(getString(J, z(ap)), "Cannot find asset") | |
165 | + | let as = valueOrElse(getInteger(this, s(aj, al)), 0) | |
166 | + | let at = valueOrElse(getInteger(this, v(aj, al)), 0) | |
167 | + | [StringEntry(o(aj, toBase58String(af.transactionId)), L(al, am, height, lastBlock.timestamp)), IntegerEntry(s(aj, al), (as + am)), IntegerEntry(v(aj, al), (at + am))] | |
348 | 168 | } | |
349 | 169 | ||
350 | 170 | ||
351 | 171 | ||
352 | - | @Callable(bt) | |
353 | - | func claimedRewardREADONLY (am) = { | |
354 | - | let bE = Y() | |
355 | - | let bF = "%s%d%d%d%s" | |
356 | - | func bG (bH,bI) = { | |
357 | - | let bJ = aJ(bI, am) | |
358 | - | let bK = aK(bI, am) | |
359 | - | let bL = valueOrElse(getInteger(aM, bJ), 0) | |
360 | - | let bM = valueOrElse(getInteger(aM, bK), 0) | |
361 | - | let bN = 0 | |
362 | - | makeString([(bF + bH), bI, toString(bL), toString(bM), toString(bN), "end"], e) | |
363 | - | } | |
364 | - | ||
365 | - | let bO = { | |
366 | - | let bP = bE | |
367 | - | let bQ = size(bP) | |
368 | - | let bR = "%s" | |
369 | - | func bS (bT,bU) = if ((bU >= bQ)) | |
370 | - | then bT | |
371 | - | else bG(bT, bP[bU]) | |
372 | - | ||
373 | - | func bV (bT,bU) = if ((bU >= bQ)) | |
374 | - | then bT | |
375 | - | else throw("List size exceeds 10") | |
376 | - | ||
377 | - | bV(bS(bS(bS(bS(bS(bS(bS(bS(bS(bS(bR, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
378 | - | } | |
379 | - | $Tuple2(nil, ((bO + e) + am)) | |
172 | + | @Callable(af) | |
173 | + | func invest (au) = { | |
174 | + | let p = valueOrErrorMessage(addressFromString(au), "invalid pool address") | |
175 | + | let an = split(valueOrErrorMessage(getString(J, x(au)), "Invalid pool passed."), a) | |
176 | + | let av = valueOrErrorMessage(getString(J, z(parseIntValue(an[1]))), "No asset mapping found") | |
177 | + | let aw = valueOrErrorMessage(getString(J, z(parseIntValue(an[2]))), "No asset mapping found") | |
178 | + | let ax = valueOrElse(getInteger(this, s(au, av)), 0) | |
179 | + | let ay = valueOrElse(getInteger(this, s(au, aw)), 0) | |
180 | + | let az = invoke(p, "evaluatePutByPriceAssetREADONLY", [ay], nil) | |
181 | + | let aA = invoke(p, "evaluatePutByAmountAssetREADONLY", [ax], nil) | |
182 | + | let aB = 7 | |
183 | + | let aC = 8 | |
184 | + | let aD = valueOrErrorMessage(parseIntValue(split(T(az), a)[aB]), "fail to parse estimated amAsset amount") | |
185 | + | let aE = valueOrErrorMessage(parseIntValue(split(T(aA), a)[aC]), "fail to parse estimated prAsset amount") | |
186 | + | let aF = if ((ax >= aD)) | |
187 | + | then $Tuple2(aD, ay) | |
188 | + | else $Tuple2(ax, aE) | |
189 | + | let aG = aF._1 | |
190 | + | let aH = aF._2 | |
191 | + | let aI = if ((av == "WAVES")) | |
192 | + | then unit | |
193 | + | else fromBase58String(av) | |
194 | + | let aJ = if ((aw == "WAVES")) | |
195 | + | then unit | |
196 | + | else fromBase58String(aw) | |
197 | + | let aK = invoke(p, "putForFree", [1000], [AttachedPayment(aI, aG), AttachedPayment(aJ, aH)]) | |
198 | + | if ((aK == aK)) | |
199 | + | then [StringEntry(r(au, toBase58String(af.transactionId)), Q(aG, aH, height, lastBlock.timestamp)), IntegerEntry(s(au, av), (ax - aG)), IntegerEntry(s(au, aw), (ay - aH))] | |
200 | + | else throw("Strict value is not equal to itself.") | |
380 | 201 | } | |
381 | 202 | ||
382 | 203 | ||
383 | 204 | ||
384 | - | @Callable(bt) | |
385 | - | func calcBoostREADONLY (bW,bX,bY,bZ,ca) = { | |
386 | - | let cb = aV | |
387 | - | let cc = "empty" | |
388 | - | let cd = parseIntValue(split(t(aW, ag()), e)[4]) | |
389 | - | let aG = if ((bZ == "")) | |
390 | - | then cc | |
391 | - | else bZ | |
392 | - | let aF = if ((ca == "")) | |
393 | - | then cc | |
394 | - | else ca | |
395 | - | let ce = valueOrElse(getString(aW, al(ca)), cc) | |
396 | - | let cf = valueOrElse(getInteger(aW, ap(ce)), 0) | |
397 | - | let cg = valueOrElse(getInteger(aW, ar(ce)), height) | |
398 | - | let bl = valueOrElse(getInteger(aW, as(ce)), 0) | |
399 | - | let ch = (cg + bl) | |
400 | - | let ci = max([(ch - height), 0]) | |
401 | - | let cj = (cf + bW) | |
402 | - | let ck = min([(ci + bX), cd]) | |
403 | - | let cl = B(x(invoke(aW, "gwxUserInfoREADONLY", [aF], nil))[0]) | |
404 | - | let cm = bj(cj, ck, cd)[0] | |
405 | - | let cn = x(invoke(cb, "calcGwxParamsREADONLY", [cm, height, ck], nil)) | |
406 | - | let co = (cm - cl) | |
407 | - | let cp = B(cn[0]) | |
408 | - | let cq = B(cn[1]) | |
409 | - | let aw = toString(B(cn[2])) | |
410 | - | let cr = aA() | |
411 | - | let cs = aD() | |
412 | - | let ct = ((cm * ck) / 2) | |
413 | - | let cu = v(aW, cr) | |
414 | - | let cv = valueOrElse(getInteger(aW, cs), 0) | |
415 | - | let cw = 1000 | |
416 | - | let cx = (w(aU, aN()) * cw) | |
417 | - | let cy = aE(aF, aG) | |
418 | - | let cz = aH(aG) | |
419 | - | let cA = aL(aM, cy) | |
420 | - | let cB = aL(aM, cz) | |
421 | - | let cC = (cA + bY) | |
422 | - | let cD = (cB + bY) | |
423 | - | let bb = if ((aG != cc)) | |
205 | + | @Callable(af) | |
206 | + | func setManager (aL) = { | |
207 | + | let ai = ae(af) | |
208 | + | if ((ai == ai)) | |
424 | 209 | then { | |
425 | - | let aZ = valueOrErrorMessage(getString(aS, R(aG)), ("unsupported lp asset " + aG)) | |
426 | - | getIntegerValue(aS, V(aZ)) | |
427 | - | } | |
428 | - | else 0 | |
429 | - | let cE = fraction(cx, bb, (f * 3)) | |
430 | - | let cF = if ((cD != 0)) | |
431 | - | then fraction(cE, b, cD) | |
432 | - | else 0 | |
433 | - | let cG = fraction(cF, cC, b) | |
434 | - | let cH = (cE * 2) | |
435 | - | let cI = fraction(cm, cH, (cv + co)) | |
436 | - | let cJ = min([cI, (cG * 2)]) | |
437 | - | let cK = if ((cG == 0)) | |
438 | - | then (1 * b) | |
439 | - | else fraction((cJ + cG), b, cG) | |
440 | - | let bC = makeString([("lpAssetIdStr=" + aG), ("userAddressStr=" + aF), ("userNumStr=" + ce), ("userAmount=" + toString(cf)), ("userAmountNew=" + toString(cj)), ("lockDurationNew=" + toString(ck)), ("gWxAmountStart=" + toString(cm)), ("tmpUserBoostPerBlockX3=" + toString(cI)), ("stakedByUserNew=" + toString(cC)), ("stakedTotalNew=" + toString(cD)), ("poolWeight=" + toString(bb)), ("wxPerLpX3=" + toString(cF)), ("poolWxEmissionPerBlockX3=" + toString(cE)), ("userWxPerBlockX3=" + toString(cG)), ("gWxAmountDiff=" + toString(co)), ("totalCachedGwx=" + toString(cv)), ("userCurrgWxAmount=" + toString(cl))], "::") | |
441 | - | $Tuple2(nil, makeString(["%d%d%s", toString(cm), toString(cK), bC], e)) | |
442 | - | } | |
443 | - | ||
444 | - | ||
445 | - | ||
446 | - | @Callable(bt) | |
447 | - | func wxEmissionStatsREADONLY () = { | |
448 | - | let cL = toString(b) | |
449 | - | let cM = "1" | |
450 | - | let bc = w(aU, aN()) | |
451 | - | let cN = w(aU, aP()) | |
452 | - | let cO = if ((cN > height)) | |
453 | - | then 0 | |
454 | - | else (height - cN) | |
455 | - | let cP = (1440 * 365) | |
456 | - | let cQ = (201000000 * b) | |
457 | - | let cR = if ((cO > cP)) | |
458 | - | then cQ | |
459 | - | else fraction(cQ, cO, cP) | |
460 | - | let cS = ((bc * cO) + cR) | |
461 | - | let cT = v(aW, ah()) | |
462 | - | let cU = v(aW, ai()) | |
463 | - | let cV = v(aW, aj()) | |
464 | - | $Tuple2(nil, makeString(["%d%d%d%d", toString(cS), toString(cT), toString(cU), toString(cV)], e)) | |
465 | - | } | |
466 | - | ||
467 | - | ||
468 | - | ||
469 | - | @Callable(bt) | |
470 | - | func poolStatsREADONLY (cW) = { | |
471 | - | let cX = addressFromStringValue(t(aS, U(cW))) | |
472 | - | let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil)) | |
473 | - | let aY = fromBase58String(D(cY[j])) | |
474 | - | let cZ = D(cY[k]) | |
475 | - | let da = D(cY[l]) | |
476 | - | let db = D(cY[o]) | |
477 | - | let dc = D(cY[p]) | |
478 | - | let dd = parseIntValue(D(cY[m])) | |
479 | - | let de = parseIntValue(D(cY[n])) | |
480 | - | let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity | |
481 | - | let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [cZ], nil)) | |
482 | - | let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [da], nil)) | |
483 | - | let di = if ((df == 0)) | |
484 | - | then [toString(g), toString(g), toString(g)] | |
485 | - | else x(invoke(cX, "calcPricesWrapperREADONLY", [dg, dh, df], nil)) | |
486 | - | let dj = 0 | |
487 | - | let dk = B(invoke(cX, "fromX18WrapperREADONLY", [di[1], b], nil)) | |
488 | - | let dl = B(invoke(cX, "fromX18WrapperREADONLY", [di[2], b], nil)) | |
489 | - | let bb = getIntegerValue(aS, V(toString(cX))) | |
490 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dg), toString(dh), toString(df), toString(dj), toString(dk), toString(dl), toString(bb)], e)) | |
491 | - | } | |
492 | - | ||
493 | - | ||
494 | - | ||
495 | - | @Callable(bt) | |
496 | - | func poolEvaluatePutByAmountAssetREADONLY (cW,dm) = { | |
497 | - | let cX = addressFromStringValue(t(aS, U(cW))) | |
498 | - | let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil)) | |
499 | - | let aY = fromBase58String(D(cY[j])) | |
500 | - | let dn = D(cY[k]) | |
501 | - | let do = fromBase58String(dn) | |
502 | - | let dp = D(cY[l]) | |
503 | - | let dq = fromBase58String(dp) | |
504 | - | let dd = parseIntValue(D(cY[m])) | |
505 | - | let de = parseIntValue(D(cY[n])) | |
506 | - | let dr = D(cY[i]) | |
507 | - | let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity | |
508 | - | let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil)) | |
509 | - | let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil)) | |
510 | - | let ds = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dg, dd], nil))) | |
511 | - | let dt = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dh, de], nil))) | |
512 | - | let du = if ((df == 0)) | |
513 | - | then g | |
514 | - | else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dt), toString(ds)], nil))) | |
515 | - | let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil)) | |
516 | - | let dv = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dm, dd], nil))) | |
517 | - | let dw = fraction(dv, du, d) | |
518 | - | let dx = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dw), de], nil)) | |
519 | - | let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil) | |
520 | - | let dz = { | |
521 | - | let z = dy | |
522 | - | if (if ($isInstanceOf(z._1, "Int")) | |
523 | - | then if ($isInstanceOf(z._3, "Int")) | |
524 | - | then if ($isInstanceOf(z._4, "Int")) | |
525 | - | then if ($isInstanceOf(z._5, "Int")) | |
526 | - | then $isInstanceOf(z._6, "Int") | |
527 | - | else false | |
528 | - | else false | |
529 | - | else false | |
530 | - | else false) | |
531 | - | then { | |
532 | - | let dA = z._1 | |
533 | - | let dB = z._3 | |
534 | - | let dC = z._4 | |
535 | - | let dD = z._5 | |
536 | - | let dE = z._6 | |
537 | - | $Tuple5(dA, dB, dC, dD, dE) | |
538 | - | } | |
539 | - | else throw("Couldn't cast types") | |
540 | - | } | |
541 | - | let dA = dz._1 | |
542 | - | let dB = dz._2 | |
543 | - | let dC = dz._3 | |
544 | - | let dD = dz._4 | |
545 | - | let dE = dz._5 | |
546 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e)) | |
547 | - | } | |
548 | - | ||
549 | - | ||
550 | - | ||
551 | - | @Callable(bt) | |
552 | - | func poolEvaluatePutByPriceAssetREADONLY (cW,dx) = { | |
553 | - | let cX = addressFromStringValue(t(aS, U(cW))) | |
554 | - | let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil)) | |
555 | - | let aY = fromBase58String(D(cY[j])) | |
556 | - | let dn = D(cY[k]) | |
557 | - | let do = fromBase58String(dn) | |
558 | - | let dp = D(cY[l]) | |
559 | - | let dq = fromBase58String(dp) | |
560 | - | let dd = parseIntValue(D(cY[m])) | |
561 | - | let de = parseIntValue(D(cY[n])) | |
562 | - | let dr = D(cY[i]) | |
563 | - | let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity | |
564 | - | let dF = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil)) | |
565 | - | let dG = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil)) | |
566 | - | let dH = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dF, dd], nil))) | |
567 | - | let dI = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dG, de], nil))) | |
568 | - | let du = if ((df == 0)) | |
569 | - | then g | |
570 | - | else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dI), toString(dH)], nil))) | |
571 | - | let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil)) | |
572 | - | let dw = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dx, de], nil))) | |
573 | - | let dv = fraction(dw, d, du) | |
574 | - | let dm = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dv), dd], nil)) | |
575 | - | let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil) | |
576 | - | let dJ = { | |
577 | - | let z = dy | |
578 | - | if (if ($isInstanceOf(z._1, "Int")) | |
579 | - | then if ($isInstanceOf(z._3, "Int")) | |
580 | - | then if ($isInstanceOf(z._4, "Int")) | |
581 | - | then if ($isInstanceOf(z._5, "Int")) | |
582 | - | then $isInstanceOf(z._6, "Int") | |
583 | - | else false | |
584 | - | else false | |
585 | - | else false | |
586 | - | else false) | |
587 | - | then { | |
588 | - | let dA = z._1 | |
589 | - | let dB = z._3 | |
590 | - | let dC = z._4 | |
591 | - | let dD = z._5 | |
592 | - | let dE = z._6 | |
593 | - | $Tuple5(dA, dB, dC, dD, dE) | |
594 | - | } | |
595 | - | else throw("Couldn't cast types") | |
596 | - | } | |
597 | - | let dA = dJ._1 | |
598 | - | let dB = dJ._2 | |
599 | - | let dC = dJ._3 | |
600 | - | let dD = dJ._4 | |
601 | - | let dE = dJ._5 | |
602 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e)) | |
603 | - | } | |
604 | - | ||
605 | - | ||
606 | - | ||
607 | - | @Callable(bt) | |
608 | - | func poolEvaluateGetREADONLY (dK,dL) = { | |
609 | - | let cX = addressFromStringValue(t(aS, U(dK))) | |
610 | - | let dy = invoke(cX, "estimateGetOperationWrapperREADONLY", ["", dK, dL, toString(cX)], nil) | |
611 | - | let dM = { | |
612 | - | let z = dy | |
613 | - | if (if ($isInstanceOf(z._1, "Int")) | |
614 | - | then if ($isInstanceOf(z._2, "Int")) | |
615 | - | then if ($isInstanceOf(z._5, "Int")) | |
616 | - | then if ($isInstanceOf(z._6, "Int")) | |
617 | - | then if ($isInstanceOf(z._7, "Int")) | |
618 | - | then if ($isInstanceOf(z._8, "String")) | |
619 | - | then $isInstanceOf(z._9, "String") | |
620 | - | else false | |
621 | - | else false | |
622 | - | else false | |
623 | - | else false | |
624 | - | else false | |
625 | - | else false) | |
626 | - | then { | |
627 | - | let dN = z._1 | |
628 | - | let dO = z._2 | |
629 | - | let dC = z._5 | |
630 | - | let dD = z._6 | |
631 | - | let dE = z._7 | |
632 | - | let dj = z._8 | |
633 | - | let dr = z._9 | |
634 | - | $Tuple7(dN, dO, dC, dD, dE, dj, dr) | |
635 | - | } | |
636 | - | else throw("Couldn't cast types") | |
637 | - | } | |
638 | - | let dN = dM._1 | |
639 | - | let dO = dM._2 | |
640 | - | let dC = dM._3 | |
641 | - | let dD = dM._4 | |
642 | - | let dE = dM._5 | |
643 | - | let dj = dM._6 | |
644 | - | let dr = dM._7 | |
645 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dN), toString(dO), toString(dC), toString(dD), toString(dE), dj, dr], e)) | |
646 | - | } | |
647 | - | ||
648 | - | ||
649 | - | ||
650 | - | @Callable(bt) | |
651 | - | func gwxUserInfoREADONLY (am) = { | |
652 | - | let dP = x(invoke(aW, "gwxUserInfoREADONLY", [am], nil)) | |
653 | - | let dQ = B(dP[0]) | |
654 | - | $Tuple2(nil, makeString(["%d", toString(dQ)], e)) | |
655 | - | } | |
656 | - | ||
657 | - | ||
658 | - | ||
659 | - | @Callable(bt) | |
660 | - | func setManager (dR) = { | |
661 | - | let dS = bs(bt) | |
662 | - | if ((dS == dS)) | |
663 | - | then { | |
664 | - | let dT = fromBase58String(dR) | |
665 | - | if ((dT == dT)) | |
666 | - | then [StringEntry(H(), dR)] | |
210 | + | let aM = fromBase58String(aL) | |
211 | + | if ((aM == aM)) | |
212 | + | then [StringEntry(I(), aL)] | |
667 | 213 | else throw("Strict value is not equal to itself.") | |
668 | 214 | } | |
669 | 215 | else throw("Strict value is not equal to itself.") | |
670 | 216 | } | |
671 | 217 | ||
672 | 218 | ||
673 | 219 | ||
674 | - | @Callable( | |
220 | + | @Callable(af) | |
675 | 221 | func confirmManager () = { | |
676 | - | let | |
677 | - | let | |
222 | + | let aN = ad() | |
223 | + | let aO = if (isDefined(aN)) | |
678 | 224 | then true | |
679 | 225 | else throw("No pending manager") | |
680 | - | if (( | |
226 | + | if ((aO == aO)) | |
681 | 227 | then { | |
682 | - | let | |
228 | + | let aP = if ((af.callerPublicKey == value(aN))) | |
683 | 229 | then true | |
684 | 230 | else throw("You are not pending manager") | |
685 | - | if (( | |
686 | - | then [StringEntry( | |
231 | + | if ((aP == aP)) | |
232 | + | then [StringEntry(H(), toBase58String(value(aN))), DeleteEntry(I())] | |
687 | 233 | else throw("Strict value is not equal to itself.") | |
688 | 234 | } | |
689 | 235 | else throw("Strict value is not equal to itself.") | |
690 | 236 | } | |
691 | 237 | ||
692 | 238 | ||
693 | - | @Verifier( | |
694 | - | func | |
695 | - | let | |
696 | - | let | |
697 | - | if ($isInstanceOf( | |
239 | + | @Verifier(aQ) | |
240 | + | func aR () = { | |
241 | + | let aS = { | |
242 | + | let V = ab() | |
243 | + | if ($isInstanceOf(V, "ByteVector")) | |
698 | 244 | then { | |
699 | - | let | |
700 | - | | |
245 | + | let ah = V | |
246 | + | ah | |
701 | 247 | } | |
702 | - | else if ($isInstanceOf( | |
703 | - | then | |
248 | + | else if ($isInstanceOf(V, "Unit")) | |
249 | + | then aQ.senderPublicKey | |
704 | 250 | else throw("Match error") | |
705 | 251 | } | |
706 | - | sigVerify( | |
252 | + | sigVerify(aQ.bodyBytes, aQ.proofs[0], aS) | |
707 | 253 | } | |
708 | 254 |
github/deemru/w8io/026f985 132.72 ms ◑