tx · 2eoK9GQgWW5K2imh8paCwLr9nMsCQKbtXd2rCrUEzMBH 3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37: -0.01400000 Waves 2021.08.06 16:41 [1646539] smart account 3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37 > SELF 0.00000000 Waves
{ "type": 13, "id": "2eoK9GQgWW5K2imh8paCwLr9nMsCQKbtXd2rCrUEzMBH", "fee": 1400000, "feeAssetId": null, "timestamp": 1628257313301, "version": 2, "chainId": 84, "sender": "3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37", "senderPublicKey": "4bwUHdA4vTBJ1k43dYKiPYTDqm3QqiZXNGXoQstGAD1k", "proofs": [ "4Z5KTSeD9pAjZwyjmzbYVL182iPvEDN9CfM2hwQsoAgjwMspq43S7cbCCjuG8ibu5rkv1KDcv3rJ3bMQ8xewu1tP", "4iqazUaGdrskgCwAYXXVseicLG3qrZVKimzoBjyu4TAvQGQxUNuG9JK7MTyuf1AsLKYikv1Sxk7gDyLvgxHH6wQm" ], "script": "base64:AAIFAAAAAAAAACMIAhIDCgEEEgMKAQESAwoBARIAEgMKAQESABIAEgMKAQESAAAAAFkAAAAAB3ZlcnNpb24CAAAABTEuMC4wAAAAAAprZXlWZXJzaW9uAgAAAAd2ZXJzaW9uAAAAAAlrZXlBY3RpdmUCAAAABmFjdGl2ZQAAAAALa2V5QXNzZXRJZEECAAAACkFfYXNzZXRfaWQAAAAAC2tleUFzc2V0SWRCAgAAAApCX2Fzc2V0X2lkAAAAAAtrZXlCYWxhbmNlQQIAAAAPQV9hc3NldF9iYWxhbmNlAAAAAAtrZXlCYWxhbmNlQgIAAAAPQl9hc3NldF9iYWxhbmNlAAAAAA9rZXlCYWxhbmNlSW5pdEECAAAADEFfYXNzZXRfaW5pdAAAAAAPa2V5QmFsYW5jZUluaXRCAgAAAAxCX2Fzc2V0X2luaXQAAAAAD2tleVNoYXJlQXNzZXRJZAIAAAAOc2hhcmVfYXNzZXRfaWQAAAAAE2t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aXJzdEhhcnZlc3QGBQAAAAtjYWxsU3Rha2luZwYFAAAAD2V4Y2hhbmdlVG9XYXZlcwYFAAAAD2V4Y2hhbmdlVG9OU0JUcwUAAAANc2lnbmVkQnlBZG1pbgcGBQAAABNtdWx0aVNpZ25lZEJ5QWRtaW5zBQAAABNtdWx0aVNpZ25lZEJ5QWRtaW5ziO1CxA==", "height": 1646539, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DbHL2yWygMe7517Buhf8LkGTo1EDgzATCZNkZPhMt4f8 Next: C3ZFD5MvuhYXhGkZXn3KvJLy7UXnf2XtpkP3wN4itE2X Diff:
Old | New | Differences | |
---|---|---|---|
42 | 42 | let kStartHeight = "start_height" | |
43 | 43 | ||
44 | 44 | let kFirstHarvestHeight = "first_harvest_height" | |
45 | + | ||
46 | + | let keyOracleAssetPriority = "asset_priority_" | |
47 | + | ||
48 | + | let keyOracleScriptHash = "script_hash_cpmm" | |
49 | + | ||
50 | + | let keyInitPoolHeight = "init_pool_height_" | |
45 | 51 | ||
46 | 52 | let keyAdminPubKey1 = "admin_pub_1" | |
47 | 53 | ||
155 | 161 | ||
156 | 162 | let scaleValue8Digits = 8 | |
157 | 163 | ||
164 | + | let comissionForInitalization = 1000000000 | |
165 | + | ||
158 | 166 | func accountBalance (assetId) = match assetId { | |
159 | 167 | case id: ByteVector => | |
160 | 168 | assetBalance(this, id) | |
187 | 195 | 0 | |
188 | 196 | } | |
189 | 197 | } | |
198 | + | ||
199 | + | ||
200 | + | func isAllowedAsset (assetId) = match assetId { | |
201 | + | case id: ByteVector => | |
202 | + | if (if ((id == USDN)) | |
203 | + | then true | |
204 | + | else (id == SWOP)) | |
205 | + | then true | |
206 | + | else false | |
207 | + | case waves: Unit => | |
208 | + | true | |
209 | + | case _ => | |
210 | + | throw("Match error") | |
211 | + | } | |
190 | 212 | ||
191 | 213 | ||
192 | 214 | let stakedAmountA = stakedAmount(assetIdA) | |
272 | 294 | ||
273 | 295 | ||
274 | 296 | @Callable(i) | |
275 | - | func init (firstHarvest) = { | |
276 | - | let $t080018078 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
277 | - | let pmtAmountA = $t080018078._1 | |
278 | - | let pmtAssetIdA = $t080018078._2 | |
279 | - | let $t080838160 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
280 | - | let pmtAmountB = $t080838160._1 | |
281 | - | let pmtAssetIdB = $t080838160._2 | |
282 | - | let $t081658242 = getAssetInfo(pmtAssetIdA) | |
283 | - | let pmtStrAssetIdA = $t081658242._1 | |
284 | - | let pmtAssetNameA = $t081658242._2 | |
285 | - | let pmtDecimalsA = $t081658242._3 | |
286 | - | let $t082478324 = getAssetInfo(pmtAssetIdB) | |
287 | - | let pmtStrAssetIdB = $t082478324._1 | |
288 | - | let pmtAssetNameB = $t082478324._2 | |
289 | - | let pmtDecimalsB = $t082478324._3 | |
290 | - | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
291 | - | then throw("Only admin can call this function") | |
292 | - | else if (isDefined(getBoolean(this, keyActive))) | |
293 | - | then throw("DApp is already active") | |
294 | - | else if ((pmtAssetIdA == pmtAssetIdB)) | |
295 | - | then throw("Assets must be different") | |
296 | - | else { | |
297 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
298 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
299 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
300 | - | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
301 | - | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
302 | - | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
303 | - | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
304 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
305 | - | let shareIssueId = calculateAssetId(shareIssue) | |
306 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
307 | - | if (firstHarvest) | |
308 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
309 | - | else baseEntry | |
310 | - | } | |
311 | - | } | |
312 | - | ||
313 | - | ||
314 | - | ||
315 | - | @Callable(i) | |
316 | - | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
317 | - | let $t01056910656 = getAssetInfoFromString(strAssetIdA) | |
318 | - | let pmtStrAssetIdA = $t01056910656._1 | |
319 | - | let pmtAssetNameA = $t01056910656._2 | |
320 | - | let pmtDecimalsA = $t01056910656._3 | |
321 | - | let $t01066110748 = getAssetInfoFromString(strAssetIdB) | |
322 | - | let pmtStrAssetIdB = $t01066110748._1 | |
323 | - | let pmtAssetNameB = $t01066110748._2 | |
324 | - | let pmtDecimalsB = $t01066110748._3 | |
325 | - | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
326 | - | then throw("Only admin can call this function") | |
327 | - | else if (isDefined(getBoolean(this, keyActive))) | |
328 | - | then throw("DApp is already active") | |
329 | - | else if ((strAssetIdA == strAssetIdB)) | |
330 | - | then throw("Assets must be different") | |
331 | - | else { | |
332 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
333 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
334 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
335 | - | let shareInitialSupply = 0 | |
336 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
337 | - | let shareIssueId = calculateAssetId(shareIssue) | |
338 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
339 | - | if (firstHarvest) | |
340 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
341 | - | else baseEntry | |
342 | - | } | |
297 | + | func init (userAdress) = { | |
298 | + | let $t083878464 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
299 | + | let pmtAmount1 = $t083878464._1 | |
300 | + | let pmtAssetId1 = $t083878464._2 | |
301 | + | let $t084698546 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
302 | + | let pmtAmount2 = $t084698546._1 | |
303 | + | let pmtAssetId2 = $t084698546._2 | |
304 | + | let $t085518634 = $Tuple2(i.payments[2].amount, i.payments[2].assetId) | |
305 | + | let pmtAmountSWOP = $t085518634._1 | |
306 | + | let pmtAssetIdSWOP = $t085518634._2 | |
307 | + | let check = isDataStorageUntouched(this) | |
308 | + | let userScriptHash = scriptHash(this) | |
309 | + | if ((i.caller == this)) | |
310 | + | then throw("You can't call yourself") | |
311 | + | else if (if ((pmtAssetIdSWOP != SWOP)) | |
312 | + | then true | |
313 | + | else (pmtAmountSWOP != comissionForInitalization)) | |
314 | + | then throw("You need to attach 10 SWOP tokens") | |
315 | + | else if (if (!(isAllowedAsset(pmtAssetId1))) | |
316 | + | then !(isAllowedAsset(pmtAssetId2)) | |
317 | + | else false) | |
318 | + | then throw("One of assets must be USDN, WAVES or SWOP") | |
319 | + | else if (if ((userScriptHash == value(getBinary(oracle, keyOracleScriptHash)))) | |
320 | + | then true | |
321 | + | else !(check)) | |
322 | + | then throw("Unexpected script was found.") | |
323 | + | else if (isDefined(getBoolean(this, keyActive))) | |
324 | + | then throw("DApp is already active") | |
325 | + | else if ((pmtAssetId1 == pmtAssetId2)) | |
326 | + | then throw("Assets must be different") | |
327 | + | else { | |
328 | + | let pmtStrAssetId1 = match pmtAssetId1 { | |
329 | + | case id: ByteVector => | |
330 | + | toBase58String(id) | |
331 | + | case waves: Unit => | |
332 | + | "WAVES" | |
333 | + | case _ => | |
334 | + | throw("Match error") | |
335 | + | } | |
336 | + | let pmtStrAssetId2 = match pmtAssetId2 { | |
337 | + | case id: ByteVector => | |
338 | + | toBase58String(id) | |
339 | + | case waves: Unit => | |
340 | + | "WAVES" | |
341 | + | case _ => | |
342 | + | throw("Match error") | |
343 | + | } | |
344 | + | let asset1Priority = valueOrElse(getInteger(oracle, ("keyOracleAssetPriority" + pmtStrAssetId1)), 999999) | |
345 | + | let asset2Priority = valueOrElse(getInteger(oracle, ("keyOracleAssetPriority" + pmtStrAssetId2)), 999999) | |
346 | + | let $t0993310160 = if ((asset2Priority > asset1Priority)) | |
347 | + | then $Tuple4(pmtAmount2, pmtAssetId2, pmtAmount1, pmtAssetId1) | |
348 | + | else $Tuple4(pmtAmount1, pmtAssetId1, pmtAmount2, pmtAssetId2) | |
349 | + | let pmtAmountA = $t0993310160._1 | |
350 | + | let pmtAssetIdA = $t0993310160._2 | |
351 | + | let pmtAmountB = $t0993310160._3 | |
352 | + | let pmtAssetIdB = $t0993310160._4 | |
353 | + | let $t01016910246 = getAssetInfo(pmtAssetIdA) | |
354 | + | let pmtStrAssetIdA = $t01016910246._1 | |
355 | + | let pmtAssetNameA = $t01016910246._2 | |
356 | + | let pmtDecimalsA = $t01016910246._3 | |
357 | + | let $t01025510332 = getAssetInfo(pmtAssetIdB) | |
358 | + | let pmtStrAssetIdB = $t01025510332._1 | |
359 | + | let pmtAssetNameB = $t01025510332._2 | |
360 | + | let pmtDecimalsB = $t01025510332._3 | |
361 | + | let addPool = invoke(oracle, "addPool", [this, ((pmtAssetNameA + "_") + pmtAssetNameB)], nil) | |
362 | + | if ((addPool == addPool)) | |
363 | + | then if (!(isDefined(getString(oracle, ("pool_" + toString(this)))))) | |
364 | + | then throw("Pool is not added") | |
365 | + | else { | |
366 | + | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
367 | + | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
368 | + | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
369 | + | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
370 | + | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
371 | + | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
372 | + | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
373 | + | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
374 | + | let shareIssueId = calculateAssetId(shareIssue) | |
375 | + | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), IntegerEntry(keyInitPoolHeight, height), ScriptTransfer(walletAddress, shareInitialSupply, shareIssueId), ScriptTransfer(i.caller, comissionForInitalization, SWOP)] | |
376 | + | baseEntry | |
377 | + | } | |
378 | + | else throw("Strict value is not equal to itself.") | |
379 | + | } | |
343 | 380 | } | |
344 | 381 | ||
345 | 382 | ||
363 | 400 | then (balanceB == 0) | |
364 | 401 | else false) | |
365 | 402 | then { | |
366 | - | let $ | |
367 | - | let pmtStrAssetIdA = $ | |
368 | - | let pmtAssetNameA = $ | |
369 | - | let pmtDecimalsA = $ | |
370 | - | let $ | |
371 | - | let pmtStrAssetIdB = $ | |
372 | - | let pmtAssetNameB = $ | |
373 | - | let pmtDecimalsB = $ | |
403 | + | let $t01312013197 = getAssetInfo(pmtAssetIdA) | |
404 | + | let pmtStrAssetIdA = $t01312013197._1 | |
405 | + | let pmtAssetNameA = $t01312013197._2 | |
406 | + | let pmtDecimalsA = $t01312013197._3 | |
407 | + | let $t01320613283 = getAssetInfo(pmtAssetIdB) | |
408 | + | let pmtStrAssetIdB = $t01320613283._1 | |
409 | + | let pmtAssetNameB = $t01320613283._2 | |
410 | + | let pmtDecimalsB = $t01320613283._3 | |
374 | 411 | let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB)) | |
375 | 412 | if ((pmtAssetIdA == pmtAssetIdB)) | |
376 | 413 | then throw("Assets must be different") | |
433 | 470 | ||
434 | 471 | @Callable(i) | |
435 | 472 | func withdraw () = { | |
436 | - | let $ | |
437 | - | let pmtAmount = $ | |
438 | - | let pmtAssetId = $ | |
473 | + | let $t01768217832 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
474 | + | let pmtAmount = $t01768217832._1 | |
475 | + | let pmtAssetId = $t01768217832._2 | |
439 | 476 | let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA, assetIdB) | |
440 | 477 | let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB, assetIdA) | |
441 | 478 | if (!(isActive)) | |
457 | 494 | ||
458 | 495 | @Callable(i) | |
459 | 496 | func exchange (minAmountToReceive) = { | |
460 | - | let $ | |
461 | - | let pmtAmount = $ | |
462 | - | let pmtAssetId = $ | |
497 | + | let $t01905819133 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
498 | + | let pmtAmount = $t01905819133._1 | |
499 | + | let pmtAssetId = $t01905819133._2 | |
463 | 500 | func calculateFees (tokenFrom,tokenTo) = { | |
464 | 501 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
465 | 502 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
484 | 521 | else if ((pmtAssetId == assetIdA)) | |
485 | 522 | then { | |
486 | 523 | let assetIdSend = assetIdB | |
487 | - | let $ | |
488 | - | let amountWithoutFee = $ | |
489 | - | let amountWithFee = $ | |
490 | - | let governanceReward = $ | |
524 | + | let $t02040720498 = calculateFees(balanceA, balanceB) | |
525 | + | let amountWithoutFee = $t02040720498._1 | |
526 | + | let amountWithFee = $t02040720498._2 | |
527 | + | let governanceReward = $t02040720498._3 | |
491 | 528 | let newBalanceA = (balanceA + pmtAmount) | |
492 | 529 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
493 | 530 | if (if ((stakedAmountA >= newBalanceA)) | |
499 | 536 | else if ((pmtAssetId == assetIdB)) | |
500 | 537 | then { | |
501 | 538 | let assetIdSend = assetIdA | |
502 | - | let $ | |
503 | - | let amountWithoutFee = $ | |
504 | - | let amountWithFee = $ | |
505 | - | let governanceReward = $ | |
539 | + | let $t02131721408 = calculateFees(balanceB, balanceA) | |
540 | + | let amountWithoutFee = $t02131721408._1 | |
541 | + | let amountWithFee = $t02131721408._2 | |
542 | + | let governanceReward = $t02131721408._3 | |
506 | 543 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
507 | 544 | let newBalanceB = (balanceB + pmtAmount) | |
508 | 545 | if (if ((stakedAmountA >= newBalanceA)) | |
562 | 599 | } | |
563 | 600 | ||
564 | 601 | ||
602 | + | ||
603 | + | @Callable(i) | |
604 | + | func enableFirstHarvest () = [BooleanEntry(keyFirstHarvest, true), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))] | |
605 | + | ||
606 | + | ||
565 | 607 | @Verifier(tx) | |
566 | - | func verify () = match tx { | |
567 | - | case inv: InvokeScriptTransaction => | |
568 | - | let callTakeIntoAccount = if ((inv.dApp == this)) | |
569 | - | then (inv.function == "takeIntoAccountExtraFunds") | |
570 | - | else false | |
571 | - | let callStaking = if (if ((inv.dApp == stakingUSDNNSBTAddress)) | |
572 | - | then if (if (if ((inv.function == "lockNeutrino")) | |
573 | - | then (size(inv.payments) == 1) | |
574 | - | else false) | |
575 | - | then if ((inv.payments[0].assetId == USDN)) | |
576 | - | then true | |
577 | - | else (inv.payments[0].assetId == NSBT) | |
578 | - | else false) | |
579 | - | then true | |
580 | - | else if ((inv.function == "unlockNeutrino")) | |
581 | - | then (size(inv.payments) == 0) | |
582 | - | else false | |
583 | - | else false) | |
584 | - | then true | |
585 | - | else if ((inv.dApp == stakingEURNAddress)) | |
586 | - | then if (if (if ((inv.function == "startStaking")) | |
587 | - | then (size(inv.payments) == 1) | |
588 | - | else false) | |
589 | - | then (inv.payments[0].assetId == EURN) | |
590 | - | else false) | |
591 | - | then true | |
592 | - | else if ((inv.function == "stopStaking")) | |
593 | - | then (size(inv.payments) == 0) | |
594 | - | else false | |
595 | - | else false | |
596 | - | let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger)) | |
597 | - | then (inv.function == "exchange") | |
598 | - | else false) | |
599 | - | then (assetIdA == USDN) | |
600 | - | else false) | |
601 | - | then true | |
602 | - | else if (if ((assetIdB == USDN)) | |
603 | - | then (size(inv.payments) == 1) | |
604 | - | else false) | |
605 | - | then (inv.payments[0].assetId == USDN) | |
606 | - | else false | |
607 | - | let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger)) | |
608 | - | then (inv.function == "exchange") | |
609 | - | else false) | |
610 | - | then (assetIdA == NSBT) | |
611 | - | else false) | |
612 | - | then true | |
613 | - | else if (if ((assetIdB == NSBT)) | |
614 | - | then (size(inv.payments) == 1) | |
615 | - | else false) | |
616 | - | then (inv.payments[0].assetId == USDN) | |
617 | - | else false | |
618 | - | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
619 | - | then true | |
620 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
621 | - | then true | |
622 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
623 | - | then true | |
624 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
625 | - | if (if (if (if (callTakeIntoAccount) | |
626 | - | then true | |
627 | - | else callStaking) | |
628 | - | then true | |
629 | - | else exchangeToWaves) | |
630 | - | then true | |
631 | - | else exchangeToNSBTs) | |
632 | - | then signedByAdmin | |
633 | - | else false | |
634 | - | case _ => | |
608 | + | func verify () = { | |
609 | + | let multiSignedByAdmins = { | |
635 | 610 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
636 | 611 | then 1 | |
637 | 612 | else 0 | |
642 | 617 | then 1 | |
643 | 618 | else 0 | |
644 | 619 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
645 | - | } | |
620 | + | } | |
621 | + | match tx { | |
622 | + | case inv: InvokeScriptTransaction => | |
623 | + | let callTakeIntoAccount = if ((inv.dApp == this)) | |
624 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
625 | + | else false | |
626 | + | let callEnableFirstHarvest = if ((inv.dApp == this)) | |
627 | + | then (inv.function == "enableFirstHarvest") | |
628 | + | else false | |
629 | + | let callStaking = if (if ((inv.dApp == stakingUSDNNSBTAddress)) | |
630 | + | then if (if (if ((inv.function == "lockNeutrino")) | |
631 | + | then (size(inv.payments) == 1) | |
632 | + | else false) | |
633 | + | then if ((inv.payments[0].assetId == USDN)) | |
634 | + | then true | |
635 | + | else (inv.payments[0].assetId == NSBT) | |
636 | + | else false) | |
637 | + | then true | |
638 | + | else if ((inv.function == "unlockNeutrino")) | |
639 | + | then (size(inv.payments) == 0) | |
640 | + | else false | |
641 | + | else false) | |
642 | + | then true | |
643 | + | else if ((inv.dApp == stakingEURNAddress)) | |
644 | + | then if (if (if ((inv.function == "startStaking")) | |
645 | + | then (size(inv.payments) == 1) | |
646 | + | else false) | |
647 | + | then (inv.payments[0].assetId == EURN) | |
648 | + | else false) | |
649 | + | then true | |
650 | + | else if ((inv.function == "stopStaking")) | |
651 | + | then (size(inv.payments) == 0) | |
652 | + | else false | |
653 | + | else false | |
654 | + | let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger)) | |
655 | + | then (inv.function == "exchange") | |
656 | + | else false) | |
657 | + | then (assetIdA == USDN) | |
658 | + | else false) | |
659 | + | then true | |
660 | + | else if (if ((assetIdB == USDN)) | |
661 | + | then (size(inv.payments) == 1) | |
662 | + | else false) | |
663 | + | then (inv.payments[0].assetId == USDN) | |
664 | + | else false | |
665 | + | let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger)) | |
666 | + | then (inv.function == "exchange") | |
667 | + | else false) | |
668 | + | then (assetIdA == NSBT) | |
669 | + | else false) | |
670 | + | then true | |
671 | + | else if (if ((assetIdB == NSBT)) | |
672 | + | then (size(inv.payments) == 1) | |
673 | + | else false) | |
674 | + | then (inv.payments[0].assetId == USDN) | |
675 | + | else false | |
676 | + | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
677 | + | then true | |
678 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
679 | + | then true | |
680 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
681 | + | then true | |
682 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
683 | + | if (if (if (if (if (if (callTakeIntoAccount) | |
684 | + | then true | |
685 | + | else callEnableFirstHarvest) | |
686 | + | then true | |
687 | + | else callStaking) | |
688 | + | then true | |
689 | + | else exchangeToWaves) | |
690 | + | then true | |
691 | + | else exchangeToNSBTs) | |
692 | + | then signedByAdmin | |
693 | + | else false) | |
694 | + | then true | |
695 | + | else multiSignedByAdmins | |
696 | + | case _ => | |
697 | + | multiSignedByAdmins | |
698 | + | } | |
699 | + | } | |
646 | 700 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let keyVersion = "version" | |
7 | 7 | ||
8 | 8 | let keyActive = "active" | |
9 | 9 | ||
10 | 10 | let keyAssetIdA = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let keyAssetIdB = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let keyBalanceA = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let keyBalanceB = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let keyBalanceInitA = "A_asset_init" | |
19 | 19 | ||
20 | 20 | let keyBalanceInitB = "B_asset_init" | |
21 | 21 | ||
22 | 22 | let keyShareAssetId = "share_asset_id" | |
23 | 23 | ||
24 | 24 | let keyShareAssetSupply = "share_asset_supply" | |
25 | 25 | ||
26 | 26 | let keyCommission = "commission" | |
27 | 27 | ||
28 | 28 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
29 | 29 | ||
30 | 30 | let keyCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let keyFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | 34 | let keyFirstHarvestHeight = "first_harvest_height" | |
35 | 35 | ||
36 | 36 | let kShareLimit = "share_limit_on_first_harvest" | |
37 | 37 | ||
38 | 38 | let kBasePeriod = "base_period" | |
39 | 39 | ||
40 | 40 | let kPeriodLength = "period_length" | |
41 | 41 | ||
42 | 42 | let kStartHeight = "start_height" | |
43 | 43 | ||
44 | 44 | let kFirstHarvestHeight = "first_harvest_height" | |
45 | + | ||
46 | + | let keyOracleAssetPriority = "asset_priority_" | |
47 | + | ||
48 | + | let keyOracleScriptHash = "script_hash_cpmm" | |
49 | + | ||
50 | + | let keyInitPoolHeight = "init_pool_height_" | |
45 | 51 | ||
46 | 52 | let keyAdminPubKey1 = "admin_pub_1" | |
47 | 53 | ||
48 | 54 | let keyAdminPubKey2 = "admin_pub_2" | |
49 | 55 | ||
50 | 56 | let keyAdminPubKey3 = "admin_pub_3" | |
51 | 57 | ||
52 | 58 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
53 | 59 | ||
54 | 60 | func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) { | |
55 | 61 | case string: String => | |
56 | 62 | fromBase58String(string) | |
57 | 63 | case nothing => | |
58 | 64 | throw("Admin public key is empty") | |
59 | 65 | } | |
60 | 66 | ||
61 | 67 | ||
62 | 68 | let adminPubKey1 = getAdminPub(keyAdminPubKey1) | |
63 | 69 | ||
64 | 70 | let adminPubKey2 = getAdminPub(keyAdminPubKey2) | |
65 | 71 | ||
66 | 72 | let adminPubKey3 = getAdminPub(keyAdminPubKey3) | |
67 | 73 | ||
68 | 74 | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
69 | 75 | ||
70 | 76 | let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
71 | 77 | ||
72 | 78 | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
73 | 79 | ||
74 | 80 | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
75 | 81 | ||
76 | 82 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
77 | 83 | ||
78 | 84 | let NSBT = base58'36mg8NZTaFRDygiVwb8uBnLR51hetJruUCZcxhaVcHj9' | |
79 | 85 | ||
80 | 86 | let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ' | |
81 | 87 | ||
82 | 88 | let EURN = base58'ECBCkHS68DckpBrzLeoRgYbFg7sCVqR176mPqbXsj9pA' | |
83 | 89 | ||
84 | 90 | let stakingUSDNNSBTAddress = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg') | |
85 | 91 | ||
86 | 92 | let stakingEURNAddress = Address(base58'3MyVqAbmKWh339gF6hy8faWw1jGeTV2wnGE') | |
87 | 93 | ||
88 | 94 | let USDNToWavesExchanger = Address(base58'3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37') | |
89 | 95 | ||
90 | 96 | let USDNToNSBTExchanger = Address(base58'3Mye9wVR7d2mc6Y5ZJTu11svzgUQ7o8H9dA') | |
91 | 97 | ||
92 | 98 | let stakingFeeInUSDN = 270000 | |
93 | 99 | ||
94 | 100 | let stakingFeeInEURN = 234000 | |
95 | 101 | ||
96 | 102 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
97 | 103 | ||
98 | 104 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
99 | 105 | ||
100 | 106 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
101 | 107 | ||
102 | 108 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
103 | 109 | ||
104 | 110 | let isActive = getBooleanValue(this, keyActive) | |
105 | 111 | ||
106 | 112 | let strAssetIdA = getStringValue(this, keyAssetIdA) | |
107 | 113 | ||
108 | 114 | let strAssetIdB = getStringValue(this, keyAssetIdB) | |
109 | 115 | ||
110 | 116 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
111 | 117 | then unit | |
112 | 118 | else fromBase58String(strAssetIdA) | |
113 | 119 | ||
114 | 120 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
115 | 121 | then unit | |
116 | 122 | else fromBase58String(strAssetIdB) | |
117 | 123 | ||
118 | 124 | let assetNameA = match assetIdA { | |
119 | 125 | case id: ByteVector => | |
120 | 126 | value(assetInfo(id)).name | |
121 | 127 | case waves: Unit => | |
122 | 128 | "WAVES" | |
123 | 129 | case _ => | |
124 | 130 | throw("Match error") | |
125 | 131 | } | |
126 | 132 | ||
127 | 133 | let assetNameB = match assetIdB { | |
128 | 134 | case id: ByteVector => | |
129 | 135 | value(assetInfo(id)).name | |
130 | 136 | case waves: Unit => | |
131 | 137 | "WAVES" | |
132 | 138 | case _ => | |
133 | 139 | throw("Match error") | |
134 | 140 | } | |
135 | 141 | ||
136 | 142 | let balanceA = getIntegerValue(this, keyBalanceA) | |
137 | 143 | ||
138 | 144 | let balanceB = getIntegerValue(this, keyBalanceB) | |
139 | 145 | ||
140 | 146 | let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId)) | |
141 | 147 | ||
142 | 148 | let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply) | |
143 | 149 | ||
144 | 150 | let commission = 3000 | |
145 | 151 | ||
146 | 152 | let commissionGovernance = 1200 | |
147 | 153 | ||
148 | 154 | let commissionScaleDelimiter = 1000000 | |
149 | 155 | ||
150 | 156 | let scaleValue3 = 1000 | |
151 | 157 | ||
152 | 158 | let scaleValue8 = 100000000 | |
153 | 159 | ||
154 | 160 | let slippageToleranceDelimiter = 1000 | |
155 | 161 | ||
156 | 162 | let scaleValue8Digits = 8 | |
157 | 163 | ||
164 | + | let comissionForInitalization = 1000000000 | |
165 | + | ||
158 | 166 | func accountBalance (assetId) = match assetId { | |
159 | 167 | case id: ByteVector => | |
160 | 168 | assetBalance(this, id) | |
161 | 169 | case waves: Unit => | |
162 | 170 | wavesBalance(this).available | |
163 | 171 | case _ => | |
164 | 172 | throw("Match error") | |
165 | 173 | } | |
166 | 174 | ||
167 | 175 | ||
168 | 176 | func stakedAmount (assetId) = { | |
169 | 177 | let stakedAmountCalculated = match assetId { | |
170 | 178 | case aId: ByteVector => | |
171 | 179 | if (if ((aId == USDN)) | |
172 | 180 | then true | |
173 | 181 | else (aId == NSBT)) | |
174 | 182 | then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
175 | 183 | else if ((aId == EURN)) | |
176 | 184 | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this))) | |
177 | 185 | else 0 | |
178 | 186 | case _: Unit => | |
179 | 187 | 0 | |
180 | 188 | case _ => | |
181 | 189 | throw("Match error") | |
182 | 190 | } | |
183 | 191 | match stakedAmountCalculated { | |
184 | 192 | case i: Int => | |
185 | 193 | i | |
186 | 194 | case _ => | |
187 | 195 | 0 | |
188 | 196 | } | |
189 | 197 | } | |
198 | + | ||
199 | + | ||
200 | + | func isAllowedAsset (assetId) = match assetId { | |
201 | + | case id: ByteVector => | |
202 | + | if (if ((id == USDN)) | |
203 | + | then true | |
204 | + | else (id == SWOP)) | |
205 | + | then true | |
206 | + | else false | |
207 | + | case waves: Unit => | |
208 | + | true | |
209 | + | case _ => | |
210 | + | throw("Match error") | |
211 | + | } | |
190 | 212 | ||
191 | 213 | ||
192 | 214 | let stakedAmountA = stakedAmount(assetIdA) | |
193 | 215 | ||
194 | 216 | let stakedAmountB = stakedAmount(assetIdB) | |
195 | 217 | ||
196 | 218 | let assetInitA = getIntegerValue(this, keyBalanceInitA) | |
197 | 219 | ||
198 | 220 | let assetInitB = getIntegerValue(this, keyBalanceInitB) | |
199 | 221 | ||
200 | 222 | let availableBalanceA = (balanceA - stakedAmountA) | |
201 | 223 | ||
202 | 224 | let availableBalanceB = (balanceB - stakedAmountB) | |
203 | 225 | ||
204 | 226 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
205 | 227 | ||
206 | 228 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
207 | 229 | ||
208 | 230 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
209 | 231 | then (accountBalanceWithStakedB >= balanceB) | |
210 | 232 | else false | |
211 | 233 | ||
212 | 234 | func getAssetInfo (assetId) = match assetId { | |
213 | 235 | case id: ByteVector => | |
214 | 236 | let stringId = toBase58String(id) | |
215 | 237 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
216 | 238 | $Tuple3(stringId, info.name, info.decimals) | |
217 | 239 | case waves: Unit => | |
218 | 240 | $Tuple3("WAVES", "WAVES", 8) | |
219 | 241 | case _ => | |
220 | 242 | throw("Match error") | |
221 | 243 | } | |
222 | 244 | ||
223 | 245 | ||
224 | 246 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
225 | 247 | then $Tuple3("WAVES", "WAVES", 8) | |
226 | 248 | else { | |
227 | 249 | let stringId = assetStr | |
228 | 250 | let id = fromBase58String(assetStr) | |
229 | 251 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
230 | 252 | $Tuple3(stringId, info.name, info.decimals) | |
231 | 253 | } | |
232 | 254 | ||
233 | 255 | ||
234 | 256 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
235 | 257 | ||
236 | 258 | ||
237 | 259 | func deductStakingFee (amount,assetId,secondAssetId) = if (if ((assetId == USDN)) | |
238 | 260 | then true | |
239 | 261 | else (assetId == EURN)) | |
240 | 262 | then { | |
241 | 263 | let stakinFee = if ((assetId == USDN)) | |
242 | 264 | then (stakingFeeInUSDN * (if ((secondAssetId == NSBT)) | |
243 | 265 | then 2 | |
244 | 266 | else 1)) | |
245 | 267 | else if ((assetId == EURN)) | |
246 | 268 | then stakingFeeInEURN | |
247 | 269 | else 0 | |
248 | 270 | let result = (amount - stakinFee) | |
249 | 271 | if ((0 >= result)) | |
250 | 272 | then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakinFee)) + "USDN/EURN")) | |
251 | 273 | else result | |
252 | 274 | } | |
253 | 275 | else amount | |
254 | 276 | ||
255 | 277 | ||
256 | 278 | func getStakingFee (assetId,secondAssetId) = if ((assetId == USDN)) | |
257 | 279 | then (stakingFeeInUSDN * (if ((secondAssetId == NSBT)) | |
258 | 280 | then 2 | |
259 | 281 | else 1)) | |
260 | 282 | else if ((assetId == EURN)) | |
261 | 283 | then stakingFeeInEURN | |
262 | 284 | else 0 | |
263 | 285 | ||
264 | 286 | ||
265 | 287 | func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
266 | 288 | ||
267 | 289 | ||
268 | 290 | func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
269 | 291 | ||
270 | 292 | ||
271 | 293 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceWithStakedA)) + " ") + assetNameA) + ", ") + toString(accountBalanceWithStakedB)) + " ") + assetNameB) + ". State: ") + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB)) | |
272 | 294 | ||
273 | 295 | ||
274 | 296 | @Callable(i) | |
275 | - | func init (firstHarvest) = { | |
276 | - | let $t080018078 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
277 | - | let pmtAmountA = $t080018078._1 | |
278 | - | let pmtAssetIdA = $t080018078._2 | |
279 | - | let $t080838160 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
280 | - | let pmtAmountB = $t080838160._1 | |
281 | - | let pmtAssetIdB = $t080838160._2 | |
282 | - | let $t081658242 = getAssetInfo(pmtAssetIdA) | |
283 | - | let pmtStrAssetIdA = $t081658242._1 | |
284 | - | let pmtAssetNameA = $t081658242._2 | |
285 | - | let pmtDecimalsA = $t081658242._3 | |
286 | - | let $t082478324 = getAssetInfo(pmtAssetIdB) | |
287 | - | let pmtStrAssetIdB = $t082478324._1 | |
288 | - | let pmtAssetNameB = $t082478324._2 | |
289 | - | let pmtDecimalsB = $t082478324._3 | |
290 | - | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
291 | - | then throw("Only admin can call this function") | |
292 | - | else if (isDefined(getBoolean(this, keyActive))) | |
293 | - | then throw("DApp is already active") | |
294 | - | else if ((pmtAssetIdA == pmtAssetIdB)) | |
295 | - | then throw("Assets must be different") | |
296 | - | else { | |
297 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
298 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
299 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
300 | - | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
301 | - | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
302 | - | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
303 | - | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
304 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
305 | - | let shareIssueId = calculateAssetId(shareIssue) | |
306 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
307 | - | if (firstHarvest) | |
308 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
309 | - | else baseEntry | |
310 | - | } | |
311 | - | } | |
312 | - | ||
313 | - | ||
314 | - | ||
315 | - | @Callable(i) | |
316 | - | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
317 | - | let $t01056910656 = getAssetInfoFromString(strAssetIdA) | |
318 | - | let pmtStrAssetIdA = $t01056910656._1 | |
319 | - | let pmtAssetNameA = $t01056910656._2 | |
320 | - | let pmtDecimalsA = $t01056910656._3 | |
321 | - | let $t01066110748 = getAssetInfoFromString(strAssetIdB) | |
322 | - | let pmtStrAssetIdB = $t01066110748._1 | |
323 | - | let pmtAssetNameB = $t01066110748._2 | |
324 | - | let pmtDecimalsB = $t01066110748._3 | |
325 | - | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
326 | - | then throw("Only admin can call this function") | |
327 | - | else if (isDefined(getBoolean(this, keyActive))) | |
328 | - | then throw("DApp is already active") | |
329 | - | else if ((strAssetIdA == strAssetIdB)) | |
330 | - | then throw("Assets must be different") | |
331 | - | else { | |
332 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
333 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
334 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
335 | - | let shareInitialSupply = 0 | |
336 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
337 | - | let shareIssueId = calculateAssetId(shareIssue) | |
338 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
339 | - | if (firstHarvest) | |
340 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
341 | - | else baseEntry | |
342 | - | } | |
297 | + | func init (userAdress) = { | |
298 | + | let $t083878464 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
299 | + | let pmtAmount1 = $t083878464._1 | |
300 | + | let pmtAssetId1 = $t083878464._2 | |
301 | + | let $t084698546 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
302 | + | let pmtAmount2 = $t084698546._1 | |
303 | + | let pmtAssetId2 = $t084698546._2 | |
304 | + | let $t085518634 = $Tuple2(i.payments[2].amount, i.payments[2].assetId) | |
305 | + | let pmtAmountSWOP = $t085518634._1 | |
306 | + | let pmtAssetIdSWOP = $t085518634._2 | |
307 | + | let check = isDataStorageUntouched(this) | |
308 | + | let userScriptHash = scriptHash(this) | |
309 | + | if ((i.caller == this)) | |
310 | + | then throw("You can't call yourself") | |
311 | + | else if (if ((pmtAssetIdSWOP != SWOP)) | |
312 | + | then true | |
313 | + | else (pmtAmountSWOP != comissionForInitalization)) | |
314 | + | then throw("You need to attach 10 SWOP tokens") | |
315 | + | else if (if (!(isAllowedAsset(pmtAssetId1))) | |
316 | + | then !(isAllowedAsset(pmtAssetId2)) | |
317 | + | else false) | |
318 | + | then throw("One of assets must be USDN, WAVES or SWOP") | |
319 | + | else if (if ((userScriptHash == value(getBinary(oracle, keyOracleScriptHash)))) | |
320 | + | then true | |
321 | + | else !(check)) | |
322 | + | then throw("Unexpected script was found.") | |
323 | + | else if (isDefined(getBoolean(this, keyActive))) | |
324 | + | then throw("DApp is already active") | |
325 | + | else if ((pmtAssetId1 == pmtAssetId2)) | |
326 | + | then throw("Assets must be different") | |
327 | + | else { | |
328 | + | let pmtStrAssetId1 = match pmtAssetId1 { | |
329 | + | case id: ByteVector => | |
330 | + | toBase58String(id) | |
331 | + | case waves: Unit => | |
332 | + | "WAVES" | |
333 | + | case _ => | |
334 | + | throw("Match error") | |
335 | + | } | |
336 | + | let pmtStrAssetId2 = match pmtAssetId2 { | |
337 | + | case id: ByteVector => | |
338 | + | toBase58String(id) | |
339 | + | case waves: Unit => | |
340 | + | "WAVES" | |
341 | + | case _ => | |
342 | + | throw("Match error") | |
343 | + | } | |
344 | + | let asset1Priority = valueOrElse(getInteger(oracle, ("keyOracleAssetPriority" + pmtStrAssetId1)), 999999) | |
345 | + | let asset2Priority = valueOrElse(getInteger(oracle, ("keyOracleAssetPriority" + pmtStrAssetId2)), 999999) | |
346 | + | let $t0993310160 = if ((asset2Priority > asset1Priority)) | |
347 | + | then $Tuple4(pmtAmount2, pmtAssetId2, pmtAmount1, pmtAssetId1) | |
348 | + | else $Tuple4(pmtAmount1, pmtAssetId1, pmtAmount2, pmtAssetId2) | |
349 | + | let pmtAmountA = $t0993310160._1 | |
350 | + | let pmtAssetIdA = $t0993310160._2 | |
351 | + | let pmtAmountB = $t0993310160._3 | |
352 | + | let pmtAssetIdB = $t0993310160._4 | |
353 | + | let $t01016910246 = getAssetInfo(pmtAssetIdA) | |
354 | + | let pmtStrAssetIdA = $t01016910246._1 | |
355 | + | let pmtAssetNameA = $t01016910246._2 | |
356 | + | let pmtDecimalsA = $t01016910246._3 | |
357 | + | let $t01025510332 = getAssetInfo(pmtAssetIdB) | |
358 | + | let pmtStrAssetIdB = $t01025510332._1 | |
359 | + | let pmtAssetNameB = $t01025510332._2 | |
360 | + | let pmtDecimalsB = $t01025510332._3 | |
361 | + | let addPool = invoke(oracle, "addPool", [this, ((pmtAssetNameA + "_") + pmtAssetNameB)], nil) | |
362 | + | if ((addPool == addPool)) | |
363 | + | then if (!(isDefined(getString(oracle, ("pool_" + toString(this)))))) | |
364 | + | then throw("Pool is not added") | |
365 | + | else { | |
366 | + | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
367 | + | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
368 | + | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
369 | + | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
370 | + | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
371 | + | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
372 | + | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
373 | + | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
374 | + | let shareIssueId = calculateAssetId(shareIssue) | |
375 | + | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), IntegerEntry(keyInitPoolHeight, height), ScriptTransfer(walletAddress, shareInitialSupply, shareIssueId), ScriptTransfer(i.caller, comissionForInitalization, SWOP)] | |
376 | + | baseEntry | |
377 | + | } | |
378 | + | else throw("Strict value is not equal to itself.") | |
379 | + | } | |
343 | 380 | } | |
344 | 381 | ||
345 | 382 | ||
346 | 383 | ||
347 | 384 | @Callable(i) | |
348 | 385 | func keepLimitForFirstHarvest (shareLimit) = if (!(isActive)) | |
349 | 386 | then throw("DApp is inactive at this moment") | |
350 | 387 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
351 | 388 | then throw("Only admin can call this function") | |
352 | 389 | else [IntegerEntry(kShareLimit, shareLimit)] | |
353 | 390 | ||
354 | 391 | ||
355 | 392 | ||
356 | 393 | @Callable(i) | |
357 | 394 | func replenishWithTwoTokens (slippageTolerance) = { | |
358 | 395 | let pmtAssetIdA = i.payments[0].assetId | |
359 | 396 | let pmtAssetIdB = i.payments[1].assetId | |
360 | 397 | let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA, pmtAssetIdB) | |
361 | 398 | let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB, pmtAssetIdA) | |
362 | 399 | if (if ((balanceA == 0)) | |
363 | 400 | then (balanceB == 0) | |
364 | 401 | else false) | |
365 | 402 | then { | |
366 | - | let $ | |
367 | - | let pmtStrAssetIdA = $ | |
368 | - | let pmtAssetNameA = $ | |
369 | - | let pmtDecimalsA = $ | |
370 | - | let $ | |
371 | - | let pmtStrAssetIdB = $ | |
372 | - | let pmtAssetNameB = $ | |
373 | - | let pmtDecimalsB = $ | |
403 | + | let $t01312013197 = getAssetInfo(pmtAssetIdA) | |
404 | + | let pmtStrAssetIdA = $t01312013197._1 | |
405 | + | let pmtAssetNameA = $t01312013197._2 | |
406 | + | let pmtDecimalsA = $t01312013197._3 | |
407 | + | let $t01320613283 = getAssetInfo(pmtAssetIdB) | |
408 | + | let pmtStrAssetIdB = $t01320613283._1 | |
409 | + | let pmtAssetNameB = $t01320613283._2 | |
410 | + | let pmtDecimalsB = $t01320613283._3 | |
374 | 411 | let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB)) | |
375 | 412 | if ((pmtAssetIdA == pmtAssetIdB)) | |
376 | 413 | then throw("Assets must be different") | |
377 | 414 | else { | |
378 | 415 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
379 | 416 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
380 | 417 | if (!(isActive)) | |
381 | 418 | then throw("DApp is inactive at this moment") | |
382 | 419 | else if (if ((0 > slippageTolerance)) | |
383 | 420 | then true | |
384 | 421 | else (slippageTolerance > slippageToleranceDelimiter)) | |
385 | 422 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
386 | 423 | else if ((size(i.payments) != 2)) | |
387 | 424 | then throw("Two attached assets expected") | |
388 | 425 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
389 | 426 | then true | |
390 | 427 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
391 | 428 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
392 | 429 | else if (if ((pmtAssetIdA != assetIdA)) | |
393 | 430 | then true | |
394 | 431 | else (pmtAssetIdB != assetIdB)) | |
395 | 432 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
396 | 433 | else if ((shareInitialSupply == 0)) | |
397 | 434 | then throw("Too small amount to replenish") | |
398 | 435 | else if (!(hasEnoughBalance)) | |
399 | 436 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
400 | 437 | else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
401 | 438 | } | |
402 | 439 | } | |
403 | 440 | else { | |
404 | 441 | let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB)) | |
405 | 442 | let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA) | |
406 | 443 | let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB) | |
407 | 444 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
408 | 445 | if (!(isActive)) | |
409 | 446 | then throw("DApp is inactive at this moment") | |
410 | 447 | else if (if ((0 > slippageTolerance)) | |
411 | 448 | then true | |
412 | 449 | else (slippageTolerance > slippageToleranceDelimiter)) | |
413 | 450 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
414 | 451 | else if ((size(i.payments) != 2)) | |
415 | 452 | then throw("Two attached assets expected") | |
416 | 453 | else if (if ((pmtAssetIdA != assetIdA)) | |
417 | 454 | then true | |
418 | 455 | else (pmtAssetIdB != assetIdB)) | |
419 | 456 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
420 | 457 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
421 | 458 | then true | |
422 | 459 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
423 | 460 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
424 | 461 | else if ((shareTokenToPayAmount == 0)) | |
425 | 462 | then throw("Too small amount to replenish") | |
426 | 463 | else if (!(hasEnoughBalance)) | |
427 | 464 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
428 | 465 | else [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)] | |
429 | 466 | } | |
430 | 467 | } | |
431 | 468 | ||
432 | 469 | ||
433 | 470 | ||
434 | 471 | @Callable(i) | |
435 | 472 | func withdraw () = { | |
436 | - | let $ | |
437 | - | let pmtAmount = $ | |
438 | - | let pmtAssetId = $ | |
473 | + | let $t01768217832 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
474 | + | let pmtAmount = $t01768217832._1 | |
475 | + | let pmtAssetId = $t01768217832._2 | |
439 | 476 | let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA, assetIdB) | |
440 | 477 | let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB, assetIdA) | |
441 | 478 | if (!(isActive)) | |
442 | 479 | then throw("DApp is inactive at this moment") | |
443 | 480 | else if ((size(i.payments) != 1)) | |
444 | 481 | then throw("One attached payment expected") | |
445 | 482 | else if ((pmtAssetId != shareAssetId)) | |
446 | 483 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
447 | 484 | else if (!(hasEnoughBalance)) | |
448 | 485 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
449 | 486 | else if (if ((amountToPayA > availableBalanceA)) | |
450 | 487 | then true | |
451 | 488 | else (amountToPayB > availableBalanceB)) | |
452 | 489 | then throwInsufficientAvailableBalances(amountToPayA, amountToPayB) | |
453 | 490 | else [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
454 | 491 | } | |
455 | 492 | ||
456 | 493 | ||
457 | 494 | ||
458 | 495 | @Callable(i) | |
459 | 496 | func exchange (minAmountToReceive) = { | |
460 | - | let $ | |
461 | - | let pmtAmount = $ | |
462 | - | let pmtAssetId = $ | |
497 | + | let $t01905819133 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
498 | + | let pmtAmount = $t01905819133._1 | |
499 | + | let pmtAssetId = $t01905819133._2 | |
463 | 500 | func calculateFees (tokenFrom,tokenTo) = { | |
464 | 501 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
465 | 502 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
466 | 503 | let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter) | |
467 | 504 | if ((minAmountToReceive > amountWithFee)) | |
468 | 505 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
469 | 506 | else $Tuple3(amountWithoutFee, amountWithFee, governanceReward) | |
470 | 507 | } | |
471 | 508 | ||
472 | 509 | if (!(isActive)) | |
473 | 510 | then throw("DApp is inactive at this moment") | |
474 | 511 | else if (if ((balanceA == 0)) | |
475 | 512 | then true | |
476 | 513 | else (balanceB == 0)) | |
477 | 514 | then throw("Can't exchange with zero balance") | |
478 | 515 | else if ((0 >= minAmountToReceive)) | |
479 | 516 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
480 | 517 | else if ((size(i.payments) != 1)) | |
481 | 518 | then throw("One attached payment expected") | |
482 | 519 | else if (!(hasEnoughBalance)) | |
483 | 520 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
484 | 521 | else if ((pmtAssetId == assetIdA)) | |
485 | 522 | then { | |
486 | 523 | let assetIdSend = assetIdB | |
487 | - | let $ | |
488 | - | let amountWithoutFee = $ | |
489 | - | let amountWithFee = $ | |
490 | - | let governanceReward = $ | |
524 | + | let $t02040720498 = calculateFees(balanceA, balanceB) | |
525 | + | let amountWithoutFee = $t02040720498._1 | |
526 | + | let amountWithFee = $t02040720498._2 | |
527 | + | let governanceReward = $t02040720498._3 | |
491 | 528 | let newBalanceA = (balanceA + pmtAmount) | |
492 | 529 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
493 | 530 | if (if ((stakedAmountA >= newBalanceA)) | |
494 | 531 | then true | |
495 | 532 | else (stakedAmountB >= newBalanceB)) | |
496 | 533 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB) | |
497 | 534 | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
498 | 535 | } | |
499 | 536 | else if ((pmtAssetId == assetIdB)) | |
500 | 537 | then { | |
501 | 538 | let assetIdSend = assetIdA | |
502 | - | let $ | |
503 | - | let amountWithoutFee = $ | |
504 | - | let amountWithFee = $ | |
505 | - | let governanceReward = $ | |
539 | + | let $t02131721408 = calculateFees(balanceB, balanceA) | |
540 | + | let amountWithoutFee = $t02131721408._1 | |
541 | + | let amountWithFee = $t02131721408._2 | |
542 | + | let governanceReward = $t02131721408._3 | |
506 | 543 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
507 | 544 | let newBalanceB = (balanceB + pmtAmount) | |
508 | 545 | if (if ((stakedAmountA >= newBalanceA)) | |
509 | 546 | then true | |
510 | 547 | else (stakedAmountB >= newBalanceB)) | |
511 | 548 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA) | |
512 | 549 | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
513 | 550 | } | |
514 | 551 | else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
515 | 552 | } | |
516 | 553 | ||
517 | 554 | ||
518 | 555 | ||
519 | 556 | @Callable(i) | |
520 | 557 | func shutdown () = if (!(isActive)) | |
521 | 558 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
522 | 559 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
523 | 560 | then throw("Only admin can call this function") | |
524 | 561 | else suspend("Paused by admin") | |
525 | 562 | ||
526 | 563 | ||
527 | 564 | ||
528 | 565 | @Callable(i) | |
529 | 566 | func activate () = if (isActive) | |
530 | 567 | then throw("DApp is already active") | |
531 | 568 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
532 | 569 | then throw("Only admin can call this function") | |
533 | 570 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
534 | 571 | ||
535 | 572 | ||
536 | 573 | ||
537 | 574 | @Callable(i) | |
538 | 575 | func takeIntoAccountExtraFunds (amountLeave) = { | |
539 | 576 | let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA) | |
540 | 577 | let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB) | |
541 | 578 | let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == unit)) | |
542 | 579 | then amountLeave | |
543 | 580 | else 0)) | |
544 | 581 | let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == unit)) | |
545 | 582 | then amountLeave | |
546 | 583 | else 0)) | |
547 | 584 | if (!(isActive)) | |
548 | 585 | then throw("DApp is inactive at this moment") | |
549 | 586 | else if ((i.caller != this)) | |
550 | 587 | then throw("Only the DApp itself can call this function") | |
551 | 588 | else if ((0 > amountLeave)) | |
552 | 589 | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave))) | |
553 | 590 | else if (if ((0 > uncountableAmountEnrollAssetA)) | |
554 | 591 | then true | |
555 | 592 | else (0 > uncountableAmountEnrollAssetB)) | |
556 | 593 | then suspend("Enroll amount negative") | |
557 | 594 | else if (if ((0 > amountEnrollA)) | |
558 | 595 | then true | |
559 | 596 | else (0 > amountEnrollB)) | |
560 | 597 | then throw("Too large amountLeave") | |
561 | 598 | else [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB)), IntegerEntry(("last_income_" + strAssetIdA), amountEnrollA), IntegerEntry(("last_income_" + strAssetIdB), amountEnrollB)] | |
562 | 599 | } | |
563 | 600 | ||
564 | 601 | ||
602 | + | ||
603 | + | @Callable(i) | |
604 | + | func enableFirstHarvest () = [BooleanEntry(keyFirstHarvest, true), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))] | |
605 | + | ||
606 | + | ||
565 | 607 | @Verifier(tx) | |
566 | - | func verify () = match tx { | |
567 | - | case inv: InvokeScriptTransaction => | |
568 | - | let callTakeIntoAccount = if ((inv.dApp == this)) | |
569 | - | then (inv.function == "takeIntoAccountExtraFunds") | |
570 | - | else false | |
571 | - | let callStaking = if (if ((inv.dApp == stakingUSDNNSBTAddress)) | |
572 | - | then if (if (if ((inv.function == "lockNeutrino")) | |
573 | - | then (size(inv.payments) == 1) | |
574 | - | else false) | |
575 | - | then if ((inv.payments[0].assetId == USDN)) | |
576 | - | then true | |
577 | - | else (inv.payments[0].assetId == NSBT) | |
578 | - | else false) | |
579 | - | then true | |
580 | - | else if ((inv.function == "unlockNeutrino")) | |
581 | - | then (size(inv.payments) == 0) | |
582 | - | else false | |
583 | - | else false) | |
584 | - | then true | |
585 | - | else if ((inv.dApp == stakingEURNAddress)) | |
586 | - | then if (if (if ((inv.function == "startStaking")) | |
587 | - | then (size(inv.payments) == 1) | |
588 | - | else false) | |
589 | - | then (inv.payments[0].assetId == EURN) | |
590 | - | else false) | |
591 | - | then true | |
592 | - | else if ((inv.function == "stopStaking")) | |
593 | - | then (size(inv.payments) == 0) | |
594 | - | else false | |
595 | - | else false | |
596 | - | let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger)) | |
597 | - | then (inv.function == "exchange") | |
598 | - | else false) | |
599 | - | then (assetIdA == USDN) | |
600 | - | else false) | |
601 | - | then true | |
602 | - | else if (if ((assetIdB == USDN)) | |
603 | - | then (size(inv.payments) == 1) | |
604 | - | else false) | |
605 | - | then (inv.payments[0].assetId == USDN) | |
606 | - | else false | |
607 | - | let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger)) | |
608 | - | then (inv.function == "exchange") | |
609 | - | else false) | |
610 | - | then (assetIdA == NSBT) | |
611 | - | else false) | |
612 | - | then true | |
613 | - | else if (if ((assetIdB == NSBT)) | |
614 | - | then (size(inv.payments) == 1) | |
615 | - | else false) | |
616 | - | then (inv.payments[0].assetId == USDN) | |
617 | - | else false | |
618 | - | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
619 | - | then true | |
620 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
621 | - | then true | |
622 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
623 | - | then true | |
624 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
625 | - | if (if (if (if (callTakeIntoAccount) | |
626 | - | then true | |
627 | - | else callStaking) | |
628 | - | then true | |
629 | - | else exchangeToWaves) | |
630 | - | then true | |
631 | - | else exchangeToNSBTs) | |
632 | - | then signedByAdmin | |
633 | - | else false | |
634 | - | case _ => | |
608 | + | func verify () = { | |
609 | + | let multiSignedByAdmins = { | |
635 | 610 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
636 | 611 | then 1 | |
637 | 612 | else 0 | |
638 | 613 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
639 | 614 | then 1 | |
640 | 615 | else 0 | |
641 | 616 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
642 | 617 | then 1 | |
643 | 618 | else 0 | |
644 | 619 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
645 | - | } | |
620 | + | } | |
621 | + | match tx { | |
622 | + | case inv: InvokeScriptTransaction => | |
623 | + | let callTakeIntoAccount = if ((inv.dApp == this)) | |
624 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
625 | + | else false | |
626 | + | let callEnableFirstHarvest = if ((inv.dApp == this)) | |
627 | + | then (inv.function == "enableFirstHarvest") | |
628 | + | else false | |
629 | + | let callStaking = if (if ((inv.dApp == stakingUSDNNSBTAddress)) | |
630 | + | then if (if (if ((inv.function == "lockNeutrino")) | |
631 | + | then (size(inv.payments) == 1) | |
632 | + | else false) | |
633 | + | then if ((inv.payments[0].assetId == USDN)) | |
634 | + | then true | |
635 | + | else (inv.payments[0].assetId == NSBT) | |
636 | + | else false) | |
637 | + | then true | |
638 | + | else if ((inv.function == "unlockNeutrino")) | |
639 | + | then (size(inv.payments) == 0) | |
640 | + | else false | |
641 | + | else false) | |
642 | + | then true | |
643 | + | else if ((inv.dApp == stakingEURNAddress)) | |
644 | + | then if (if (if ((inv.function == "startStaking")) | |
645 | + | then (size(inv.payments) == 1) | |
646 | + | else false) | |
647 | + | then (inv.payments[0].assetId == EURN) | |
648 | + | else false) | |
649 | + | then true | |
650 | + | else if ((inv.function == "stopStaking")) | |
651 | + | then (size(inv.payments) == 0) | |
652 | + | else false | |
653 | + | else false | |
654 | + | let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger)) | |
655 | + | then (inv.function == "exchange") | |
656 | + | else false) | |
657 | + | then (assetIdA == USDN) | |
658 | + | else false) | |
659 | + | then true | |
660 | + | else if (if ((assetIdB == USDN)) | |
661 | + | then (size(inv.payments) == 1) | |
662 | + | else false) | |
663 | + | then (inv.payments[0].assetId == USDN) | |
664 | + | else false | |
665 | + | let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger)) | |
666 | + | then (inv.function == "exchange") | |
667 | + | else false) | |
668 | + | then (assetIdA == NSBT) | |
669 | + | else false) | |
670 | + | then true | |
671 | + | else if (if ((assetIdB == NSBT)) | |
672 | + | then (size(inv.payments) == 1) | |
673 | + | else false) | |
674 | + | then (inv.payments[0].assetId == USDN) | |
675 | + | else false | |
676 | + | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
677 | + | then true | |
678 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
679 | + | then true | |
680 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
681 | + | then true | |
682 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
683 | + | if (if (if (if (if (if (callTakeIntoAccount) | |
684 | + | then true | |
685 | + | else callEnableFirstHarvest) | |
686 | + | then true | |
687 | + | else callStaking) | |
688 | + | then true | |
689 | + | else exchangeToWaves) | |
690 | + | then true | |
691 | + | else exchangeToNSBTs) | |
692 | + | then signedByAdmin | |
693 | + | else false) | |
694 | + | then true | |
695 | + | else multiSignedByAdmins | |
696 | + | case _ => | |
697 | + | multiSignedByAdmins | |
698 | + | } | |
699 | + | } | |
646 | 700 |
github/deemru/w8io/026f985 101.78 ms ◑