tx · C9UZZSnjAJkqZiqoCuUxX6KQ8SAcwj18kU1q8nExW3Gc

3N9EdhMHMire3ztB1rLtBTZ5TbVmhi2Q6JW:  -0.02500000 Waves

2024.11.26 11:55 [3388171] smart account 3N9EdhMHMire3ztB1rLtBTZ5TbVmhi2Q6JW > SELF 0.00000000 Waves

{ "type": 13, "id": "C9UZZSnjAJkqZiqoCuUxX6KQ8SAcwj18kU1q8nExW3Gc", "fee": 2500000, "feeAssetId": null, "timestamp": 1732611320101, "version": 2, "chainId": 84, "sender": "3N9EdhMHMire3ztB1rLtBTZ5TbVmhi2Q6JW", "senderPublicKey": "DfZcdBUB2ZvrDUFJ4jwcvF9uUJbseXdJkS76ABfGzkCk", "proofs": [ "hSoEpwCpa1dRMhcioUt2Nd6YBr6JYUomsfnKzdVxyWtnf7yr3HCGsjqfHNBCBfZphuSiszj3B9iV1Q8do9axveA" ], "script": "base64:BgItCAISBwoFCAgICAESBwoFCAgICAESABIDCgEIEgQKAggBEgUKAwgIARIDCgEIRwAHVkVSU0lPTgINUE0tMC44LjEtUFJPRAAJY29uZmlnU3RyCQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMCDWNvbmZpZ0FkZHJlc3MCIzNQUEVCUmc0czJhZjJyUTJaYkx2ZHUxSGZkNFZvNlFWRFRvAA5DT05GSUdfQUREUkVTUwMJAAACBQljb25maWdTdHICAAUEdGhpcwkBB0FkZHJlc3MBCQDZBAEFCWNvbmZpZ1N0cgAVQXNzZXRzV2VpZ2h0c0RlY2ltYWxzAAQABVNjYWxlAJBOAAZTY2FsZTgAgMLXLwAHU2NhbGUxNgCAgIT+pt7hEQAIRmVlU2NhbGUAkE4AEVBvb2xUb2tlbkRlY2ltYWxzAAgADlBvb2xUb2tlblNjYWxlCQBsBgAKAAAFEVBvb2xUb2tlbkRlY2ltYWxzAAAAAAUGSEFMRlVQABBNSU5fU1RFUFNfQU1PVU5UCQELdmFsdWVPckVsc2UCCQCaCAIFDkNPTkZJR19BRERSRVNTA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HuGW9myjXHwbSTxgBiryemV615uzEvtyNF Next: 24hAcoqdQ7q4UYaHQ6JeznAzafgsjpct3Jzb8Qq6YM6z Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VERSION = "PM-0.8.1-PROD"
55
66 let configStr = valueOrElse(getString(this, "configAddress"), "3PPEBRg4s2af2rQ2ZbLvdu1Hfd4Vo6QVDTo")
77
88 let CONFIG_ADDRESS = if ((configStr == ""))
99 then this
1010 else Address(fromBase58String(configStr))
1111
1212 let AssetsWeightsDecimals = 4
1313
1414 let Scale = 10000
1515
1616 let Scale8 = 100000000
1717
1818 let Scale16 = 10000000000000000
1919
2020 let FeeScale = 10000
2121
2222 let PoolTokenDecimals = 8
2323
2424 let PoolTokenScale = pow(10, 0, PoolTokenDecimals, 0, 0, HALFUP)
2525
2626 let MIN_STEPS_AMOUNT = valueOrElse(getInteger(CONFIG_ADDRESS, "min_steps_amount"), 1)
2727
2828 let MAX_STEPS_AMOUNT = valueOrElse(getInteger(CONFIG_ADDRESS, "max_steps_amount"), 500)
2929
3030 let MIN_STEPS_INTERVAL = valueOrElse(getInteger(CONFIG_ADDRESS, "min_steps_interval"), 1)
3131
3232 let MAX_STEPS_INTERVAL = valueOrElse(getInteger(CONFIG_ADDRESS, "max_steps_interval"), 10000)
3333
3434 let MIN_WEIGHT = valueOrElse(getInteger(CONFIG_ADDRESS, "min_weight"), 100)
3535
3636 let MAX_WEIGHT = valueOrElse(getInteger(CONFIG_ADDRESS, "max_weight"), 9900)
3737
3838 func tryGetInteger (key) = match getInteger(this, key) {
3939 case b: Int =>
4040 b
4141 case _ =>
4242 0
4343 }
4444
4545
4646 func tryGetBinary (key) = match getBinary(this, key) {
4747 case b: ByteVector =>
4848 b
4949 case _ =>
5050 base58''
5151 }
5252
5353
5454 func tryGetString (key) = match getString(this, key) {
5555 case b: String =>
5656 b
5757 case _ =>
5858 ""
5959 }
6060
6161
6262 func tryGetStringOrThrow (key) = match getString(this, key) {
6363 case b: String =>
6464 b
6565 case _ =>
6666 throw(("no such key in data storage: " + key))
6767 }
6868
6969
7070 func getAssetString (assetId) = match assetId {
7171 case b: ByteVector =>
7272 toBase58String(b)
7373 case _ =>
7474 "WAVES"
7575 }
7676
7777
7878 func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES"))
7979 then unit
8080 else fromBase58String(assetIdStr)
8181
8282
8383 func getTokenBalance (assetId) = match assetId {
8484 case t: ByteVector =>
8585 assetBalance(this, t)
8686 case _ =>
8787 wavesBalance(this).available
8888 }
8989
9090
9191 func addAssetBytesToList (accum,item) = (accum ++ [getAssetBytes(item)])
9292
9393
9494 func addAssetWeightToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_weight"))])
9595
9696
9797 func addAssetWeightToStrList (accum,item) = (accum ++ [toString(tryGetInteger((("static_" + item) + "_weight")))])
9898
9999
100100 func addAssetDecimalsToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_decimals"))])
101101
102102
103103 func addAssetScaleToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_scale"))])
104104
105105
106106 func addIntToList (accum,item) = (accum ++ [parseIntValue(item)])
107107
108108
109109 let usdnAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "usdnAssetIdStr"), "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p")
110110
111111 let puzzleAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "puzzleAssetIdStr"), "HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS")
112112
113113 let usdtAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "usdtAssetIdStr"), "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ")
114114
115115 let usdtPptAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "usdtPptAssetIdStr"), "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi")
116116
117117 let romeAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "romeAssetIdStr"), "AP4Cb5xLYGH6ZigHreCZHoXpQTWDkPsG2BHqfDUx6taJ")
118118
119119 let wavesAssetIdStr = "WAVES"
120120
121121 let usdnAssetId = fromBase58String(usdnAssetIdStr)
122122
123123 let puzzleAssetId = fromBase58String(puzzleAssetIdStr)
124124
125125 let usdtAssetId = fromBase58String(usdtAssetIdStr)
126126
127127 let usdtPptAssetId = fromBase58String(usdtPptAssetIdStr)
128128
129129 let romeAssetId = fromBase58String(romeAssetIdStr)
130130
131131 let wavesAssetId = unit
132132
133133 let supportedFeeAssetsStr = [usdnAssetIdStr, puzzleAssetIdStr, usdtAssetIdStr, usdtPptAssetIdStr, wavesAssetIdStr, romeAssetIdStr]
134134
135135 let oracleAddress = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "oracleAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj")))
136136
137137 let feesAddress = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "feesAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj")))
138138
139139 let shutdownAddressStr = valueOrElse(getString(CONFIG_ADDRESS, "shutdownAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj")
140140
141141 let layer2Addresses = valueOrElse(getString(CONFIG_ADDRESS, "layer2Addresses"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj")
142142
143143 let coldMasterAddress = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "coldMasterAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj")))
144144
145145 let calculatorAccount = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "factoryAddress"), "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr")))
146146
147147 let factoryAccount = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "factoryAddress"), "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T")))
148148
149149 let masterPubKey = fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "masterPubKey"), "4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU"))
150150
151151 let T = tryGetInteger("static_tokensAmount")
152152
153153 let assetIds = {
154154 let $l = split(tryGetString("static_tokenIds"), ",")
155155 let $s = size($l)
156156 let $acc0 = nil
157157 func $f0_1 ($a,$i) = if (($i >= $s))
158158 then $a
159159 else addAssetBytesToList($a, $l[$i])
160160
161161 func $f0_2 ($a,$i) = if (($i >= $s))
162162 then $a
163163 else throw("List size exceeds 10")
164164
165165 $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)
166166 }
167167
168168 let AssetsWeights = {
169169 let $l = assetIds
170170 let $s = size($l)
171171 let $acc0 = nil
172172 func $f1_1 ($a,$i) = if (($i >= $s))
173173 then $a
174174 else addAssetWeightToList($a, $l[$i])
175175
176176 func $f1_2 ($a,$i) = if (($i >= $s))
177177 then $a
178178 else throw("List size exceeds 10")
179179
180180 $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)
181181 }
182182
183183 let Decimals = {
184184 let $l = assetIds
185185 let $s = size($l)
186186 let $acc0 = nil
187187 func $f2_1 ($a,$i) = if (($i >= $s))
188188 then $a
189189 else addAssetDecimalsToList($a, $l[$i])
190190
191191 func $f2_2 ($a,$i) = if (($i >= $s))
192192 then $a
193193 else throw("List size exceeds 10")
194194
195195 $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)
196196 }
197197
198198 let Scales = {
199199 let $l = assetIds
200200 let $s = size($l)
201201 let $acc0 = nil
202202 func $f3_1 ($a,$i) = if (($i >= $s))
203203 then $a
204204 else addAssetScaleToList($a, $l[$i])
205205
206206 func $f3_2 ($a,$i) = if (($i >= $s))
207207 then $a
208208 else throw("List size exceeds 10")
209209
210210 $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)
211211 }
212212
213213 let Fee = tryGetInteger("static_fee")
214214
215215 let earnedAssets = assetIds
216216
217217 func getPoolStatus () = {
218218 let poolId = valueOrElse(getInteger(factoryAccount, ("pool__" + toString(this))), 0)
219219 let status = valueOrElse(getInteger(factoryAccount, ("pool__status__" + toString(poolId))), 2)
220220 status
221221 }
222222
223223
224224 func getSetting (key) = getIntegerValue(factoryAccount, ("setup__" + key))
225225
226226
227227 let InitalWavesLiquidity = getSetting("virtualLiquidity")
228228
229229 let CreationFee = getSetting("creationFee")
230230
231231 let CurveTarget = getSetting("curveTarget")
232232
233233 func isShutdown () = {
234234 let shutdownAddress = addressFromString(shutdownAddressStr)
235235 if ((shutdownAddress == unit))
236236 then false
237237 else match getBoolean(value(shutdownAddress), "is_shutdown") {
238238 case x: Boolean =>
239239 x
240240 case _ =>
241241 false
242242 }
243243 }
244244
245245
246246 func getPriceFromOracle (assetIdStr) = match getInteger(oracleAddress, (assetIdStr + "_twap5B")) {
247247 case x: Int =>
248248 x
249249 case _ =>
250250 1000000
251251 }
252252
253253
254254 func calculateUsdValue (assetId,amount,aBalance) = {
255255 let assetWeight = tryGetInteger((("static_" + getAssetString(assetId)) + "_weight"))
256256 let feeAssetStr = tryGetString("static_feeToken")
257257 let feeAssetScale = getIntegerValue(this, (("static_" + feeAssetStr) + "_scale"))
258258 let feeAssetNum = value(indexOf(assetIds, getAssetBytes(feeAssetStr)))
259259 let feeAssetWeight = AssetsWeights[feeAssetNum]
260260 let feeAssetBalance = tryGetInteger((("global_" + feeAssetStr) + "_balance"))
261261 let valInFeeAsset = fraction(amount, (feeAssetBalance / feeAssetWeight), (aBalance / assetWeight))
262262 let feeAssetPrice = getPriceFromOracle(feeAssetStr)
263263 fraction(valInFeeAsset, feeAssetPrice, feeAssetScale)
264264 }
265265
266266
267267 func calculateOutAmount (AmountIn,assetIn,assetOut,BalanceIn,BalanceOut) = {
268268 let IndexIn = value(indexOf(assetIds, assetIn))
269269 let IndexOut = value(indexOf(assetIds, assetOut))
270270 if ((IndexIn == IndexOut))
271271 then AmountIn
272272 else fraction(BalanceOut, ((Scale8 * Scale8) - toInt(pow(fraction((toBigInt(BalanceIn) * toBigInt(10000)), toBigInt((Scale8 * Scale8)), (toBigInt((BalanceIn + AmountIn)) * toBigInt(10000)), HALFUP), 16, toBigInt(fraction(AssetsWeights[IndexIn], 1000000000000, AssetsWeights[IndexOut])), 12, 16, CEILING))), (Scale8 * Scale8), HALFEVEN)
273273 }
274274
275275
276276 func calculateCurrentAssetInterest (assetId,assetIdStr,aBalance,tokenEarningsLastCheck) = {
277277 let totalStaked = tryGetInteger("global_indexStaked")
278278 let tokenBalanceLastCheck = tokenEarningsLastCheck
279279 let currentBalanceDelta = (getTokenBalance(assetId) - aBalance)
280280 let currentTokenEarnings = if ((currentBalanceDelta > tokenBalanceLastCheck))
281281 then currentBalanceDelta
282282 else tokenBalanceLastCheck
283283 let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck)
284284 let newInterest = if ((totalStaked == 0))
285285 then 0
286286 else fraction(newEarnings, Scale8, totalStaked)
287287 let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest"))
288288 (lastCheckInterest + newInterest)
289289 }
290290
291291
292292 func claimResult (address) = {
293293 let addressStr = toString(address)
294294 let puzzleAmount = tryGetInteger((addressStr + "_indexStaked"))
295295 func handler (accum,assetId) = {
296296 let assetIdStr = getAssetString(assetId)
297297 let aBalance = tryGetInteger((("global_" + getAssetString(assetId)) + "_balance"))
298298 let tokenEarningsLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings"))
299299 let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr, aBalance, tokenEarningsLastCheck)
300300 let currentTokenEarnings = max([tokenEarningsLastCheck, (getTokenBalance(assetId) - aBalance)])
301301 let rewardAmount = fraction(puzzleAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), Scale8)
302302 let transfer = if ((rewardAmount == 0))
303303 then nil
304304 else [ScriptTransfer(address, rewardAmount, assetId)]
305305 $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 + calculateUsdValue(assetId, rewardAmount, aBalance)))
306306 }
307307
308308 let accum = {
309309 let $l = earnedAssets
310310 let $s = size($l)
311311 let $acc0 = $Tuple2(nil, 0)
312312 func $f4_1 ($a,$i) = if (($i >= $s))
313313 then $a
314314 else handler($a, $l[$i])
315315
316316 func $f4_2 ($a,$i) = if (($i >= $s))
317317 then $a
318318 else throw("List size exceeds 10")
319319
320320 $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)
321321 }
322322 $Tuple2((accum._1 ++ [IntegerEntry((addressStr + "_claimedRewardUSD"), (tryGetInteger((addressStr + "_claimedRewardUSD")) + accum._2)), IntegerEntry((addressStr + "_lastClaim"), lastBlock.timestamp)]), accum._2)
323323 }
324324
325325
326326 func sum (accum,n) = (accum + parseIntValue(n))
327327
328328
329329 func checkFeeAsset (accum,next) = if (if ((indexOf(supportedFeeAssetsStr, next) != unit))
330330 then (accum == "")
331331 else false)
332332 then next
333333 else accum
334334
335335
336336 func swapInternal (assetIn,assetOut,amountIn,minimum,receipientAddressStr) = {
337337 let AmountIn = amountIn
338338 let AssetIn = getAssetBytes(assetIn)
339339 let AssetOut = getAssetBytes(assetOut)
340340 let scaleIn = (Scale8 / tryGetInteger((("static_" + assetIn) + "_scale")))
341341 let scaleOut = (Scale8 / tryGetInteger((("static_" + assetOut) + "_scale")))
342342 let feeAssetOutStr = tryGetString("static_feeToken")
343343 let feeAssetOut = if ((feeAssetOutStr == ""))
344344 then wavesAssetId
345345 else getAssetBytes(feeAssetOutStr)
346346 let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance"))
347347 let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance"))
348348 let AssetInBalanceScaled = (AssetInBalance * scaleIn)
349349 let AssetOutBalanceScaled = (AssetOutBalance * scaleOut)
350350 let feeAmountIn = fraction(AmountIn, Fee, FeeScale)
351351 let cleanAmountIn = (AmountIn - feeAmountIn)
352352 let cleanAmountInScaled = (cleanAmountIn * scaleIn)
353353 let AmountOut1 = calculateOutAmount(cleanAmountInScaled, AssetIn, AssetOut, AssetInBalanceScaled, AssetOutBalanceScaled)
354354 let AmountOut = fraction(AmountOut1, 1, scaleOut)
355355 let AssetOutBalance2 = (AssetOutBalance - AmountOut)
356356 let AssetInBalance2 = (AssetInBalance + cleanAmountIn)
357357 let feeAssetOutBalance = if ((feeAssetOut == AssetIn))
358358 then AssetInBalance2
359359 else if ((feeAssetOut == AssetOut))
360360 then AssetOutBalance2
361361 else tryGetInteger((("global_" + getAssetString(feeAssetOut)) + "_balance"))
362362 let feeAmountOut = calculateOutAmount(feeAmountIn, AssetIn, feeAssetOut, AssetInBalance, feeAssetOutBalance)
363363 if ((minimum > AmountOut))
364364 then throw("amount to recieve is lower than given one")
365365 else if ((AssetOut == AssetIn))
366366 then throw("this swap is not allowed")
367367 else if ((0 > (AssetOutBalance - AmountOut)))
368368 then throw("contract is out of reserves")
369369 else if (isShutdown())
370370 then throw("contract is on stop")
371371 else {
372372 let creatorFee = fraction(feeAmountOut, 1, 10)
373373 let protocolFee = fraction(feeAmountOut, 4, 10)
374374 let newBalanceIn = AssetInBalance2
375375 let newBalanceOut = (AssetOutBalance2 - (if ((AssetOut == feeAssetOut))
376376 then feeAmountOut
377377 else 0))
378378 let newBalanceFeeAsset = if (if ((feeAssetOut != AssetIn))
379379 then (feeAssetOut != AssetOut)
380380 else false)
381381 then (feeAssetOutBalance - feeAmountOut)
382382 else unit
383383 let assetInChange = IntegerEntry((("global_" + getAssetString(AssetIn)) + "_balance"), newBalanceIn)
384384 let assetOutChange = IntegerEntry((("global_" + assetOut) + "_balance"), newBalanceOut)
385385 let feeAssetOutChange = if ((newBalanceFeeAsset != unit))
386386 then IntegerEntry((("global_" + getAssetString(feeAssetOut)) + "_balance"), value(newBalanceFeeAsset))
387387 else StringEntry("hello", "world")
388388 let volumeUsdUpdate = calculateUsdValue(AssetIn, AmountIn, AssetInBalance)
389389 $Tuple2([assetOutChange, assetInChange, feeAssetOutChange, ScriptTransfer(addressFromStringValue(receipientAddressStr), AmountOut, AssetOut), ScriptTransfer(addressFromStringValue(tryGetString("static_poolOwner")), creatorFee, feeAssetOut), IntegerEntry("global_earnedByOwner", (tryGetInteger("global_earnedByOwner") + creatorFee)), IntegerEntry("global_volume_usd", (tryGetInteger("global_volume_usd") + volumeUsdUpdate)), ScriptTransfer(feesAddress, protocolFee, feeAssetOut)], AmountOut)
390390 }
391391 }
392392
393393
394394 @Callable(i)
395395 func initPool (poolDomain,poolOwner,tokenName,tokenDesc,tokenQuantity) = {
396396 func calculatePoolTokensAmount (payments) = {
397397 func handler (accum,pmt) = {
398398 let assetId = pmt.assetId
399399 func handler2 (accum,n) = if ((n == assetId))
400400 then value(indexOf(assetIds, n))
401401 else accum
402402
403403 let Token = {
404404 let $l = assetIds
405405 let $s = size($l)
406406 let $acc0 = 1
407407 func $f4_1 ($a,$i) = if (($i >= $s))
408408 then $a
409409 else handler2($a, $l[$i])
410410
411411 func $f4_2 ($a,$i) = if (($i >= $s))
412412 then $a
413413 else throw("List size exceeds 10")
414414
415415 $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)
416416 }
417417 fraction(accum, pow(pmt.amount, Decimals[Token], AssetsWeights[Token], AssetsWeightsDecimals, 8, FLOOR), Scale8)
418418 }
419419
420420 let $l = payments
421421 let $s = size($l)
422422 let $acc0 = PoolTokenScale
423423 func $f4_1 ($a,$i) = if (($i >= $s))
424424 then $a
425425 else handler($a, $l[$i])
426426
427427 func $f4_2 ($a,$i) = if (($i >= $s))
428428 then $a
429429 else throw("List size exceeds 10")
430430
431431 $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)
432432 }
433433
434434 let meme = Issue(tokenName, tokenDesc, tokenQuantity, 8, false)
435435 let memeId = calculateAssetId(meme)
436436 let memeIdStr = getAssetString(memeId)
437437 let assetWeightsStr = "5000,5000"
438438 let baseTokenIdStr = "WAVES"
439439 let poolOwnerAddress = Address(fromBase58String(poolOwner))
440440 let assetIdsStr = ("WAVES," + memeIdStr)
441441 let assetIdsStrLi = split(assetIdsStr, ",")
442442 let assetIdsLi = {
443443 let $l = assetIdsStrLi
444444 let $s = size($l)
445445 let $acc0 = nil
446446 func $f4_1 ($a,$i) = if (($i >= $s))
447447 then $a
448448 else addAssetBytesToList($a, $l[$i])
449449
450450 func $f4_2 ($a,$i) = if (($i >= $s))
451451 then $a
452452 else throw("List size exceeds 10")
453453
454454 $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)
455455 }
456456 let fee = 100
457457 let feeAssetStr = {
458458 let $l = assetIdsStrLi
459459 let $s = size($l)
460460 let $acc0 = ""
461461 func $f5_1 ($a,$i) = if (($i >= $s))
462462 then $a
463463 else checkFeeAsset($a, $l[$i])
464464
465465 func $f5_2 ($a,$i) = if (($i >= $s))
466466 then $a
467467 else throw("List size exceeds 10")
468468
469469 $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)
470470 }
471471 let pmt = i.payments[0]
472472 let amount = pmt.amount
473473 let pmtAsset = if ((pmt.assetId == unit))
474474 then "WAVES"
475475 else throw("you have to attach some WAVES")
476476 if ((this != this))
477477 then throw("self-invoke only")
478478 else if ((feeAssetStr == ""))
479479 then throw("pool must have one of the supported fee assets in the composition")
480480 else if ((size(poolDomain) > 13))
481481 then throw("too large pool domain")
482482 else if (if ((fee > 500))
483483 then true
484484 else (0 > fee))
485485 then throw("fee value must be between 50 and 500 (0.5-5%)")
486486 else if (isShutdown())
487487 then throw("contract is on stop")
488488 else {
489489 let assetWeightsStrLi = split(assetWeightsStr, ",")
490490 let assetWeightsSum = {
491491 let $l = assetWeightsStrLi
492492 let $s = size($l)
493493 let $acc0 = 0
494494 func $f6_1 ($a,$i) = if (($i >= $s))
495495 then $a
496496 else sum($a, $l[$i])
497497
498498 func $f6_2 ($a,$i) = if (($i >= $s))
499499 then $a
500500 else throw("List size exceeds 10")
501501
502502 $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)
503503 }
504504 func addTokenDataEntries (accum,assetNum) = if ((assetNum >= size(assetIdsLi)))
505505 then accum
506506 else {
507507 let assetDecimals = 8
508508 (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])))])
509509 }
510510
511511 let initialPoolTokens = calculatePoolTokensAmount(i.payments)
512512 if ((assetWeightsSum != 10000))
513513 then throw("sum of token weights must be equal to 10000")
514514 else if ((initialPoolTokens == 0))
515515 then throw("you need a bigger tokens amount to launch the pool")
516516 else {
517517 let poolTokenIssue = Issue(("PZ " + poolDomain), "Puzzle Swap: pool index token", initialPoolTokens, PoolTokenDecimals, true, unit, 0)
518518 let poolTokenId = calculateAssetId(poolTokenIssue)
519519 $Tuple2(((({
520520 let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
521521 let $s = size($l)
522522 let $acc0 = nil
523523 func $f7_1 ($a,$i) = if (($i >= $s))
524524 then $a
525525 else addTokenDataEntries($a, $l[$i])
526526
527527 func $f7_2 ($a,$i) = if (($i >= $s))
528528 then $a
529529 else throw("List size exceeds 10")
530530
531531 $f7_2($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
532532 } ++ [meme, 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), IntegerEntry("static_KMult", Scale16), IntegerEntry("global_wasPreInited", 1)]) ++ [IntegerEntry("global_WAVES_balance", InitalWavesLiquidity), IntegerEntry((("global_" + memeIdStr) + "_balance"), tokenQuantity)]) ++ [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)]), memeIdStr)
533533 }
534534 }
535535 }
536536
537537
538538
539539 @Callable(i)
540540 func init (poolDomain,poolOwner,tokenName,tokenDesc,tokenQuantity) = if ((i.caller != factoryAccount))
541541 then throw("admin only")
542542 else {
543543 let inv1 = invoke(this, "initPool", [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity], nil)
544544 if ((inv1 == inv1))
545545 then {
546546 let memeIdStr = {
547547 let @ = inv1
548548 if ($isInstanceOf(@, "String"))
549549 then @
550550 else throw(($getType(@) + " couldn't be cast to String"))
551551 }
552552 swapInternal("WAVES", memeIdStr, (i.payments[0].amount - CreationFee), 0, toString(i.originCaller))._1
553553 }
554554 else throw("Strict value is not equal to itself.")
555555 }
556556
557557
558558
559559 @Callable(i)
560560 func claimIndexRewards () = if (isShutdown())
561561 then throw("contract is on stop")
562562 else claimResult(i.caller)
563563
564564
565565
566566 @Callable(i)
567567 func evaluateClaim (user) = $Tuple2(nil, claimResult(addressFromStringValue(user))._2)
568568
569569
570570
571571 @Callable(i)
572572 func swap (assetOut,minimum) = {
573573 let status = getPoolStatus()
574574 if ((2 > status))
575575 then {
576576 let pmt = if ((size(i.payments) == 1))
577577 then value(i.payments[0])
578578 else throw("please attach exactly one payment")
579579 let AmountIn = value(i.payments[0].amount)
580580 let AssetIn = i.payments[0].assetId
581581 let res = swapInternal(getAssetString(AssetIn), assetOut, AmountIn, minimum, toString(i.caller))
582582 if ((getIntegerValue("global_WAVES_balance") > CurveTarget))
583583 then {
584584 let notifyInv = invoke(factoryAccount, "notifyStatusUpdate", [2], nil)
585585 if ((notifyInv == notifyInv))
586586 then res
587587 else throw("Strict value is not equal to itself.")
588588 }
589589 else res
590590 }
591591 else throw("pool is stopped: most probably it reached the target liquidity")
592592 }
593593
594594
595595
596596 @Callable(i)
597597 func swapReadOnly (assetIn,assetOut,AmountIn) = {
598598 let AssetIn = getAssetBytes(assetIn)
599599 let AssetOut = getAssetBytes(assetOut)
600600 let scaleIn = (Scale8 / tryGetInteger((("static_" + assetIn) + "_scale")))
601601 let scaleOut = (Scale8 / tryGetInteger((("static_" + assetOut) + "_scale")))
602602 let feeAssetOutStr = tryGetString("static_feeToken")
603603 let feeAssetOut = if ((feeAssetOutStr == ""))
604604 then usdnAssetId
605605 else getAssetBytes(feeAssetOutStr)
606606 let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance"))
607607 let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance"))
608608 let AssetInBalanceScaled = (AssetInBalance * scaleIn)
609609 let AssetOutBalanceScaled = (AssetOutBalance * scaleOut)
610610 let feeAmountIn = fraction(AmountIn, Fee, FeeScale)
611611 let cleanAmountIn = (AmountIn - feeAmountIn)
612612 let cleanAmountInScaled = (cleanAmountIn * scaleIn)
613613 let AmountOut1 = calculateOutAmount(cleanAmountInScaled, AssetIn, AssetOut, AssetInBalanceScaled, AssetOutBalanceScaled)
614614 let AmountOut = fraction(AmountOut1, 1, scaleOut)
615615 let AssetOutBalance2 = (AssetOutBalance - AmountOut)
616616 let AssetInBalance2 = (AssetInBalance + cleanAmountIn)
617617 let feeAssetOutBalance = if ((feeAssetOut == AssetIn))
618618 then AssetInBalance2
619619 else if ((feeAssetOut == AssetOut))
620620 then AssetOutBalance2
621621 else tryGetInteger((("global_" + getAssetString(feeAssetOut)) + "_balance"))
622622 let feeAmountOut = calculateOutAmount(feeAmountIn, AssetIn, feeAssetOut, AssetInBalance, feeAssetOutBalance)
623623 if ((AssetOut == AssetIn))
624624 then throw("this swap is not allowed")
625625 else if ((0 > (AssetOutBalance - AmountOut)))
626626 then throw("contract is out of reserves")
627627 else if (isShutdown())
628628 then throw("contract is on stop")
629629 else $Tuple2(nil, AmountOut)
630630 }
631631
632632
633633
634634 @Callable(i)
635635 func transferOwnership (newOwnerAddress) = if ((toString(i.caller) != tryGetString("static_poolOwner")))
636636 then throw("this call available only for pool owner")
637637 else [StringEntry("static_poolOwner", newOwnerAddress)]
638638
639639
640640 @Verifier(tx)
641641 func verify () = {
642642 let keyAdminAddressList = "%s__adminAddressList"
643643 let kPoolContractHash = "pool__contract__hash"
644644 let keyAllowedTxId = "%s__txId"
645645 let adminList = split(valueOrElse(getString(factoryAccount, keyAdminAddressList), ""), "__")
646646 let byOwner = if ((size(adminList) >= 3))
647647 then false
648648 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
649649 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAccount, keyAllowedTxId), "")))
650650 match tx {
651651 case setScripTx: SetScriptTransaction =>
652652 let hashOnFactory = valueOrElse(getBinary(factoryAccount, kPoolContractHash), base58'')
653653 let hash = blake2b256(value(setScripTx.script))
654654 if (if ((hash == hashOnFactory))
655655 then true
656656 else byAdmins)
657657 then true
658658 else byOwner
659659 case _ =>
660660 if (byAdmins)
661661 then true
662662 else byOwner
663663 }
664664 }
665665

github/deemru/w8io/026f985 
97.69 ms