tx · EMFXQqnP2adEmDBfWfZwo4ogJcDUqk93jZPdSER28UsN 3N46pWZUQEHok4dtnzwxP6z7SKXqFGFAMaS: -0.01000000 Waves 2022.04.15 05:29 [2009063] smart account 3N46pWZUQEHok4dtnzwxP6z7SKXqFGFAMaS > SELF 0.00000000 Waves
{ "type": 13, "id": "EMFXQqnP2adEmDBfWfZwo4ogJcDUqk93jZPdSER28UsN", "fee": 1000000, "feeAssetId": null, "timestamp": 1649989783226, "version": 2, "chainId": 84, "sender": "3N46pWZUQEHok4dtnzwxP6z7SKXqFGFAMaS", "senderPublicKey": "BYCDpmQbHo1258qHe1B3178z4HR6FQf4QKqqq8zVVW4m", "proofs": [ "wVzwdybQ4JE9M9agRmLEWjgFsgWRXfVCY3Tj2r6oqfQdJJ8QJW9jPQ1Jjtpxxt28A2AUxCpFycqt46rd9Z8YTRm" ], "script": "base64:AAIFAAAAAAAAACcIAhIGCgQICAgIEgASABIDCgEEEgASAwoBARIAEgMKAQQSBAoCCAEAAAAlAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAABAAAADHRyeUdldEJpbmFyeQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgEAAAAAAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAQAAAA5nZXRBc3NldFN0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kJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAdnbG9iYWxfCQEAAAAOZ2V0QXNzZXRTdHJpbmcAAAABBQAAAAdBc3NldEluAgAAAAhfYmFsYW5jZQUAAAAMbmV3QmFsYW5jZUluBQAAAANuaWwJAAUUAAAAAgkABE4AAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAHZ2xvYmFsXwUAAAAIYXNzZXRPdXQCAAAACF9iYWxhbmNlCQAAZAAAAAIFAAAADW5ld0JhbGFuY2VPdXQFAAAACWZlZUFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADmNsZWFuQW1vdW50T3V0BQAAAAhBc3NldE91dAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAANZ2xvYmFsX3ZvbHVtZQkAAGQAAAACCQEAAAANdHJ5R2V0SW50ZWdlcgAAAAECAAAADWdsb2JhbF92b2x1bWUJAQAAABJjYWxjdWxhdGVVc2RuVmFsdWUAAAADBQAAAAdBc3NldEluBQAAAAhBbW91bnRJbgUAAAAOQXNzZXRJbkJhbGFuY2UFAAAAA25pbAUAAAAOYmFsYW5jZUNoYW5nZXMFAAAADmNsZWFuQW1vdW50T3V0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAADCQEAAAAKaXNTaHV0ZG93bgAAAAAHCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleTgnnik=", "height": 2009063, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
5 | + | case b: Int => | |
6 | + | b | |
7 | + | case _ => | |
8 | + | 0 | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func tryGetBinary (key) = match getBinary(this, key) { | |
13 | + | case b: ByteVector => | |
14 | + | b | |
15 | + | case _ => | |
16 | + | base58'' | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func tryGetString (key) = match getString(this, key) { | |
21 | + | case b: String => | |
22 | + | b | |
23 | + | case _ => | |
24 | + | "" | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func getAssetString (assetId) = match assetId { | |
29 | + | case b: ByteVector => | |
30 | + | toBase58String(b) | |
31 | + | case _ => | |
32 | + | "WAVES" | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
37 | + | then unit | |
38 | + | else fromBase58String(assetIdStr) | |
39 | + | ||
40 | + | ||
41 | + | func addAssetBytesToList (accum,item) = (accum ++ [getAssetBytes(item)]) | |
42 | + | ||
43 | + | ||
44 | + | func addAssetWeightToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_weight"))]) | |
45 | + | ||
46 | + | ||
47 | + | func addAssetDecimalsToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_decimals"))]) | |
48 | + | ||
49 | + | ||
50 | + | func addAssetScaleToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_scale"))]) | |
51 | + | ||
52 | + | ||
53 | + | func addIntToList (accum,item) = (accum ++ [parseIntValue(item)]) | |
54 | + | ||
55 | + | ||
56 | + | let T = tryGetInteger("static_tokensAmount") | |
57 | + | ||
58 | + | let assetIds = { | |
59 | + | let $l = split(tryGetString("static_tokenIds"), ",") | |
60 | + | let $s = size($l) | |
61 | + | let $acc0 = nil | |
62 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
63 | + | then $a | |
64 | + | else addAssetBytesToList($a, $l[$i]) | |
65 | + | ||
66 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
67 | + | then $a | |
68 | + | else throw("List size exceeds 10") | |
69 | + | ||
70 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
71 | + | } | |
72 | + | ||
73 | + | let AssetsWeights = { | |
74 | + | let $l = assetIds | |
75 | + | let $s = size($l) | |
76 | + | let $acc0 = nil | |
77 | + | func $f1_1 ($a,$i) = if (($i >= $s)) | |
78 | + | then $a | |
79 | + | else addAssetWeightToList($a, $l[$i]) | |
80 | + | ||
81 | + | func $f1_2 ($a,$i) = if (($i >= $s)) | |
82 | + | then $a | |
83 | + | else throw("List size exceeds 10") | |
84 | + | ||
85 | + | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
86 | + | } | |
87 | + | ||
88 | + | let Decimals = { | |
89 | + | let $l = assetIds | |
90 | + | let $s = size($l) | |
91 | + | let $acc0 = nil | |
92 | + | func $f2_1 ($a,$i) = if (($i >= $s)) | |
93 | + | then $a | |
94 | + | else addAssetDecimalsToList($a, $l[$i]) | |
95 | + | ||
96 | + | func $f2_2 ($a,$i) = if (($i >= $s)) | |
97 | + | then $a | |
98 | + | else throw("List size exceeds 10") | |
99 | + | ||
100 | + | $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
101 | + | } | |
102 | + | ||
103 | + | let Scales = { | |
104 | + | let $l = assetIds | |
105 | + | let $s = size($l) | |
106 | + | let $acc0 = nil | |
107 | + | func $f3_1 ($a,$i) = if (($i >= $s)) | |
108 | + | then $a | |
109 | + | else addAssetScaleToList($a, $l[$i]) | |
110 | + | ||
111 | + | func $f3_2 ($a,$i) = if (($i >= $s)) | |
112 | + | then $a | |
113 | + | else throw("List size exceeds 10") | |
114 | + | ||
115 | + | $f3_2($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
116 | + | } | |
117 | + | ||
118 | + | let Fee = tryGetInteger("static_fee") | |
119 | + | ||
120 | + | let AssetsWeightsDecimals = 2 | |
121 | + | ||
122 | + | let Scale = 10000 | |
123 | + | ||
124 | + | let Scale8 = 100000000 | |
125 | + | ||
126 | + | let FeeScale = 10000 | |
127 | + | ||
128 | + | let PoolTokenDecimals = 8 | |
129 | + | ||
130 | + | let PoolTokenScale = pow(10, 0, PoolTokenDecimals, 0, 0, HALFUP) | |
131 | + | ||
132 | + | let earnedAssets = assetIds | |
133 | + | ||
134 | + | func isShutdown () = match getBoolean(Address(base58'3PEpv9hRFWEEBU22WRnLsw1bH4YGtcU728o'), "is_shutdown") { | |
135 | + | case x: Boolean => | |
136 | + | x | |
137 | + | case _ => | |
138 | + | false | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | func getCurrentTokenBalance (tokenType) = { | |
143 | + | let tokenId = getAssetString(assetIds[tokenType]) | |
144 | + | tryGetInteger((("global_" + tokenId) + "_balance")) | |
145 | + | } | |
146 | + | ||
147 | + | ||
148 | + | func calculatePIssued (amount,tokenId) = { | |
149 | + | let Psupply = tryGetInteger("global_poolToken_amount") | |
150 | + | let Balance = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
151 | + | fraction(amount, Psupply, Balance, DOWN) | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | func getMinPIssued (payments) = { | |
156 | + | func handler (accum,current) = { | |
157 | + | let PIssued = calculatePIssued(current.amount, current.assetId) | |
158 | + | if (if ((accum == 0)) | |
159 | + | then true | |
160 | + | else (accum > PIssued)) | |
161 | + | then PIssued | |
162 | + | else accum | |
163 | + | } | |
164 | + | ||
165 | + | let minPIssed = { | |
166 | + | let $l = payments | |
167 | + | let $s = size($l) | |
168 | + | let $acc0 = 0 | |
169 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
170 | + | then $a | |
171 | + | else handler($a, $l[$i]) | |
172 | + | ||
173 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
174 | + | then $a | |
175 | + | else throw("List size exceeds 10") | |
176 | + | ||
177 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
178 | + | } | |
179 | + | minPIssed | |
180 | + | } | |
181 | + | ||
182 | + | ||
183 | + | func calculateUsdnValue (assetId,amount,aBalance) = { | |
184 | + | let usdnId = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
185 | + | let usdnWeight = AssetsWeights[value(indexOf(assetIds, usdnId))] | |
186 | + | let assetWeight = AssetsWeights[value(indexOf(assetIds, assetId))] | |
187 | + | let usdnBalance = tryGetInteger((("global_" + getAssetString(usdnId)) + "_balance")) | |
188 | + | fraction(amount, (usdnBalance / usdnWeight), (aBalance / assetWeight)) | |
189 | + | } | |
190 | + | ||
191 | + | ||
192 | + | func checkTokensValidity (payments) = { | |
193 | + | func handler1 (accum,payment) = (accum ++ [payment.assetId]) | |
194 | + | ||
195 | + | let ids = { | |
196 | + | let $l = payments | |
197 | + | let $s = size($l) | |
198 | + | let $acc0 = nil | |
199 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
200 | + | then $a | |
201 | + | else handler1($a, $l[$i]) | |
202 | + | ||
203 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
204 | + | then $a | |
205 | + | else throw("List size exceeds 10") | |
206 | + | ||
207 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
208 | + | } | |
209 | + | if ((ids == ids)) | |
210 | + | then { | |
211 | + | func handler2 (accum,assetId) = if ((indexOf(ids, assetId) != unit)) | |
212 | + | then (accum + 1) | |
213 | + | else throw(("asset not attached: " + getAssetString(assetId))) | |
214 | + | ||
215 | + | let checks = { | |
216 | + | let $l = assetIds | |
217 | + | let $s = size($l) | |
218 | + | let $acc0 = 0 | |
219 | + | func $f5_1 ($a,$i) = if (($i >= $s)) | |
220 | + | then $a | |
221 | + | else handler2($a, $l[$i]) | |
222 | + | ||
223 | + | func $f5_2 ($a,$i) = if (($i >= $s)) | |
224 | + | then $a | |
225 | + | else throw("List size exceeds 10") | |
226 | + | ||
227 | + | $f5_2($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
228 | + | } | |
229 | + | if ((checks == checks)) | |
230 | + | then true | |
231 | + | else throw("Strict value is not equal to itself.") | |
232 | + | } | |
233 | + | else throw("Strict value is not equal to itself.") | |
234 | + | } | |
235 | + | ||
236 | + | ||
237 | + | func handlePoolTokensAdd (PIssued,payments,userAddress,needChange) = { | |
238 | + | func getTokenPaymentAmount (tokenId) = { | |
239 | + | func handler (accum,payment) = if ((payment.assetId == tokenId)) | |
240 | + | then payment.amount | |
241 | + | else accum | |
242 | + | ||
243 | + | let $l = payments | |
244 | + | let $s = size($l) | |
245 | + | let $acc0 = 0 | |
246 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
247 | + | then $a | |
248 | + | else handler($a, $l[$i]) | |
249 | + | ||
250 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
251 | + | then $a | |
252 | + | else throw("List size exceeds 10") | |
253 | + | ||
254 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
255 | + | } | |
256 | + | ||
257 | + | func handleTokenChange (accum,tokenId) = { | |
258 | + | let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
259 | + | let PSupply = tryGetInteger("global_poolToken_amount") | |
260 | + | let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale")) | |
261 | + | let Dk = fraction((fraction((PSupply + PIssued), tokenDecimals, PSupply, DOWN) - tokenDecimals), Bk, tokenDecimals, DOWN) | |
262 | + | let paymentAmount = getTokenPaymentAmount(tokenId) | |
263 | + | let toReturn = ((if ((paymentAmount != 0)) | |
264 | + | then paymentAmount | |
265 | + | else 0) - Dk) | |
266 | + | let t = if (needChange) | |
267 | + | then [ScriptTransfer(userAddress, toReturn, tokenId)] | |
268 | + | else nil | |
269 | + | ((accum ++ t) ++ [IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk + Dk))]) | |
270 | + | } | |
271 | + | ||
272 | + | let $l = assetIds | |
273 | + | let $s = size($l) | |
274 | + | let $acc0 = nil | |
275 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
276 | + | then $a | |
277 | + | else handleTokenChange($a, $l[$i]) | |
278 | + | ||
279 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
280 | + | then $a | |
281 | + | else throw("List size exceeds 10") | |
282 | + | ||
283 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | func handlePoolTokensRedeem (PRedeemed,userAddress) = { | |
288 | + | func handleTokenRedeem (accum,tokenId) = { | |
289 | + | let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
290 | + | let PSupply = tryGetInteger("global_poolToken_amount") | |
291 | + | let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale")) | |
292 | + | let amount = toInt(fraction((toBigInt(Scale8) - fraction(toBigInt((PSupply - PRedeemed)), toBigInt(Scale8), toBigInt(PSupply), CEILING)), toBigInt(Bk), toBigInt(Scale8), DOWN)) | |
293 | + | (accum ++ [IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk - amount)), ScriptTransfer(userAddress, amount, tokenId)]) | |
294 | + | } | |
295 | + | ||
296 | + | let $l = assetIds | |
297 | + | let $s = size($l) | |
298 | + | let $acc0 = nil | |
299 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
300 | + | then $a | |
301 | + | else handleTokenRedeem($a, $l[$i]) | |
302 | + | ||
303 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
304 | + | then $a | |
305 | + | else throw("List size exceeds 10") | |
306 | + | ||
307 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
308 | + | } | |
309 | + | ||
310 | + | ||
311 | + | func calculateOutAmount (AmountIn,assetIn,assetOut,BalanceIn,BalanceOut) = { | |
312 | + | let IndexIn = value(indexOf(assetIds, assetIn)) | |
313 | + | let IndexOut = value(indexOf(assetIds, assetOut)) | |
314 | + | if ((IndexIn == IndexOut)) | |
315 | + | then throw("wrong tokens pair") | |
316 | + | else fraction(BalanceOut, ((Scale8 * Scale8) - toInt(pow(fraction(toBigInt(BalanceIn), toBigInt((Scale8 * Scale8)), toBigInt((BalanceIn + AmountIn)), HALFUP), 16, toBigInt(fraction(AssetsWeights[IndexIn], 10000, AssetsWeights[IndexOut])), 4, 16, CEILING))), (Scale8 * Scale8), DOWN) | |
317 | + | } | |
318 | + | ||
319 | + | ||
320 | + | func getTokenBalance (assetId) = match assetId { | |
321 | + | case t: ByteVector => | |
322 | + | assetBalance(this, t) | |
323 | + | case _ => | |
324 | + | wavesBalance(this).available | |
325 | + | } | |
326 | + | ||
327 | + | ||
328 | + | func calculateCurrentAssetInterest (assetId,assetIdStr,aBalance,tokenEarningsLastCheck) = { | |
329 | + | let totalStaked = tryGetInteger("global_indexStaked") | |
330 | + | let tokenBalanceLastCheck = tokenEarningsLastCheck | |
331 | + | let currentBalanceDelta = (getTokenBalance(assetId) - aBalance) | |
332 | + | let currentTokenEarnings = if ((currentBalanceDelta > tokenBalanceLastCheck)) | |
333 | + | then currentBalanceDelta | |
334 | + | else tokenBalanceLastCheck | |
335 | + | let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck) | |
336 | + | let newInterest = if ((totalStaked == 0)) | |
337 | + | then 0 | |
338 | + | else fraction(newEarnings, Scale8, totalStaked) | |
339 | + | let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest")) | |
340 | + | (lastCheckInterest + newInterest) | |
341 | + | } | |
342 | + | ||
343 | + | ||
344 | + | func claimResult (address) = { | |
345 | + | let addressStr = toString(address) | |
346 | + | let puzzleAmount = tryGetInteger((addressStr + "_indexStaked")) | |
347 | + | func handler (accum,assetId) = { | |
348 | + | let assetIdStr = getAssetString(assetId) | |
349 | + | let aBalance = tryGetInteger((("global_" + getAssetString(assetId)) + "_balance")) | |
350 | + | let tokenEarningsLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings")) | |
351 | + | let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr, aBalance, tokenEarningsLastCheck) | |
352 | + | let currentTokenEarnings = max([tokenEarningsLastCheck, (getTokenBalance(assetId) - aBalance)]) | |
353 | + | let rewardAmount = fraction(puzzleAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), Scale8) | |
354 | + | let transfer = if ((rewardAmount == 0)) | |
355 | + | then nil | |
356 | + | else [ScriptTransfer(address, rewardAmount, assetId)] | |
357 | + | $Tuple2(((accum._1 ++ transfer) ++ [IntegerEntry((("global_lastCheck_" + assetIdStr) + "_earnings"), (currentTokenEarnings - rewardAmount)), IntegerEntry((("global_lastCheck_" + assetIdStr) + "_interest"), currentTokenInterest), IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"), currentTokenInterest)]), (accum._2 + calculateUsdnValue(assetId, rewardAmount, aBalance))) | |
358 | + | } | |
359 | + | ||
360 | + | let accum = { | |
361 | + | let $l = earnedAssets | |
362 | + | let $s = size($l) | |
363 | + | let $acc0 = $Tuple2(nil, 0) | |
364 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
365 | + | then $a | |
366 | + | else handler($a, $l[$i]) | |
367 | + | ||
368 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
369 | + | then $a | |
370 | + | else throw("List size exceeds 10") | |
371 | + | ||
372 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
373 | + | } | |
374 | + | (accum._1 ++ [IntegerEntry((addressStr + "_claimedRewardValue"), (tryGetInteger((addressStr + "_claimedRewardValue")) + accum._2)), IntegerEntry((addressStr + "_lastClaim"), lastBlock.timestamp)]) | |
375 | + | } | |
376 | + | ||
377 | + | ||
378 | + | func indexStakeResult (addressStr,amount) = { | |
379 | + | let li = claimResult(addressFromStringValue(addressStr)) | |
380 | + | (li ++ [IntegerEntry((addressStr + "_indexStaked"), (tryGetInteger((addressStr + "_indexStaked")) + amount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") + amount))]) | |
381 | + | } | |
382 | + | ||
383 | + | ||
384 | + | func sum (accum,n) = (accum + parseIntValue(n)) | |
385 | + | ||
386 | + | ||
387 | + | @Callable(i) | |
388 | + | func preInit (assetIdsStr,assetWeightsStr,baseTokenIdStr,poolDomain) = if ((this != i.caller)) | |
389 | + | then throw("admin only") | |
390 | + | else if ((size(poolDomain) > 13)) | |
391 | + | then throw("too large pool domain") | |
392 | + | else { | |
393 | + | let assetIdsStrLi = split(assetIdsStr, ",") | |
394 | + | let assetIdsLi = { | |
395 | + | let $l = assetIdsStrLi | |
396 | + | let $s = size($l) | |
397 | + | let $acc0 = nil | |
398 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
399 | + | then $a | |
400 | + | else addAssetBytesToList($a, $l[$i]) | |
401 | + | ||
402 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
403 | + | then $a | |
404 | + | else throw("List size exceeds 10") | |
405 | + | ||
406 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
407 | + | } | |
408 | + | let assetWeightsStrLi = split(assetWeightsStr, ",") | |
409 | + | let assetWeightsSum = { | |
410 | + | let $l = assetWeightsStrLi | |
411 | + | let $s = size($l) | |
412 | + | let $acc0 = 0 | |
413 | + | func $f5_1 ($a,$i) = if (($i >= $s)) | |
414 | + | then $a | |
415 | + | else sum($a, $l[$i]) | |
416 | + | ||
417 | + | func $f5_2 ($a,$i) = if (($i >= $s)) | |
418 | + | then $a | |
419 | + | else throw("List size exceeds 10") | |
420 | + | ||
421 | + | $f5_2($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
422 | + | } | |
423 | + | func addTokenDataEntries (accum,assetNum) = if ((assetNum >= size(assetIdsLi))) | |
424 | + | then accum | |
425 | + | else { | |
426 | + | let assetDecimals = value(assetInfo(assetIdsLi[assetNum])).decimals | |
427 | + | (accum ++ [IntegerEntry((("static_" + assetIdsStrLi[assetNum]) + "_scale"), pow(10, 0, assetDecimals, 0, 0, DOWN)), IntegerEntry((("static_" + assetIdsStrLi[assetNum]) + "_decimals"), assetDecimals), IntegerEntry((("static_" + assetIdsStrLi[assetNum]) + "_weight"), value(parseInt(assetWeightsStrLi[assetNum])))]) | |
428 | + | } | |
429 | + | ||
430 | + | if ((assetWeightsSum != 100)) | |
431 | + | then throw("sum of token weights must be equal to 100") | |
432 | + | else ({ | |
433 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
434 | + | let $s = size($l) | |
435 | + | let $acc0 = nil | |
436 | + | func $f6_1 ($a,$i) = if (($i >= $s)) | |
437 | + | then $a | |
438 | + | else addTokenDataEntries($a, $l[$i]) | |
439 | + | ||
440 | + | func $f6_2 ($a,$i) = if (($i >= $s)) | |
441 | + | then $a | |
442 | + | else throw("List size exceeds 10") | |
443 | + | ||
444 | + | $f6_2($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
445 | + | } ++ [StringEntry("static_tokenIds", assetIdsStr), StringEntry("static_tokenWeights", assetWeightsStr), IntegerEntry("static_tokensAmount", size(assetIdsLi)), StringEntry("static_poolDomain", poolDomain), StringEntry("static_baseTokenId", baseTokenIdStr), IntegerEntry("static_fee", 200)]) | |
446 | + | } | |
447 | + | ||
448 | + | ||
449 | + | ||
450 | + | @Callable(i) | |
451 | + | func deInit () = if ((i.caller != this)) | |
452 | + | then throw("admin only") | |
453 | + | else [IntegerEntry("global_wasInited", 0)] | |
454 | + | ||
455 | + | ||
456 | + | ||
457 | + | @Callable(i) | |
458 | + | func init () = { | |
459 | + | func prepareList () = { | |
460 | + | func handler (accum,n) = (accum ++ [IntegerEntry((("global_" + getAssetString(n.assetId)) + "_balance"), n.amount)]) | |
461 | + | ||
462 | + | let $l = i.payments | |
463 | + | let $s = size($l) | |
464 | + | let $acc0 = nil | |
465 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
466 | + | then $a | |
467 | + | else handler($a, $l[$i]) | |
468 | + | ||
469 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
470 | + | then $a | |
471 | + | else throw("List size exceeds 10") | |
472 | + | ||
473 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
474 | + | } | |
475 | + | ||
476 | + | func calculatePoolTokensAmount (payments) = { | |
477 | + | func handler (accum,pmt) = { | |
478 | + | let assetId = pmt.assetId | |
479 | + | func handler2 (accum,n) = if ((n == assetId)) | |
480 | + | then value(indexOf(assetIds, n)) | |
481 | + | else accum | |
482 | + | ||
483 | + | let Token = { | |
484 | + | let $l = assetIds | |
485 | + | let $s = size($l) | |
486 | + | let $acc0 = 1 | |
487 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
488 | + | then $a | |
489 | + | else handler2($a, $l[$i]) | |
490 | + | ||
491 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
492 | + | then $a | |
493 | + | else throw("List size exceeds 10") | |
494 | + | ||
495 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
496 | + | } | |
497 | + | fraction(accum, pow(pmt.amount, Decimals[Token], AssetsWeights[Token], AssetsWeightsDecimals, 8, FLOOR), Scale8) | |
498 | + | } | |
499 | + | ||
500 | + | let $l = payments | |
501 | + | let $s = size($l) | |
502 | + | let $acc0 = PoolTokenScale | |
503 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
504 | + | then $a | |
505 | + | else handler($a, $l[$i]) | |
506 | + | ||
507 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
508 | + | then $a | |
509 | + | else throw("List size exceeds 10") | |
510 | + | ||
511 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
512 | + | } | |
513 | + | ||
514 | + | if ((tryGetInteger("global_wasInited") > 0)) | |
515 | + | then throw("pool already inited") | |
516 | + | else { | |
517 | + | let initialPoolTokens = calculatePoolTokensAmount(i.payments) | |
518 | + | if ((initialPoolTokens == 0)) | |
519 | + | then throw("you need a bigger tokens amount to launch the pool") | |
520 | + | else { | |
521 | + | let poolTokenIssue = Issue(("PZ " + tryGetString("static_poolDomain")), "Puzzle Swap: pool index token", initialPoolTokens, PoolTokenDecimals, true, unit, 0) | |
522 | + | let poolTokenId = calculateAssetId(poolTokenIssue) | |
523 | + | (prepareList() ++ [poolTokenIssue, IntegerEntry("global_poolToken_amount", initialPoolTokens), IntegerEntry("global_wasInited", 1), BinaryEntry("global_poolToken_id", poolTokenId), StringEntry("static_poolToken_idStr", getAssetString(poolTokenId)), ScriptTransfer(i.caller, initialPoolTokens, poolTokenId)]) | |
524 | + | } | |
525 | + | } | |
526 | + | } | |
527 | + | ||
528 | + | ||
529 | + | ||
530 | + | @Callable(i) | |
531 | + | func generateIndex (needChange) = if ((size(i.payments) != T)) | |
532 | + | then throw(("you need to attach all pool tokens. amount of pool tokens: " + toString(T))) | |
533 | + | else if (!(checkTokensValidity(i.payments))) | |
534 | + | then throw("wrong assets attached") | |
535 | + | else { | |
536 | + | let PIssued = getMinPIssued(i.payments) | |
537 | + | let reissue = Reissue(getBinaryValue("global_poolToken_id"), PIssued, true) | |
538 | + | let result = handlePoolTokensAdd(PIssued, i.payments, i.originCaller, needChange) | |
539 | + | $Tuple2((result ++ [ScriptTransfer(i.caller, PIssued, tryGetBinary("global_poolToken_id")), reissue, IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") + PIssued))]), PIssued) | |
540 | + | } | |
541 | + | ||
542 | + | ||
543 | + | ||
544 | + | @Callable(i) | |
545 | + | func stakeIndex () = { | |
546 | + | let addressStr = toString(i.originCaller) | |
547 | + | let pmt = i.payments[0] | |
548 | + | if ((value(pmt.assetId) != tryGetBinary("global_poolToken_id"))) | |
549 | + | then throw("wrong asset attached") | |
550 | + | else indexStakeResult(addressStr, pmt.amount) | |
551 | + | } | |
552 | + | ||
553 | + | ||
554 | + | ||
555 | + | @Callable(i) | |
556 | + | func unstakeIndex (puzzleAmount) = { | |
557 | + | let addressStr = toString(i.originCaller) | |
558 | + | let puzzleAvailable = tryGetInteger((addressStr + "_indexStaked")) | |
559 | + | if ((puzzleAmount > puzzleAvailable)) | |
560 | + | then throw("you don't have index tokens available") | |
561 | + | else (claimResult(i.originCaller) ++ [IntegerEntry((addressStr + "_indexStaked"), (puzzleAvailable - puzzleAmount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") - puzzleAmount)), ScriptTransfer(i.caller, puzzleAmount, getBinaryValue("global_poolToken_id"))]) | |
562 | + | } | |
563 | + | ||
564 | + | ||
565 | + | ||
566 | + | @Callable(i) | |
567 | + | func claimIndexRewards () = claimResult(i.caller) | |
568 | + | ||
569 | + | ||
570 | + | ||
571 | + | @Callable(i) | |
572 | + | func redeemIndex (sendToOrigin) = { | |
573 | + | let pmt = i.payments[0] | |
574 | + | if ((pmt.assetId != tryGetBinary("global_poolToken_id"))) | |
575 | + | then throw("please attach pool share token") | |
576 | + | else { | |
577 | + | let PRedeemed = pmt.amount | |
578 | + | let result = handlePoolTokensRedeem(PRedeemed, if (sendToOrigin) | |
579 | + | then i.originCaller | |
580 | + | else i.caller) | |
581 | + | (result ++ [Burn(tryGetBinary("global_poolToken_id"), PRedeemed), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") - PRedeemed))]) | |
582 | + | } | |
583 | + | } | |
584 | + | ||
585 | + | ||
586 | + | ||
587 | + | @Callable(i) | |
588 | + | func swap (assetOut,minimum) = { | |
589 | + | let pmt = value(i.payments[0]) | |
590 | + | let AmountIn = value(i.payments[0].amount) | |
591 | + | let AssetIn = pmt.assetId | |
592 | + | let AssetOut = getAssetBytes(assetOut) | |
593 | + | let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance")) | |
594 | + | let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance")) | |
595 | + | let AmountOut = calculateOutAmount(AmountIn, AssetIn, AssetOut, AssetInBalance, AssetOutBalance) | |
596 | + | let feeAmount = fraction(AmountOut, Fee, FeeScale) | |
597 | + | let cleanAmountOut = (AmountOut - feeAmount) | |
598 | + | if ((minimum > cleanAmountOut)) | |
599 | + | then throw(("amount to recieve is lower than given one: " + toString(cleanAmountOut))) | |
600 | + | else if ((0 > (AssetOutBalance - AmountOut))) | |
601 | + | then throw("contract is out of reserves") | |
602 | + | else { | |
603 | + | let newBalanceIn = (AssetInBalance + AmountIn) | |
604 | + | let newBalanceOut = (AssetOutBalance - AmountOut) | |
605 | + | let usdnAssetId = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
606 | + | if ((usdnAssetId == AssetOut)) | |
607 | + | then { | |
608 | + | let usdnFeeAmount = feeAmount | |
609 | + | let protocolUsdnFee = fraction(usdnFeeAmount, 4, 10) | |
610 | + | let stakingTopUp = reentrantInvoke(Address(base58'3PFTbywqxtFfukX3HyT881g4iW5K4QL3FAS'), "topUpReward", nil, [AttachedPayment(usdnAssetId, protocolUsdnFee)]) | |
611 | + | if ((stakingTopUp == stakingTopUp)) | |
612 | + | then $Tuple2([IntegerEntry((("global_" + assetOut) + "_balance"), newBalanceOut), IntegerEntry((("global_" + getAssetString(AssetIn)) + "_balance"), newBalanceIn), ScriptTransfer(i.caller, cleanAmountOut, AssetOut), IntegerEntry("global_volume", (tryGetInteger("global_volume") + calculateUsdnValue(AssetIn, AmountIn, AssetInBalance)))], cleanAmountOut) | |
613 | + | else throw("Strict value is not equal to itself.") | |
614 | + | } | |
615 | + | else { | |
616 | + | let usdnBalance = if ((AssetIn == usdnAssetId)) | |
617 | + | then newBalanceIn | |
618 | + | else tryGetInteger((("global_" + getAssetString(usdnAssetId)) + "_balance")) | |
619 | + | let usdnFeeAmount = calculateOutAmount(feeAmount, AssetOut, usdnAssetId, newBalanceOut, usdnBalance) | |
620 | + | let protocolUsdnFee = fraction(usdnFeeAmount, 4, 10) | |
621 | + | let stakingTopUp = reentrantInvoke(Address(base58'3PFTbywqxtFfukX3HyT881g4iW5K4QL3FAS'), "topUpReward", nil, [AttachedPayment(usdnAssetId, protocolUsdnFee)]) | |
622 | + | if ((stakingTopUp == stakingTopUp)) | |
623 | + | then { | |
624 | + | let usdnBalanceChangeEntry = IntegerEntry((("global_" + toBase58String(usdnAssetId)) + "_balance"), (usdnBalance - usdnFeeAmount)) | |
625 | + | let balanceChanges = if ((AssetIn == usdnAssetId)) | |
626 | + | then [usdnBalanceChangeEntry] | |
627 | + | else [usdnBalanceChangeEntry, IntegerEntry((("global_" + getAssetString(AssetIn)) + "_balance"), newBalanceIn)] | |
628 | + | $Tuple2(([IntegerEntry((("global_" + assetOut) + "_balance"), (newBalanceOut + feeAmount)), ScriptTransfer(i.caller, cleanAmountOut, AssetOut), IntegerEntry("global_volume", (tryGetInteger("global_volume") + calculateUsdnValue(AssetIn, AmountIn, AssetInBalance)))] ++ balanceChanges), cleanAmountOut) | |
629 | + | } | |
630 | + | else throw("Strict value is not equal to itself.") | |
631 | + | } | |
632 | + | } | |
633 | + | } | |
634 | + | ||
635 | + | ||
636 | + | @Verifier(tx) | |
637 | + | func verify () = if (isShutdown()) | |
638 | + | then false | |
639 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
640 | + |
github/deemru/w8io/169f3d6 69.47 ms ◑