tx · HTMNnfxYyTVQ1qEdjrx4LeaSMeHrb12hZRVPDZZXmGdQ

3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn:  -0.02700000 Waves

2023.06.27 18:19 [2641238] smart account 3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn > SELF 0.00000000 Waves

{ "type": 13, "id": "HTMNnfxYyTVQ1qEdjrx4LeaSMeHrb12hZRVPDZZXmGdQ", "fee": 2700000, "feeAssetId": null, "timestamp": 1687879115746, "version": 2, "chainId": 84, "sender": "3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn", "senderPublicKey": "6oJuynzr7rKRYRDWhDrENciDLidQuVGfe82pK7hr5nev", "proofs": [ "4ybEkjyWim88iJJkVavPCVnwobGTgZ3BRhrbeR1yzbcNa8VWWDCHoPz9Zyjb4G6bioknUZAimkUVqqjbMYQcv5du" ], "script": "base64:BgIuCAISCAoGCAgICAgBEgASABIDCgEEEgASAwoBARIAEgMKAQgSAwoBBBIECgIIATMAC3VzZG5Bc3NldElkASC2JinDBPXOU5GkDkt1JC9kjFGx+t+vVCm9SNIdKrKq0QANcHV6emxlQXNzZXRJZAEg8Rr+Jf72mTj0aSrE3+ES1keyxsoOujcJr3dtH46i5WMAC3VzZHRBc3NldElkASAelAcTUnahJZX9yGGogl8Qf986Tym7/JpGP1r9Nk+fkQAOdXNkdFBwdEFzc2V0SWQBIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYAA51c2RuQXNzZXRJZFN0cgIsREcyeEZrUGREd0tVb0JrekdBaFF0THBTR3pmWExpQ1lQRXplS0gyQWQyNHAAEHB1enpsZUFzc2V0SWRTdHICLEhFQjhRYXc5eHJXcFdzOHRIc2lBVFlHQldEQnRQMlM3a2NQQUxyTXU0M0FTAA51c2R0QXNzZXRJZFN0cgIsMzROOVljRUVUTFduOTNxWVE2NEVzUDF4ODl0U3J1SlU0NFJyRU1TWFhFUEoAEXVzZHRQcHRBc3NldElkU3RyAiw2bVd3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lCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUJQW1vdW50T3V0BQhBc3NldE91dAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQERQGV4dHJOYXRpdmUoMTA2MikBCQEMdHJ5R2V0U3RyaW5nAQIQc3RhdGljX3Bvb2xPd25lcgUKY3JlYXRvckZlZQULZmVlQXNzZXRPdXQJAMwIAgkBDEludGVnZXJFbnRyeQICFGdsb2JhbF9lYXJuZWRCeU93bmVyCQBkAgkBDXRyeUdldEludGVnZXIBAhRnbG9iYWxfZWFybmVkQnlPd25lcgUKY3JlYXRvckZlZQkAzAgCCQEMSW50ZWdlckVudHJ5AgINZ2xvYmFsX3ZvbHVtZQkAZAIJAQ10cnlHZXRJbnRlZ2VyAQINZ2xvYmFsX3ZvbHVtZQUMdm9sdW1lVXBkYXRlBQNuaWwDCQAAAgUMc3Rha2luZ1RvcFVwBQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQUMZmVlQ29sbGVjdG9yBQtwcm90b2NvbEZlZQULZmVlQXNzZXRPdXQFA25pbAUDbmlsBQlBbW91bnRPdXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkAAwkBCmlzU2h1dGRvd24ABwMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkGCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQxtYXN0ZXJQdWJLZXli4way", "height": 2641238, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CrqJi2WVLN7hz63z5HdxsxR8xRiizvpU1S23Nqu8nH1Z Next: EfbaQqEWLNEwVx1dPfgWBZEkNWg7J1dAcxh8XsEUxBRR Diff:
OldNewDifferences
372372 let IndexIn = value(indexOf(assetIds, assetIn))
373373 let IndexOut = value(indexOf(assetIds, assetOut))
374374 if ((IndexIn == IndexOut))
375- then throw("wrong tokens pair")
375+ then AmountIn
376376 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)
377377 }
378378
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdnAssetId = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
55
66 let puzzleAssetId = base58'HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS'
77
88 let usdtAssetId = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ'
99
1010 let usdtPptAssetId = base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
1111
1212 let usdnAssetIdStr = "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"
1313
1414 let puzzleAssetIdStr = "HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS"
1515
1616 let usdtAssetIdStr = "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ"
1717
1818 let usdtPptAssetIdStr = "6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63"
1919
2020 let parentPoolAddress = Address(base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy')
2121
2222 let masterAddress = Address(base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy')
2323
2424 let masterPubKey = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU'
2525
2626 let feeCollector = base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy'
2727
2828 let stakingContract = base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy'
2929
3030 let controlContract = base58'3MzEbuBV9st5CMYSdFJgaeSZL5zcaDMjhjR'
3131
3232 func tryGetInteger (key) = match getInteger(this, key) {
3333 case b: Int =>
3434 b
3535 case _ =>
3636 0
3737 }
3838
3939
4040 func tryGetBinary (key) = match getBinary(this, key) {
4141 case b: ByteVector =>
4242 b
4343 case _ =>
4444 base58''
4545 }
4646
4747
4848 func tryGetString (key) = match getString(this, key) {
4949 case b: String =>
5050 b
5151 case _ =>
5252 ""
5353 }
5454
5555
5656 func getAssetString (assetId) = match assetId {
5757 case b: ByteVector =>
5858 toBase58String(b)
5959 case _ =>
6060 "WAVES"
6161 }
6262
6363
6464 func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES"))
6565 then unit
6666 else fromBase58String(assetIdStr)
6767
6868
6969 func addAssetBytesToList (accum,item) = (accum :+ getAssetBytes(item))
7070
7171
7272 func addAssetWeightToList (accum,item) = (accum :+ tryGetInteger((("static_" + getAssetString(item)) + "_weight")))
7373
7474
7575 func addAssetDecimalsToList (accum,item) = (accum :+ tryGetInteger((("static_" + getAssetString(item)) + "_decimals")))
7676
7777
7878 func addAssetScaleToList (accum,item) = (accum :+ tryGetInteger((("static_" + getAssetString(item)) + "_scale")))
7979
8080
8181 func addIntToList (accum,item) = (accum :+ parseIntValue(item))
8282
8383
8484 let T = tryGetInteger("static_tokensAmount")
8585
8686 let assetIds = {
8787 let $l = split(tryGetString("static_tokenIds"), ",")
8888 let $s = size($l)
8989 let $acc0 = nil
9090 func $f0_1 ($a,$i) = if (($i >= $s))
9191 then $a
9292 else addAssetBytesToList($a, $l[$i])
9393
9494 func $f0_2 ($a,$i) = if (($i >= $s))
9595 then $a
9696 else throw("List size exceeds 10")
9797
9898 $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)
9999 }
100100
101101 let AssetsWeights = {
102102 let $l = assetIds
103103 let $s = size($l)
104104 let $acc0 = nil
105105 func $f1_1 ($a,$i) = if (($i >= $s))
106106 then $a
107107 else addAssetWeightToList($a, $l[$i])
108108
109109 func $f1_2 ($a,$i) = if (($i >= $s))
110110 then $a
111111 else throw("List size exceeds 10")
112112
113113 $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)
114114 }
115115
116116 let Decimals = {
117117 let $l = assetIds
118118 let $s = size($l)
119119 let $acc0 = nil
120120 func $f2_1 ($a,$i) = if (($i >= $s))
121121 then $a
122122 else addAssetDecimalsToList($a, $l[$i])
123123
124124 func $f2_2 ($a,$i) = if (($i >= $s))
125125 then $a
126126 else throw("List size exceeds 10")
127127
128128 $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)
129129 }
130130
131131 let Scales = {
132132 let $l = assetIds
133133 let $s = size($l)
134134 let $acc0 = nil
135135 func $f3_1 ($a,$i) = if (($i >= $s))
136136 then $a
137137 else addAssetScaleToList($a, $l[$i])
138138
139139 func $f3_2 ($a,$i) = if (($i >= $s))
140140 then $a
141141 else throw("List size exceeds 10")
142142
143143 $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)
144144 }
145145
146146 let Fee = tryGetInteger("static_fee")
147147
148148 let AssetsWeightsDecimals = 4
149149
150150 let Scale = 10000
151151
152152 let Scale8 = 100000000
153153
154154 let FeeScale = 10000
155155
156156 let PoolTokenDecimals = 8
157157
158158 let PoolTokenScale = pow(10, 0, PoolTokenDecimals, 0, 0, HALFUP)
159159
160160 let earnedAssets = assetIds
161161
162162 func isShutdown () = match getBoolean(Address(controlContract), "is_shutdown") {
163163 case x: Boolean =>
164164 x
165165 case _ =>
166166 false
167167 }
168168
169169
170170 func getCurrentTokenBalance (tokenType) = {
171171 let tokenId = getAssetString(assetIds[tokenType])
172172 tryGetInteger((("global_" + tokenId) + "_balance"))
173173 }
174174
175175
176176 func calculatePIssued (amount,tokenId) = {
177177 let Psupply = tryGetInteger("global_poolToken_amount")
178178 let Balance = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance"))
179179 fraction(amount, Psupply, Balance, DOWN)
180180 }
181181
182182
183183 func getMinPIssued (payments) = {
184184 func handler (accum,current) = {
185185 let PIssued = calculatePIssued(current.amount, current.assetId)
186186 if ((PIssued == 0))
187187 then throw("one of the tokens amounts is too low")
188188 else if (if ((accum == 0))
189189 then true
190190 else (accum > PIssued))
191191 then PIssued
192192 else accum
193193 }
194194
195195 let $l = payments
196196 let $s = size($l)
197197 let $acc0 = 0
198198 func $f4_1 ($a,$i) = if (($i >= $s))
199199 then $a
200200 else handler($a, $l[$i])
201201
202202 func $f4_2 ($a,$i) = if (($i >= $s))
203203 then $a
204204 else throw("List size exceeds 10")
205205
206206 $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)
207207 }
208208
209209
210210 func calculateUsdnValue (assetId,amount,aBalance,givenUsdnBalance) = {
211211 let usdnInPool = indexOf(assetIds, usdnAssetId)
212212 let puzzleInPool = indexOf(assetIds, puzzleAssetId)
213213 let usdtInPool = indexOf(assetIds, usdtAssetId)
214214 let wavesInPool = indexOf(assetIds, unit)
215215 let assetWeight = tryGetInteger((("static_" + getAssetString(assetId)) + "_weight"))
216216 let feeAssetStr = tryGetString("static_feeToken")
217217 if ((feeAssetStr == puzzleAssetIdStr))
218218 then {
219219 let puzzleWeight = AssetsWeights[value(indexOf(assetIds, puzzleAssetId))]
220220 let puzzleBalance = tryGetInteger((("global_" + puzzleAssetIdStr) + "_balance"))
221221 let amountInPuzzle = fraction(amount, (puzzleBalance / puzzleWeight), (aBalance / assetWeight))
222222 let puzzlePrice = getIntegerValue(parentPoolAddress, "global_lastPuzzlePrice")
223223 fraction((amountInPuzzle * puzzlePrice), 1, Scale8)
224224 }
225225 else if ((feeAssetStr == usdtAssetIdStr))
226226 then {
227227 let usdtWeight = AssetsWeights[value(usdtInPool)]
228228 let usdtBalance = tryGetInteger((("global_" + usdtAssetIdStr) + "_balance"))
229229 fraction(amount, (usdtBalance / usdtWeight), (aBalance / assetWeight))
230230 }
231231 else if ((feeAssetStr == usdnAssetIdStr))
232232 then {
233233 let usdnWeight = AssetsWeights[value(indexOf(assetIds, usdnAssetId))]
234234 let usdnBalance = match givenUsdnBalance {
235235 case x: Int =>
236236 givenUsdnBalance
237237 case _ =>
238238 tryGetInteger((("global_" + getAssetString(usdnAssetId)) + "_balance"))
239239 }
240240 fraction(amount, (value(usdnBalance) / usdnWeight), (aBalance / assetWeight))
241241 }
242242 else {
243243 let wavesWeight = 3000
244244 let wBalance = (tryGetInteger("global_WAVES_balance") / 50)
245245 fraction(amount, (wBalance / wavesWeight), (aBalance / assetWeight))
246246 }
247247 }
248248
249249
250250 func checkTokensValidity (payments) = {
251251 func handler1 (accum,payment) = (accum :+ payment.assetId)
252252
253253 let ids = {
254254 let $l = payments
255255 let $s = size($l)
256256 let $acc0 = nil
257257 func $f4_1 ($a,$i) = if (($i >= $s))
258258 then $a
259259 else handler1($a, $l[$i])
260260
261261 func $f4_2 ($a,$i) = if (($i >= $s))
262262 then $a
263263 else throw("List size exceeds 10")
264264
265265 $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)
266266 }
267267 if ((ids == ids))
268268 then {
269269 func handler2 (accum,assetId) = if ((indexOf(ids, assetId) != unit))
270270 then (accum + 1)
271271 else throw(("asset not attached: " + getAssetString(assetId)))
272272
273273 let checks = {
274274 let $l = assetIds
275275 let $s = size($l)
276276 let $acc0 = 0
277277 func $f5_1 ($a,$i) = if (($i >= $s))
278278 then $a
279279 else handler2($a, $l[$i])
280280
281281 func $f5_2 ($a,$i) = if (($i >= $s))
282282 then $a
283283 else throw("List size exceeds 10")
284284
285285 $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)
286286 }
287287 if ((checks == checks))
288288 then true
289289 else throw("Strict value is not equal to itself.")
290290 }
291291 else throw("Strict value is not equal to itself.")
292292 }
293293
294294
295295 func handlePoolTokensAdd (PIssued,payments,userAddress,needChange) = {
296296 func getTokenPaymentAmount (tokenId) = {
297297 func handler (accum,payment) = if ((payment.assetId == tokenId))
298298 then payment.amount
299299 else accum
300300
301301 let $l = payments
302302 let $s = size($l)
303303 let $acc0 = 0
304304 func $f4_1 ($a,$i) = if (($i >= $s))
305305 then $a
306306 else handler($a, $l[$i])
307307
308308 func $f4_2 ($a,$i) = if (($i >= $s))
309309 then $a
310310 else throw("List size exceeds 10")
311311
312312 $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)
313313 }
314314
315315 func handleTokenChange (accum,tokenId) = {
316316 let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance"))
317317 let PSupply = tryGetInteger("global_poolToken_amount")
318318 let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale"))
319319 let Dk = fraction((fraction((PSupply + PIssued), tokenDecimals, PSupply, CEILING) - tokenDecimals), Bk, tokenDecimals, CEILING)
320320 let paymentAmount = getTokenPaymentAmount(tokenId)
321321 let toReturn = ((if ((paymentAmount != 0))
322322 then paymentAmount
323323 else 0) - Dk)
324324 let t = if (if (needChange)
325325 then (toReturn > 0)
326326 else false)
327327 then [ScriptTransfer(userAddress, toReturn, tokenId)]
328328 else nil
329329 ((accum ++ t) :+ IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk + Dk)))
330330 }
331331
332332 let $l = assetIds
333333 let $s = size($l)
334334 let $acc0 = nil
335335 func $f4_1 ($a,$i) = if (($i >= $s))
336336 then $a
337337 else handleTokenChange($a, $l[$i])
338338
339339 func $f4_2 ($a,$i) = if (($i >= $s))
340340 then $a
341341 else throw("List size exceeds 10")
342342
343343 $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)
344344 }
345345
346346
347347 func handlePoolTokensRedeem (PRedeemed,userAddress) = {
348348 func handleTokenRedeem (accum,tokenId) = {
349349 let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance"))
350350 let PSupply = tryGetInteger("global_poolToken_amount")
351351 let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale"))
352352 let amount = toInt(fraction((toBigInt(Scale8) - fraction(toBigInt((PSupply - PRedeemed)), toBigInt(Scale8), toBigInt(PSupply), CEILING)), toBigInt(Bk), toBigInt(Scale8), DOWN))
353353 ((accum :+ IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk - amount))) :+ ScriptTransfer(userAddress, amount, tokenId))
354354 }
355355
356356 let $l = assetIds
357357 let $s = size($l)
358358 let $acc0 = nil
359359 func $f4_1 ($a,$i) = if (($i >= $s))
360360 then $a
361361 else handleTokenRedeem($a, $l[$i])
362362
363363 func $f4_2 ($a,$i) = if (($i >= $s))
364364 then $a
365365 else throw("List size exceeds 10")
366366
367367 $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)
368368 }
369369
370370
371371 func calculateOutAmount (AmountIn,assetIn,assetOut,BalanceIn,BalanceOut) = {
372372 let IndexIn = value(indexOf(assetIds, assetIn))
373373 let IndexOut = value(indexOf(assetIds, assetOut))
374374 if ((IndexIn == IndexOut))
375- then throw("wrong tokens pair")
375+ then AmountIn
376376 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)
377377 }
378378
379379
380380 func getTokenBalance (assetId) = match assetId {
381381 case t: ByteVector =>
382382 assetBalance(this, t)
383383 case _ =>
384384 wavesBalance(this).available
385385 }
386386
387387
388388 func calculateCurrentAssetInterest (assetId,assetIdStr,aBalance,tokenEarningsLastCheck) = {
389389 let totalStaked = tryGetInteger("global_indexStaked")
390390 let tokenBalanceLastCheck = tokenEarningsLastCheck
391391 let currentBalanceDelta = (getTokenBalance(assetId) - aBalance)
392392 let currentTokenEarnings = if ((currentBalanceDelta > tokenBalanceLastCheck))
393393 then currentBalanceDelta
394394 else tokenBalanceLastCheck
395395 let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck)
396396 let newInterest = if ((totalStaked == 0))
397397 then 0
398398 else fraction(newEarnings, Scale8, totalStaked)
399399 let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest"))
400400 (lastCheckInterest + newInterest)
401401 }
402402
403403
404404 func claimResult (address) = {
405405 let addressStr = toString(address)
406406 let puzzleAmount = tryGetInteger((addressStr + "_indexStaked"))
407407 func handler (accum,assetId) = {
408408 let assetIdStr = getAssetString(assetId)
409409 let aBalance = tryGetInteger((("global_" + getAssetString(assetId)) + "_balance"))
410410 let tokenEarningsLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings"))
411411 let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr, aBalance, tokenEarningsLastCheck)
412412 let currentTokenEarnings = max([tokenEarningsLastCheck, (getTokenBalance(assetId) - aBalance)])
413413 let rewardAmount = fraction(puzzleAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), Scale8)
414414 let transfer = if ((rewardAmount == 0))
415415 then nil
416416 else [ScriptTransfer(address, rewardAmount, assetId)]
417417 $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, unit)))
418418 }
419419
420420 let accum = {
421421 let $l = earnedAssets
422422 let $s = size($l)
423423 let $acc0 = $Tuple2(nil, 0)
424424 func $f4_1 ($a,$i) = if (($i >= $s))
425425 then $a
426426 else handler($a, $l[$i])
427427
428428 func $f4_2 ($a,$i) = if (($i >= $s))
429429 then $a
430430 else throw("List size exceeds 10")
431431
432432 $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)
433433 }
434434 $Tuple2((accum._1 ++ [IntegerEntry((addressStr + "_claimedRewardValue"), (tryGetInteger((addressStr + "_claimedRewardValue")) + accum._2)), IntegerEntry((addressStr + "_lastClaim"), lastBlock.timestamp)]), accum._2)
435435 }
436436
437437
438438 func indexStakeResult (addressStr,amount) = {
439439 let li = claimResult(addressFromStringValue(addressStr))._1
440440 (li ++ [IntegerEntry((addressStr + "_indexStaked"), (tryGetInteger((addressStr + "_indexStaked")) + amount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") + amount))])
441441 }
442442
443443
444444 func sum (accum,n) = (accum + parseIntValue(n))
445445
446446
447447 @Callable(i)
448448 func preInit (assetIdsStr,assetWeightsStr,baseTokenIdStr,poolDomain,poolOwner,fee) = {
449449 let poolOwnerAddress = Address(fromBase58String(poolOwner))
450450 if (isShutdown())
451451 then throw("contract is on stop")
452452 else if ((this != i.caller))
453453 then throw("admin only")
454454 else if ((size(poolDomain) > 13))
455455 then throw("too large pool domain")
456456 else if (if ((50 > fee))
457457 then true
458458 else (fee > 500))
459459 then throw("fee value must be between 50 and 500 (0.5-5%)")
460460 else if (if (if (if (if ((indexOf(assetIdsStr, puzzleAssetIdStr) == unit))
461461 then (indexOf(assetIdsStr, usdnAssetIdStr) == unit)
462462 else false)
463463 then (indexOf(assetIdsStr, usdtAssetIdStr) == unit)
464464 else false)
465465 then (indexOf(assetIdsStr, "WAVES") == unit)
466466 else false)
467467 then (indexOf(assetIdsStr, usdtPptAssetIdStr) == unit)
468468 else false)
469469 then throw("pool must have USDT-WXG, USDT-PPT, USDN, WAVES or PUZZLE in the composition")
470470 else {
471471 let assetIdsStrLi = split(assetIdsStr, ",")
472472 let assetIdsLi = {
473473 let $l = assetIdsStrLi
474474 let $s = size($l)
475475 let $acc0 = nil
476476 func $f4_1 ($a,$i) = if (($i >= $s))
477477 then $a
478478 else addAssetBytesToList($a, $l[$i])
479479
480480 func $f4_2 ($a,$i) = if (($i >= $s))
481481 then $a
482482 else throw("List size exceeds 10")
483483
484484 $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)
485485 }
486486 let assetWeightsStrLi = split(assetWeightsStr, ",")
487487 let assetWeightsSum = {
488488 let $l = assetWeightsStrLi
489489 let $s = size($l)
490490 let $acc0 = 0
491491 func $f5_1 ($a,$i) = if (($i >= $s))
492492 then $a
493493 else sum($a, $l[$i])
494494
495495 func $f5_2 ($a,$i) = if (($i >= $s))
496496 then $a
497497 else throw("List size exceeds 10")
498498
499499 $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)
500500 }
501501 let feeAssetStr = if ((indexOf(assetIdsStr, usdnAssetIdStr) != unit))
502502 then usdnAssetIdStr
503503 else if ((indexOf(assetIdsStr, "WAVES") != unit))
504504 then "WAVES"
505505 else if ((indexOf(assetIdsStr, usdtAssetIdStr) != unit))
506506 then usdtAssetIdStr
507507 else if ((indexOf(assetIdsStr, puzzleAssetIdStr) != unit))
508508 then puzzleAssetIdStr
509509 else usdtPptAssetIdStr
510510 func addTokenDataEntries (accum,assetNum) = if ((assetNum >= size(assetIdsLi)))
511511 then accum
512512 else {
513513 let assetDecimals = match assetIdsLi[assetNum] {
514514 case x: ByteVector =>
515515 value(assetInfo(x)).decimals
516516 case _ =>
517517 8
518518 }
519519 (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])))])
520520 }
521521
522522 if ((assetWeightsSum != 10000))
523523 then throw("sum of token weights must be equal to 10000")
524524 else ({
525525 let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
526526 let $s = size($l)
527527 let $acc0 = nil
528528 func $f6_1 ($a,$i) = if (($i >= $s))
529529 then $a
530530 else addTokenDataEntries($a, $l[$i])
531531
532532 func $f6_2 ($a,$i) = if (($i >= $s))
533533 then $a
534534 else throw("List size exceeds 10")
535535
536536 $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)
537537 } ++ [StringEntry("static_tokenIds", assetIdsStr), StringEntry("static_feeToken", feeAssetStr), StringEntry("static_tokenWeights", assetWeightsStr), IntegerEntry("static_tokensAmount", size(assetIdsLi)), StringEntry("static_poolDomain", poolDomain), StringEntry("static_baseTokenId", baseTokenIdStr), StringEntry("static_poolOwner", poolOwner), IntegerEntry("static_fee", fee)])
538538 }
539539 }
540540
541541
542542
543543 @Callable(i)
544544 func deInit () = if ((i.caller != this))
545545 then throw("admin only")
546546 else [IntegerEntry("global_wasInited", 0)]
547547
548548
549549
550550 @Callable(i)
551551 func init () = {
552552 func prepareList () = {
553553 func handler (accum,n) = (accum :+ IntegerEntry((("global_" + getAssetString(n.assetId)) + "_balance"), n.amount))
554554
555555 let $l = i.payments
556556 let $s = size($l)
557557 let $acc0 = nil
558558 func $f4_1 ($a,$i) = if (($i >= $s))
559559 then $a
560560 else handler($a, $l[$i])
561561
562562 func $f4_2 ($a,$i) = if (($i >= $s))
563563 then $a
564564 else throw("List size exceeds 10")
565565
566566 $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)
567567 }
568568
569569 func calculatePoolTokensAmount (payments) = {
570570 func handler (accum,pmt) = {
571571 let assetId = pmt.assetId
572572 func handler2 (accum,n) = if ((n == assetId))
573573 then value(indexOf(assetIds, n))
574574 else accum
575575
576576 let Token = {
577577 let $l = assetIds
578578 let $s = size($l)
579579 let $acc0 = 1
580580 func $f4_1 ($a,$i) = if (($i >= $s))
581581 then $a
582582 else handler2($a, $l[$i])
583583
584584 func $f4_2 ($a,$i) = if (($i >= $s))
585585 then $a
586586 else throw("List size exceeds 10")
587587
588588 $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)
589589 }
590590 fraction(accum, pow(pmt.amount, Decimals[Token], AssetsWeights[Token], AssetsWeightsDecimals, 8, FLOOR), Scale8)
591591 }
592592
593593 let $l = payments
594594 let $s = size($l)
595595 let $acc0 = PoolTokenScale
596596 func $f4_1 ($a,$i) = if (($i >= $s))
597597 then $a
598598 else handler($a, $l[$i])
599599
600600 func $f4_2 ($a,$i) = if (($i >= $s))
601601 then $a
602602 else throw("List size exceeds 10")
603603
604604 $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)
605605 }
606606
607607 if (isShutdown())
608608 then throw("contract is on stop")
609609 else if ((tryGetInteger("global_wasInited") > 0))
610610 then throw("pool already inited")
611611 else {
612612 let initialPoolTokens = calculatePoolTokensAmount(i.payments)
613613 if ((initialPoolTokens == 0))
614614 then throw("you need a bigger tokens amount to launch the pool")
615615 else {
616616 let poolTokenIssue = Issue(("PZ " + tryGetString("static_poolDomain")), "Puzzle Swap: pool index token", initialPoolTokens, PoolTokenDecimals, true, unit, 0)
617617 let poolTokenId = calculateAssetId(poolTokenIssue)
618618 (prepareList() ++ [poolTokenIssue, IntegerEntry("global_poolToken_amount", initialPoolTokens), IntegerEntry("global_wasInited", 1), BinaryEntry("global_poolToken_id", poolTokenId), StringEntry("static_poolToken_idStr", getAssetString(poolTokenId)), IntegerEntry((toString(i.caller) + "_indexStaked"), initialPoolTokens), IntegerEntry("global_indexStaked", initialPoolTokens)])
619619 }
620620 }
621621 }
622622
623623
624624
625625 @Callable(i)
626626 func generateIndex (needChange) = if (isShutdown())
627627 then throw("contract is on stop")
628628 else if ((size(i.payments) != T))
629629 then throw(("you need to attach all pool tokens. amount of pool tokens: " + toString(T)))
630630 else if (!(checkTokensValidity(i.payments)))
631631 then throw("wrong assets attached")
632632 else {
633633 let PIssued = getMinPIssued(i.payments)
634634 let reissue = Reissue(getBinaryValue("global_poolToken_id"), PIssued, true)
635635 let result = handlePoolTokensAdd(PIssued, i.payments, i.originCaller, needChange)
636636 $Tuple2((result ++ [reissue, ScriptTransfer(i.caller, PIssued, tryGetBinary("global_poolToken_id")), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") + PIssued))]), PIssued)
637637 }
638638
639639
640640
641641 @Callable(i)
642642 func stakeIndex () = {
643643 let addressStr = toString(i.originCaller)
644644 let pmt = i.payments[0]
645645 if (isShutdown())
646646 then throw("contract is on stop")
647647 else if ((value(pmt.assetId) != tryGetBinary("global_poolToken_id")))
648648 then throw("wrong asset attached")
649649 else indexStakeResult(addressStr, pmt.amount)
650650 }
651651
652652
653653
654654 @Callable(i)
655655 func unstakeIndex (puzzleAmount) = {
656656 let addressStr = toString(i.originCaller)
657657 let puzzleAvailable = tryGetInteger((addressStr + "_indexStaked"))
658658 if (isShutdown())
659659 then throw("contract is on stop")
660660 else if ((puzzleAmount > puzzleAvailable))
661661 then throw("you don't have index tokens available")
662662 else (claimResult(i.originCaller)._1 ++ [IntegerEntry((addressStr + "_indexStaked"), (puzzleAvailable - puzzleAmount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") - puzzleAmount)), ScriptTransfer(i.caller, puzzleAmount, getBinaryValue("global_poolToken_id"))])
663663 }
664664
665665
666666
667667 @Callable(i)
668668 func claimIndexRewards () = if (isShutdown())
669669 then throw("contract is on stop")
670670 else claimResult(i.caller)
671671
672672
673673
674674 @Callable(i)
675675 func evaluateClaim (user) = $Tuple2(nil, claimResult(addressFromStringValue(user))._2)
676676
677677
678678
679679 @Callable(i)
680680 func redeemIndex (sendToOrigin) = {
681681 let pmt = i.payments[0]
682682 if ((pmt.assetId != tryGetBinary("global_poolToken_id")))
683683 then throw("please attach pool share token")
684684 else if (isShutdown())
685685 then throw("contract is on stop")
686686 else {
687687 let PRedeemed = pmt.amount
688688 let result = handlePoolTokensRedeem(PRedeemed, if (sendToOrigin)
689689 then i.originCaller
690690 else i.caller)
691691 (result ++ [Burn(tryGetBinary("global_poolToken_id"), PRedeemed), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") - PRedeemed))])
692692 }
693693 }
694694
695695
696696
697697 @Callable(i)
698698 func swap (assetOut,minimum) = if ((size(i.payments) != 1))
699699 then throw("please attach exactly one payment")
700700 else {
701701 let pmt = value(i.payments[0])
702702 let AmountIn = value(i.payments[0].amount)
703703 let AssetIn = pmt.assetId
704704 let AssetOut = getAssetBytes(assetOut)
705705 let feeAssetOutStr = tryGetString("static_feeToken")
706706 let feeAssetOut = if ((feeAssetOutStr == ""))
707707 then usdnAssetId
708708 else getAssetBytes(feeAssetOutStr)
709709 let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance"))
710710 let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance"))
711711 let feeAmountIn = fraction(AmountIn, Fee, FeeScale)
712712 let cleanAmountIn = (AmountIn - feeAmountIn)
713713 let AmountOut = calculateOutAmount(cleanAmountIn, AssetIn, AssetOut, AssetInBalance, AssetOutBalance)
714714 let AssetOutBalance2 = (AssetOutBalance - AmountOut)
715715 let AssetInBalance2 = (AssetInBalance + cleanAmountIn)
716716 let feeAssetOutBalance = if ((feeAssetOut == AssetIn))
717717 then AssetInBalance2
718718 else if ((feeAssetOut == AssetOut))
719719 then AssetOutBalance2
720720 else tryGetInteger((("global_" + getAssetString(feeAssetOut)) + "_balance"))
721721 let feeAmountOut = calculateOutAmount(feeAmountIn, AssetIn, feeAssetOut, AssetInBalance, feeAssetOutBalance)
722722 if ((minimum > AmountOut))
723723 then throw("amount to recieve is lower than given one")
724724 else if ((AssetOut == AssetIn))
725725 then throw("this swap is not allowed")
726726 else if ((0 > (AssetOutBalance - AmountOut)))
727727 then throw("contract is out of reserves")
728728 else if (isShutdown())
729729 then throw("contract is on stop")
730730 else {
731731 let creatorFee = fraction(feeAmountOut, 1, 10)
732732 let protocolFee = fraction(feeAmountOut, 4, 10)
733733 let stakingTopUp = if (if ((feeAssetOut == usdnAssetId))
734734 then true
735735 else (feeAssetOut == puzzleAssetId))
736736 then reentrantInvoke(Address(stakingContract), "topUpReward", nil, [AttachedPayment(feeAssetOut, protocolFee)])
737737 else unit
738738 if ((stakingTopUp == stakingTopUp))
739739 then {
740740 let newBalanceIn = AssetInBalance2
741741 let newBalanceOut = (AssetOutBalance2 - (if ((AssetOut == feeAssetOut))
742742 then feeAmountOut
743743 else 0))
744744 let newBalanceFeeAsset = if (if ((feeAssetOut != AssetIn))
745745 then (feeAssetOut != AssetOut)
746746 else false)
747747 then (feeAssetOutBalance - feeAmountOut)
748748 else unit
749749 let assetInChange = IntegerEntry((("global_" + getAssetString(AssetIn)) + "_balance"), newBalanceIn)
750750 let assetOutChange = IntegerEntry((("global_" + assetOut) + "_balance"), newBalanceOut)
751751 let feeAssetOutChange = if ((newBalanceFeeAsset != unit))
752752 then IntegerEntry((("global_" + getAssetString(feeAssetOut)) + "_balance"), value(newBalanceFeeAsset))
753753 else StringEntry("hello", "world")
754754 let volumeUpdate = calculateUsdnValue(AssetIn, AmountIn, AssetInBalance, feeAssetOutBalance)
755755 $Tuple2(([assetOutChange, assetInChange, feeAssetOutChange, ScriptTransfer(i.caller, AmountOut, AssetOut), ScriptTransfer(addressFromStringValue(tryGetString("static_poolOwner")), creatorFee, feeAssetOut), IntegerEntry("global_earnedByOwner", (tryGetInteger("global_earnedByOwner") + creatorFee)), IntegerEntry("global_volume", (tryGetInteger("global_volume") + volumeUpdate))] ++ (if ((stakingTopUp == unit))
756756 then [ScriptTransfer(Address(feeCollector), protocolFee, feeAssetOut)]
757757 else nil)), AmountOut)
758758 }
759759 else throw("Strict value is not equal to itself.")
760760 }
761761 }
762762
763763
764764 @Verifier(tx)
765765 func verify () = if (isShutdown())
766766 then false
767767 else if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
768768 then true
769769 else sigVerify(tx.bodyBytes, tx.proofs[0], masterPubKey)
770770

github/deemru/w8io/169f3d6 
77.92 ms