tx · CeYNUFbti1doGKDi8nQeASmWDt2UES2qRcH7ufykbRzn 3Mtztqg2zjDGfocDhjvuCZya7y7GwqYm1od: -0.02100000 Waves 2024.10.30 14:08 [3349522] smart account 3Mtztqg2zjDGfocDhjvuCZya7y7GwqYm1od > SELF 0.00000000 Waves
{ "type": 13, "id": "CeYNUFbti1doGKDi8nQeASmWDt2UES2qRcH7ufykbRzn", "fee": 2100000, "feeAssetId": null, "timestamp": 1730286515288, "version": 2, "chainId": 84, "sender": "3Mtztqg2zjDGfocDhjvuCZya7y7GwqYm1od", "senderPublicKey": "Gyf93vAqxgehCd6FnJ3tihn4UqBvzp9yWPUrZXVv3uwG", "proofs": [ "53bhmPZGRdc2oL7hg2nzrFh7QHUWbYosH5WDutsVqeTkQrWRNWciBJT5eBeaPeLfsJtzE7X2PcYNBFdYiHVyd87H" ], "script": "base64:BgItCAISBwoFCAgICAESBwoFCAgICAESABIDCgEIEgQKAggBEgUKAwgIARIDCgEIRwAHVkVSU0lPTgIIUE0tMC44LjAACWNvbmZpZ1N0cgkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzAg1jb25maWdBZGRyZXNzAiMzTjkxZTd3SGlWN1FhZERzeDNSVUpReHgxZXRxY0FLcmZIagAOQ09ORklHX0FERFJFU1MDCQAAAgUJY29uZmlnU3RyAgAFBHRoaXMJAQdBZGRyZXNzAQkA2QQBBQljb25maWdTdHIAFUFzc2V0c1dlaWdodHNEZWNpbWFscwAEAAVTY2FsZQCQTgAGU2NhbGU4AIDC1y8AB1NjYWxlMTYAgICE/qbe4REACEZlZVNjYWxlAJBOABFQb29sVG9rZW5EZWNpbWFscwAIAA5Qb29sVG9rZW5TY2FsZQkAbAYACgAABRFQb29sVG9rZW5EZWNpbWFscwAAAAAFBkhBTEZVUAAQTUlOX1NURVBTX0FNT1VOVAkBC3ZhbHVlT3JFbHNlAgkAmggCBQ5DT05GSUdfQUREUkVTUwIQbWluX3N0ZXBzX2Ftb3VudAABABBNQVhfU1R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lAoCBQNuaWwFCUFtb3VudE91dAFpARF0cmFuc2Zlck93bmVyc2hpcAEPbmV3T3duZXJBZGRyZXNzAwkBAiE9AgkApQgBCAUBaQZjYWxsZXIJAQx0cnlHZXRTdHJpbmcBAhBzdGF0aWNfcG9vbE93bmVyCQACAQIndGhpcyBjYWxsIGF2YWlsYWJsZSBvbmx5IGZvciBwb29sIG93bmVyCQDMCAIJAQtTdHJpbmdFbnRyeQICEHN0YXRpY19wb29sT3duZXIFD25ld093bmVyQWRkcmVzcwUDbmlsAGGkg4U=", "height": 3349522, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4Pr7KB1CKNKAUCZWUUBg4xzmVS1yrdUk7ptA9reRob1q Next: GAqm1EYvCt1AzcfvHVb8v7TZMfhSaf9pgCN3vDnFMFX2 Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = "PM-0. | |
4 | + | let a = "PM-0.8.0" | |
5 | 5 | ||
6 | 6 | let b = valueOrElse(getString(this, "configAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
7 | 7 | ||
23 | 23 | ||
24 | 24 | let j = pow(10, 0, i, 0, 0, HALFUP) | |
25 | 25 | ||
26 | - | let k = | |
26 | + | let k = valueOrElse(getInteger(c, "min_steps_amount"), 1) | |
27 | 27 | ||
28 | - | let l = valueOrElse(getInteger(c, " | |
28 | + | let l = valueOrElse(getInteger(c, "max_steps_amount"), 500) | |
29 | 29 | ||
30 | - | let m = valueOrElse(getInteger(c, " | |
30 | + | let m = valueOrElse(getInteger(c, "min_steps_interval"), 1) | |
31 | 31 | ||
32 | - | let n = valueOrElse(getInteger(c, " | |
32 | + | let n = valueOrElse(getInteger(c, "max_steps_interval"), 10000) | |
33 | 33 | ||
34 | - | let o = valueOrElse(getInteger(c, " | |
34 | + | let o = valueOrElse(getInteger(c, "min_weight"), 100) | |
35 | 35 | ||
36 | - | let p = valueOrElse(getInteger(c, " | |
36 | + | let p = valueOrElse(getInteger(c, "max_weight"), 9900) | |
37 | 37 | ||
38 | - | let q = valueOrElse(getInteger(c, "max_weight"), 9900) | |
39 | - | ||
40 | - | func r (s) = { | |
41 | - | let t = getInteger(this, s) | |
42 | - | if ($isInstanceOf(t, "Int")) | |
38 | + | func q (r) = { | |
39 | + | let s = getInteger(this, r) | |
40 | + | if ($isInstanceOf(s, "Int")) | |
43 | 41 | then { | |
44 | - | let | |
45 | - | | |
42 | + | let t = s | |
43 | + | t | |
46 | 44 | } | |
47 | 45 | else 0 | |
48 | 46 | } | |
49 | 47 | ||
50 | 48 | ||
51 | - | func | |
52 | - | let | |
53 | - | if ($isInstanceOf( | |
49 | + | func u (r) = { | |
50 | + | let s = getBinary(this, r) | |
51 | + | if ($isInstanceOf(s, "ByteVector")) | |
54 | 52 | then { | |
55 | - | let | |
56 | - | | |
53 | + | let t = s | |
54 | + | t | |
57 | 55 | } | |
58 | 56 | else base58'' | |
59 | 57 | } | |
60 | 58 | ||
61 | 59 | ||
62 | - | func | |
63 | - | let | |
64 | - | if ($isInstanceOf( | |
60 | + | func v (r) = { | |
61 | + | let s = getString(this, r) | |
62 | + | if ($isInstanceOf(s, "String")) | |
65 | 63 | then { | |
66 | - | let | |
67 | - | | |
64 | + | let t = s | |
65 | + | t | |
68 | 66 | } | |
69 | 67 | else "" | |
70 | 68 | } | |
71 | 69 | ||
72 | 70 | ||
73 | - | func | |
74 | - | let | |
75 | - | if ($isInstanceOf( | |
71 | + | func w (r) = { | |
72 | + | let s = getString(this, r) | |
73 | + | if ($isInstanceOf(s, "String")) | |
76 | 74 | then { | |
77 | - | let | |
78 | - | | |
75 | + | let t = s | |
76 | + | t | |
79 | 77 | } | |
80 | - | else throw(("no such key in data storage: " + | |
78 | + | else throw(("no such key in data storage: " + r)) | |
81 | 79 | } | |
82 | 80 | ||
83 | 81 | ||
84 | - | func | |
85 | - | let | |
86 | - | if ($isInstanceOf( | |
82 | + | func x (y) = { | |
83 | + | let s = y | |
84 | + | if ($isInstanceOf(s, "ByteVector")) | |
87 | 85 | then { | |
88 | - | let | |
89 | - | toBase58String( | |
86 | + | let t = s | |
87 | + | toBase58String(t) | |
90 | 88 | } | |
91 | 89 | else "WAVES" | |
92 | 90 | } | |
93 | 91 | ||
94 | 92 | ||
95 | - | func | |
93 | + | func z (A) = if ((A == "WAVES")) | |
96 | 94 | then unit | |
97 | - | else fromBase58String( | |
95 | + | else fromBase58String(A) | |
98 | 96 | ||
99 | 97 | ||
100 | - | func | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
98 | + | func B (y) = { | |
99 | + | let s = y | |
100 | + | if ($isInstanceOf(s, "ByteVector")) | |
103 | 101 | then { | |
104 | - | let | |
105 | - | assetBalance(this, | |
102 | + | let C = s | |
103 | + | assetBalance(this, C) | |
106 | 104 | } | |
107 | 105 | else wavesBalance(this).available | |
108 | 106 | } | |
109 | 107 | ||
110 | 108 | ||
111 | - | func | |
109 | + | func D (E,F) = (E ++ [z(F)]) | |
112 | 110 | ||
113 | 111 | ||
114 | - | func | |
112 | + | func G (E,F) = (E ++ [q((("static_" + x(F)) + "_weight"))]) | |
115 | 113 | ||
116 | 114 | ||
117 | - | func | |
115 | + | func H (E,F) = (E ++ [toString(q((("static_" + F) + "_weight")))]) | |
118 | 116 | ||
119 | 117 | ||
120 | - | func | |
118 | + | func I (E,F) = (E ++ [q((("static_" + x(F)) + "_decimals"))]) | |
121 | 119 | ||
122 | 120 | ||
123 | - | func | |
121 | + | func J (E,F) = (E ++ [q((("static_" + x(F)) + "_scale"))]) | |
124 | 122 | ||
125 | 123 | ||
126 | - | func | |
124 | + | func K (E,F) = (E ++ [parseIntValue(F)]) | |
127 | 125 | ||
128 | 126 | ||
129 | - | let | |
127 | + | let L = valueOrElse(getString(c, "usdnAssetIdStr"), "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p") | |
130 | 128 | ||
131 | - | let | |
129 | + | let M = valueOrElse(getString(c, "puzzleAssetIdStr"), "HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS") | |
132 | 130 | ||
133 | - | let | |
131 | + | let N = valueOrElse(getString(c, "usdtAssetIdStr"), "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ") | |
134 | 132 | ||
135 | - | let | |
133 | + | let O = valueOrElse(getString(c, "usdtPptAssetIdStr"), "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi") | |
136 | 134 | ||
137 | - | let | |
135 | + | let P = valueOrElse(getString(c, "romeAssetIdStr"), "AP4Cb5xLYGH6ZigHreCZHoXpQTWDkPsG2BHqfDUx6taJ") | |
138 | 136 | ||
139 | - | let R = "WAVES" | |
137 | + | let Q = "WAVES" | |
138 | + | ||
139 | + | let R = fromBase58String(L) | |
140 | 140 | ||
141 | 141 | let S = fromBase58String(M) | |
142 | 142 | ||
146 | 146 | ||
147 | 147 | let V = fromBase58String(P) | |
148 | 148 | ||
149 | - | let W = | |
149 | + | let W = unit | |
150 | 150 | ||
151 | - | let X = | |
151 | + | let X = [L, M, N, O, Q, P] | |
152 | 152 | ||
153 | - | let Y = | |
153 | + | let Y = Address(fromBase58String(valueOrElse(getString(c, "oracleAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
154 | 154 | ||
155 | - | let Z = Address(fromBase58String(valueOrElse(getString(c, " | |
155 | + | let Z = Address(fromBase58String(valueOrElse(getString(c, "feesAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
156 | 156 | ||
157 | - | let aa = | |
157 | + | let aa = valueOrElse(getString(c, "shutdownAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
158 | 158 | ||
159 | - | let ab = valueOrElse(getString(c, " | |
159 | + | let ab = valueOrElse(getString(c, "layer2Addresses"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
160 | 160 | ||
161 | - | let ac = valueOrElse(getString(c, " | |
161 | + | let ac = Address(fromBase58String(valueOrElse(getString(c, "coldMasterAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
162 | 162 | ||
163 | - | let ad = Address(fromBase58String(valueOrElse(getString(c, " | |
163 | + | let ad = Address(fromBase58String(valueOrElse(getString(c, "factoryAddress"), "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr"))) | |
164 | 164 | ||
165 | 165 | let ae = Address(fromBase58String(valueOrElse(getString(c, "factoryAddress"), "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T"))) | |
166 | 166 | ||
167 | 167 | let af = fromBase58String(valueOrElse(getString(c, "masterPubKey"), "4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU")) | |
168 | 168 | ||
169 | - | let ag = | |
169 | + | let ag = q("static_tokensAmount") | |
170 | 170 | ||
171 | 171 | let ah = { | |
172 | - | let ai = split( | |
172 | + | let ai = split(v("static_tokenIds"), ",") | |
173 | 173 | let aj = size(ai) | |
174 | 174 | let ak = nil | |
175 | 175 | func al (am,an) = if ((an >= aj)) | |
176 | 176 | then am | |
177 | - | else | |
177 | + | else D(am, ai[an]) | |
178 | 178 | ||
179 | 179 | func ao (am,an) = if ((an >= aj)) | |
180 | 180 | then am | |
189 | 189 | let ak = nil | |
190 | 190 | func aq (am,an) = if ((an >= aj)) | |
191 | 191 | then am | |
192 | - | else | |
192 | + | else G(am, ai[an]) | |
193 | 193 | ||
194 | 194 | func ar (am,an) = if ((an >= aj)) | |
195 | 195 | then am | |
204 | 204 | let ak = nil | |
205 | 205 | func at (am,an) = if ((an >= aj)) | |
206 | 206 | then am | |
207 | - | else | |
207 | + | else I(am, ai[an]) | |
208 | 208 | ||
209 | 209 | func au (am,an) = if ((an >= aj)) | |
210 | 210 | then am | |
219 | 219 | let ak = nil | |
220 | 220 | func aw (am,an) = if ((an >= aj)) | |
221 | 221 | then am | |
222 | - | else | |
222 | + | else J(am, ai[an]) | |
223 | 223 | ||
224 | 224 | func ax (am,an) = if ((an >= aj)) | |
225 | 225 | then am | |
228 | 228 | ax(aw(aw(aw(aw(aw(aw(aw(aw(aw(aw(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
229 | 229 | } | |
230 | 230 | ||
231 | - | let ay = | |
231 | + | let ay = q("static_fee") | |
232 | 232 | ||
233 | 233 | let az = ah | |
234 | 234 | ||
235 | 235 | func aA () = { | |
236 | - | let aB = addressFromString(ab) | |
237 | - | if ((aB == unit)) | |
236 | + | let aB = valueOrElse(getInteger(ae, ("pool__" + toString(this))), 0) | |
237 | + | let aC = valueOrElse(getInteger(ae, ("pool__status__" + toString(aB))), 2) | |
238 | + | aC | |
239 | + | } | |
240 | + | ||
241 | + | ||
242 | + | func aD (r) = getIntegerValue(ae, ("setup__" + r)) | |
243 | + | ||
244 | + | ||
245 | + | let aE = aD("virtualLiquidity") | |
246 | + | ||
247 | + | let aF = aD("creationFee") | |
248 | + | ||
249 | + | let aG = aD("curveTarget") | |
250 | + | ||
251 | + | func aH () = { | |
252 | + | let aI = addressFromString(aa) | |
253 | + | if ((aI == unit)) | |
238 | 254 | then false | |
239 | 255 | else { | |
240 | - | let | |
241 | - | if ($isInstanceOf( | |
256 | + | let s = getBoolean(value(aI), "is_shutdown") | |
257 | + | if ($isInstanceOf(s, "Boolean")) | |
242 | 258 | then { | |
243 | - | let | |
244 | - | | |
259 | + | let aJ = s | |
260 | + | aJ | |
245 | 261 | } | |
246 | 262 | else false | |
247 | 263 | } | |
248 | 264 | } | |
249 | 265 | ||
250 | 266 | ||
251 | - | func aD (aE) = { | |
252 | - | let aF = y(ah[aE]) | |
253 | - | r((("global_" + aF) + "_balance")) | |
254 | - | } | |
255 | - | ||
256 | - | ||
257 | - | func aG () = { | |
258 | - | let t = getInteger("static_KMult") | |
259 | - | if ($isInstanceOf(t, "Int")) | |
267 | + | func aK (A) = { | |
268 | + | let s = getInteger(Y, (A + "_twap5B")) | |
269 | + | if ($isInstanceOf(s, "Int")) | |
260 | 270 | then { | |
261 | - | let aC = t | |
262 | - | aC | |
263 | - | } | |
264 | - | else g | |
265 | - | } | |
266 | - | ||
267 | - | ||
268 | - | func aH () = fraction(r("global_poolToken_amount"), aG(), g) | |
269 | - | ||
270 | - | ||
271 | - | func aI (B) = { | |
272 | - | let t = getInteger(Z, (B + "_twap5B")) | |
273 | - | if ($isInstanceOf(t, "Int")) | |
274 | - | then { | |
275 | - | let aC = t | |
276 | - | aC | |
271 | + | let aJ = s | |
272 | + | aJ | |
277 | 273 | } | |
278 | 274 | else 1000000 | |
279 | 275 | } | |
280 | 276 | ||
281 | 277 | ||
282 | - | func | |
283 | - | let | |
284 | - | let | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | fraction( | |
278 | + | func aL (y,aM,aN) = { | |
279 | + | let aO = q((("static_" + x(y)) + "_weight")) | |
280 | + | let aP = v("static_feeToken") | |
281 | + | let aQ = getIntegerValue(this, (("static_" + aP) + "_scale")) | |
282 | + | let aR = value(indexOf(ah, z(aP))) | |
283 | + | let aS = ap[aR] | |
284 | + | let aT = q((("global_" + aP) + "_balance")) | |
285 | + | let aU = fraction(aM, (aT / aS), (aN / aO)) | |
286 | + | let aV = aK(aP) | |
287 | + | fraction(aU, aV, aQ) | |
292 | 288 | } | |
293 | 289 | ||
294 | 290 | ||
295 | - | func aU (aV,aW) = { | |
296 | - | func aX (F,aY) = { | |
297 | - | let aZ = r((("global_" + y(aY)) + "_balance")) | |
298 | - | let ba = aH() | |
299 | - | let bb = r((("static_" + y(aY)) + "_scale")) | |
300 | - | let bc = fraction((toBigInt((ba - aV)) * toBigInt(f)), toBigInt(f), toBigInt(ba), DOWN) | |
301 | - | let aK = toInt(fraction((toBigInt(g) - bc), toBigInt(aZ), toBigInt(g), CEILING)) | |
302 | - | (F ++ [IntegerEntry((("global_" + y(aY)) + "_balance"), (aZ - aK)), ScriptTransfer(aW, aK, aY)]) | |
303 | - | } | |
304 | - | ||
305 | - | let ai = ah | |
306 | - | let aj = size(ai) | |
307 | - | let ak = nil | |
308 | - | func bd (am,an) = if ((an >= aj)) | |
309 | - | then am | |
310 | - | else aX(am, ai[an]) | |
311 | - | ||
312 | - | func be (am,an) = if ((an >= aj)) | |
313 | - | then am | |
314 | - | else throw("List size exceeds 10") | |
315 | - | ||
316 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
291 | + | func aW (aX,aY,aZ,ba,bb) = { | |
292 | + | let bc = value(indexOf(ah, aY)) | |
293 | + | let bd = value(indexOf(ah, aZ)) | |
294 | + | if ((bc == bd)) | |
295 | + | then aX | |
296 | + | else fraction(bb, ((f * f) - toInt(pow(fraction((toBigInt(ba) * toBigInt(10000)), toBigInt((f * f)), (toBigInt((ba + aX)) * toBigInt(10000)), HALFUP), 16, toBigInt(fraction(ap[bc], 1000000000000, ap[bd])), 12, 16, CEILING))), (f * f), HALFEVEN) | |
317 | 297 | } | |
318 | 298 | ||
319 | 299 | ||
320 | - | func bf (bg,bh,bi,bj,bk) = { | |
321 | - | let bl = value(indexOf(ah, bh)) | |
322 | - | let bm = value(indexOf(ah, bi)) | |
323 | - | if ((bl == bm)) | |
324 | - | then bg | |
325 | - | else fraction(bk, ((f * f) - toInt(pow(fraction((toBigInt(bj) * toBigInt(10000)), toBigInt((f * f)), (toBigInt((bj + bg)) * toBigInt(10000)), HALFUP), 16, toBigInt(fraction(ap[bl], 1000000000000, ap[bm])), 12, 16, CEILING))), (f * f), HALFEVEN) | |
300 | + | func be (y,A,aN,bf) = { | |
301 | + | let bg = q("global_indexStaked") | |
302 | + | let bh = bf | |
303 | + | let bi = (B(y) - aN) | |
304 | + | let bj = if ((bi > bh)) | |
305 | + | then bi | |
306 | + | else bh | |
307 | + | let bk = (bj - bh) | |
308 | + | let bl = if ((bg == 0)) | |
309 | + | then 0 | |
310 | + | else fraction(bk, f, bg) | |
311 | + | let bm = q((("global_lastCheck_" + A) + "_interest")) | |
312 | + | (bm + bl) | |
326 | 313 | } | |
327 | 314 | ||
328 | 315 | ||
329 | - | func bn (z,B,aL,bo) = { | |
330 | - | let bp = r("global_indexStaked") | |
331 | - | let bq = bo | |
332 | - | let br = (C(z) - aL) | |
333 | - | let bs = if ((br > bq)) | |
334 | - | then br | |
335 | - | else bq | |
336 | - | let bt = (bs - bq) | |
337 | - | let bu = if ((bp == 0)) | |
338 | - | then 0 | |
339 | - | else fraction(bt, f, bp) | |
340 | - | let bv = r((("global_lastCheck_" + B) + "_interest")) | |
341 | - | (bv + bu) | |
316 | + | func bn (bo) = { | |
317 | + | let bp = toString(bo) | |
318 | + | let bq = q((bp + "_indexStaked")) | |
319 | + | func br (E,y) = { | |
320 | + | let A = x(y) | |
321 | + | let aN = q((("global_" + x(y)) + "_balance")) | |
322 | + | let bf = q((("global_lastCheck_" + A) + "_earnings")) | |
323 | + | let bs = be(y, A, aN, bf) | |
324 | + | let bj = max([bf, (B(y) - aN)]) | |
325 | + | let bt = fraction(bq, (bs - q((((bp + "_lastCheck_") + A) + "_interest"))), f) | |
326 | + | let bu = if ((bt == 0)) | |
327 | + | then nil | |
328 | + | else [ScriptTransfer(bo, bt, y)] | |
329 | + | $Tuple2(((E._1 ++ bu) ++ [IntegerEntry((("global_lastCheck_" + A) + "_earnings"), (bj - bt)), IntegerEntry((("global_lastCheck_" + A) + "_interest"), bs), IntegerEntry((((bp + "_lastCheck_") + A) + "_interest"), bs)]), (E._2 + aL(y, bt, aN))) | |
330 | + | } | |
331 | + | ||
332 | + | let E = { | |
333 | + | let ai = az | |
334 | + | let aj = size(ai) | |
335 | + | let ak = $Tuple2(nil, 0) | |
336 | + | func bv (am,an) = if ((an >= aj)) | |
337 | + | then am | |
338 | + | else br(am, ai[an]) | |
339 | + | ||
340 | + | func bw (am,an) = if ((an >= aj)) | |
341 | + | then am | |
342 | + | else throw("List size exceeds 10") | |
343 | + | ||
344 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
345 | + | } | |
346 | + | $Tuple2((E._1 ++ [IntegerEntry((bp + "_claimedRewardUSD"), (q((bp + "_claimedRewardUSD")) + E._2)), IntegerEntry((bp + "_lastClaim"), lastBlock.timestamp)]), E._2) | |
342 | 347 | } | |
343 | 348 | ||
344 | 349 | ||
345 | - | func bw (bx) = { | |
346 | - | let by = toString(bx) | |
347 | - | let bz = r((by + "_indexStaked")) | |
348 | - | func bA (F,z) = { | |
349 | - | let B = y(z) | |
350 | - | let aL = r((("global_" + y(z)) + "_balance")) | |
351 | - | let bo = r((("global_lastCheck_" + B) + "_earnings")) | |
352 | - | let bB = bn(z, B, aL, bo) | |
353 | - | let bs = max([bo, (C(z) - aL)]) | |
354 | - | let bC = fraction(bz, (bB - r((((by + "_lastCheck_") + B) + "_interest"))), f) | |
355 | - | let bD = if ((bC == 0)) | |
356 | - | then nil | |
357 | - | else [ScriptTransfer(bx, bC, z)] | |
358 | - | $Tuple2(((F._1 ++ bD) ++ [IntegerEntry((("global_lastCheck_" + B) + "_earnings"), (bs - bC)), IntegerEntry((("global_lastCheck_" + B) + "_interest"), bB), IntegerEntry((((by + "_lastCheck_") + B) + "_interest"), bB)]), (F._2 + aJ(z, bC, aL))) | |
359 | - | } | |
360 | - | ||
361 | - | let F = { | |
362 | - | let ai = az | |
363 | - | let aj = size(ai) | |
364 | - | let ak = $Tuple2(nil, 0) | |
365 | - | func bd (am,an) = if ((an >= aj)) | |
366 | - | then am | |
367 | - | else bA(am, ai[an]) | |
368 | - | ||
369 | - | func be (am,an) = if ((an >= aj)) | |
370 | - | then am | |
371 | - | else throw("List size exceeds 10") | |
372 | - | ||
373 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
374 | - | } | |
375 | - | $Tuple2((F._1 ++ [IntegerEntry((by + "_claimedRewardUSD"), (r((by + "_claimedRewardUSD")) + F._2)), IntegerEntry((by + "_lastClaim"), lastBlock.timestamp)]), F._2) | |
376 | - | } | |
350 | + | func bx (E,by) = (E + parseIntValue(by)) | |
377 | 351 | ||
378 | 352 | ||
379 | - | func bE (by,aK) = { | |
380 | - | let bF = bw(addressFromStringValue(by))._1 | |
381 | - | (bF ++ [IntegerEntry((by + "_indexStaked"), (r((by + "_indexStaked")) + aK)), IntegerEntry("global_indexStaked", (r("global_indexStaked") + aK))]) | |
382 | - | } | |
353 | + | func bz (E,bA) = if (if ((indexOf(X, bA) != unit)) | |
354 | + | then (E == "") | |
355 | + | else false) | |
356 | + | then bA | |
357 | + | else E | |
383 | 358 | ||
384 | 359 | ||
385 | - | func bG (F,bH) = (F + parseIntValue(bH)) | |
386 | - | ||
387 | - | ||
388 | - | func bI (F,bJ) = if (if ((indexOf(Y, bJ) != unit)) | |
389 | - | then (F == "") | |
390 | - | else false) | |
391 | - | then bJ | |
392 | - | else F | |
393 | - | ||
394 | - | ||
395 | - | func bK (bL) = { | |
396 | - | let bM = split(w("static_tokenIds"), ",") | |
397 | - | let bN = bL | |
398 | - | func bO (F,z) = if ((indexOf(bN, z) == unit)) | |
399 | - | then (F ++ [z]) | |
400 | - | else F | |
401 | - | ||
402 | - | let ai = bM | |
403 | - | let aj = size(ai) | |
404 | - | let ak = bN | |
405 | - | func bd (am,an) = if ((an >= aj)) | |
406 | - | then am | |
407 | - | else bO(am, ai[an]) | |
408 | - | ||
409 | - | func be (am,an) = if ((an >= aj)) | |
410 | - | then am | |
411 | - | else throw("List size exceeds 10") | |
412 | - | ||
413 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
414 | - | } | |
415 | - | ||
416 | - | ||
417 | - | func bP (bL) = { | |
418 | - | let bM = split(w("static_tokenIds"), ",") | |
419 | - | func bQ (F,z) = if ((indexOf(bL, z) == unit)) | |
420 | - | then (F + 1) | |
421 | - | else F | |
422 | - | ||
423 | - | func bR (F,z) = if ((indexOf(bM, z) == unit)) | |
424 | - | then (F + 1) | |
425 | - | else F | |
426 | - | ||
427 | - | let bS = { | |
428 | - | let ai = bM | |
429 | - | let aj = size(ai) | |
430 | - | let ak = 0 | |
431 | - | func bd (am,an) = if ((an >= aj)) | |
432 | - | then am | |
433 | - | else bQ(am, ai[an]) | |
434 | - | ||
435 | - | func be (am,an) = if ((an >= aj)) | |
436 | - | then am | |
437 | - | else throw("List size exceeds 10") | |
438 | - | ||
439 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
440 | - | } | |
441 | - | let bT = { | |
442 | - | let ai = bL | |
443 | - | let aj = size(ai) | |
444 | - | let ak = 0 | |
445 | - | func bU (am,an) = if ((an >= aj)) | |
446 | - | then am | |
447 | - | else bR(am, ai[an]) | |
448 | - | ||
449 | - | func bV (am,an) = if ((an >= aj)) | |
450 | - | then am | |
451 | - | else throw("List size exceeds 10") | |
452 | - | ||
453 | - | bV(bU(bU(bU(bU(bU(bU(bU(bU(bU(bU(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
454 | - | } | |
455 | - | (bS + bT) | |
456 | - | } | |
457 | - | ||
458 | - | ||
459 | - | func bW (bX,bY) = { | |
460 | - | func bZ (F,bJ) = if ((0 >= bJ.amount)) | |
461 | - | then throw(((("Too low payment amount for " + y(bJ.assetId)) + ": ") + toString(bJ.amount))) | |
462 | - | else (F ++ [y(bJ.assetId)]) | |
463 | - | ||
464 | - | let ca = { | |
465 | - | let ai = bY | |
466 | - | let aj = size(ai) | |
467 | - | let ak = nil | |
468 | - | func bd (am,an) = if ((an >= aj)) | |
469 | - | then am | |
470 | - | else bZ(am, ai[an]) | |
471 | - | ||
472 | - | func be (am,an) = if ((an >= aj)) | |
473 | - | then am | |
474 | - | else throw("List size exceeds 10") | |
475 | - | ||
476 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
477 | - | } | |
478 | - | func cb (F,bJ) = if ((indexOf(bX, bJ) == unit)) | |
479 | - | then throw(((bJ + " asset is present in payments, but is not in new assets: ") + makeString(bX, ","))) | |
480 | - | else (F + 1) | |
481 | - | ||
482 | - | func cc (F,bJ) = if ((indexOf(ca, bJ) == unit)) | |
483 | - | then throw(((bJ + " asset is present in new assets, but is not in payments: ") + makeString(ca, ","))) | |
484 | - | else (F + 1) | |
485 | - | ||
486 | - | let cd = { | |
487 | - | let ai = ca | |
488 | - | let aj = size(ai) | |
489 | - | let ak = 0 | |
490 | - | func bU (am,an) = if ((an >= aj)) | |
491 | - | then am | |
492 | - | else cb(am, ai[an]) | |
493 | - | ||
494 | - | func bV (am,an) = if ((an >= aj)) | |
495 | - | then am | |
496 | - | else throw("List size exceeds 10") | |
497 | - | ||
498 | - | bV(bU(bU(bU(bU(bU(bU(bU(bU(bU(bU(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
499 | - | } | |
500 | - | let ce = { | |
501 | - | let ai = bX | |
502 | - | let aj = size(ai) | |
503 | - | let ak = 0 | |
504 | - | func cf (am,an) = if ((an >= aj)) | |
505 | - | then am | |
506 | - | else cc(am, ai[an]) | |
507 | - | ||
508 | - | func cg (am,an) = if ((an >= aj)) | |
509 | - | then am | |
510 | - | else throw("List size exceeds 10") | |
511 | - | ||
512 | - | cg(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
513 | - | } | |
514 | - | (cd + ce) | |
515 | - | } | |
516 | - | ||
517 | - | ||
518 | - | func ch (bh,bi,ci,cj,ck) = { | |
519 | - | let bg = ci | |
520 | - | let cl = A(bh) | |
521 | - | let cm = A(bi) | |
522 | - | let cn = (f / r((("static_" + bh) + "_scale"))) | |
523 | - | let co = (f / r((("static_" + bi) + "_scale"))) | |
524 | - | let cp = w("static_feeToken") | |
525 | - | let cq = if ((cp == "")) | |
526 | - | then X | |
527 | - | else A(cp) | |
528 | - | let cr = r((("global_" + y(cl)) + "_balance")) | |
529 | - | let cs = r((("global_" + bi) + "_balance")) | |
530 | - | let ct = (cr * cn) | |
531 | - | let cu = (cs * co) | |
532 | - | let cv = fraction(bg, ay, h) | |
533 | - | let cw = (bg - cv) | |
534 | - | let cx = (cw * cn) | |
535 | - | let cy = bf(cx, cl, cm, ct, cu) | |
536 | - | let cz = fraction(cy, 1, co) | |
537 | - | let cA = (cs - cz) | |
538 | - | let cB = (cr + cw) | |
539 | - | let cC = if ((cq == cl)) | |
540 | - | then cB | |
541 | - | else if ((cq == cm)) | |
542 | - | then cA | |
543 | - | else r((("global_" + y(cq)) + "_balance")) | |
544 | - | let cD = bf(cv, cl, cq, cr, cC) | |
545 | - | if ((cj > cz)) | |
360 | + | func bB (aY,aZ,bC,bD,bE) = { | |
361 | + | let aX = bC | |
362 | + | let bF = z(aY) | |
363 | + | let bG = z(aZ) | |
364 | + | let bH = (f / q((("static_" + aY) + "_scale"))) | |
365 | + | let bI = (f / q((("static_" + aZ) + "_scale"))) | |
366 | + | let bJ = v("static_feeToken") | |
367 | + | let bK = if ((bJ == "")) | |
368 | + | then W | |
369 | + | else z(bJ) | |
370 | + | let bL = q((("global_" + x(bF)) + "_balance")) | |
371 | + | let bM = q((("global_" + aZ) + "_balance")) | |
372 | + | let bN = (bL * bH) | |
373 | + | let bO = (bM * bI) | |
374 | + | let bP = fraction(aX, ay, h) | |
375 | + | let bQ = (aX - bP) | |
376 | + | let bR = (bQ * bH) | |
377 | + | let bS = aW(bR, bF, bG, bN, bO) | |
378 | + | let bT = fraction(bS, 1, bI) | |
379 | + | let bU = (bM - bT) | |
380 | + | let bV = (bL + bQ) | |
381 | + | let bW = if ((bK == bF)) | |
382 | + | then bV | |
383 | + | else if ((bK == bG)) | |
384 | + | then bU | |
385 | + | else q((("global_" + x(bK)) + "_balance")) | |
386 | + | let bX = aW(bP, bF, bK, bL, bW) | |
387 | + | if ((bD > bT)) | |
546 | 388 | then throw("amount to recieve is lower than given one") | |
547 | - | else if (( | |
389 | + | else if ((bG == bF)) | |
548 | 390 | then throw("this swap is not allowed") | |
549 | - | else if ((0 > ( | |
391 | + | else if ((0 > (bM - bT))) | |
550 | 392 | then throw("contract is out of reserves") | |
551 | - | else if ( | |
393 | + | else if (aH()) | |
552 | 394 | then throw("contract is on stop") | |
553 | 395 | else { | |
554 | - | let | |
555 | - | let | |
556 | - | let | |
557 | - | let | |
558 | - | then | |
396 | + | let bY = fraction(bX, 1, 10) | |
397 | + | let bZ = fraction(bX, 4, 10) | |
398 | + | let ca = bV | |
399 | + | let cb = (bU - (if ((bG == bK)) | |
400 | + | then bX | |
559 | 401 | else 0)) | |
560 | - | let | |
561 | - | then ( | |
402 | + | let cc = if (if ((bK != bF)) | |
403 | + | then (bK != bG) | |
562 | 404 | else false) | |
563 | - | then ( | |
405 | + | then (bW - bX) | |
564 | 406 | else unit | |
565 | - | let | |
566 | - | let | |
567 | - | let | |
568 | - | then IntegerEntry((("global_" + | |
407 | + | let cd = IntegerEntry((("global_" + x(bF)) + "_balance"), ca) | |
408 | + | let ce = IntegerEntry((("global_" + aZ) + "_balance"), cb) | |
409 | + | let cf = if ((cc != unit)) | |
410 | + | then IntegerEntry((("global_" + x(bK)) + "_balance"), value(cc)) | |
569 | 411 | else StringEntry("hello", "world") | |
570 | - | let | |
571 | - | $Tuple2([ | |
412 | + | let cg = aL(bF, aX, bL) | |
413 | + | $Tuple2([ce, cd, cf, ScriptTransfer(addressFromStringValue(bE), bT, bG), ScriptTransfer(addressFromStringValue(v("static_poolOwner")), bY, bK), IntegerEntry("global_earnedByOwner", (q("global_earnedByOwner") + bY)), IntegerEntry("global_volume_usd", (q("global_volume_usd") + cg)), ScriptTransfer(Z, bZ, bK)], bT) | |
572 | 414 | } | |
573 | 415 | } | |
574 | 416 | ||
575 | 417 | ||
576 | - | @Callable(cN) | |
577 | - | func deInit () = if (aA()) | |
578 | - | then throw("contract is on stop") | |
579 | - | else if ((cN.caller != this)) | |
580 | - | then throw("admin only") | |
581 | - | else [IntegerEntry("global_wasInited", 0)] | |
418 | + | @Callable(ch) | |
419 | + | func initPool (ci,cj,ck,cl,cm) = { | |
420 | + | func cn (co) = { | |
421 | + | func br (E,cp) = { | |
422 | + | let y = cp.assetId | |
423 | + | func cq (E,by) = if ((by == y)) | |
424 | + | then value(indexOf(ah, by)) | |
425 | + | else E | |
582 | 426 | ||
583 | - | ||
584 | - | ||
585 | - | @Callable(cN) | |
586 | - | func initPool (cO,cP,cQ,cR,cS) = { | |
587 | - | func cT (bY) = { | |
588 | - | func bA (F,cU) = { | |
589 | - | let z = cU.assetId | |
590 | - | func cV (F,bH) = if ((bH == z)) | |
591 | - | then value(indexOf(ah, bH)) | |
592 | - | else F | |
593 | - | ||
594 | - | let cW = { | |
427 | + | let cr = { | |
595 | 428 | let ai = ah | |
596 | 429 | let aj = size(ai) | |
597 | 430 | let ak = 1 | |
598 | - | func | |
431 | + | func bv (am,an) = if ((an >= aj)) | |
599 | 432 | then am | |
600 | - | else | |
433 | + | else cq(am, ai[an]) | |
601 | 434 | ||
602 | - | func | |
435 | + | func bw (am,an) = if ((an >= aj)) | |
603 | 436 | then am | |
604 | 437 | else throw("List size exceeds 10") | |
605 | 438 | ||
606 | - | | |
439 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
607 | 440 | } | |
608 | - | fraction( | |
441 | + | fraction(E, pow(cp.amount, as[cr], ap[cr], d, 8, FLOOR), f) | |
609 | 442 | } | |
610 | 443 | ||
611 | - | let ai = | |
444 | + | let ai = co | |
612 | 445 | let aj = size(ai) | |
613 | 446 | let ak = j | |
614 | - | func | |
447 | + | func bv (am,an) = if ((an >= aj)) | |
615 | 448 | then am | |
616 | - | else | |
449 | + | else br(am, ai[an]) | |
617 | 450 | ||
618 | - | func | |
451 | + | func bw (am,an) = if ((an >= aj)) | |
619 | 452 | then am | |
620 | 453 | else throw("List size exceeds 10") | |
621 | 454 | ||
622 | - | | |
455 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
623 | 456 | } | |
624 | 457 | ||
625 | - | let | |
626 | - | let | |
627 | - | let | |
628 | - | let | |
629 | - | let | |
630 | - | let | |
631 | - | let | |
632 | - | let | |
633 | - | let | |
634 | - | let ai = | |
458 | + | let cs = Issue(ck, cl, cm, 8, false) | |
459 | + | let ct = calculateAssetId(cs) | |
460 | + | let cu = x(ct) | |
461 | + | let cv = "5000,5000" | |
462 | + | let cw = "WAVES" | |
463 | + | let cx = Address(fromBase58String(cj)) | |
464 | + | let cy = ("WAVES," + cu) | |
465 | + | let cz = split(cy, ",") | |
466 | + | let cA = { | |
467 | + | let ai = cz | |
635 | 468 | let aj = size(ai) | |
636 | 469 | let ak = nil | |
637 | - | func | |
470 | + | func bv (am,an) = if ((an >= aj)) | |
638 | 471 | then am | |
639 | - | else | |
472 | + | else D(am, ai[an]) | |
640 | 473 | ||
641 | - | func | |
474 | + | func bw (am,an) = if ((an >= aj)) | |
642 | 475 | then am | |
643 | 476 | else throw("List size exceeds 10") | |
644 | 477 | ||
645 | - | | |
478 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
646 | 479 | } | |
647 | - | let | |
648 | - | let | |
649 | - | let ai = | |
480 | + | let cB = 100 | |
481 | + | let aP = { | |
482 | + | let ai = cz | |
650 | 483 | let aj = size(ai) | |
651 | 484 | let ak = "" | |
652 | - | func | |
485 | + | func cC (am,an) = if ((an >= aj)) | |
653 | 486 | then am | |
654 | - | else | |
487 | + | else bz(am, ai[an]) | |
655 | 488 | ||
656 | - | func | |
489 | + | func cD (am,an) = if ((an >= aj)) | |
657 | 490 | then am | |
658 | 491 | else throw("List size exceeds 10") | |
659 | 492 | ||
660 | - | | |
493 | + | cD(cC(cC(cC(cC(cC(cC(cC(cC(cC(cC(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
661 | 494 | } | |
662 | - | let | |
663 | - | let | |
664 | - | let | |
495 | + | let cp = ch.payments[0] | |
496 | + | let aM = cp.amount | |
497 | + | let cE = if ((cp.assetId == unit)) | |
665 | 498 | then "WAVES" | |
666 | 499 | else throw("you have to attach some WAVES") | |
667 | 500 | if ((this != this)) | |
668 | - | then throw(" | |
669 | - | else if (( | |
501 | + | then throw("self-invoke only") | |
502 | + | else if ((aP == "")) | |
670 | 503 | then throw("pool must have one of the supported fee assets in the composition") | |
671 | - | else if ((size( | |
504 | + | else if ((size(ci) > 13)) | |
672 | 505 | then throw("too large pool domain") | |
673 | - | else if (if (( | |
506 | + | else if (if ((cB > 500)) | |
674 | 507 | then true | |
675 | - | else (0 > | |
508 | + | else (0 > cB)) | |
676 | 509 | then throw("fee value must be between 50 and 500 (0.5-5%)") | |
677 | - | else if ( | |
510 | + | else if (aH()) | |
678 | 511 | then throw("contract is on stop") | |
679 | 512 | else { | |
680 | - | let | |
681 | - | let | |
682 | - | let ai = | |
513 | + | let cF = split(cv, ",") | |
514 | + | let cG = { | |
515 | + | let ai = cF | |
683 | 516 | let aj = size(ai) | |
684 | 517 | let ak = 0 | |
685 | - | func | |
518 | + | func cH (am,an) = if ((an >= aj)) | |
686 | 519 | then am | |
687 | - | else | |
520 | + | else bx(am, ai[an]) | |
688 | 521 | ||
689 | - | func | |
522 | + | func cI (am,an) = if ((an >= aj)) | |
690 | 523 | then am | |
691 | 524 | else throw("List size exceeds 10") | |
692 | 525 | ||
693 | - | | |
526 | + | cI(cH(cH(cH(cH(cH(cH(cH(cH(cH(cH(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
694 | 527 | } | |
695 | - | func | |
696 | - | then | |
528 | + | func cJ (E,cK) = if ((cK >= size(cA))) | |
529 | + | then E | |
697 | 530 | else { | |
698 | - | let | |
699 | - | ( | |
531 | + | let cL = 8 | |
532 | + | (E ++ [IntegerEntry((("static_" + cz[cK]) + "_scale"), pow(10, 0, cL, 0, 0, DOWN)), IntegerEntry((("static_" + cz[cK]) + "_decimals"), cL), IntegerEntry((("static_" + cz[cK]) + "_weight"), value(parseInt(cF[cK])))]) | |
700 | 533 | } | |
701 | 534 | ||
702 | - | let | |
703 | - | if (( | |
535 | + | let cM = cn(ch.payments) | |
536 | + | if ((cG != 10000)) | |
704 | 537 | then throw("sum of token weights must be equal to 10000") | |
705 | - | else if (( | |
538 | + | else if ((cM == 0)) | |
706 | 539 | then throw("you need a bigger tokens amount to launch the pool") | |
707 | 540 | else { | |
708 | - | let | |
709 | - | let | |
541 | + | let cN = Issue(("PZ " + ci), "Puzzle Swap: pool index token", cM, i, true, unit, 0) | |
542 | + | let cO = calculateAssetId(cN) | |
710 | 543 | $Tuple2(((({ | |
711 | 544 | let ai = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
712 | 545 | let aj = size(ai) | |
713 | 546 | let ak = nil | |
714 | - | func | |
547 | + | func cP (am,an) = if ((an >= aj)) | |
715 | 548 | then am | |
716 | - | else | |
549 | + | else cJ(am, ai[an]) | |
717 | 550 | ||
718 | - | func | |
551 | + | func cQ (am,an) = if ((an >= aj)) | |
719 | 552 | then am | |
720 | 553 | else throw("List size exceeds 10") | |
721 | 554 | ||
722 | - | | |
723 | - | } ++ [ | |
555 | + | cQ(cP(cP(cP(cP(cP(cP(cP(cP(cP(cP(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
556 | + | } ++ [cs, StringEntry("static_tokenIds", cy), StringEntry("static_feeToken", aP), StringEntry("static_tokenWeights", cv), IntegerEntry("static_tokensAmount", size(cA)), StringEntry("static_poolDomain", ci), StringEntry("static_baseTokenId", cw), StringEntry("static_poolOwner", cj), IntegerEntry("static_fee", cB), IntegerEntry("static_KMult", g), IntegerEntry("global_wasPreInited", 1)]) ++ [IntegerEntry("global_WAVES_balance", aE), IntegerEntry((("global_" + cu) + "_balance"), cm)]) ++ [cN, IntegerEntry("global_poolToken_amount", cM), IntegerEntry("global_wasInited", 1), BinaryEntry("global_poolToken_id", cO), StringEntry("static_poolToken_idStr", x(cO)), IntegerEntry((toString(ch.caller) + "_indexStaked"), cM), IntegerEntry("global_indexStaked", cM)]), cu) | |
724 | 557 | } | |
725 | 558 | } | |
726 | 559 | } | |
727 | 560 | ||
728 | 561 | ||
729 | 562 | ||
730 | - | @Callable( | |
731 | - | func init ( | |
563 | + | @Callable(ch) | |
564 | + | func init (ci,cj,ck,cl,cm) = if ((ch.caller != ae)) | |
732 | 565 | then throw("admin only") | |
733 | 566 | else { | |
734 | - | let | |
735 | - | if (( | |
567 | + | let cR = invoke(this, "initPool", [ci, cj, ck, cl, cm], nil) | |
568 | + | if ((cR == cR)) | |
736 | 569 | then { | |
737 | - | let | |
738 | - | let | |
739 | - | if ($isInstanceOf( | |
740 | - | then | |
741 | - | else throw(($getType( | |
570 | + | let cu = { | |
571 | + | let cS = cR | |
572 | + | if ($isInstanceOf(cS, "String")) | |
573 | + | then cS | |
574 | + | else throw(($getType(cS) + " couldn't be cast to String")) | |
742 | 575 | } | |
743 | - | | |
576 | + | bB("WAVES", cu, (ch.payments[0].amount - aF), 0, toString(ch.caller))._1 | |
744 | 577 | } | |
745 | 578 | else throw("Strict value is not equal to itself.") | |
746 | 579 | } | |
747 | 580 | ||
748 | 581 | ||
749 | 582 | ||
750 | - | @Callable(cN) | |
751 | - | func redeemIndex (du) = { | |
752 | - | let cU = cN.payments[0] | |
753 | - | if ((cU.assetId != v("global_poolToken_id"))) | |
754 | - | then throw("please attach pool share token") | |
755 | - | else if (aA()) | |
756 | - | then throw("contract is on stop") | |
757 | - | else { | |
758 | - | let dv = cU.amount | |
759 | - | let dw = fraction(dv, aG(), g, DOWN) | |
760 | - | let bN = aU(dw, if (du) | |
761 | - | then cN.originCaller | |
762 | - | else cN.caller) | |
763 | - | (bN ++ [Burn(v("global_poolToken_id"), dv), IntegerEntry("global_poolToken_amount", (r("global_poolToken_amount") - dv))]) | |
764 | - | } | |
583 | + | @Callable(ch) | |
584 | + | func claimIndexRewards () = if (aH()) | |
585 | + | then throw("contract is on stop") | |
586 | + | else bn(ch.caller) | |
587 | + | ||
588 | + | ||
589 | + | ||
590 | + | @Callable(ch) | |
591 | + | func evaluateClaim (cT) = $Tuple2(nil, bn(addressFromStringValue(cT))._2) | |
592 | + | ||
593 | + | ||
594 | + | ||
595 | + | @Callable(ch) | |
596 | + | func swap (aZ,bD) = { | |
597 | + | let aC = aA() | |
598 | + | if ((2 > aC)) | |
599 | + | then { | |
600 | + | let cp = if ((size(ch.payments) == 1)) | |
601 | + | then value(ch.payments[0]) | |
602 | + | else throw("please attach exactly one payment") | |
603 | + | let aX = value(ch.payments[0].amount) | |
604 | + | let bF = ch.payments[0].assetId | |
605 | + | let cU = bB(x(bF), aZ, aX, bD, toString(ch.caller)) | |
606 | + | if ((getIntegerValue("global_WAVES_balance") > aG)) | |
607 | + | then { | |
608 | + | let cV = invoke(ae, "notifyStatusUpdate", [2], nil) | |
609 | + | if ((cV == cV)) | |
610 | + | then cU | |
611 | + | else throw("Strict value is not equal to itself.") | |
612 | + | } | |
613 | + | else cU | |
614 | + | } | |
615 | + | else throw("pool is stopped: most probably it reached the target liquidity") | |
765 | 616 | } | |
766 | 617 | ||
767 | 618 | ||
768 | 619 | ||
769 | - | @Callable(cN) | |
770 | - | func stakeIndex () = { | |
771 | - | let by = toString(cN.originCaller) | |
772 | - | let cU = cN.payments[0] | |
773 | - | if ((value(cU.assetId) != v("global_poolToken_id"))) | |
774 | - | then throw("wrong asset attached") | |
775 | - | else bE(by, cU.amount) | |
620 | + | @Callable(ch) | |
621 | + | func swapReadOnly (aY,aZ,aX) = { | |
622 | + | let bF = z(aY) | |
623 | + | let bG = z(aZ) | |
624 | + | let bH = (f / q((("static_" + aY) + "_scale"))) | |
625 | + | let bI = (f / q((("static_" + aZ) + "_scale"))) | |
626 | + | let bJ = v("static_feeToken") | |
627 | + | let bK = if ((bJ == "")) | |
628 | + | then R | |
629 | + | else z(bJ) | |
630 | + | let bL = q((("global_" + x(bF)) + "_balance")) | |
631 | + | let bM = q((("global_" + aZ) + "_balance")) | |
632 | + | let bN = (bL * bH) | |
633 | + | let bO = (bM * bI) | |
634 | + | let bP = fraction(aX, ay, h) | |
635 | + | let bQ = (aX - bP) | |
636 | + | let bR = (bQ * bH) | |
637 | + | let bS = aW(bR, bF, bG, bN, bO) | |
638 | + | let bT = fraction(bS, 1, bI) | |
639 | + | let bU = (bM - bT) | |
640 | + | let bV = (bL + bQ) | |
641 | + | let bW = if ((bK == bF)) | |
642 | + | then bV | |
643 | + | else if ((bK == bG)) | |
644 | + | then bU | |
645 | + | else q((("global_" + x(bK)) + "_balance")) | |
646 | + | let bX = aW(bP, bF, bK, bL, bW) | |
647 | + | if ((bG == bF)) | |
648 | + | then throw("this swap is not allowed") | |
649 | + | else if ((0 > (bM - bT))) | |
650 | + | then throw("contract is out of reserves") | |
651 | + | else if (aH()) | |
652 | + | then throw("contract is on stop") | |
653 | + | else $Tuple2(nil, bT) | |
776 | 654 | } | |
777 | 655 | ||
778 | 656 | ||
779 | 657 | ||
780 | - | @Callable(cN) | |
781 | - | func stakeIndexFor (by) = { | |
782 | - | let cU = cN.payments[0] | |
783 | - | if ((value(cU.assetId) != v("global_poolToken_id"))) | |
784 | - | then throw("wrong asset attached") | |
785 | - | else bE(by, cU.amount) | |
786 | - | } | |
787 | - | ||
788 | - | ||
789 | - | ||
790 | - | @Callable(cN) | |
791 | - | func unstakeIndex (dx) = { | |
792 | - | let by = if ((indexOf(ac, toString(cN.caller)) != unit)) | |
793 | - | then toString(cN.originCaller) | |
794 | - | else toString(cN.caller) | |
795 | - | let dy = r((by + "_indexStaked")) | |
796 | - | if (aA()) | |
797 | - | then throw("contract is on stop") | |
798 | - | else if ((dx > dy)) | |
799 | - | then throw("you don't have index tokens available") | |
800 | - | else if (aA()) | |
801 | - | then throw("contract is on stop") | |
802 | - | else (bw(addressFromStringValue(by))._1 ++ [IntegerEntry((by + "_indexStaked"), (dy - dx)), IntegerEntry("global_indexStaked", (r("global_indexStaked") - dx)), ScriptTransfer(cN.caller, dx, getBinaryValue("global_poolToken_id"))]) | |
803 | - | } | |
804 | - | ||
805 | - | ||
806 | - | ||
807 | - | @Callable(cN) | |
808 | - | func claimIndexRewards () = if (aA()) | |
809 | - | then throw("contract is on stop") | |
810 | - | else bw(cN.caller) | |
811 | - | ||
812 | - | ||
813 | - | ||
814 | - | @Callable(cN) | |
815 | - | func evaluateClaim (dz) = $Tuple2(nil, bw(addressFromStringValue(dz))._2) | |
816 | - | ||
817 | - | ||
818 | - | ||
819 | - | @Callable(cN) | |
820 | - | func swap (bi,cj) = { | |
821 | - | let cU = if ((size(cN.payments) == 1)) | |
822 | - | then value(cN.payments[0]) | |
823 | - | else throw("please attach exactly one payment") | |
824 | - | let bg = value(cN.payments[0].amount) | |
825 | - | let cl = cN.payments[0].assetId | |
826 | - | ch(y(cl), bi, bg, cj, toString(cN.caller)) | |
827 | - | } | |
828 | - | ||
829 | - | ||
830 | - | ||
831 | - | @Callable(cN) | |
832 | - | func swapReadOnly (bh,bi,bg) = { | |
833 | - | let cl = A(bh) | |
834 | - | let cm = A(bi) | |
835 | - | let cn = (f / r((("static_" + bh) + "_scale"))) | |
836 | - | let co = (f / r((("static_" + bi) + "_scale"))) | |
837 | - | let cp = w("static_feeToken") | |
838 | - | let cq = if ((cp == "")) | |
839 | - | then S | |
840 | - | else A(cp) | |
841 | - | let cr = r((("global_" + y(cl)) + "_balance")) | |
842 | - | let cs = r((("global_" + bi) + "_balance")) | |
843 | - | let ct = (cr * cn) | |
844 | - | let cu = (cs * co) | |
845 | - | let cv = fraction(bg, ay, h) | |
846 | - | let cw = (bg - cv) | |
847 | - | let cx = (cw * cn) | |
848 | - | let cy = bf(cx, cl, cm, ct, cu) | |
849 | - | let cz = fraction(cy, 1, co) | |
850 | - | let cA = (cs - cz) | |
851 | - | let cB = (cr + cw) | |
852 | - | let cC = if ((cq == cl)) | |
853 | - | then cB | |
854 | - | else if ((cq == cm)) | |
855 | - | then cA | |
856 | - | else r((("global_" + y(cq)) + "_balance")) | |
857 | - | let cD = bf(cv, cl, cq, cr, cC) | |
858 | - | if ((cm == cl)) | |
859 | - | then throw("this swap is not allowed") | |
860 | - | else if ((0 > (cs - cz))) | |
861 | - | then throw("contract is out of reserves") | |
862 | - | else if (aA()) | |
863 | - | then throw("contract is on stop") | |
864 | - | else $Tuple2(nil, cz) | |
865 | - | } | |
866 | - | ||
867 | - | ||
868 | - | ||
869 | - | @Callable(cN) | |
870 | - | func transferOwnership (dA) = if ((toString(cN.caller) != w("static_poolOwner"))) | |
658 | + | @Callable(ch) | |
659 | + | func transferOwnership (cW) = if ((toString(ch.caller) != v("static_poolOwner"))) | |
871 | 660 | then throw("this call available only for pool owner") | |
872 | - | else [StringEntry("static_poolOwner", | |
661 | + | else [StringEntry("static_poolOwner", cW)] | |
873 | 662 | ||
874 | 663 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = "PM-0. | |
4 | + | let a = "PM-0.8.0" | |
5 | 5 | ||
6 | 6 | let b = valueOrElse(getString(this, "configAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
7 | 7 | ||
8 | 8 | let c = if ((b == "")) | |
9 | 9 | then this | |
10 | 10 | else Address(fromBase58String(b)) | |
11 | 11 | ||
12 | 12 | let d = 4 | |
13 | 13 | ||
14 | 14 | let e = 10000 | |
15 | 15 | ||
16 | 16 | let f = 100000000 | |
17 | 17 | ||
18 | 18 | let g = 10000000000000000 | |
19 | 19 | ||
20 | 20 | let h = 10000 | |
21 | 21 | ||
22 | 22 | let i = 8 | |
23 | 23 | ||
24 | 24 | let j = pow(10, 0, i, 0, 0, HALFUP) | |
25 | 25 | ||
26 | - | let k = | |
26 | + | let k = valueOrElse(getInteger(c, "min_steps_amount"), 1) | |
27 | 27 | ||
28 | - | let l = valueOrElse(getInteger(c, " | |
28 | + | let l = valueOrElse(getInteger(c, "max_steps_amount"), 500) | |
29 | 29 | ||
30 | - | let m = valueOrElse(getInteger(c, " | |
30 | + | let m = valueOrElse(getInteger(c, "min_steps_interval"), 1) | |
31 | 31 | ||
32 | - | let n = valueOrElse(getInteger(c, " | |
32 | + | let n = valueOrElse(getInteger(c, "max_steps_interval"), 10000) | |
33 | 33 | ||
34 | - | let o = valueOrElse(getInteger(c, " | |
34 | + | let o = valueOrElse(getInteger(c, "min_weight"), 100) | |
35 | 35 | ||
36 | - | let p = valueOrElse(getInteger(c, " | |
36 | + | let p = valueOrElse(getInteger(c, "max_weight"), 9900) | |
37 | 37 | ||
38 | - | let q = valueOrElse(getInteger(c, "max_weight"), 9900) | |
39 | - | ||
40 | - | func r (s) = { | |
41 | - | let t = getInteger(this, s) | |
42 | - | if ($isInstanceOf(t, "Int")) | |
38 | + | func q (r) = { | |
39 | + | let s = getInteger(this, r) | |
40 | + | if ($isInstanceOf(s, "Int")) | |
43 | 41 | then { | |
44 | - | let | |
45 | - | | |
42 | + | let t = s | |
43 | + | t | |
46 | 44 | } | |
47 | 45 | else 0 | |
48 | 46 | } | |
49 | 47 | ||
50 | 48 | ||
51 | - | func | |
52 | - | let | |
53 | - | if ($isInstanceOf( | |
49 | + | func u (r) = { | |
50 | + | let s = getBinary(this, r) | |
51 | + | if ($isInstanceOf(s, "ByteVector")) | |
54 | 52 | then { | |
55 | - | let | |
56 | - | | |
53 | + | let t = s | |
54 | + | t | |
57 | 55 | } | |
58 | 56 | else base58'' | |
59 | 57 | } | |
60 | 58 | ||
61 | 59 | ||
62 | - | func | |
63 | - | let | |
64 | - | if ($isInstanceOf( | |
60 | + | func v (r) = { | |
61 | + | let s = getString(this, r) | |
62 | + | if ($isInstanceOf(s, "String")) | |
65 | 63 | then { | |
66 | - | let | |
67 | - | | |
64 | + | let t = s | |
65 | + | t | |
68 | 66 | } | |
69 | 67 | else "" | |
70 | 68 | } | |
71 | 69 | ||
72 | 70 | ||
73 | - | func | |
74 | - | let | |
75 | - | if ($isInstanceOf( | |
71 | + | func w (r) = { | |
72 | + | let s = getString(this, r) | |
73 | + | if ($isInstanceOf(s, "String")) | |
76 | 74 | then { | |
77 | - | let | |
78 | - | | |
75 | + | let t = s | |
76 | + | t | |
79 | 77 | } | |
80 | - | else throw(("no such key in data storage: " + | |
78 | + | else throw(("no such key in data storage: " + r)) | |
81 | 79 | } | |
82 | 80 | ||
83 | 81 | ||
84 | - | func | |
85 | - | let | |
86 | - | if ($isInstanceOf( | |
82 | + | func x (y) = { | |
83 | + | let s = y | |
84 | + | if ($isInstanceOf(s, "ByteVector")) | |
87 | 85 | then { | |
88 | - | let | |
89 | - | toBase58String( | |
86 | + | let t = s | |
87 | + | toBase58String(t) | |
90 | 88 | } | |
91 | 89 | else "WAVES" | |
92 | 90 | } | |
93 | 91 | ||
94 | 92 | ||
95 | - | func | |
93 | + | func z (A) = if ((A == "WAVES")) | |
96 | 94 | then unit | |
97 | - | else fromBase58String( | |
95 | + | else fromBase58String(A) | |
98 | 96 | ||
99 | 97 | ||
100 | - | func | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
98 | + | func B (y) = { | |
99 | + | let s = y | |
100 | + | if ($isInstanceOf(s, "ByteVector")) | |
103 | 101 | then { | |
104 | - | let | |
105 | - | assetBalance(this, | |
102 | + | let C = s | |
103 | + | assetBalance(this, C) | |
106 | 104 | } | |
107 | 105 | else wavesBalance(this).available | |
108 | 106 | } | |
109 | 107 | ||
110 | 108 | ||
111 | - | func | |
109 | + | func D (E,F) = (E ++ [z(F)]) | |
112 | 110 | ||
113 | 111 | ||
114 | - | func | |
112 | + | func G (E,F) = (E ++ [q((("static_" + x(F)) + "_weight"))]) | |
115 | 113 | ||
116 | 114 | ||
117 | - | func | |
115 | + | func H (E,F) = (E ++ [toString(q((("static_" + F) + "_weight")))]) | |
118 | 116 | ||
119 | 117 | ||
120 | - | func | |
118 | + | func I (E,F) = (E ++ [q((("static_" + x(F)) + "_decimals"))]) | |
121 | 119 | ||
122 | 120 | ||
123 | - | func | |
121 | + | func J (E,F) = (E ++ [q((("static_" + x(F)) + "_scale"))]) | |
124 | 122 | ||
125 | 123 | ||
126 | - | func | |
124 | + | func K (E,F) = (E ++ [parseIntValue(F)]) | |
127 | 125 | ||
128 | 126 | ||
129 | - | let | |
127 | + | let L = valueOrElse(getString(c, "usdnAssetIdStr"), "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p") | |
130 | 128 | ||
131 | - | let | |
129 | + | let M = valueOrElse(getString(c, "puzzleAssetIdStr"), "HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS") | |
132 | 130 | ||
133 | - | let | |
131 | + | let N = valueOrElse(getString(c, "usdtAssetIdStr"), "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ") | |
134 | 132 | ||
135 | - | let | |
133 | + | let O = valueOrElse(getString(c, "usdtPptAssetIdStr"), "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi") | |
136 | 134 | ||
137 | - | let | |
135 | + | let P = valueOrElse(getString(c, "romeAssetIdStr"), "AP4Cb5xLYGH6ZigHreCZHoXpQTWDkPsG2BHqfDUx6taJ") | |
138 | 136 | ||
139 | - | let R = "WAVES" | |
137 | + | let Q = "WAVES" | |
138 | + | ||
139 | + | let R = fromBase58String(L) | |
140 | 140 | ||
141 | 141 | let S = fromBase58String(M) | |
142 | 142 | ||
143 | 143 | let T = fromBase58String(N) | |
144 | 144 | ||
145 | 145 | let U = fromBase58String(O) | |
146 | 146 | ||
147 | 147 | let V = fromBase58String(P) | |
148 | 148 | ||
149 | - | let W = | |
149 | + | let W = unit | |
150 | 150 | ||
151 | - | let X = | |
151 | + | let X = [L, M, N, O, Q, P] | |
152 | 152 | ||
153 | - | let Y = | |
153 | + | let Y = Address(fromBase58String(valueOrElse(getString(c, "oracleAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
154 | 154 | ||
155 | - | let Z = Address(fromBase58String(valueOrElse(getString(c, " | |
155 | + | let Z = Address(fromBase58String(valueOrElse(getString(c, "feesAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
156 | 156 | ||
157 | - | let aa = | |
157 | + | let aa = valueOrElse(getString(c, "shutdownAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
158 | 158 | ||
159 | - | let ab = valueOrElse(getString(c, " | |
159 | + | let ab = valueOrElse(getString(c, "layer2Addresses"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
160 | 160 | ||
161 | - | let ac = valueOrElse(getString(c, " | |
161 | + | let ac = Address(fromBase58String(valueOrElse(getString(c, "coldMasterAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
162 | 162 | ||
163 | - | let ad = Address(fromBase58String(valueOrElse(getString(c, " | |
163 | + | let ad = Address(fromBase58String(valueOrElse(getString(c, "factoryAddress"), "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr"))) | |
164 | 164 | ||
165 | 165 | let ae = Address(fromBase58String(valueOrElse(getString(c, "factoryAddress"), "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T"))) | |
166 | 166 | ||
167 | 167 | let af = fromBase58String(valueOrElse(getString(c, "masterPubKey"), "4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU")) | |
168 | 168 | ||
169 | - | let ag = | |
169 | + | let ag = q("static_tokensAmount") | |
170 | 170 | ||
171 | 171 | let ah = { | |
172 | - | let ai = split( | |
172 | + | let ai = split(v("static_tokenIds"), ",") | |
173 | 173 | let aj = size(ai) | |
174 | 174 | let ak = nil | |
175 | 175 | func al (am,an) = if ((an >= aj)) | |
176 | 176 | then am | |
177 | - | else | |
177 | + | else D(am, ai[an]) | |
178 | 178 | ||
179 | 179 | func ao (am,an) = if ((an >= aj)) | |
180 | 180 | then am | |
181 | 181 | else throw("List size exceeds 10") | |
182 | 182 | ||
183 | 183 | ao(al(al(al(al(al(al(al(al(al(al(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
184 | 184 | } | |
185 | 185 | ||
186 | 186 | let ap = { | |
187 | 187 | let ai = ah | |
188 | 188 | let aj = size(ai) | |
189 | 189 | let ak = nil | |
190 | 190 | func aq (am,an) = if ((an >= aj)) | |
191 | 191 | then am | |
192 | - | else | |
192 | + | else G(am, ai[an]) | |
193 | 193 | ||
194 | 194 | func ar (am,an) = if ((an >= aj)) | |
195 | 195 | then am | |
196 | 196 | else throw("List size exceeds 10") | |
197 | 197 | ||
198 | 198 | ar(aq(aq(aq(aq(aq(aq(aq(aq(aq(aq(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | let as = { | |
202 | 202 | let ai = ah | |
203 | 203 | let aj = size(ai) | |
204 | 204 | let ak = nil | |
205 | 205 | func at (am,an) = if ((an >= aj)) | |
206 | 206 | then am | |
207 | - | else | |
207 | + | else I(am, ai[an]) | |
208 | 208 | ||
209 | 209 | func au (am,an) = if ((an >= aj)) | |
210 | 210 | then am | |
211 | 211 | else throw("List size exceeds 10") | |
212 | 212 | ||
213 | 213 | au(at(at(at(at(at(at(at(at(at(at(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | let av = { | |
217 | 217 | let ai = ah | |
218 | 218 | let aj = size(ai) | |
219 | 219 | let ak = nil | |
220 | 220 | func aw (am,an) = if ((an >= aj)) | |
221 | 221 | then am | |
222 | - | else | |
222 | + | else J(am, ai[an]) | |
223 | 223 | ||
224 | 224 | func ax (am,an) = if ((an >= aj)) | |
225 | 225 | then am | |
226 | 226 | else throw("List size exceeds 10") | |
227 | 227 | ||
228 | 228 | ax(aw(aw(aw(aw(aw(aw(aw(aw(aw(aw(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
229 | 229 | } | |
230 | 230 | ||
231 | - | let ay = | |
231 | + | let ay = q("static_fee") | |
232 | 232 | ||
233 | 233 | let az = ah | |
234 | 234 | ||
235 | 235 | func aA () = { | |
236 | - | let aB = addressFromString(ab) | |
237 | - | if ((aB == unit)) | |
236 | + | let aB = valueOrElse(getInteger(ae, ("pool__" + toString(this))), 0) | |
237 | + | let aC = valueOrElse(getInteger(ae, ("pool__status__" + toString(aB))), 2) | |
238 | + | aC | |
239 | + | } | |
240 | + | ||
241 | + | ||
242 | + | func aD (r) = getIntegerValue(ae, ("setup__" + r)) | |
243 | + | ||
244 | + | ||
245 | + | let aE = aD("virtualLiquidity") | |
246 | + | ||
247 | + | let aF = aD("creationFee") | |
248 | + | ||
249 | + | let aG = aD("curveTarget") | |
250 | + | ||
251 | + | func aH () = { | |
252 | + | let aI = addressFromString(aa) | |
253 | + | if ((aI == unit)) | |
238 | 254 | then false | |
239 | 255 | else { | |
240 | - | let | |
241 | - | if ($isInstanceOf( | |
256 | + | let s = getBoolean(value(aI), "is_shutdown") | |
257 | + | if ($isInstanceOf(s, "Boolean")) | |
242 | 258 | then { | |
243 | - | let | |
244 | - | | |
259 | + | let aJ = s | |
260 | + | aJ | |
245 | 261 | } | |
246 | 262 | else false | |
247 | 263 | } | |
248 | 264 | } | |
249 | 265 | ||
250 | 266 | ||
251 | - | func aD (aE) = { | |
252 | - | let aF = y(ah[aE]) | |
253 | - | r((("global_" + aF) + "_balance")) | |
254 | - | } | |
255 | - | ||
256 | - | ||
257 | - | func aG () = { | |
258 | - | let t = getInteger("static_KMult") | |
259 | - | if ($isInstanceOf(t, "Int")) | |
267 | + | func aK (A) = { | |
268 | + | let s = getInteger(Y, (A + "_twap5B")) | |
269 | + | if ($isInstanceOf(s, "Int")) | |
260 | 270 | then { | |
261 | - | let aC = t | |
262 | - | aC | |
263 | - | } | |
264 | - | else g | |
265 | - | } | |
266 | - | ||
267 | - | ||
268 | - | func aH () = fraction(r("global_poolToken_amount"), aG(), g) | |
269 | - | ||
270 | - | ||
271 | - | func aI (B) = { | |
272 | - | let t = getInteger(Z, (B + "_twap5B")) | |
273 | - | if ($isInstanceOf(t, "Int")) | |
274 | - | then { | |
275 | - | let aC = t | |
276 | - | aC | |
271 | + | let aJ = s | |
272 | + | aJ | |
277 | 273 | } | |
278 | 274 | else 1000000 | |
279 | 275 | } | |
280 | 276 | ||
281 | 277 | ||
282 | - | func | |
283 | - | let | |
284 | - | let | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | fraction( | |
278 | + | func aL (y,aM,aN) = { | |
279 | + | let aO = q((("static_" + x(y)) + "_weight")) | |
280 | + | let aP = v("static_feeToken") | |
281 | + | let aQ = getIntegerValue(this, (("static_" + aP) + "_scale")) | |
282 | + | let aR = value(indexOf(ah, z(aP))) | |
283 | + | let aS = ap[aR] | |
284 | + | let aT = q((("global_" + aP) + "_balance")) | |
285 | + | let aU = fraction(aM, (aT / aS), (aN / aO)) | |
286 | + | let aV = aK(aP) | |
287 | + | fraction(aU, aV, aQ) | |
292 | 288 | } | |
293 | 289 | ||
294 | 290 | ||
295 | - | func aU (aV,aW) = { | |
296 | - | func aX (F,aY) = { | |
297 | - | let aZ = r((("global_" + y(aY)) + "_balance")) | |
298 | - | let ba = aH() | |
299 | - | let bb = r((("static_" + y(aY)) + "_scale")) | |
300 | - | let bc = fraction((toBigInt((ba - aV)) * toBigInt(f)), toBigInt(f), toBigInt(ba), DOWN) | |
301 | - | let aK = toInt(fraction((toBigInt(g) - bc), toBigInt(aZ), toBigInt(g), CEILING)) | |
302 | - | (F ++ [IntegerEntry((("global_" + y(aY)) + "_balance"), (aZ - aK)), ScriptTransfer(aW, aK, aY)]) | |
303 | - | } | |
304 | - | ||
305 | - | let ai = ah | |
306 | - | let aj = size(ai) | |
307 | - | let ak = nil | |
308 | - | func bd (am,an) = if ((an >= aj)) | |
309 | - | then am | |
310 | - | else aX(am, ai[an]) | |
311 | - | ||
312 | - | func be (am,an) = if ((an >= aj)) | |
313 | - | then am | |
314 | - | else throw("List size exceeds 10") | |
315 | - | ||
316 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
291 | + | func aW (aX,aY,aZ,ba,bb) = { | |
292 | + | let bc = value(indexOf(ah, aY)) | |
293 | + | let bd = value(indexOf(ah, aZ)) | |
294 | + | if ((bc == bd)) | |
295 | + | then aX | |
296 | + | else fraction(bb, ((f * f) - toInt(pow(fraction((toBigInt(ba) * toBigInt(10000)), toBigInt((f * f)), (toBigInt((ba + aX)) * toBigInt(10000)), HALFUP), 16, toBigInt(fraction(ap[bc], 1000000000000, ap[bd])), 12, 16, CEILING))), (f * f), HALFEVEN) | |
317 | 297 | } | |
318 | 298 | ||
319 | 299 | ||
320 | - | func bf (bg,bh,bi,bj,bk) = { | |
321 | - | let bl = value(indexOf(ah, bh)) | |
322 | - | let bm = value(indexOf(ah, bi)) | |
323 | - | if ((bl == bm)) | |
324 | - | then bg | |
325 | - | else fraction(bk, ((f * f) - toInt(pow(fraction((toBigInt(bj) * toBigInt(10000)), toBigInt((f * f)), (toBigInt((bj + bg)) * toBigInt(10000)), HALFUP), 16, toBigInt(fraction(ap[bl], 1000000000000, ap[bm])), 12, 16, CEILING))), (f * f), HALFEVEN) | |
300 | + | func be (y,A,aN,bf) = { | |
301 | + | let bg = q("global_indexStaked") | |
302 | + | let bh = bf | |
303 | + | let bi = (B(y) - aN) | |
304 | + | let bj = if ((bi > bh)) | |
305 | + | then bi | |
306 | + | else bh | |
307 | + | let bk = (bj - bh) | |
308 | + | let bl = if ((bg == 0)) | |
309 | + | then 0 | |
310 | + | else fraction(bk, f, bg) | |
311 | + | let bm = q((("global_lastCheck_" + A) + "_interest")) | |
312 | + | (bm + bl) | |
326 | 313 | } | |
327 | 314 | ||
328 | 315 | ||
329 | - | func bn (z,B,aL,bo) = { | |
330 | - | let bp = r("global_indexStaked") | |
331 | - | let bq = bo | |
332 | - | let br = (C(z) - aL) | |
333 | - | let bs = if ((br > bq)) | |
334 | - | then br | |
335 | - | else bq | |
336 | - | let bt = (bs - bq) | |
337 | - | let bu = if ((bp == 0)) | |
338 | - | then 0 | |
339 | - | else fraction(bt, f, bp) | |
340 | - | let bv = r((("global_lastCheck_" + B) + "_interest")) | |
341 | - | (bv + bu) | |
316 | + | func bn (bo) = { | |
317 | + | let bp = toString(bo) | |
318 | + | let bq = q((bp + "_indexStaked")) | |
319 | + | func br (E,y) = { | |
320 | + | let A = x(y) | |
321 | + | let aN = q((("global_" + x(y)) + "_balance")) | |
322 | + | let bf = q((("global_lastCheck_" + A) + "_earnings")) | |
323 | + | let bs = be(y, A, aN, bf) | |
324 | + | let bj = max([bf, (B(y) - aN)]) | |
325 | + | let bt = fraction(bq, (bs - q((((bp + "_lastCheck_") + A) + "_interest"))), f) | |
326 | + | let bu = if ((bt == 0)) | |
327 | + | then nil | |
328 | + | else [ScriptTransfer(bo, bt, y)] | |
329 | + | $Tuple2(((E._1 ++ bu) ++ [IntegerEntry((("global_lastCheck_" + A) + "_earnings"), (bj - bt)), IntegerEntry((("global_lastCheck_" + A) + "_interest"), bs), IntegerEntry((((bp + "_lastCheck_") + A) + "_interest"), bs)]), (E._2 + aL(y, bt, aN))) | |
330 | + | } | |
331 | + | ||
332 | + | let E = { | |
333 | + | let ai = az | |
334 | + | let aj = size(ai) | |
335 | + | let ak = $Tuple2(nil, 0) | |
336 | + | func bv (am,an) = if ((an >= aj)) | |
337 | + | then am | |
338 | + | else br(am, ai[an]) | |
339 | + | ||
340 | + | func bw (am,an) = if ((an >= aj)) | |
341 | + | then am | |
342 | + | else throw("List size exceeds 10") | |
343 | + | ||
344 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
345 | + | } | |
346 | + | $Tuple2((E._1 ++ [IntegerEntry((bp + "_claimedRewardUSD"), (q((bp + "_claimedRewardUSD")) + E._2)), IntegerEntry((bp + "_lastClaim"), lastBlock.timestamp)]), E._2) | |
342 | 347 | } | |
343 | 348 | ||
344 | 349 | ||
345 | - | func bw (bx) = { | |
346 | - | let by = toString(bx) | |
347 | - | let bz = r((by + "_indexStaked")) | |
348 | - | func bA (F,z) = { | |
349 | - | let B = y(z) | |
350 | - | let aL = r((("global_" + y(z)) + "_balance")) | |
351 | - | let bo = r((("global_lastCheck_" + B) + "_earnings")) | |
352 | - | let bB = bn(z, B, aL, bo) | |
353 | - | let bs = max([bo, (C(z) - aL)]) | |
354 | - | let bC = fraction(bz, (bB - r((((by + "_lastCheck_") + B) + "_interest"))), f) | |
355 | - | let bD = if ((bC == 0)) | |
356 | - | then nil | |
357 | - | else [ScriptTransfer(bx, bC, z)] | |
358 | - | $Tuple2(((F._1 ++ bD) ++ [IntegerEntry((("global_lastCheck_" + B) + "_earnings"), (bs - bC)), IntegerEntry((("global_lastCheck_" + B) + "_interest"), bB), IntegerEntry((((by + "_lastCheck_") + B) + "_interest"), bB)]), (F._2 + aJ(z, bC, aL))) | |
359 | - | } | |
360 | - | ||
361 | - | let F = { | |
362 | - | let ai = az | |
363 | - | let aj = size(ai) | |
364 | - | let ak = $Tuple2(nil, 0) | |
365 | - | func bd (am,an) = if ((an >= aj)) | |
366 | - | then am | |
367 | - | else bA(am, ai[an]) | |
368 | - | ||
369 | - | func be (am,an) = if ((an >= aj)) | |
370 | - | then am | |
371 | - | else throw("List size exceeds 10") | |
372 | - | ||
373 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
374 | - | } | |
375 | - | $Tuple2((F._1 ++ [IntegerEntry((by + "_claimedRewardUSD"), (r((by + "_claimedRewardUSD")) + F._2)), IntegerEntry((by + "_lastClaim"), lastBlock.timestamp)]), F._2) | |
376 | - | } | |
350 | + | func bx (E,by) = (E + parseIntValue(by)) | |
377 | 351 | ||
378 | 352 | ||
379 | - | func bE (by,aK) = { | |
380 | - | let bF = bw(addressFromStringValue(by))._1 | |
381 | - | (bF ++ [IntegerEntry((by + "_indexStaked"), (r((by + "_indexStaked")) + aK)), IntegerEntry("global_indexStaked", (r("global_indexStaked") + aK))]) | |
382 | - | } | |
353 | + | func bz (E,bA) = if (if ((indexOf(X, bA) != unit)) | |
354 | + | then (E == "") | |
355 | + | else false) | |
356 | + | then bA | |
357 | + | else E | |
383 | 358 | ||
384 | 359 | ||
385 | - | func bG (F,bH) = (F + parseIntValue(bH)) | |
386 | - | ||
387 | - | ||
388 | - | func bI (F,bJ) = if (if ((indexOf(Y, bJ) != unit)) | |
389 | - | then (F == "") | |
390 | - | else false) | |
391 | - | then bJ | |
392 | - | else F | |
393 | - | ||
394 | - | ||
395 | - | func bK (bL) = { | |
396 | - | let bM = split(w("static_tokenIds"), ",") | |
397 | - | let bN = bL | |
398 | - | func bO (F,z) = if ((indexOf(bN, z) == unit)) | |
399 | - | then (F ++ [z]) | |
400 | - | else F | |
401 | - | ||
402 | - | let ai = bM | |
403 | - | let aj = size(ai) | |
404 | - | let ak = bN | |
405 | - | func bd (am,an) = if ((an >= aj)) | |
406 | - | then am | |
407 | - | else bO(am, ai[an]) | |
408 | - | ||
409 | - | func be (am,an) = if ((an >= aj)) | |
410 | - | then am | |
411 | - | else throw("List size exceeds 10") | |
412 | - | ||
413 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
414 | - | } | |
415 | - | ||
416 | - | ||
417 | - | func bP (bL) = { | |
418 | - | let bM = split(w("static_tokenIds"), ",") | |
419 | - | func bQ (F,z) = if ((indexOf(bL, z) == unit)) | |
420 | - | then (F + 1) | |
421 | - | else F | |
422 | - | ||
423 | - | func bR (F,z) = if ((indexOf(bM, z) == unit)) | |
424 | - | then (F + 1) | |
425 | - | else F | |
426 | - | ||
427 | - | let bS = { | |
428 | - | let ai = bM | |
429 | - | let aj = size(ai) | |
430 | - | let ak = 0 | |
431 | - | func bd (am,an) = if ((an >= aj)) | |
432 | - | then am | |
433 | - | else bQ(am, ai[an]) | |
434 | - | ||
435 | - | func be (am,an) = if ((an >= aj)) | |
436 | - | then am | |
437 | - | else throw("List size exceeds 10") | |
438 | - | ||
439 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
440 | - | } | |
441 | - | let bT = { | |
442 | - | let ai = bL | |
443 | - | let aj = size(ai) | |
444 | - | let ak = 0 | |
445 | - | func bU (am,an) = if ((an >= aj)) | |
446 | - | then am | |
447 | - | else bR(am, ai[an]) | |
448 | - | ||
449 | - | func bV (am,an) = if ((an >= aj)) | |
450 | - | then am | |
451 | - | else throw("List size exceeds 10") | |
452 | - | ||
453 | - | bV(bU(bU(bU(bU(bU(bU(bU(bU(bU(bU(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
454 | - | } | |
455 | - | (bS + bT) | |
456 | - | } | |
457 | - | ||
458 | - | ||
459 | - | func bW (bX,bY) = { | |
460 | - | func bZ (F,bJ) = if ((0 >= bJ.amount)) | |
461 | - | then throw(((("Too low payment amount for " + y(bJ.assetId)) + ": ") + toString(bJ.amount))) | |
462 | - | else (F ++ [y(bJ.assetId)]) | |
463 | - | ||
464 | - | let ca = { | |
465 | - | let ai = bY | |
466 | - | let aj = size(ai) | |
467 | - | let ak = nil | |
468 | - | func bd (am,an) = if ((an >= aj)) | |
469 | - | then am | |
470 | - | else bZ(am, ai[an]) | |
471 | - | ||
472 | - | func be (am,an) = if ((an >= aj)) | |
473 | - | then am | |
474 | - | else throw("List size exceeds 10") | |
475 | - | ||
476 | - | be(bd(bd(bd(bd(bd(bd(bd(bd(bd(bd(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
477 | - | } | |
478 | - | func cb (F,bJ) = if ((indexOf(bX, bJ) == unit)) | |
479 | - | then throw(((bJ + " asset is present in payments, but is not in new assets: ") + makeString(bX, ","))) | |
480 | - | else (F + 1) | |
481 | - | ||
482 | - | func cc (F,bJ) = if ((indexOf(ca, bJ) == unit)) | |
483 | - | then throw(((bJ + " asset is present in new assets, but is not in payments: ") + makeString(ca, ","))) | |
484 | - | else (F + 1) | |
485 | - | ||
486 | - | let cd = { | |
487 | - | let ai = ca | |
488 | - | let aj = size(ai) | |
489 | - | let ak = 0 | |
490 | - | func bU (am,an) = if ((an >= aj)) | |
491 | - | then am | |
492 | - | else cb(am, ai[an]) | |
493 | - | ||
494 | - | func bV (am,an) = if ((an >= aj)) | |
495 | - | then am | |
496 | - | else throw("List size exceeds 10") | |
497 | - | ||
498 | - | bV(bU(bU(bU(bU(bU(bU(bU(bU(bU(bU(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
499 | - | } | |
500 | - | let ce = { | |
501 | - | let ai = bX | |
502 | - | let aj = size(ai) | |
503 | - | let ak = 0 | |
504 | - | func cf (am,an) = if ((an >= aj)) | |
505 | - | then am | |
506 | - | else cc(am, ai[an]) | |
507 | - | ||
508 | - | func cg (am,an) = if ((an >= aj)) | |
509 | - | then am | |
510 | - | else throw("List size exceeds 10") | |
511 | - | ||
512 | - | cg(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
513 | - | } | |
514 | - | (cd + ce) | |
515 | - | } | |
516 | - | ||
517 | - | ||
518 | - | func ch (bh,bi,ci,cj,ck) = { | |
519 | - | let bg = ci | |
520 | - | let cl = A(bh) | |
521 | - | let cm = A(bi) | |
522 | - | let cn = (f / r((("static_" + bh) + "_scale"))) | |
523 | - | let co = (f / r((("static_" + bi) + "_scale"))) | |
524 | - | let cp = w("static_feeToken") | |
525 | - | let cq = if ((cp == "")) | |
526 | - | then X | |
527 | - | else A(cp) | |
528 | - | let cr = r((("global_" + y(cl)) + "_balance")) | |
529 | - | let cs = r((("global_" + bi) + "_balance")) | |
530 | - | let ct = (cr * cn) | |
531 | - | let cu = (cs * co) | |
532 | - | let cv = fraction(bg, ay, h) | |
533 | - | let cw = (bg - cv) | |
534 | - | let cx = (cw * cn) | |
535 | - | let cy = bf(cx, cl, cm, ct, cu) | |
536 | - | let cz = fraction(cy, 1, co) | |
537 | - | let cA = (cs - cz) | |
538 | - | let cB = (cr + cw) | |
539 | - | let cC = if ((cq == cl)) | |
540 | - | then cB | |
541 | - | else if ((cq == cm)) | |
542 | - | then cA | |
543 | - | else r((("global_" + y(cq)) + "_balance")) | |
544 | - | let cD = bf(cv, cl, cq, cr, cC) | |
545 | - | if ((cj > cz)) | |
360 | + | func bB (aY,aZ,bC,bD,bE) = { | |
361 | + | let aX = bC | |
362 | + | let bF = z(aY) | |
363 | + | let bG = z(aZ) | |
364 | + | let bH = (f / q((("static_" + aY) + "_scale"))) | |
365 | + | let bI = (f / q((("static_" + aZ) + "_scale"))) | |
366 | + | let bJ = v("static_feeToken") | |
367 | + | let bK = if ((bJ == "")) | |
368 | + | then W | |
369 | + | else z(bJ) | |
370 | + | let bL = q((("global_" + x(bF)) + "_balance")) | |
371 | + | let bM = q((("global_" + aZ) + "_balance")) | |
372 | + | let bN = (bL * bH) | |
373 | + | let bO = (bM * bI) | |
374 | + | let bP = fraction(aX, ay, h) | |
375 | + | let bQ = (aX - bP) | |
376 | + | let bR = (bQ * bH) | |
377 | + | let bS = aW(bR, bF, bG, bN, bO) | |
378 | + | let bT = fraction(bS, 1, bI) | |
379 | + | let bU = (bM - bT) | |
380 | + | let bV = (bL + bQ) | |
381 | + | let bW = if ((bK == bF)) | |
382 | + | then bV | |
383 | + | else if ((bK == bG)) | |
384 | + | then bU | |
385 | + | else q((("global_" + x(bK)) + "_balance")) | |
386 | + | let bX = aW(bP, bF, bK, bL, bW) | |
387 | + | if ((bD > bT)) | |
546 | 388 | then throw("amount to recieve is lower than given one") | |
547 | - | else if (( | |
389 | + | else if ((bG == bF)) | |
548 | 390 | then throw("this swap is not allowed") | |
549 | - | else if ((0 > ( | |
391 | + | else if ((0 > (bM - bT))) | |
550 | 392 | then throw("contract is out of reserves") | |
551 | - | else if ( | |
393 | + | else if (aH()) | |
552 | 394 | then throw("contract is on stop") | |
553 | 395 | else { | |
554 | - | let | |
555 | - | let | |
556 | - | let | |
557 | - | let | |
558 | - | then | |
396 | + | let bY = fraction(bX, 1, 10) | |
397 | + | let bZ = fraction(bX, 4, 10) | |
398 | + | let ca = bV | |
399 | + | let cb = (bU - (if ((bG == bK)) | |
400 | + | then bX | |
559 | 401 | else 0)) | |
560 | - | let | |
561 | - | then ( | |
402 | + | let cc = if (if ((bK != bF)) | |
403 | + | then (bK != bG) | |
562 | 404 | else false) | |
563 | - | then ( | |
405 | + | then (bW - bX) | |
564 | 406 | else unit | |
565 | - | let | |
566 | - | let | |
567 | - | let | |
568 | - | then IntegerEntry((("global_" + | |
407 | + | let cd = IntegerEntry((("global_" + x(bF)) + "_balance"), ca) | |
408 | + | let ce = IntegerEntry((("global_" + aZ) + "_balance"), cb) | |
409 | + | let cf = if ((cc != unit)) | |
410 | + | then IntegerEntry((("global_" + x(bK)) + "_balance"), value(cc)) | |
569 | 411 | else StringEntry("hello", "world") | |
570 | - | let | |
571 | - | $Tuple2([ | |
412 | + | let cg = aL(bF, aX, bL) | |
413 | + | $Tuple2([ce, cd, cf, ScriptTransfer(addressFromStringValue(bE), bT, bG), ScriptTransfer(addressFromStringValue(v("static_poolOwner")), bY, bK), IntegerEntry("global_earnedByOwner", (q("global_earnedByOwner") + bY)), IntegerEntry("global_volume_usd", (q("global_volume_usd") + cg)), ScriptTransfer(Z, bZ, bK)], bT) | |
572 | 414 | } | |
573 | 415 | } | |
574 | 416 | ||
575 | 417 | ||
576 | - | @Callable(cN) | |
577 | - | func deInit () = if (aA()) | |
578 | - | then throw("contract is on stop") | |
579 | - | else if ((cN.caller != this)) | |
580 | - | then throw("admin only") | |
581 | - | else [IntegerEntry("global_wasInited", 0)] | |
418 | + | @Callable(ch) | |
419 | + | func initPool (ci,cj,ck,cl,cm) = { | |
420 | + | func cn (co) = { | |
421 | + | func br (E,cp) = { | |
422 | + | let y = cp.assetId | |
423 | + | func cq (E,by) = if ((by == y)) | |
424 | + | then value(indexOf(ah, by)) | |
425 | + | else E | |
582 | 426 | ||
583 | - | ||
584 | - | ||
585 | - | @Callable(cN) | |
586 | - | func initPool (cO,cP,cQ,cR,cS) = { | |
587 | - | func cT (bY) = { | |
588 | - | func bA (F,cU) = { | |
589 | - | let z = cU.assetId | |
590 | - | func cV (F,bH) = if ((bH == z)) | |
591 | - | then value(indexOf(ah, bH)) | |
592 | - | else F | |
593 | - | ||
594 | - | let cW = { | |
427 | + | let cr = { | |
595 | 428 | let ai = ah | |
596 | 429 | let aj = size(ai) | |
597 | 430 | let ak = 1 | |
598 | - | func | |
431 | + | func bv (am,an) = if ((an >= aj)) | |
599 | 432 | then am | |
600 | - | else | |
433 | + | else cq(am, ai[an]) | |
601 | 434 | ||
602 | - | func | |
435 | + | func bw (am,an) = if ((an >= aj)) | |
603 | 436 | then am | |
604 | 437 | else throw("List size exceeds 10") | |
605 | 438 | ||
606 | - | | |
439 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
607 | 440 | } | |
608 | - | fraction( | |
441 | + | fraction(E, pow(cp.amount, as[cr], ap[cr], d, 8, FLOOR), f) | |
609 | 442 | } | |
610 | 443 | ||
611 | - | let ai = | |
444 | + | let ai = co | |
612 | 445 | let aj = size(ai) | |
613 | 446 | let ak = j | |
614 | - | func | |
447 | + | func bv (am,an) = if ((an >= aj)) | |
615 | 448 | then am | |
616 | - | else | |
449 | + | else br(am, ai[an]) | |
617 | 450 | ||
618 | - | func | |
451 | + | func bw (am,an) = if ((an >= aj)) | |
619 | 452 | then am | |
620 | 453 | else throw("List size exceeds 10") | |
621 | 454 | ||
622 | - | | |
455 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
623 | 456 | } | |
624 | 457 | ||
625 | - | let | |
626 | - | let | |
627 | - | let | |
628 | - | let | |
629 | - | let | |
630 | - | let | |
631 | - | let | |
632 | - | let | |
633 | - | let | |
634 | - | let ai = | |
458 | + | let cs = Issue(ck, cl, cm, 8, false) | |
459 | + | let ct = calculateAssetId(cs) | |
460 | + | let cu = x(ct) | |
461 | + | let cv = "5000,5000" | |
462 | + | let cw = "WAVES" | |
463 | + | let cx = Address(fromBase58String(cj)) | |
464 | + | let cy = ("WAVES," + cu) | |
465 | + | let cz = split(cy, ",") | |
466 | + | let cA = { | |
467 | + | let ai = cz | |
635 | 468 | let aj = size(ai) | |
636 | 469 | let ak = nil | |
637 | - | func | |
470 | + | func bv (am,an) = if ((an >= aj)) | |
638 | 471 | then am | |
639 | - | else | |
472 | + | else D(am, ai[an]) | |
640 | 473 | ||
641 | - | func | |
474 | + | func bw (am,an) = if ((an >= aj)) | |
642 | 475 | then am | |
643 | 476 | else throw("List size exceeds 10") | |
644 | 477 | ||
645 | - | | |
478 | + | bw(bv(bv(bv(bv(bv(bv(bv(bv(bv(bv(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
646 | 479 | } | |
647 | - | let | |
648 | - | let | |
649 | - | let ai = | |
480 | + | let cB = 100 | |
481 | + | let aP = { | |
482 | + | let ai = cz | |
650 | 483 | let aj = size(ai) | |
651 | 484 | let ak = "" | |
652 | - | func | |
485 | + | func cC (am,an) = if ((an >= aj)) | |
653 | 486 | then am | |
654 | - | else | |
487 | + | else bz(am, ai[an]) | |
655 | 488 | ||
656 | - | func | |
489 | + | func cD (am,an) = if ((an >= aj)) | |
657 | 490 | then am | |
658 | 491 | else throw("List size exceeds 10") | |
659 | 492 | ||
660 | - | | |
493 | + | cD(cC(cC(cC(cC(cC(cC(cC(cC(cC(cC(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
661 | 494 | } | |
662 | - | let | |
663 | - | let | |
664 | - | let | |
495 | + | let cp = ch.payments[0] | |
496 | + | let aM = cp.amount | |
497 | + | let cE = if ((cp.assetId == unit)) | |
665 | 498 | then "WAVES" | |
666 | 499 | else throw("you have to attach some WAVES") | |
667 | 500 | if ((this != this)) | |
668 | - | then throw(" | |
669 | - | else if (( | |
501 | + | then throw("self-invoke only") | |
502 | + | else if ((aP == "")) | |
670 | 503 | then throw("pool must have one of the supported fee assets in the composition") | |
671 | - | else if ((size( | |
504 | + | else if ((size(ci) > 13)) | |
672 | 505 | then throw("too large pool domain") | |
673 | - | else if (if (( | |
506 | + | else if (if ((cB > 500)) | |
674 | 507 | then true | |
675 | - | else (0 > | |
508 | + | else (0 > cB)) | |
676 | 509 | then throw("fee value must be between 50 and 500 (0.5-5%)") | |
677 | - | else if ( | |
510 | + | else if (aH()) | |
678 | 511 | then throw("contract is on stop") | |
679 | 512 | else { | |
680 | - | let | |
681 | - | let | |
682 | - | let ai = | |
513 | + | let cF = split(cv, ",") | |
514 | + | let cG = { | |
515 | + | let ai = cF | |
683 | 516 | let aj = size(ai) | |
684 | 517 | let ak = 0 | |
685 | - | func | |
518 | + | func cH (am,an) = if ((an >= aj)) | |
686 | 519 | then am | |
687 | - | else | |
520 | + | else bx(am, ai[an]) | |
688 | 521 | ||
689 | - | func | |
522 | + | func cI (am,an) = if ((an >= aj)) | |
690 | 523 | then am | |
691 | 524 | else throw("List size exceeds 10") | |
692 | 525 | ||
693 | - | | |
526 | + | cI(cH(cH(cH(cH(cH(cH(cH(cH(cH(cH(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
694 | 527 | } | |
695 | - | func | |
696 | - | then | |
528 | + | func cJ (E,cK) = if ((cK >= size(cA))) | |
529 | + | then E | |
697 | 530 | else { | |
698 | - | let | |
699 | - | ( | |
531 | + | let cL = 8 | |
532 | + | (E ++ [IntegerEntry((("static_" + cz[cK]) + "_scale"), pow(10, 0, cL, 0, 0, DOWN)), IntegerEntry((("static_" + cz[cK]) + "_decimals"), cL), IntegerEntry((("static_" + cz[cK]) + "_weight"), value(parseInt(cF[cK])))]) | |
700 | 533 | } | |
701 | 534 | ||
702 | - | let | |
703 | - | if (( | |
535 | + | let cM = cn(ch.payments) | |
536 | + | if ((cG != 10000)) | |
704 | 537 | then throw("sum of token weights must be equal to 10000") | |
705 | - | else if (( | |
538 | + | else if ((cM == 0)) | |
706 | 539 | then throw("you need a bigger tokens amount to launch the pool") | |
707 | 540 | else { | |
708 | - | let | |
709 | - | let | |
541 | + | let cN = Issue(("PZ " + ci), "Puzzle Swap: pool index token", cM, i, true, unit, 0) | |
542 | + | let cO = calculateAssetId(cN) | |
710 | 543 | $Tuple2(((({ | |
711 | 544 | let ai = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
712 | 545 | let aj = size(ai) | |
713 | 546 | let ak = nil | |
714 | - | func | |
547 | + | func cP (am,an) = if ((an >= aj)) | |
715 | 548 | then am | |
716 | - | else | |
549 | + | else cJ(am, ai[an]) | |
717 | 550 | ||
718 | - | func | |
551 | + | func cQ (am,an) = if ((an >= aj)) | |
719 | 552 | then am | |
720 | 553 | else throw("List size exceeds 10") | |
721 | 554 | ||
722 | - | | |
723 | - | } ++ [ | |
555 | + | cQ(cP(cP(cP(cP(cP(cP(cP(cP(cP(cP(ak, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
556 | + | } ++ [cs, StringEntry("static_tokenIds", cy), StringEntry("static_feeToken", aP), StringEntry("static_tokenWeights", cv), IntegerEntry("static_tokensAmount", size(cA)), StringEntry("static_poolDomain", ci), StringEntry("static_baseTokenId", cw), StringEntry("static_poolOwner", cj), IntegerEntry("static_fee", cB), IntegerEntry("static_KMult", g), IntegerEntry("global_wasPreInited", 1)]) ++ [IntegerEntry("global_WAVES_balance", aE), IntegerEntry((("global_" + cu) + "_balance"), cm)]) ++ [cN, IntegerEntry("global_poolToken_amount", cM), IntegerEntry("global_wasInited", 1), BinaryEntry("global_poolToken_id", cO), StringEntry("static_poolToken_idStr", x(cO)), IntegerEntry((toString(ch.caller) + "_indexStaked"), cM), IntegerEntry("global_indexStaked", cM)]), cu) | |
724 | 557 | } | |
725 | 558 | } | |
726 | 559 | } | |
727 | 560 | ||
728 | 561 | ||
729 | 562 | ||
730 | - | @Callable( | |
731 | - | func init ( | |
563 | + | @Callable(ch) | |
564 | + | func init (ci,cj,ck,cl,cm) = if ((ch.caller != ae)) | |
732 | 565 | then throw("admin only") | |
733 | 566 | else { | |
734 | - | let | |
735 | - | if (( | |
567 | + | let cR = invoke(this, "initPool", [ci, cj, ck, cl, cm], nil) | |
568 | + | if ((cR == cR)) | |
736 | 569 | then { | |
737 | - | let | |
738 | - | let | |
739 | - | if ($isInstanceOf( | |
740 | - | then | |
741 | - | else throw(($getType( | |
570 | + | let cu = { | |
571 | + | let cS = cR | |
572 | + | if ($isInstanceOf(cS, "String")) | |
573 | + | then cS | |
574 | + | else throw(($getType(cS) + " couldn't be cast to String")) | |
742 | 575 | } | |
743 | - | | |
576 | + | bB("WAVES", cu, (ch.payments[0].amount - aF), 0, toString(ch.caller))._1 | |
744 | 577 | } | |
745 | 578 | else throw("Strict value is not equal to itself.") | |
746 | 579 | } | |
747 | 580 | ||
748 | 581 | ||
749 | 582 | ||
750 | - | @Callable(cN) | |
751 | - | func redeemIndex (du) = { | |
752 | - | let cU = cN.payments[0] | |
753 | - | if ((cU.assetId != v("global_poolToken_id"))) | |
754 | - | then throw("please attach pool share token") | |
755 | - | else if (aA()) | |
756 | - | then throw("contract is on stop") | |
757 | - | else { | |
758 | - | let dv = cU.amount | |
759 | - | let dw = fraction(dv, aG(), g, DOWN) | |
760 | - | let bN = aU(dw, if (du) | |
761 | - | then cN.originCaller | |
762 | - | else cN.caller) | |
763 | - | (bN ++ [Burn(v("global_poolToken_id"), dv), IntegerEntry("global_poolToken_amount", (r("global_poolToken_amount") - dv))]) | |
764 | - | } | |
583 | + | @Callable(ch) | |
584 | + | func claimIndexRewards () = if (aH()) | |
585 | + | then throw("contract is on stop") | |
586 | + | else bn(ch.caller) | |
587 | + | ||
588 | + | ||
589 | + | ||
590 | + | @Callable(ch) | |
591 | + | func evaluateClaim (cT) = $Tuple2(nil, bn(addressFromStringValue(cT))._2) | |
592 | + | ||
593 | + | ||
594 | + | ||
595 | + | @Callable(ch) | |
596 | + | func swap (aZ,bD) = { | |
597 | + | let aC = aA() | |
598 | + | if ((2 > aC)) | |
599 | + | then { | |
600 | + | let cp = if ((size(ch.payments) == 1)) | |
601 | + | then value(ch.payments[0]) | |
602 | + | else throw("please attach exactly one payment") | |
603 | + | let aX = value(ch.payments[0].amount) | |
604 | + | let bF = ch.payments[0].assetId | |
605 | + | let cU = bB(x(bF), aZ, aX, bD, toString(ch.caller)) | |
606 | + | if ((getIntegerValue("global_WAVES_balance") > aG)) | |
607 | + | then { | |
608 | + | let cV = invoke(ae, "notifyStatusUpdate", [2], nil) | |
609 | + | if ((cV == cV)) | |
610 | + | then cU | |
611 | + | else throw("Strict value is not equal to itself.") | |
612 | + | } | |
613 | + | else cU | |
614 | + | } | |
615 | + | else throw("pool is stopped: most probably it reached the target liquidity") | |
765 | 616 | } | |
766 | 617 | ||
767 | 618 | ||
768 | 619 | ||
769 | - | @Callable(cN) | |
770 | - | func stakeIndex () = { | |
771 | - | let by = toString(cN.originCaller) | |
772 | - | let cU = cN.payments[0] | |
773 | - | if ((value(cU.assetId) != v("global_poolToken_id"))) | |
774 | - | then throw("wrong asset attached") | |
775 | - | else bE(by, cU.amount) | |
620 | + | @Callable(ch) | |
621 | + | func swapReadOnly (aY,aZ,aX) = { | |
622 | + | let bF = z(aY) | |
623 | + | let bG = z(aZ) | |
624 | + | let bH = (f / q((("static_" + aY) + "_scale"))) | |
625 | + | let bI = (f / q((("static_" + aZ) + "_scale"))) | |
626 | + | let bJ = v("static_feeToken") | |
627 | + | let bK = if ((bJ == "")) | |
628 | + | then R | |
629 | + | else z(bJ) | |
630 | + | let bL = q((("global_" + x(bF)) + "_balance")) | |
631 | + | let bM = q((("global_" + aZ) + "_balance")) | |
632 | + | let bN = (bL * bH) | |
633 | + | let bO = (bM * bI) | |
634 | + | let bP = fraction(aX, ay, h) | |
635 | + | let bQ = (aX - bP) | |
636 | + | let bR = (bQ * bH) | |
637 | + | let bS = aW(bR, bF, bG, bN, bO) | |
638 | + | let bT = fraction(bS, 1, bI) | |
639 | + | let bU = (bM - bT) | |
640 | + | let bV = (bL + bQ) | |
641 | + | let bW = if ((bK == bF)) | |
642 | + | then bV | |
643 | + | else if ((bK == bG)) | |
644 | + | then bU | |
645 | + | else q((("global_" + x(bK)) + "_balance")) | |
646 | + | let bX = aW(bP, bF, bK, bL, bW) | |
647 | + | if ((bG == bF)) | |
648 | + | then throw("this swap is not allowed") | |
649 | + | else if ((0 > (bM - bT))) | |
650 | + | then throw("contract is out of reserves") | |
651 | + | else if (aH()) | |
652 | + | then throw("contract is on stop") | |
653 | + | else $Tuple2(nil, bT) | |
776 | 654 | } | |
777 | 655 | ||
778 | 656 | ||
779 | 657 | ||
780 | - | @Callable(cN) | |
781 | - | func stakeIndexFor (by) = { | |
782 | - | let cU = cN.payments[0] | |
783 | - | if ((value(cU.assetId) != v("global_poolToken_id"))) | |
784 | - | then throw("wrong asset attached") | |
785 | - | else bE(by, cU.amount) | |
786 | - | } | |
787 | - | ||
788 | - | ||
789 | - | ||
790 | - | @Callable(cN) | |
791 | - | func unstakeIndex (dx) = { | |
792 | - | let by = if ((indexOf(ac, toString(cN.caller)) != unit)) | |
793 | - | then toString(cN.originCaller) | |
794 | - | else toString(cN.caller) | |
795 | - | let dy = r((by + "_indexStaked")) | |
796 | - | if (aA()) | |
797 | - | then throw("contract is on stop") | |
798 | - | else if ((dx > dy)) | |
799 | - | then throw("you don't have index tokens available") | |
800 | - | else if (aA()) | |
801 | - | then throw("contract is on stop") | |
802 | - | else (bw(addressFromStringValue(by))._1 ++ [IntegerEntry((by + "_indexStaked"), (dy - dx)), IntegerEntry("global_indexStaked", (r("global_indexStaked") - dx)), ScriptTransfer(cN.caller, dx, getBinaryValue("global_poolToken_id"))]) | |
803 | - | } | |
804 | - | ||
805 | - | ||
806 | - | ||
807 | - | @Callable(cN) | |
808 | - | func claimIndexRewards () = if (aA()) | |
809 | - | then throw("contract is on stop") | |
810 | - | else bw(cN.caller) | |
811 | - | ||
812 | - | ||
813 | - | ||
814 | - | @Callable(cN) | |
815 | - | func evaluateClaim (dz) = $Tuple2(nil, bw(addressFromStringValue(dz))._2) | |
816 | - | ||
817 | - | ||
818 | - | ||
819 | - | @Callable(cN) | |
820 | - | func swap (bi,cj) = { | |
821 | - | let cU = if ((size(cN.payments) == 1)) | |
822 | - | then value(cN.payments[0]) | |
823 | - | else throw("please attach exactly one payment") | |
824 | - | let bg = value(cN.payments[0].amount) | |
825 | - | let cl = cN.payments[0].assetId | |
826 | - | ch(y(cl), bi, bg, cj, toString(cN.caller)) | |
827 | - | } | |
828 | - | ||
829 | - | ||
830 | - | ||
831 | - | @Callable(cN) | |
832 | - | func swapReadOnly (bh,bi,bg) = { | |
833 | - | let cl = A(bh) | |
834 | - | let cm = A(bi) | |
835 | - | let cn = (f / r((("static_" + bh) + "_scale"))) | |
836 | - | let co = (f / r((("static_" + bi) + "_scale"))) | |
837 | - | let cp = w("static_feeToken") | |
838 | - | let cq = if ((cp == "")) | |
839 | - | then S | |
840 | - | else A(cp) | |
841 | - | let cr = r((("global_" + y(cl)) + "_balance")) | |
842 | - | let cs = r((("global_" + bi) + "_balance")) | |
843 | - | let ct = (cr * cn) | |
844 | - | let cu = (cs * co) | |
845 | - | let cv = fraction(bg, ay, h) | |
846 | - | let cw = (bg - cv) | |
847 | - | let cx = (cw * cn) | |
848 | - | let cy = bf(cx, cl, cm, ct, cu) | |
849 | - | let cz = fraction(cy, 1, co) | |
850 | - | let cA = (cs - cz) | |
851 | - | let cB = (cr + cw) | |
852 | - | let cC = if ((cq == cl)) | |
853 | - | then cB | |
854 | - | else if ((cq == cm)) | |
855 | - | then cA | |
856 | - | else r((("global_" + y(cq)) + "_balance")) | |
857 | - | let cD = bf(cv, cl, cq, cr, cC) | |
858 | - | if ((cm == cl)) | |
859 | - | then throw("this swap is not allowed") | |
860 | - | else if ((0 > (cs - cz))) | |
861 | - | then throw("contract is out of reserves") | |
862 | - | else if (aA()) | |
863 | - | then throw("contract is on stop") | |
864 | - | else $Tuple2(nil, cz) | |
865 | - | } | |
866 | - | ||
867 | - | ||
868 | - | ||
869 | - | @Callable(cN) | |
870 | - | func transferOwnership (dA) = if ((toString(cN.caller) != w("static_poolOwner"))) | |
658 | + | @Callable(ch) | |
659 | + | func transferOwnership (cW) = if ((toString(ch.caller) != v("static_poolOwner"))) | |
871 | 660 | then throw("this call available only for pool owner") | |
872 | - | else [StringEntry("static_poolOwner", | |
661 | + | else [StringEntry("static_poolOwner", cW)] | |
873 | 662 | ||
874 | 663 |
github/deemru/w8io/026f985 211.11 ms ◑