tx · DaQaMBzCwiyn3dnFbjgMcMdvoA1SXrVASieXhTycjm3w 3MzqQ3HKdkHmJmk9mDhAeAMxmK5D2ztdAe5: -0.03900000 Waves 2023.03.17 17:08 [2494094] smart account 3MzqQ3HKdkHmJmk9mDhAeAMxmK5D2ztdAe5 > SELF 0.00000000 Waves
{ "type": 13, "id": "DaQaMBzCwiyn3dnFbjgMcMdvoA1SXrVASieXhTycjm3w", "fee": 3900000, "feeAssetId": null, "timestamp": 1679062186466, "version": 2, "chainId": 84, "sender": "3MzqQ3HKdkHmJmk9mDhAeAMxmK5D2ztdAe5", "senderPublicKey": "FEnkfXnQZkk1FmjhH6QZqyK2taN6ngnZBexevKxouLUM", "proofs": [ "3s9MSVDADAr7RTA4KMQMx4zdxzqQ9K2yoh35JiKWpi5gYMFcJudoAyJ79jB6iCteJNy4uW4uixxaV9hcrrqX3k7s", "2dkrzeucU7oMJqVrVGuVn2A55PiHAEva8oiD3AzbusvvjuEPevo6RXCVVgH9r4GLRUacWQHeqVzV23oTeSoDxJHh" ], "script": "base64:BgJKCAISBgoEAhgREhIGCgQCGBESEgYKBAIYERISBgoEAhgREhIGCgQCGBESEgYKBAIYERISBgoEAhgREhIGCgQCGBESEgYKBAIYERJQAAd2ZXJzaW9uAgUxLjAuMAAIa1ZlcnNpb24CB3ZlcnNpb24AB2tBY3RpdmUCBmFjdGl2ZQALa0RlcHJlY2F0ZWQCC2RlcHJlY2F0ZWRfAAlrQXNzZXRJZEECCkFfYXNzZXRfaWQACWtBc3NldElkQgIKQl9hc3NldF9pZAAJa0JhbGFuY2VBAg9BX2Fzc2V0X2JhbGFuY2UACWtCYWxhbmNlQgIPQl9hc3NldF9iYWxhbmNlAA1rQmFsYW5jZUluaXRBAgxBX2Fzc2V0X2luaXQADWtCYWxhbmNlSW5pdEICDEJfYXNzZXRfaW5pdAANa1NoYXJlQXNzZXRJZAIOc2hhcmVfYXNzZXRfaWQAEWtTaGFyZUFzc2V0U3VwcGx5AhJzaGFyZV9h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ZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgUTbXVsdGlTaWduZWRCeUFkbWluc+dkGas=", "height": 2494094, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9xCTNz47G3NoeyG4DDuYwpafcFdrQzgy7GQYwSwPs6j9 Next: 9jcf6Udfuj74gJqeNQCJLNhypVavEnur9WSqF7T1CT1J Diff:
Old | New | Differences | |
---|---|---|---|
75 | 75 | ||
76 | 76 | let kMoneyBoxAddress = "money_box_address" | |
77 | 77 | ||
78 | + | let kTeamBoxAddress = "team_box_address" | |
79 | + | ||
78 | 80 | let kVotingAddress = "voting_address" | |
79 | 81 | ||
80 | 82 | let kGovAddress = "governance_address" | |
100 | 102 | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
101 | 103 | ||
102 | 104 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
105 | + | ||
106 | + | let teamBoxAddress = Address(getBase58FromOracle(kTeamBoxAddress)) | |
103 | 107 | ||
104 | 108 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
105 | 109 | ||
167 | 171 | ||
168 | 172 | func getAssetInfo (assetId) = match assetId { | |
169 | 173 | case id: String|ByteVector => | |
170 | - | let $ | |
174 | + | let $t040794251 = match id { | |
171 | 175 | case aId: ByteVector => | |
172 | 176 | $Tuple2(toBase58String(aId), aId) | |
173 | 177 | case aId: String => | |
175 | 179 | case _ => | |
176 | 180 | throw("Match error") | |
177 | 181 | } | |
178 | - | let stringId = $ | |
179 | - | let bytesId = $ | |
182 | + | let stringId = $t040794251._1 | |
183 | + | let bytesId = $t040794251._2 | |
180 | 184 | let info = valueOrErrorMessage(assetInfo(bytesId), (("Asset " + stringId) + " doesn't exist")) | |
181 | 185 | $Tuple3(stringId, info.name, info.decimals) | |
182 | 186 | case waves: Unit => | |
216 | 220 | } | |
217 | 221 | ||
218 | 222 | ||
219 | - | func calculateFees (pmtAmount,minAmountToReceive,tokenFrom,tokenTo,fee, | |
223 | + | func calculateFees (pmtAmount,minAmountToReceive,tokenFrom,tokenTo,fee,feeGov,feeTeam) = { | |
220 | 224 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
221 | 225 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - fee), feeScale6) | |
222 | - | let governanceReward = fraction(amountWithoutFee, feeGovernance, feeScale6) | |
226 | + | let governanceReward = fraction(amountWithoutFee, feeGov, feeScale6) | |
227 | + | let teamReward = fraction(amountWithoutFee, feeTeam, feeScale6) | |
223 | 228 | if ((minAmountToReceive > amountWithFee)) | |
224 | 229 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
225 | - | else $ | |
230 | + | else $Tuple4(amountWithoutFee, amountWithFee, governanceReward, teamReward) | |
226 | 231 | } | |
227 | 232 | ||
228 | 233 | ||
229 | 234 | func calculateVirtPay (pmtAmount,balance,fee) = { | |
230 | 235 | let F = (feeScale6 - fee) | |
231 | - | let k = fraction(fee, | |
236 | + | let k = fraction(fee, 55, 100) | |
232 | 237 | let a = (scale8 + fraction((F * k), scale8, (feeScale6 * feeScale6))) | |
233 | 238 | let b = ((((balance + fraction(balance, F, feeScale6)) + fraction(pmtAmount, F, feeScale6)) - pmtAmount) - fraction(pmtAmount, (F * k), (feeScale6 * feeScale6))) | |
234 | 239 | let c = (-(toBigInt(balance)) * toBigInt(pmtAmount)) | |
289 | 294 | func getFeeParams (pool,caller) = { | |
290 | 295 | let feeDiscount = calculateFeeDiscount(caller) | |
291 | 296 | let fee = fraction(getIntegerValue(pool, kFee), feeDiscount, feeScale6, CEILING) | |
292 | - | let govFee = fraction(fee, 40, 100) | |
293 | - | $Tuple2(fee, govFee) | |
297 | + | let govFee = fraction(fee, 35, 100) | |
298 | + | let teamFee = fraction(fee, 10, 100) | |
299 | + | $Tuple3(fee, govFee, teamFee) | |
294 | 300 | } | |
295 | 301 | ||
296 | 302 | ||
297 | 303 | @Callable(i) | |
298 | 304 | func init (callerBytes,args,pAmounts,pAssetIds) = { | |
299 | 305 | let caller = Address(callerBytes) | |
300 | - | let $ | |
301 | - | let pmtAmountA = $ | |
302 | - | let pmtAssetIdA = $ | |
303 | - | let $ | |
304 | - | let pmtAmountB = $ | |
305 | - | let pmtAssetIdB = $ | |
306 | + | let $t095649642 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
307 | + | let pmtAmountA = $t095649642._1 | |
308 | + | let pmtAssetIdA = $t095649642._2 | |
309 | + | let $t096479725 = $Tuple2(pAmounts[1], parsePaymentAsset(pAssetIds[1])) | |
310 | + | let pmtAmountB = $t096479725._1 | |
311 | + | let pmtAssetIdB = $t096479725._2 | |
306 | 312 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
307 | 313 | then throw("Only admin can call this function") | |
308 | 314 | else if ((size(args) != 1)) | |
312 | 318 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
313 | 319 | then throw("Assets must be different") | |
314 | 320 | else { | |
315 | - | let $ | |
316 | - | let pmtStrAssetIdA = $ | |
317 | - | let pmtAssetNameA = $ | |
318 | - | let pmtDecimalsA = $ | |
319 | - | let $ | |
320 | - | let pmtStrAssetIdB = $ | |
321 | - | let pmtAssetNameB = $ | |
322 | - | let pmtDecimalsB = $ | |
321 | + | let $t01016010237 = getAssetInfo(pmtAssetIdA) | |
322 | + | let pmtStrAssetIdA = $t01016010237._1 | |
323 | + | let pmtAssetNameA = $t01016010237._2 | |
324 | + | let pmtDecimalsA = $t01016010237._3 | |
325 | + | let $t01024610323 = getAssetInfo(pmtAssetIdB) | |
326 | + | let pmtStrAssetIdB = $t01024610323._1 | |
327 | + | let pmtAssetNameB = $t01024610323._2 | |
328 | + | let pmtDecimalsB = $t01024610323._3 | |
323 | 329 | let firstHarvest = (args[0] == "true") | |
324 | 330 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
325 | 331 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
356 | 362 | @Callable(i) | |
357 | 363 | func initWithInitRatio (callerBytes,args,pAmounts,pAssetIds) = { | |
358 | 364 | let caller = Address(callerBytes) | |
359 | - | let $ | |
360 | - | let amtAssetA = $ | |
361 | - | let amtAssetB = $ | |
362 | - | let assetIdAStr = $ | |
363 | - | let assetIdBStr = $ | |
364 | - | let firstHarvest = $ | |
365 | + | let $t01254412744 = $Tuple5(parseIntValue(args[0]), parseIntValue(args[1]), args[2], args[3], (args[4] == "true")) | |
366 | + | let amtAssetA = $t01254412744._1 | |
367 | + | let amtAssetB = $t01254412744._2 | |
368 | + | let assetIdAStr = $t01254412744._3 | |
369 | + | let assetIdBStr = $t01254412744._4 | |
370 | + | let firstHarvest = $t01254412744._5 | |
365 | 371 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
366 | 372 | then throw("Only admin can call this function") | |
367 | 373 | else if ((size(args) != 5)) | |
371 | 377 | else if ((assetIdAStr == assetIdBStr)) | |
372 | 378 | then throw("Assets must be different") | |
373 | 379 | else { | |
374 | - | let $ | |
375 | - | let pmtStrAssetIdA = $ | |
376 | - | let pmtAssetNameA = $ | |
377 | - | let pmtDecimalsA = $ | |
378 | - | let $ | |
379 | - | let pmtStrAssetIdB = $ | |
380 | - | let pmtAssetNameB = $ | |
381 | - | let pmtDecimalsB = $ | |
380 | + | let $t01317913256 = getAssetInfo(assetIdAStr) | |
381 | + | let pmtStrAssetIdA = $t01317913256._1 | |
382 | + | let pmtAssetNameA = $t01317913256._2 | |
383 | + | let pmtDecimalsA = $t01317913256._3 | |
384 | + | let $t01326513342 = getAssetInfo(assetIdBStr) | |
385 | + | let pmtStrAssetIdB = $t01326513342._1 | |
386 | + | let pmtAssetNameB = $t01326513342._2 | |
387 | + | let pmtDecimalsB = $t01326513342._3 | |
382 | 388 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
383 | 389 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
384 | 390 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
409 | 415 | @Callable(i) | |
410 | 416 | func exchange (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
411 | 417 | let caller = Address(callerBytes) | |
412 | - | let $ | |
413 | - | let pmtAmount = $ | |
414 | - | let pmtAssetId = $ | |
418 | + | let $t01576815844 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
419 | + | let pmtAmount = $t01576815844._1 | |
420 | + | let pmtAssetId = $t01576815844._2 | |
415 | 421 | let minAmountToReceive = parseIntValue(args[0]) | |
416 | - | let $ | |
417 | - | let strAssetIdA = $ | |
418 | - | let strAssetIdB = $ | |
419 | - | let assetIdA = $ | |
420 | - | let assetIdB = $ | |
421 | - | let $ | |
422 | - | let balanceA = $ | |
423 | - | let balanceB = $ | |
424 | - | let accountBalanceA = $ | |
425 | - | let accountBalanceB = $ | |
422 | + | let $t01590915985 = getPoolAssets(i.caller) | |
423 | + | let strAssetIdA = $t01590915985._1 | |
424 | + | let strAssetIdB = $t01590915985._2 | |
425 | + | let assetIdA = $t01590915985._3 | |
426 | + | let assetIdB = $t01590915985._4 | |
427 | + | let $t01599416100 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
428 | + | let balanceA = $t01599416100._1 | |
429 | + | let balanceB = $t01599416100._2 | |
430 | + | let accountBalanceA = $t01599416100._3 | |
431 | + | let accountBalanceB = $t01599416100._4 | |
426 | 432 | if ((size(args) != 1)) | |
427 | 433 | then throw("Wrong args size") | |
428 | 434 | else if (if ((balanceA == 0)) | |
440 | 446 | else (balanceB > accountBalanceB)) | |
441 | 447 | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
442 | 448 | else { | |
443 | - | let $t01672716785 = getFeeParams(i.caller, i.originCaller) | |
444 | - | let fee = $t01672716785._1 | |
445 | - | let govFee = $t01672716785._2 | |
446 | - | let $t01679817119 = if ((pmtAssetId == assetIdA)) | |
447 | - | then calculateFees(pmtAmount, minAmountToReceive, balanceA, balanceB, fee, govFee) | |
448 | - | else calculateFees(pmtAmount, minAmountToReceive, balanceB, balanceA, fee, govFee) | |
449 | - | let amountWithoutFee = $t01679817119._1 | |
450 | - | let amountWithFee = $t01679817119._2 | |
451 | - | let governanceReward = $t01679817119._3 | |
452 | - | let $t01713317442 = if ((pmtAssetId == assetIdA)) | |
453 | - | then $Tuple3((balanceA + pmtAmount), ((balanceB - amountWithFee) - governanceReward), assetIdB) | |
454 | - | else $Tuple3(((balanceA - amountWithFee) - governanceReward), (balanceB + pmtAmount), assetIdA) | |
455 | - | let newBalanceA = $t01713317442._1 | |
456 | - | let newBalanceB = $t01713317442._2 | |
457 | - | let assetIdSend = $t01713317442._3 | |
458 | - | let $t01745617690 = if ((pmtAssetId == assetIdA)) | |
459 | - | then $Tuple2(pmtAmount, (amountWithFee + governanceReward)) | |
460 | - | else $Tuple2((amountWithFee + governanceReward), pmtAmount) | |
461 | - | let stakeAmountA = $t01745617690._1 | |
462 | - | let stakeAmountB = $t01745617690._2 | |
449 | + | let $t01700017067 = getFeeParams(i.caller, i.originCaller) | |
450 | + | let fee = $t01700017067._1 | |
451 | + | let govFee = $t01700017067._2 | |
452 | + | let teamFee = $t01700017067._3 | |
453 | + | let $t01708017431 = if ((pmtAssetId == assetIdA)) | |
454 | + | then calculateFees(pmtAmount, minAmountToReceive, balanceA, balanceB, fee, govFee, teamFee) | |
455 | + | else calculateFees(pmtAmount, minAmountToReceive, balanceB, balanceA, fee, govFee, teamFee) | |
456 | + | let amountWithoutFee = $t01708017431._1 | |
457 | + | let amountWithFee = $t01708017431._2 | |
458 | + | let governanceReward = $t01708017431._3 | |
459 | + | let teamReward = $t01708017431._4 | |
460 | + | let $t01744517780 = if ((pmtAssetId == assetIdA)) | |
461 | + | then $Tuple3((balanceA + pmtAmount), (((balanceB - amountWithFee) - governanceReward) - teamReward), assetIdB) | |
462 | + | else $Tuple3((((balanceA - amountWithFee) - governanceReward) - teamReward), (balanceB + pmtAmount), assetIdA) | |
463 | + | let newBalanceA = $t01744517780._1 | |
464 | + | let newBalanceB = $t01744517780._2 | |
465 | + | let assetIdSend = $t01744517780._3 | |
466 | + | let $t01779418054 = if ((pmtAssetId == assetIdA)) | |
467 | + | then $Tuple2(pmtAmount, ((amountWithFee + governanceReward) + teamReward)) | |
468 | + | else $Tuple2(((amountWithFee + governanceReward) + teamReward), pmtAmount) | |
469 | + | let stakeAmountA = $t01779418054._1 | |
470 | + | let stakeAmountB = $t01779418054._2 | |
463 | 471 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
464 | 472 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdA), stakeAmountA, strAssetIdA], nil) | |
465 | 473 | else 0 | |
469 | 477 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdB), stakeAmountB, strAssetIdB], nil) | |
470 | 478 | else 0 | |
471 | 479 | if ((stake2 == stake2)) | |
472 | - | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), ScriptTransfer(caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, governanceReward, assetIdSend)], [amountWithFee, assetIdSend])) | |
480 | + | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), ScriptTransfer(caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, governanceReward, assetIdSend), ScriptTransfer(teamBoxAddress, teamReward, assetIdSend)], [amountWithFee, assetIdSend])) | |
473 | 481 | else throw("Strict value is not equal to itself.") | |
474 | 482 | } | |
475 | 483 | else throw("Strict value is not equal to itself.") | |
485 | 493 | let pmtAssetIdB = parsePaymentAsset(pAssetIds[1]) | |
486 | 494 | let stakeFarming = (args[0] == "true") | |
487 | 495 | let lockType = parseIntValue(args[1]) | |
488 | - | let $ | |
489 | - | let strAssetIdA = $ | |
490 | - | let strAssetIdB = $ | |
491 | - | let assetIdA = $ | |
492 | - | let assetIdB = $ | |
493 | - | let shareAssetId = $ | |
494 | - | let $ | |
495 | - | let balanceA = $ | |
496 | - | let balanceB = $ | |
497 | - | let accountBalanceA = $ | |
498 | - | let accountBalanceB = $ | |
499 | - | let shareAssetSupply = $ | |
496 | + | let $t01936919459 = getPoolAssets(i.caller) | |
497 | + | let strAssetIdA = $t01936919459._1 | |
498 | + | let strAssetIdB = $t01936919459._2 | |
499 | + | let assetIdA = $t01936919459._3 | |
500 | + | let assetIdB = $t01936919459._4 | |
501 | + | let shareAssetId = $t01936919459._5 | |
502 | + | let $t01946819592 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
503 | + | let balanceA = $t01946819592._1 | |
504 | + | let balanceB = $t01946819592._2 | |
505 | + | let accountBalanceA = $t01946819592._3 | |
506 | + | let accountBalanceB = $t01946819592._4 | |
507 | + | let shareAssetSupply = $t01946819592._5 | |
500 | 508 | if ((size(args) != 2)) | |
501 | 509 | then throw("Wrong args size") | |
502 | 510 | else if (if ((size(pAmounts) != 2)) | |
516 | 524 | else pAssetIds[2], pAmounts[2])] | |
517 | 525 | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
518 | 526 | else { | |
519 | - | let $ | |
520 | - | let pmtStrAssetIdA = $ | |
521 | - | let pmtAssetNameA = $ | |
522 | - | let pmtDecimalsA = $ | |
523 | - | let $ | |
524 | - | let pmtStrAssetIdB = $ | |
525 | - | let pmtAssetNameB = $ | |
526 | - | let pmtDecimalsB = $ | |
527 | + | let $t02052520602 = getAssetInfo(pmtAssetIdA) | |
528 | + | let pmtStrAssetIdA = $t02052520602._1 | |
529 | + | let pmtAssetNameA = $t02052520602._2 | |
530 | + | let pmtDecimalsA = $t02052520602._3 | |
531 | + | let $t02061520692 = getAssetInfo(pmtAssetIdB) | |
532 | + | let pmtStrAssetIdB = $t02061520692._1 | |
533 | + | let pmtAssetNameB = $t02061520692._2 | |
534 | + | let pmtDecimalsB = $t02061520692._3 | |
527 | 535 | let initial = ((balanceA + balanceB) == 0) | |
528 | - | let $ | |
536 | + | let $t02075921615 = if (initial) | |
529 | 537 | then $Tuple5(pAmounts[0], pAmounts[1], 0, pmtAssetIdA, toBigInt(1)) | |
530 | 538 | else { | |
531 | 539 | let ratioShareTokensInA = fraction(scale16, toBigInt(pAmounts[0]), toBigInt(balanceA)) | |
540 | 548 | $Tuple5(pmt, pAmounts[1], (pAmounts[0] - pmt), pmtAssetIdA, ratioShareTokensInB) | |
541 | 549 | } | |
542 | 550 | } | |
543 | - | let pmtAmountA = $ | |
544 | - | let pmtAmountB = $ | |
545 | - | let change = $ | |
546 | - | let changeAssetId = $ | |
547 | - | let shareTokenRatio = $ | |
551 | + | let pmtAmountA = $t02075921615._1 | |
552 | + | let pmtAmountB = $t02075921615._2 | |
553 | + | let change = $t02075921615._3 | |
554 | + | let changeAssetId = $t02075921615._4 | |
555 | + | let shareTokenRatio = $t02075921615._5 | |
548 | 556 | let shareTokenToPayAmount = if (initial) | |
549 | 557 | then { | |
550 | 558 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
603 | 611 | let virtGetMinAmount = parseIntValue(args[0]) | |
604 | 612 | let stakeFarming = (args[1] == "true") | |
605 | 613 | let lockType = parseIntValue(args[2]) | |
606 | - | let $ | |
607 | - | let strAssetIdA = $ | |
608 | - | let strAssetIdB = $ | |
609 | - | let assetIdA = $ | |
610 | - | let assetIdB = $ | |
611 | - | let shareAssetId = $ | |
612 | - | let $ | |
613 | - | let balanceA = $ | |
614 | - | let balanceB = $ | |
615 | - | let accountBalanceA = $ | |
616 | - | let accountBalanceB = $ | |
617 | - | let shareAssetSupply = $ | |
614 | + | let $t02437024460 = getPoolAssets(i.caller) | |
615 | + | let strAssetIdA = $t02437024460._1 | |
616 | + | let strAssetIdB = $t02437024460._2 | |
617 | + | let assetIdA = $t02437024460._3 | |
618 | + | let assetIdB = $t02437024460._4 | |
619 | + | let shareAssetId = $t02437024460._5 | |
620 | + | let $t02446524589 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
621 | + | let balanceA = $t02446524589._1 | |
622 | + | let balanceB = $t02446524589._2 | |
623 | + | let accountBalanceA = $t02446524589._3 | |
624 | + | let accountBalanceB = $t02446524589._4 | |
625 | + | let shareAssetSupply = $t02446524589._5 | |
618 | 626 | let initial = ((balanceA + balanceB) == 0) | |
619 | 627 | if ((size(args) != 3)) | |
620 | 628 | then throw("Wrong args size") | |
637 | 645 | else pAssetIds[2], pAmounts[2])] | |
638 | 646 | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
639 | 647 | else { | |
640 | - | let $t02506425122 = getFeeParams(i.caller, i.originCaller) | |
641 | - | let fee = $t02506425122._1 | |
642 | - | let govFee = $t02506425122._2 | |
643 | - | let $t02513127293 = if ((pmtAssetId == assetIdA)) | |
648 | + | let $t02550125568 = getFeeParams(i.caller, i.originCaller) | |
649 | + | let fee = $t02550125568._1 | |
650 | + | let govFee = $t02550125568._2 | |
651 | + | let teamFee = $t02550125568._3 | |
652 | + | let $t02557727845 = if ((pmtAssetId == assetIdA)) | |
644 | 653 | then { | |
645 | 654 | let virtPayAmount = calculateVirtPay(pmtAmount, balanceA, fee) | |
646 | - | let $t02538625523 = calculateFees(virtPayAmount, virtGetMinAmount, balanceA, balanceB, fee, govFee) | |
647 | - | let amountWithoutFee = $t02538625523._1 | |
648 | - | let amountWithFee = $t02538625523._2 | |
649 | - | let governanceReward = $t02538625523._3 | |
655 | + | let $t02584425999 = calculateFees(virtPayAmount, virtGetMinAmount, balanceA, balanceB, fee, govFee, teamFee) | |
656 | + | let amountWithoutFee = $t02584425999._1 | |
657 | + | let amountWithFee = $t02584425999._2 | |
658 | + | let governanceReward = $t02584425999._3 | |
659 | + | let tReward = $t02584425999._4 | |
650 | 660 | let balanceAVirt = (balanceA + virtPayAmount) | |
651 | - | let balanceBVirt = ((balanceB + amountWithoutFee) - governanceReward) | |
661 | + | let balanceBVirt = (((balanceB + amountWithoutFee) - governanceReward) - tReward) | |
652 | 662 | let newBalanceA = (balanceA + pmtAmount) | |
653 | - | let newBalanceB = (balanceB - governanceReward) | |
663 | + | let newBalanceB = ((balanceB - governanceReward) - tReward) | |
654 | 664 | let ratioShareTokensInA = fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balanceAVirt)) | |
655 | 665 | let ratioShareTokensInB = fraction(toBigInt(amountWithFee), scale16, toBigInt(balanceBVirt)) | |
656 | 666 | let shareTokenToPayAmount = toInt(fraction(min([ratioShareTokensInA, ratioShareTokensInB]), toBigInt(shareAssetSupply), scale16)) | |
657 | - | $ | |
667 | + | $Tuple8(newBalanceA, newBalanceB, shareTokenToPayAmount, governanceReward, tReward, assetIdB, strAssetIdB, strAssetIdA) | |
658 | 668 | } | |
659 | 669 | else { | |
660 | 670 | let virtPayAmount = calculateVirtPay(pmtAmount, balanceB, fee) | |
661 | - | let $t02639626533 = calculateFees(virtPayAmount, virtGetMinAmount, balanceB, balanceA, fee, govFee) | |
662 | - | let amountWithoutFee = $t02639626533._1 | |
663 | - | let amountWithFee = $t02639626533._2 | |
664 | - | let governanceReward = $t02639626533._3 | |
665 | - | let balanceAVirt = ((balanceA + amountWithoutFee) - governanceReward) | |
671 | + | let $t02690127056 = calculateFees(virtPayAmount, virtGetMinAmount, balanceB, balanceA, fee, govFee, teamFee) | |
672 | + | let amountWithoutFee = $t02690127056._1 | |
673 | + | let amountWithFee = $t02690127056._2 | |
674 | + | let governanceReward = $t02690127056._3 | |
675 | + | let tReward = $t02690127056._4 | |
676 | + | let balanceAVirt = (((balanceA + amountWithoutFee) - governanceReward) - tReward) | |
666 | 677 | let balanceBVirt = (balanceB + virtPayAmount) | |
667 | - | let newBalanceA = (balanceA - governanceReward) | |
678 | + | let newBalanceA = ((balanceA - governanceReward) - tReward) | |
668 | 679 | let newBalanceB = (balanceB + pmtAmount) | |
669 | 680 | let ratioShareTokensInA = fraction(toBigInt(amountWithFee), scale16, toBigInt(balanceAVirt)) | |
670 | 681 | let ratioShareTokensInB = fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balanceBVirt)) | |
671 | 682 | let shareTokenToPayAmount = toInt(fraction(min([ratioShareTokensInA, ratioShareTokensInB]), toBigInt(shareAssetSupply), scale16)) | |
672 | - | $ | |
683 | + | $Tuple8(newBalanceA, newBalanceB, shareTokenToPayAmount, governanceReward, tReward, assetIdA, strAssetIdA, strAssetIdB) | |
673 | 684 | } | |
674 | - | let newBalanceA = $t02513127293._1 | |
675 | - | let newBalanceB = $t02513127293._2 | |
676 | - | let shareTokenToPayAmount = $t02513127293._3 | |
677 | - | let govReward = $t02513127293._4 | |
678 | - | let govRewardAsset = $t02513127293._5 | |
679 | - | let govRewardAssetStr = $t02513127293._6 | |
680 | - | let pmtAssetIdStr = $t02513127293._7 | |
685 | + | let newBalanceA = $t02557727845._1 | |
686 | + | let newBalanceB = $t02557727845._2 | |
687 | + | let shareTokenToPayAmount = $t02557727845._3 | |
688 | + | let govReward = $t02557727845._4 | |
689 | + | let teamReward = $t02557727845._5 | |
690 | + | let govRewardAsset = $t02557727845._6 | |
691 | + | let govRewardAssetStr = $t02557727845._7 | |
692 | + | let pmtAssetIdStr = $t02557727845._8 | |
681 | 693 | if ((shareTokenToPayAmount == 0)) | |
682 | 694 | then throw("Too small amount to replenish") | |
683 | 695 | else { | |
687 | 699 | if ((stake1 == stake1)) | |
688 | 700 | then { | |
689 | 701 | let stake2 = if (contains(stakingAssets, govRewardAssetStr)) | |
690 | - | then invoke(i.caller, "stakeUnstake", [false, govReward, govRewardAssetStr], nil) | |
702 | + | then invoke(i.caller, "stakeUnstake", [false, (govReward + teamReward), govRewardAssetStr], nil) | |
691 | 703 | else 0 | |
692 | 704 | if ((stake2 == stake2)) | |
693 | 705 | then { | |
709 | 721 | else throw("Strict value is not equal to itself.") | |
710 | 722 | } | |
711 | 723 | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(caller, shareTokenToPayAmount, shareAssetId)] | |
712 | - | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(moneyBoxAddress, govReward, govRewardAsset)] ++ shareTokenST), nil)) | |
724 | + | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(moneyBoxAddress, govReward, govRewardAsset), ScriptTransfer(teamBoxAddress, teamReward, govRewardAsset)] ++ shareTokenST), nil)) | |
713 | 725 | } | |
714 | 726 | else throw("Strict value is not equal to itself.") | |
715 | 727 | } | |
724 | 736 | func withdraw (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
725 | 737 | let time = lastBlock.timestamp | |
726 | 738 | let caller = Address(callerBytes) | |
727 | - | let $ | |
728 | - | let strAssetIdA = $ | |
729 | - | let strAssetIdB = $ | |
730 | - | let assetIdA = $ | |
731 | - | let assetIdB = $ | |
732 | - | let shareAssetId = $ | |
733 | - | let $ | |
734 | - | let balanceA = $ | |
735 | - | let balanceB = $ | |
736 | - | let accountBalanceA = $ | |
737 | - | let accountBalanceB = $ | |
738 | - | let shareAssetSupply = $ | |
739 | - | let $ | |
739 | + | let $t02985329943 = getPoolAssets(i.caller) | |
740 | + | let strAssetIdA = $t02985329943._1 | |
741 | + | let strAssetIdB = $t02985329943._2 | |
742 | + | let assetIdA = $t02985329943._3 | |
743 | + | let assetIdB = $t02985329943._4 | |
744 | + | let shareAssetId = $t02985329943._5 | |
745 | + | let $t02995230076 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
746 | + | let balanceA = $t02995230076._1 | |
747 | + | let balanceB = $t02995230076._2 | |
748 | + | let accountBalanceA = $t02995230076._3 | |
749 | + | let accountBalanceB = $t02995230076._4 | |
750 | + | let shareAssetSupply = $t02995230076._5 | |
751 | + | let $t03008530465 = if ((size(pAmounts) == 1)) | |
740 | 752 | then { | |
741 | 753 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
742 | 754 | if ((pAsset != shareAssetId)) | |
744 | 756 | else $Tuple2(pAmounts[0], pAsset) | |
745 | 757 | } | |
746 | 758 | else $Tuple2(0, shareAssetId) | |
747 | - | let pmtAmount = $ | |
748 | - | let pmtAssetId = $ | |
759 | + | let pmtAmount = $t03008530465._1 | |
760 | + | let pmtAssetId = $t03008530465._2 | |
749 | 761 | if ((size(args) != 1)) | |
750 | 762 | then throw("Wrong args size") | |
751 | 763 | else if ((size(pAmounts) > 1)) | |
790 | 802 | let withdrawAsset = if ((args[0] == "")) | |
791 | 803 | then unit | |
792 | 804 | else fromBase58String(args[0]) | |
793 | - | let $ | |
794 | - | let strAssetIdA = $ | |
795 | - | let strAssetIdB = $ | |
796 | - | let assetIdA = $ | |
797 | - | let assetIdB = $ | |
798 | - | let shareAssetId = $ | |
799 | - | let $ | |
800 | - | let balanceA = $ | |
801 | - | let balanceB = $ | |
802 | - | let accountBalanceA = $ | |
803 | - | let accountBalanceB = $ | |
804 | - | let shareAssetSupply = $ | |
805 | - | let $ | |
805 | + | let $t03268332773 = getPoolAssets(i.caller) | |
806 | + | let strAssetIdA = $t03268332773._1 | |
807 | + | let strAssetIdB = $t03268332773._2 | |
808 | + | let assetIdA = $t03268332773._3 | |
809 | + | let assetIdB = $t03268332773._4 | |
810 | + | let shareAssetId = $t03268332773._5 | |
811 | + | let $t03278232906 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
812 | + | let balanceA = $t03278232906._1 | |
813 | + | let balanceB = $t03278232906._2 | |
814 | + | let accountBalanceA = $t03278232906._3 | |
815 | + | let accountBalanceB = $t03278232906._4 | |
816 | + | let shareAssetSupply = $t03278232906._5 | |
817 | + | let $t03291533267 = if ((size(pAmounts) == 1)) | |
806 | 818 | then { | |
807 | 819 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
808 | 820 | if ((pAsset != shareAssetId)) | |
810 | 822 | else $Tuple2(pAmounts[0], pAsset) | |
811 | 823 | } | |
812 | 824 | else $Tuple2(0, shareAssetId) | |
813 | - | let pmtAmount = $ | |
814 | - | let pmtAssetId = $ | |
825 | + | let pmtAmount = $t03291533267._1 | |
826 | + | let pmtAssetId = $t03291533267._2 | |
815 | 827 | let virtMinToRecive = parseIntValue(args[1]) | |
816 | 828 | if ((size(args) != 3)) | |
817 | 829 | then throw("Wrong args size") | |
835 | 847 | let withdrawAmount = (pmtAmount + unlockAmount) | |
836 | 848 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
837 | 849 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
838 | - | let $t03388933947 = getFeeParams(i.caller, i.originCaller) | |
839 | - | let fee = $t03388933947._1 | |
840 | - | let govFee = $t03388933947._2 | |
841 | - | let $t03396034344 = if ((withdrawAsset == assetIdA)) | |
842 | - | then calculateFees(amountToPayB, virtMinToRecive, (balanceB - amountToPayB), (balanceA - amountToPayA), fee, govFee) | |
843 | - | else calculateFees(amountToPayA, virtMinToRecive, (balanceA - amountToPayA), (balanceB - amountToPayB), fee, govFee) | |
844 | - | let amountWithoutFee = $t03396034344._1 | |
845 | - | let amountWithFee = $t03396034344._2 | |
846 | - | let governanceReward = $t03396034344._3 | |
847 | - | let $t03435735615 = if ((withdrawAsset == assetIdA)) | |
850 | + | let $t03453434601 = getFeeParams(i.caller, i.originCaller) | |
851 | + | let fee = $t03453434601._1 | |
852 | + | let govFee = $t03453434601._2 | |
853 | + | let teamFee = $t03453434601._3 | |
854 | + | let $t03461435028 = if ((withdrawAsset == assetIdA)) | |
855 | + | then calculateFees(amountToPayB, virtMinToRecive, (balanceB - amountToPayB), (balanceA - amountToPayA), fee, govFee, teamFee) | |
856 | + | else calculateFees(amountToPayA, virtMinToRecive, (balanceA - amountToPayA), (balanceB - amountToPayB), fee, govFee, teamFee) | |
857 | + | let amountWithoutFee = $t03461435028._1 | |
858 | + | let amountWithFee = $t03461435028._2 | |
859 | + | let governanceReward = $t03461435028._3 | |
860 | + | let teamReward = $t03461435028._4 | |
861 | + | let $t03504136351 = if ((withdrawAsset == assetIdA)) | |
848 | 862 | then { | |
849 | 863 | let unstake = if (contains(stakingAssets, strAssetIdA)) | |
850 | - | then invoke(i.caller, "stakeUnstake", [false, ((amountToPayA + amountWithFee) + governanceReward), strAssetIdA], nil) | |
864 | + | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayA + amountWithFee) + governanceReward) + teamReward), strAssetIdA], nil) | |
851 | 865 | else 0 | |
852 | 866 | if ((unstake == unstake)) | |
853 | - | then $Tuple4((((balanceA - amountToPayA) - amountWithFee) - governanceReward), balanceB, assetIdA, [ScriptTransfer(caller, (amountToPayA + amountWithFee), assetIdA)]) | |
867 | + | then $Tuple4(((((balanceA - amountToPayA) - amountWithFee) - governanceReward) - teamReward), balanceB, assetIdA, [ScriptTransfer(caller, (amountToPayA + amountWithFee), assetIdA)]) | |
854 | 868 | else throw("Strict value is not equal to itself.") | |
855 | 869 | } | |
856 | 870 | else { | |
857 | 871 | let unstake = if (contains(stakingAssets, strAssetIdB)) | |
858 | - | then invoke(i.caller, "stakeUnstake", [false, ((amountToPayB + amountWithFee) + governanceReward), strAssetIdB], nil) | |
872 | + | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayB + amountWithFee) + governanceReward) + teamReward), strAssetIdB], nil) | |
859 | 873 | else 0 | |
860 | 874 | if ((unstake == unstake)) | |
861 | - | then $Tuple4(balanceA, (((balanceB - amountToPayB) - amountWithFee) - governanceReward), assetIdB, [ScriptTransfer(caller, (amountToPayB + amountWithFee), assetIdB)]) | |
875 | + | then $Tuple4(balanceA, ((((balanceB - amountToPayB) - amountWithFee) - governanceReward) - teamReward), assetIdB, [ScriptTransfer(caller, (amountToPayB + amountWithFee), assetIdB)]) | |
862 | 876 | else throw("Strict value is not equal to itself.") | |
863 | 877 | } | |
864 | - | let newBalanceA = $ | |
865 | - | let newBalanceB = $ | |
866 | - | let govRewardAssetId = $ | |
867 | - | let userTransfer = $ | |
868 | - | $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceReward, govRewardAssetId)] ++ userTransfer), nil)) | |
878 | + | let newBalanceA = $t03504136351._1 | |
879 | + | let newBalanceB = $t03504136351._2 | |
880 | + | let govRewardAssetId = $t03504136351._3 | |
881 | + | let userTransfer = $t03504136351._4 | |
882 | + | $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceReward, govRewardAssetId), ScriptTransfer(teamBoxAddress, teamReward, govRewardAssetId)] ++ userTransfer), nil)) | |
869 | 883 | } | |
870 | 884 | else throw("Strict value is not equal to itself.") | |
871 | 885 | } | |
875 | 889 | ||
876 | 890 | @Callable(i) | |
877 | 891 | func takeIntoAccountExtraFunds (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
878 | - | let $ | |
879 | - | let strAssetIdA = $ | |
880 | - | let strAssetIdB = $ | |
881 | - | let assetIdA = $ | |
882 | - | let assetIdB = $ | |
892 | + | let $t03711137187 = getPoolAssets(i.caller) | |
893 | + | let strAssetIdA = $t03711137187._1 | |
894 | + | let strAssetIdB = $t03711137187._2 | |
895 | + | let assetIdA = $t03711137187._3 | |
896 | + | let assetIdB = $t03711137187._4 | |
883 | 897 | let claim = if (if ((assetIdA == USDN)) | |
884 | 898 | then true | |
885 | 899 | else (assetIdB == USDN)) | |
887 | 901 | else 0 | |
888 | 902 | if ((claim == claim)) | |
889 | 903 | then { | |
890 | - | let $ | |
891 | - | let balanceA = $ | |
892 | - | let balanceB = $ | |
893 | - | let accountBalanceA = $ | |
894 | - | let accountBalanceB = $ | |
904 | + | let $t03734737453 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
905 | + | let balanceA = $t03734737453._1 | |
906 | + | let balanceB = $t03734737453._2 | |
907 | + | let accountBalanceA = $t03734737453._3 | |
908 | + | let accountBalanceB = $t03734737453._4 | |
895 | 909 | let amountEnrollA = (accountBalanceA - balanceA) | |
896 | 910 | let amountEnrollB = (accountBalanceB - balanceB) | |
897 | 911 | if ((size(args) != 0)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let kVersion = "version" | |
7 | 7 | ||
8 | 8 | let kActive = "active" | |
9 | 9 | ||
10 | 10 | let kDeprecated = "deprecated_" | |
11 | 11 | ||
12 | 12 | let kAssetIdA = "A_asset_id" | |
13 | 13 | ||
14 | 14 | let kAssetIdB = "B_asset_id" | |
15 | 15 | ||
16 | 16 | let kBalanceA = "A_asset_balance" | |
17 | 17 | ||
18 | 18 | let kBalanceB = "B_asset_balance" | |
19 | 19 | ||
20 | 20 | let kBalanceInitA = "A_asset_init" | |
21 | 21 | ||
22 | 22 | let kBalanceInitB = "B_asset_init" | |
23 | 23 | ||
24 | 24 | let kShareAssetId = "share_asset_id" | |
25 | 25 | ||
26 | 26 | let kShareAssetSupply = "share_asset_supply" | |
27 | 27 | ||
28 | 28 | let kFee = "commission" | |
29 | 29 | ||
30 | 30 | let kCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let kFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | 34 | let kFirstHarvestHeight = "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 kUSDNAddress = "staking_usdnnsbt_address" | |
45 | 45 | ||
46 | 46 | let kEURNAddress = "staking_eurn_address" | |
47 | 47 | ||
48 | 48 | let kLeasingAmount = "leasing_amount" | |
49 | 49 | ||
50 | 50 | let kUSDNAssetId = "usdn_asset_id" | |
51 | 51 | ||
52 | 52 | let kEURNAssetId = "eurn_asset_id" | |
53 | 53 | ||
54 | 54 | let kStakingAssets = "staking_assets" | |
55 | 55 | ||
56 | 56 | let kOracleActive = "active_all_contracts" | |
57 | 57 | ||
58 | 58 | let kDiscounts = "discounts" | |
59 | 59 | ||
60 | 60 | let kDiscountValues = "discount_values" | |
61 | 61 | ||
62 | 62 | let kUserGSwopInGov = "_GSwop_amount" | |
63 | 63 | ||
64 | 64 | let kUserSwopInGov = "_SWOP_amount" | |
65 | 65 | ||
66 | 66 | let kOraclePool = "pool_" | |
67 | 67 | ||
68 | 68 | let kAdminPubKey1 = "admin_pub_1" | |
69 | 69 | ||
70 | 70 | let kAdminPubKey2 = "admin_pub_2" | |
71 | 71 | ||
72 | 72 | let kAdminPubKey3 = "admin_pub_3" | |
73 | 73 | ||
74 | 74 | let kAdminInvokePubKey = "admin_invoke_pub" | |
75 | 75 | ||
76 | 76 | let kMoneyBoxAddress = "money_box_address" | |
77 | 77 | ||
78 | + | let kTeamBoxAddress = "team_box_address" | |
79 | + | ||
78 | 80 | let kVotingAddress = "voting_address" | |
79 | 81 | ||
80 | 82 | let kGovAddress = "governance_address" | |
81 | 83 | ||
82 | 84 | let kFarmingAddress = "farming_address" | |
83 | 85 | ||
84 | 86 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
85 | 87 | ||
86 | 88 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
87 | 89 | case string: String => | |
88 | 90 | fromBase58String(string) | |
89 | 91 | case nothing => | |
90 | 92 | throw((key + "is empty")) | |
91 | 93 | } | |
92 | 94 | ||
93 | 95 | ||
94 | 96 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
95 | 97 | ||
96 | 98 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
97 | 99 | ||
98 | 100 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
99 | 101 | ||
100 | 102 | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
101 | 103 | ||
102 | 104 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
105 | + | ||
106 | + | let teamBoxAddress = Address(getBase58FromOracle(kTeamBoxAddress)) | |
103 | 107 | ||
104 | 108 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
105 | 109 | ||
106 | 110 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
107 | 111 | ||
108 | 112 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
109 | 113 | ||
110 | 114 | let USDN = getBase58FromOracle(kUSDNAssetId) | |
111 | 115 | ||
112 | 116 | let EURN = getBase58FromOracle(kEURNAssetId) | |
113 | 117 | ||
114 | 118 | let stakingAssets = getStringValue(oracle, kStakingAssets) | |
115 | 119 | ||
116 | 120 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
117 | 121 | ||
118 | 122 | let stakingEURNAddress = Address(getBase58FromOracle(kEURNAddress)) | |
119 | 123 | ||
120 | 124 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
121 | 125 | ||
122 | 126 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
123 | 127 | ||
124 | 128 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
125 | 129 | ||
126 | 130 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
127 | 131 | ||
128 | 132 | let active = getBooleanValue(oracle, kOracleActive) | |
129 | 133 | ||
130 | 134 | let feeScale6 = 1000000 | |
131 | 135 | ||
132 | 136 | let scale8 = 100000000 | |
133 | 137 | ||
134 | 138 | let scale16 = toBigInt(10000000000000000) | |
135 | 139 | ||
136 | 140 | func accountBalance (assetId,pool) = match assetId { | |
137 | 141 | case id: ByteVector => | |
138 | 142 | assetBalance(pool, id) | |
139 | 143 | case waves: Unit => | |
140 | 144 | wavesBalance(pool).available | |
141 | 145 | case _ => | |
142 | 146 | throw("Match error") | |
143 | 147 | } | |
144 | 148 | ||
145 | 149 | ||
146 | 150 | func stakedAmount (assetId,pool) = { | |
147 | 151 | let stakedAmountCalculated = match assetId { | |
148 | 152 | case aId: ByteVector => | |
149 | 153 | if ((aId == USDN)) | |
150 | 154 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(pool))) | |
151 | 155 | else if ((aId == EURN)) | |
152 | 156 | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(pool))) | |
153 | 157 | else 0 | |
154 | 158 | case _: Unit => | |
155 | 159 | valueOrElse(getInteger(pool, kLeasingAmount), 0) | |
156 | 160 | case _ => | |
157 | 161 | throw("Match error") | |
158 | 162 | } | |
159 | 163 | match stakedAmountCalculated { | |
160 | 164 | case i: Int => | |
161 | 165 | i | |
162 | 166 | case _ => | |
163 | 167 | 0 | |
164 | 168 | } | |
165 | 169 | } | |
166 | 170 | ||
167 | 171 | ||
168 | 172 | func getAssetInfo (assetId) = match assetId { | |
169 | 173 | case id: String|ByteVector => | |
170 | - | let $ | |
174 | + | let $t040794251 = match id { | |
171 | 175 | case aId: ByteVector => | |
172 | 176 | $Tuple2(toBase58String(aId), aId) | |
173 | 177 | case aId: String => | |
174 | 178 | $Tuple2(aId, fromBase58String(aId)) | |
175 | 179 | case _ => | |
176 | 180 | throw("Match error") | |
177 | 181 | } | |
178 | - | let stringId = $ | |
179 | - | let bytesId = $ | |
182 | + | let stringId = $t040794251._1 | |
183 | + | let bytesId = $t040794251._2 | |
180 | 184 | let info = valueOrErrorMessage(assetInfo(bytesId), (("Asset " + stringId) + " doesn't exist")) | |
181 | 185 | $Tuple3(stringId, info.name, info.decimals) | |
182 | 186 | case waves: Unit => | |
183 | 187 | $Tuple3("WAVES", "WAVES", 8) | |
184 | 188 | case _ => | |
185 | 189 | throw("Match error") | |
186 | 190 | } | |
187 | 191 | ||
188 | 192 | ||
189 | 193 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
190 | 194 | ||
191 | 195 | ||
192 | 196 | func calculateFeeDiscount (userAddr) = { | |
193 | 197 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
194 | 198 | let gSwopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserGSwopInGov)), swopAmount) | |
195 | 199 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
196 | 200 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
197 | 201 | if (if ((gSwopAmount >= parseIntValue(discountValues[0]))) | |
198 | 202 | then (parseIntValue(discountValues[1]) > gSwopAmount) | |
199 | 203 | else false) | |
200 | 204 | then (feeScale6 - parseIntValue(discounts[0])) | |
201 | 205 | else if (if ((gSwopAmount >= parseIntValue(discountValues[1]))) | |
202 | 206 | then (parseIntValue(discountValues[2]) > gSwopAmount) | |
203 | 207 | else false) | |
204 | 208 | then (feeScale6 - parseIntValue(discounts[1])) | |
205 | 209 | else if (if ((gSwopAmount >= parseIntValue(discountValues[2]))) | |
206 | 210 | then (parseIntValue(discountValues[3]) > gSwopAmount) | |
207 | 211 | else false) | |
208 | 212 | then (feeScale6 - parseIntValue(discounts[2])) | |
209 | 213 | else if (if ((gSwopAmount >= parseIntValue(discountValues[3]))) | |
210 | 214 | then (parseIntValue(discountValues[4]) > gSwopAmount) | |
211 | 215 | else false) | |
212 | 216 | then (feeScale6 - parseIntValue(discounts[3])) | |
213 | 217 | else if ((gSwopAmount >= parseIntValue(discountValues[4]))) | |
214 | 218 | then (feeScale6 - parseIntValue(discounts[4])) | |
215 | 219 | else feeScale6 | |
216 | 220 | } | |
217 | 221 | ||
218 | 222 | ||
219 | - | func calculateFees (pmtAmount,minAmountToReceive,tokenFrom,tokenTo,fee, | |
223 | + | func calculateFees (pmtAmount,minAmountToReceive,tokenFrom,tokenTo,fee,feeGov,feeTeam) = { | |
220 | 224 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
221 | 225 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - fee), feeScale6) | |
222 | - | let governanceReward = fraction(amountWithoutFee, feeGovernance, feeScale6) | |
226 | + | let governanceReward = fraction(amountWithoutFee, feeGov, feeScale6) | |
227 | + | let teamReward = fraction(amountWithoutFee, feeTeam, feeScale6) | |
223 | 228 | if ((minAmountToReceive > amountWithFee)) | |
224 | 229 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
225 | - | else $ | |
230 | + | else $Tuple4(amountWithoutFee, amountWithFee, governanceReward, teamReward) | |
226 | 231 | } | |
227 | 232 | ||
228 | 233 | ||
229 | 234 | func calculateVirtPay (pmtAmount,balance,fee) = { | |
230 | 235 | let F = (feeScale6 - fee) | |
231 | - | let k = fraction(fee, | |
236 | + | let k = fraction(fee, 55, 100) | |
232 | 237 | let a = (scale8 + fraction((F * k), scale8, (feeScale6 * feeScale6))) | |
233 | 238 | let b = ((((balance + fraction(balance, F, feeScale6)) + fraction(pmtAmount, F, feeScale6)) - pmtAmount) - fraction(pmtAmount, (F * k), (feeScale6 * feeScale6))) | |
234 | 239 | let c = (-(toBigInt(balance)) * toBigInt(pmtAmount)) | |
235 | 240 | let D = ((toBigInt(b) * toBigInt(b)) - fraction((toBigInt(4) * c), toBigInt(a), toBigInt(scale8))) | |
236 | 241 | toInt(fraction((-(toBigInt(b)) + sqrtBigInt(D, 0, 0, DOWN)), toBigInt(scale8), toBigInt((2 * a)))) | |
237 | 242 | } | |
238 | 243 | ||
239 | 244 | ||
240 | 245 | func parsePaymentAsset (assetId) = if ((assetId == base58'')) | |
241 | 246 | then unit | |
242 | 247 | else assetId | |
243 | 248 | ||
244 | 249 | ||
245 | 250 | func suspendSuspicious (accountBalanceA,accountBalanceB,balanceA,balanceB,assetIdA,assetIdB) = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceA)) + " ") + assetIdA) + ", ") + toString(accountBalanceB)) + " ") + assetIdB) + ". State: ") + toString(balanceA)) + " ") + assetIdA) + ", ") + toString(balanceB)) + " ") + assetIdB)) | |
246 | 251 | ||
247 | 252 | ||
248 | 253 | func isActive () = if (active) | |
249 | 254 | then unit | |
250 | 255 | else throw("DApp is inactive at this moment") | |
251 | 256 | ||
252 | 257 | ||
253 | 258 | func isOraclePool (poolAddress) = if (isDefined(getString(oracle, (kOraclePool + poolAddress)))) | |
254 | 259 | then unit | |
255 | 260 | else throw("DApp is not registered pool") | |
256 | 261 | ||
257 | 262 | ||
258 | 263 | func isDepricated (poolAddress) = if (!(valueOrElse(getBoolean(oracle, (kDeprecated + poolAddress)), false))) | |
259 | 264 | then unit | |
260 | 265 | else throw("Pool is deprecated. Only withdraw action allowed.") | |
261 | 266 | ||
262 | 267 | ||
263 | 268 | func getPoolBalances (pool,assetIdA,assetIdB) = { | |
264 | 269 | let balanceA = getIntegerValue(pool, kBalanceA) | |
265 | 270 | let balanceB = getIntegerValue(pool, kBalanceB) | |
266 | 271 | let stakedAmountA = stakedAmount(assetIdA, pool) | |
267 | 272 | let stakedAmountB = stakedAmount(assetIdB, pool) | |
268 | 273 | let accountBalanceA = (accountBalance(assetIdA, pool) + stakedAmountA) | |
269 | 274 | let accountBalanceB = (accountBalance(assetIdB, pool) + stakedAmountB) | |
270 | 275 | let shareSupply = getIntegerValue(pool, kShareAssetSupply) | |
271 | 276 | $Tuple5(balanceA, balanceB, accountBalanceA, accountBalanceB, shareSupply) | |
272 | 277 | } | |
273 | 278 | ||
274 | 279 | ||
275 | 280 | func getPoolAssets (pool) = { | |
276 | 281 | let strAssetIdA = getStringValue(pool, kAssetIdA) | |
277 | 282 | let strAssetIdB = getStringValue(pool, kAssetIdB) | |
278 | 283 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
279 | 284 | then unit | |
280 | 285 | else fromBase58String(strAssetIdA) | |
281 | 286 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
282 | 287 | then unit | |
283 | 288 | else fromBase58String(strAssetIdB) | |
284 | 289 | let shareAssetId = fromBase58String(getStringValue(pool, kShareAssetId)) | |
285 | 290 | $Tuple5(strAssetIdA, strAssetIdB, assetIdA, assetIdB, shareAssetId) | |
286 | 291 | } | |
287 | 292 | ||
288 | 293 | ||
289 | 294 | func getFeeParams (pool,caller) = { | |
290 | 295 | let feeDiscount = calculateFeeDiscount(caller) | |
291 | 296 | let fee = fraction(getIntegerValue(pool, kFee), feeDiscount, feeScale6, CEILING) | |
292 | - | let govFee = fraction(fee, 40, 100) | |
293 | - | $Tuple2(fee, govFee) | |
297 | + | let govFee = fraction(fee, 35, 100) | |
298 | + | let teamFee = fraction(fee, 10, 100) | |
299 | + | $Tuple3(fee, govFee, teamFee) | |
294 | 300 | } | |
295 | 301 | ||
296 | 302 | ||
297 | 303 | @Callable(i) | |
298 | 304 | func init (callerBytes,args,pAmounts,pAssetIds) = { | |
299 | 305 | let caller = Address(callerBytes) | |
300 | - | let $ | |
301 | - | let pmtAmountA = $ | |
302 | - | let pmtAssetIdA = $ | |
303 | - | let $ | |
304 | - | let pmtAmountB = $ | |
305 | - | let pmtAssetIdB = $ | |
306 | + | let $t095649642 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
307 | + | let pmtAmountA = $t095649642._1 | |
308 | + | let pmtAssetIdA = $t095649642._2 | |
309 | + | let $t096479725 = $Tuple2(pAmounts[1], parsePaymentAsset(pAssetIds[1])) | |
310 | + | let pmtAmountB = $t096479725._1 | |
311 | + | let pmtAssetIdB = $t096479725._2 | |
306 | 312 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
307 | 313 | then throw("Only admin can call this function") | |
308 | 314 | else if ((size(args) != 1)) | |
309 | 315 | then throw("Wrong args size") | |
310 | 316 | else if (isDefined(getBoolean(caller, kActive))) | |
311 | 317 | then throw("DApp is already active") | |
312 | 318 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
313 | 319 | then throw("Assets must be different") | |
314 | 320 | else { | |
315 | - | let $ | |
316 | - | let pmtStrAssetIdA = $ | |
317 | - | let pmtAssetNameA = $ | |
318 | - | let pmtDecimalsA = $ | |
319 | - | let $ | |
320 | - | let pmtStrAssetIdB = $ | |
321 | - | let pmtAssetNameB = $ | |
322 | - | let pmtDecimalsB = $ | |
321 | + | let $t01016010237 = getAssetInfo(pmtAssetIdA) | |
322 | + | let pmtStrAssetIdA = $t01016010237._1 | |
323 | + | let pmtAssetNameA = $t01016010237._2 | |
324 | + | let pmtDecimalsA = $t01016010237._3 | |
325 | + | let $t01024610323 = getAssetInfo(pmtAssetIdB) | |
326 | + | let pmtStrAssetIdB = $t01024610323._1 | |
327 | + | let pmtAssetNameB = $t01024610323._2 | |
328 | + | let pmtDecimalsB = $t01024610323._3 | |
323 | 329 | let firstHarvest = (args[0] == "true") | |
324 | 330 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
325 | 331 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
326 | 332 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
327 | 333 | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
328 | 334 | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
329 | 335 | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
330 | 336 | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
331 | 337 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
332 | 338 | let shareIssueId = calculateAssetId(shareIssue) | |
333 | 339 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
334 | 340 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
335 | 341 | else 0 | |
336 | 342 | if ((stake1 == stake1)) | |
337 | 343 | then { | |
338 | 344 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
339 | 345 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
340 | 346 | else 0 | |
341 | 347 | if ((stake2 == stake2)) | |
342 | 348 | then { | |
343 | 349 | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_cpmm")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(caller, shareInitialSupply, shareIssueId)] | |
344 | 350 | if (firstHarvest) | |
345 | 351 | then $Tuple2(nil, $Tuple2((baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]), nil)) | |
346 | 352 | else $Tuple2(nil, $Tuple2(baseEntry, nil)) | |
347 | 353 | } | |
348 | 354 | else throw("Strict value is not equal to itself.") | |
349 | 355 | } | |
350 | 356 | else throw("Strict value is not equal to itself.") | |
351 | 357 | } | |
352 | 358 | } | |
353 | 359 | ||
354 | 360 | ||
355 | 361 | ||
356 | 362 | @Callable(i) | |
357 | 363 | func initWithInitRatio (callerBytes,args,pAmounts,pAssetIds) = { | |
358 | 364 | let caller = Address(callerBytes) | |
359 | - | let $ | |
360 | - | let amtAssetA = $ | |
361 | - | let amtAssetB = $ | |
362 | - | let assetIdAStr = $ | |
363 | - | let assetIdBStr = $ | |
364 | - | let firstHarvest = $ | |
365 | + | let $t01254412744 = $Tuple5(parseIntValue(args[0]), parseIntValue(args[1]), args[2], args[3], (args[4] == "true")) | |
366 | + | let amtAssetA = $t01254412744._1 | |
367 | + | let amtAssetB = $t01254412744._2 | |
368 | + | let assetIdAStr = $t01254412744._3 | |
369 | + | let assetIdBStr = $t01254412744._4 | |
370 | + | let firstHarvest = $t01254412744._5 | |
365 | 371 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
366 | 372 | then throw("Only admin can call this function") | |
367 | 373 | else if ((size(args) != 5)) | |
368 | 374 | then throw("Wrong args size") | |
369 | 375 | else if (isDefined(getBoolean(caller, kActive))) | |
370 | 376 | then throw("DApp is already active") | |
371 | 377 | else if ((assetIdAStr == assetIdBStr)) | |
372 | 378 | then throw("Assets must be different") | |
373 | 379 | else { | |
374 | - | let $ | |
375 | - | let pmtStrAssetIdA = $ | |
376 | - | let pmtAssetNameA = $ | |
377 | - | let pmtDecimalsA = $ | |
378 | - | let $ | |
379 | - | let pmtStrAssetIdB = $ | |
380 | - | let pmtAssetNameB = $ | |
381 | - | let pmtDecimalsB = $ | |
380 | + | let $t01317913256 = getAssetInfo(assetIdAStr) | |
381 | + | let pmtStrAssetIdA = $t01317913256._1 | |
382 | + | let pmtAssetNameA = $t01317913256._2 | |
383 | + | let pmtDecimalsA = $t01317913256._3 | |
384 | + | let $t01326513342 = getAssetInfo(assetIdBStr) | |
385 | + | let pmtStrAssetIdB = $t01326513342._1 | |
386 | + | let pmtAssetNameB = $t01326513342._2 | |
387 | + | let pmtDecimalsB = $t01326513342._3 | |
382 | 388 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
383 | 389 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
384 | 390 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
385 | 391 | let shareInitialSupply = 0 | |
386 | 392 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
387 | 393 | let shareIssueId = calculateAssetId(shareIssue) | |
388 | 394 | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceInitA, amtAssetA), IntegerEntry(kBalanceInitB, amtAssetB), IntegerEntry(kBalanceA, 0), IntegerEntry(kBalanceB, 0), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_cpmm")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply)] | |
389 | 395 | if (firstHarvest) | |
390 | 396 | then $Tuple2(nil, $Tuple2((baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]), nil)) | |
391 | 397 | else $Tuple2(nil, $Tuple2(baseEntry, nil)) | |
392 | 398 | } | |
393 | 399 | } | |
394 | 400 | ||
395 | 401 | ||
396 | 402 | ||
397 | 403 | @Callable(i) | |
398 | 404 | func keepLimitForFirstHarvest (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
399 | 405 | then throw("Only admin can call this function") | |
400 | 406 | else if ((size(args) != 1)) | |
401 | 407 | then throw("Wrong args size") | |
402 | 408 | else { | |
403 | 409 | let shareLimit = parseIntValue(args[0]) | |
404 | 410 | $Tuple2(nil, $Tuple2([IntegerEntry(kShareLimit, shareLimit)], nil)) | |
405 | 411 | })) | |
406 | 412 | ||
407 | 413 | ||
408 | 414 | ||
409 | 415 | @Callable(i) | |
410 | 416 | func exchange (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
411 | 417 | let caller = Address(callerBytes) | |
412 | - | let $ | |
413 | - | let pmtAmount = $ | |
414 | - | let pmtAssetId = $ | |
418 | + | let $t01576815844 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
419 | + | let pmtAmount = $t01576815844._1 | |
420 | + | let pmtAssetId = $t01576815844._2 | |
415 | 421 | let minAmountToReceive = parseIntValue(args[0]) | |
416 | - | let $ | |
417 | - | let strAssetIdA = $ | |
418 | - | let strAssetIdB = $ | |
419 | - | let assetIdA = $ | |
420 | - | let assetIdB = $ | |
421 | - | let $ | |
422 | - | let balanceA = $ | |
423 | - | let balanceB = $ | |
424 | - | let accountBalanceA = $ | |
425 | - | let accountBalanceB = $ | |
422 | + | let $t01590915985 = getPoolAssets(i.caller) | |
423 | + | let strAssetIdA = $t01590915985._1 | |
424 | + | let strAssetIdB = $t01590915985._2 | |
425 | + | let assetIdA = $t01590915985._3 | |
426 | + | let assetIdB = $t01590915985._4 | |
427 | + | let $t01599416100 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
428 | + | let balanceA = $t01599416100._1 | |
429 | + | let balanceB = $t01599416100._2 | |
430 | + | let accountBalanceA = $t01599416100._3 | |
431 | + | let accountBalanceB = $t01599416100._4 | |
426 | 432 | if ((size(args) != 1)) | |
427 | 433 | then throw("Wrong args size") | |
428 | 434 | else if (if ((balanceA == 0)) | |
429 | 435 | then true | |
430 | 436 | else (balanceB == 0)) | |
431 | 437 | then throw("Can't exchange with zero balance") | |
432 | 438 | else if ((0 >= minAmountToReceive)) | |
433 | 439 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
434 | 440 | else if ((size(pAmounts) != 1)) | |
435 | 441 | then throw("One attached payment expected") | |
436 | 442 | else if (!(containsElement([assetIdA, assetIdB], pmtAssetId))) | |
437 | 443 | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
438 | 444 | else if (if ((balanceA > accountBalanceA)) | |
439 | 445 | then true | |
440 | 446 | else (balanceB > accountBalanceB)) | |
441 | 447 | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
442 | 448 | else { | |
443 | - | let $t01672716785 = getFeeParams(i.caller, i.originCaller) | |
444 | - | let fee = $t01672716785._1 | |
445 | - | let govFee = $t01672716785._2 | |
446 | - | let $t01679817119 = if ((pmtAssetId == assetIdA)) | |
447 | - | then calculateFees(pmtAmount, minAmountToReceive, balanceA, balanceB, fee, govFee) | |
448 | - | else calculateFees(pmtAmount, minAmountToReceive, balanceB, balanceA, fee, govFee) | |
449 | - | let amountWithoutFee = $t01679817119._1 | |
450 | - | let amountWithFee = $t01679817119._2 | |
451 | - | let governanceReward = $t01679817119._3 | |
452 | - | let $t01713317442 = if ((pmtAssetId == assetIdA)) | |
453 | - | then $Tuple3((balanceA + pmtAmount), ((balanceB - amountWithFee) - governanceReward), assetIdB) | |
454 | - | else $Tuple3(((balanceA - amountWithFee) - governanceReward), (balanceB + pmtAmount), assetIdA) | |
455 | - | let newBalanceA = $t01713317442._1 | |
456 | - | let newBalanceB = $t01713317442._2 | |
457 | - | let assetIdSend = $t01713317442._3 | |
458 | - | let $t01745617690 = if ((pmtAssetId == assetIdA)) | |
459 | - | then $Tuple2(pmtAmount, (amountWithFee + governanceReward)) | |
460 | - | else $Tuple2((amountWithFee + governanceReward), pmtAmount) | |
461 | - | let stakeAmountA = $t01745617690._1 | |
462 | - | let stakeAmountB = $t01745617690._2 | |
449 | + | let $t01700017067 = getFeeParams(i.caller, i.originCaller) | |
450 | + | let fee = $t01700017067._1 | |
451 | + | let govFee = $t01700017067._2 | |
452 | + | let teamFee = $t01700017067._3 | |
453 | + | let $t01708017431 = if ((pmtAssetId == assetIdA)) | |
454 | + | then calculateFees(pmtAmount, minAmountToReceive, balanceA, balanceB, fee, govFee, teamFee) | |
455 | + | else calculateFees(pmtAmount, minAmountToReceive, balanceB, balanceA, fee, govFee, teamFee) | |
456 | + | let amountWithoutFee = $t01708017431._1 | |
457 | + | let amountWithFee = $t01708017431._2 | |
458 | + | let governanceReward = $t01708017431._3 | |
459 | + | let teamReward = $t01708017431._4 | |
460 | + | let $t01744517780 = if ((pmtAssetId == assetIdA)) | |
461 | + | then $Tuple3((balanceA + pmtAmount), (((balanceB - amountWithFee) - governanceReward) - teamReward), assetIdB) | |
462 | + | else $Tuple3((((balanceA - amountWithFee) - governanceReward) - teamReward), (balanceB + pmtAmount), assetIdA) | |
463 | + | let newBalanceA = $t01744517780._1 | |
464 | + | let newBalanceB = $t01744517780._2 | |
465 | + | let assetIdSend = $t01744517780._3 | |
466 | + | let $t01779418054 = if ((pmtAssetId == assetIdA)) | |
467 | + | then $Tuple2(pmtAmount, ((amountWithFee + governanceReward) + teamReward)) | |
468 | + | else $Tuple2(((amountWithFee + governanceReward) + teamReward), pmtAmount) | |
469 | + | let stakeAmountA = $t01779418054._1 | |
470 | + | let stakeAmountB = $t01779418054._2 | |
463 | 471 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
464 | 472 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdA), stakeAmountA, strAssetIdA], nil) | |
465 | 473 | else 0 | |
466 | 474 | if ((stake1 == stake1)) | |
467 | 475 | then { | |
468 | 476 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
469 | 477 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdB), stakeAmountB, strAssetIdB], nil) | |
470 | 478 | else 0 | |
471 | 479 | if ((stake2 == stake2)) | |
472 | - | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), ScriptTransfer(caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, governanceReward, assetIdSend)], [amountWithFee, assetIdSend])) | |
480 | + | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), ScriptTransfer(caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, governanceReward, assetIdSend), ScriptTransfer(teamBoxAddress, teamReward, assetIdSend)], [amountWithFee, assetIdSend])) | |
473 | 481 | else throw("Strict value is not equal to itself.") | |
474 | 482 | } | |
475 | 483 | else throw("Strict value is not equal to itself.") | |
476 | 484 | } | |
477 | 485 | }))) | |
478 | 486 | ||
479 | 487 | ||
480 | 488 | ||
481 | 489 | @Callable(i) | |
482 | 490 | func replenishWithTwoTokens (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
483 | 491 | let caller = Address(callerBytes) | |
484 | 492 | let pmtAssetIdA = parsePaymentAsset(pAssetIds[0]) | |
485 | 493 | let pmtAssetIdB = parsePaymentAsset(pAssetIds[1]) | |
486 | 494 | let stakeFarming = (args[0] == "true") | |
487 | 495 | let lockType = parseIntValue(args[1]) | |
488 | - | let $ | |
489 | - | let strAssetIdA = $ | |
490 | - | let strAssetIdB = $ | |
491 | - | let assetIdA = $ | |
492 | - | let assetIdB = $ | |
493 | - | let shareAssetId = $ | |
494 | - | let $ | |
495 | - | let balanceA = $ | |
496 | - | let balanceB = $ | |
497 | - | let accountBalanceA = $ | |
498 | - | let accountBalanceB = $ | |
499 | - | let shareAssetSupply = $ | |
496 | + | let $t01936919459 = getPoolAssets(i.caller) | |
497 | + | let strAssetIdA = $t01936919459._1 | |
498 | + | let strAssetIdB = $t01936919459._2 | |
499 | + | let assetIdA = $t01936919459._3 | |
500 | + | let assetIdB = $t01936919459._4 | |
501 | + | let shareAssetId = $t01936919459._5 | |
502 | + | let $t01946819592 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
503 | + | let balanceA = $t01946819592._1 | |
504 | + | let balanceB = $t01946819592._2 | |
505 | + | let accountBalanceA = $t01946819592._3 | |
506 | + | let accountBalanceB = $t01946819592._4 | |
507 | + | let shareAssetSupply = $t01946819592._5 | |
500 | 508 | if ((size(args) != 2)) | |
501 | 509 | then throw("Wrong args size") | |
502 | 510 | else if (if ((size(pAmounts) != 2)) | |
503 | 511 | then (size(pAmounts) != 3) | |
504 | 512 | else false) | |
505 | 513 | then throw("Two or three payments expected") | |
506 | 514 | else if (if ((pmtAssetIdA != assetIdA)) | |
507 | 515 | then true | |
508 | 516 | else (pmtAssetIdB != assetIdB)) | |
509 | 517 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
510 | 518 | else if (if ((balanceA > accountBalanceA)) | |
511 | 519 | then true | |
512 | 520 | else (balanceB > accountBalanceB)) | |
513 | 521 | then $Tuple2(nil, ([ScriptTransfer(caller, pAmounts[0], pmtAssetIdA), ScriptTransfer(caller, pAmounts[1], pmtAssetIdB)] ++ (if ((size(pAmounts) == 3)) | |
514 | 522 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
515 | 523 | then unit | |
516 | 524 | else pAssetIds[2], pAmounts[2])] | |
517 | 525 | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
518 | 526 | else { | |
519 | - | let $ | |
520 | - | let pmtStrAssetIdA = $ | |
521 | - | let pmtAssetNameA = $ | |
522 | - | let pmtDecimalsA = $ | |
523 | - | let $ | |
524 | - | let pmtStrAssetIdB = $ | |
525 | - | let pmtAssetNameB = $ | |
526 | - | let pmtDecimalsB = $ | |
527 | + | let $t02052520602 = getAssetInfo(pmtAssetIdA) | |
528 | + | let pmtStrAssetIdA = $t02052520602._1 | |
529 | + | let pmtAssetNameA = $t02052520602._2 | |
530 | + | let pmtDecimalsA = $t02052520602._3 | |
531 | + | let $t02061520692 = getAssetInfo(pmtAssetIdB) | |
532 | + | let pmtStrAssetIdB = $t02061520692._1 | |
533 | + | let pmtAssetNameB = $t02061520692._2 | |
534 | + | let pmtDecimalsB = $t02061520692._3 | |
527 | 535 | let initial = ((balanceA + balanceB) == 0) | |
528 | - | let $ | |
536 | + | let $t02075921615 = if (initial) | |
529 | 537 | then $Tuple5(pAmounts[0], pAmounts[1], 0, pmtAssetIdA, toBigInt(1)) | |
530 | 538 | else { | |
531 | 539 | let ratioShareTokensInA = fraction(scale16, toBigInt(pAmounts[0]), toBigInt(balanceA)) | |
532 | 540 | let ratioShareTokensInB = fraction(scale16, toBigInt(pAmounts[1]), toBigInt(balanceB)) | |
533 | 541 | if ((ratioShareTokensInB > ratioShareTokensInA)) | |
534 | 542 | then { | |
535 | 543 | let pmt = fraction(pAmounts[0], balanceB, balanceA) | |
536 | 544 | $Tuple5(pAmounts[0], pmt, (pAmounts[1] - pmt), pmtAssetIdB, ratioShareTokensInA) | |
537 | 545 | } | |
538 | 546 | else { | |
539 | 547 | let pmt = fraction(pAmounts[1], balanceA, balanceB) | |
540 | 548 | $Tuple5(pmt, pAmounts[1], (pAmounts[0] - pmt), pmtAssetIdA, ratioShareTokensInB) | |
541 | 549 | } | |
542 | 550 | } | |
543 | - | let pmtAmountA = $ | |
544 | - | let pmtAmountB = $ | |
545 | - | let change = $ | |
546 | - | let changeAssetId = $ | |
547 | - | let shareTokenRatio = $ | |
551 | + | let pmtAmountA = $t02075921615._1 | |
552 | + | let pmtAmountB = $t02075921615._2 | |
553 | + | let change = $t02075921615._3 | |
554 | + | let changeAssetId = $t02075921615._4 | |
555 | + | let shareTokenRatio = $t02075921615._5 | |
548 | 556 | let shareTokenToPayAmount = if (initial) | |
549 | 557 | then { | |
550 | 558 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
551 | 559 | fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
552 | 560 | } | |
553 | 561 | else toInt(fraction(shareTokenRatio, toBigInt(shareAssetSupply), scale16)) | |
554 | 562 | if ((shareTokenToPayAmount == 0)) | |
555 | 563 | then throw("Too small amount to replenish") | |
556 | 564 | else if ((0 > change)) | |
557 | 565 | then throw("Change < 0") | |
558 | 566 | else { | |
559 | 567 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
560 | 568 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
561 | 569 | else 0 | |
562 | 570 | if ((stake1 == stake1)) | |
563 | 571 | then { | |
564 | 572 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
565 | 573 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
566 | 574 | else 0 | |
567 | 575 | if ((stake2 == stake2)) | |
568 | 576 | then { | |
569 | 577 | let shareTokenST = if (stakeFarming) | |
570 | 578 | then { | |
571 | 579 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(pAmounts) == 3)) | |
572 | 580 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
573 | 581 | then unit | |
574 | 582 | else pAssetIds[2], pAmounts[2])] | |
575 | 583 | else nil)) | |
576 | 584 | let reissue = invoke(i.caller, "reissueShareToken", [shareTokenToPayAmount], nil) | |
577 | 585 | if ((reissue == reissue)) | |
578 | 586 | then { | |
579 | 587 | let stake3 = invoke(farmingAddress, "lockShareTokensFromPool", [callerBytes, toString(i.caller), lockType], stPayments) | |
580 | 588 | if ((stake3 == stake3)) | |
581 | 589 | then nil | |
582 | 590 | else throw("Strict value is not equal to itself.") | |
583 | 591 | } | |
584 | 592 | else throw("Strict value is not equal to itself.") | |
585 | 593 | } | |
586 | 594 | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(caller, shareTokenToPayAmount, shareAssetId)] | |
587 | 595 | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, (balanceA + pmtAmountA)), IntegerEntry(kBalanceB, (balanceB + pmtAmountB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(caller, change, changeAssetId)] ++ shareTokenST), nil)) | |
588 | 596 | } | |
589 | 597 | else throw("Strict value is not equal to itself.") | |
590 | 598 | } | |
591 | 599 | else throw("Strict value is not equal to itself.") | |
592 | 600 | } | |
593 | 601 | } | |
594 | 602 | }))) | |
595 | 603 | ||
596 | 604 | ||
597 | 605 | ||
598 | 606 | @Callable(i) | |
599 | 607 | func replenishWithOneToken (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
600 | 608 | let caller = Address(callerBytes) | |
601 | 609 | let pmtAssetId = parsePaymentAsset(pAssetIds[0]) | |
602 | 610 | let pmtAmount = pAmounts[0] | |
603 | 611 | let virtGetMinAmount = parseIntValue(args[0]) | |
604 | 612 | let stakeFarming = (args[1] == "true") | |
605 | 613 | let lockType = parseIntValue(args[2]) | |
606 | - | let $ | |
607 | - | let strAssetIdA = $ | |
608 | - | let strAssetIdB = $ | |
609 | - | let assetIdA = $ | |
610 | - | let assetIdB = $ | |
611 | - | let shareAssetId = $ | |
612 | - | let $ | |
613 | - | let balanceA = $ | |
614 | - | let balanceB = $ | |
615 | - | let accountBalanceA = $ | |
616 | - | let accountBalanceB = $ | |
617 | - | let shareAssetSupply = $ | |
614 | + | let $t02437024460 = getPoolAssets(i.caller) | |
615 | + | let strAssetIdA = $t02437024460._1 | |
616 | + | let strAssetIdB = $t02437024460._2 | |
617 | + | let assetIdA = $t02437024460._3 | |
618 | + | let assetIdB = $t02437024460._4 | |
619 | + | let shareAssetId = $t02437024460._5 | |
620 | + | let $t02446524589 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
621 | + | let balanceA = $t02446524589._1 | |
622 | + | let balanceB = $t02446524589._2 | |
623 | + | let accountBalanceA = $t02446524589._3 | |
624 | + | let accountBalanceB = $t02446524589._4 | |
625 | + | let shareAssetSupply = $t02446524589._5 | |
618 | 626 | let initial = ((balanceA + balanceB) == 0) | |
619 | 627 | if ((size(args) != 3)) | |
620 | 628 | then throw("Wrong args size") | |
621 | 629 | else if (if ((size(pAmounts) != 1)) | |
622 | 630 | then (size(pAmounts) != 2) | |
623 | 631 | else false) | |
624 | 632 | then throw("Two or one attached assets expected") | |
625 | 633 | else if (if ((pmtAssetId != assetIdA)) | |
626 | 634 | then (pmtAssetId != assetIdB) | |
627 | 635 | else false) | |
628 | 636 | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
629 | 637 | else if (initial) | |
630 | 638 | then throw("For initial exchanger you need to use two tokens") | |
631 | 639 | else if (if ((balanceA > accountBalanceA)) | |
632 | 640 | then true | |
633 | 641 | else (balanceB > accountBalanceB)) | |
634 | 642 | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ (if ((size(pAmounts) == 2)) | |
635 | 643 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
636 | 644 | then unit | |
637 | 645 | else pAssetIds[2], pAmounts[2])] | |
638 | 646 | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
639 | 647 | else { | |
640 | - | let $t02506425122 = getFeeParams(i.caller, i.originCaller) | |
641 | - | let fee = $t02506425122._1 | |
642 | - | let govFee = $t02506425122._2 | |
643 | - | let $t02513127293 = if ((pmtAssetId == assetIdA)) | |
648 | + | let $t02550125568 = getFeeParams(i.caller, i.originCaller) | |
649 | + | let fee = $t02550125568._1 | |
650 | + | let govFee = $t02550125568._2 | |
651 | + | let teamFee = $t02550125568._3 | |
652 | + | let $t02557727845 = if ((pmtAssetId == assetIdA)) | |
644 | 653 | then { | |
645 | 654 | let virtPayAmount = calculateVirtPay(pmtAmount, balanceA, fee) | |
646 | - | let $t02538625523 = calculateFees(virtPayAmount, virtGetMinAmount, balanceA, balanceB, fee, govFee) | |
647 | - | let amountWithoutFee = $t02538625523._1 | |
648 | - | let amountWithFee = $t02538625523._2 | |
649 | - | let governanceReward = $t02538625523._3 | |
655 | + | let $t02584425999 = calculateFees(virtPayAmount, virtGetMinAmount, balanceA, balanceB, fee, govFee, teamFee) | |
656 | + | let amountWithoutFee = $t02584425999._1 | |
657 | + | let amountWithFee = $t02584425999._2 | |
658 | + | let governanceReward = $t02584425999._3 | |
659 | + | let tReward = $t02584425999._4 | |
650 | 660 | let balanceAVirt = (balanceA + virtPayAmount) | |
651 | - | let balanceBVirt = ((balanceB + amountWithoutFee) - governanceReward) | |
661 | + | let balanceBVirt = (((balanceB + amountWithoutFee) - governanceReward) - tReward) | |
652 | 662 | let newBalanceA = (balanceA + pmtAmount) | |
653 | - | let newBalanceB = (balanceB - governanceReward) | |
663 | + | let newBalanceB = ((balanceB - governanceReward) - tReward) | |
654 | 664 | let ratioShareTokensInA = fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balanceAVirt)) | |
655 | 665 | let ratioShareTokensInB = fraction(toBigInt(amountWithFee), scale16, toBigInt(balanceBVirt)) | |
656 | 666 | let shareTokenToPayAmount = toInt(fraction(min([ratioShareTokensInA, ratioShareTokensInB]), toBigInt(shareAssetSupply), scale16)) | |
657 | - | $ | |
667 | + | $Tuple8(newBalanceA, newBalanceB, shareTokenToPayAmount, governanceReward, tReward, assetIdB, strAssetIdB, strAssetIdA) | |
658 | 668 | } | |
659 | 669 | else { | |
660 | 670 | let virtPayAmount = calculateVirtPay(pmtAmount, balanceB, fee) | |
661 | - | let $t02639626533 = calculateFees(virtPayAmount, virtGetMinAmount, balanceB, balanceA, fee, govFee) | |
662 | - | let amountWithoutFee = $t02639626533._1 | |
663 | - | let amountWithFee = $t02639626533._2 | |
664 | - | let governanceReward = $t02639626533._3 | |
665 | - | let balanceAVirt = ((balanceA + amountWithoutFee) - governanceReward) | |
671 | + | let $t02690127056 = calculateFees(virtPayAmount, virtGetMinAmount, balanceB, balanceA, fee, govFee, teamFee) | |
672 | + | let amountWithoutFee = $t02690127056._1 | |
673 | + | let amountWithFee = $t02690127056._2 | |
674 | + | let governanceReward = $t02690127056._3 | |
675 | + | let tReward = $t02690127056._4 | |
676 | + | let balanceAVirt = (((balanceA + amountWithoutFee) - governanceReward) - tReward) | |
666 | 677 | let balanceBVirt = (balanceB + virtPayAmount) | |
667 | - | let newBalanceA = (balanceA - governanceReward) | |
678 | + | let newBalanceA = ((balanceA - governanceReward) - tReward) | |
668 | 679 | let newBalanceB = (balanceB + pmtAmount) | |
669 | 680 | let ratioShareTokensInA = fraction(toBigInt(amountWithFee), scale16, toBigInt(balanceAVirt)) | |
670 | 681 | let ratioShareTokensInB = fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balanceBVirt)) | |
671 | 682 | let shareTokenToPayAmount = toInt(fraction(min([ratioShareTokensInA, ratioShareTokensInB]), toBigInt(shareAssetSupply), scale16)) | |
672 | - | $ | |
683 | + | $Tuple8(newBalanceA, newBalanceB, shareTokenToPayAmount, governanceReward, tReward, assetIdA, strAssetIdA, strAssetIdB) | |
673 | 684 | } | |
674 | - | let newBalanceA = $t02513127293._1 | |
675 | - | let newBalanceB = $t02513127293._2 | |
676 | - | let shareTokenToPayAmount = $t02513127293._3 | |
677 | - | let govReward = $t02513127293._4 | |
678 | - | let govRewardAsset = $t02513127293._5 | |
679 | - | let govRewardAssetStr = $t02513127293._6 | |
680 | - | let pmtAssetIdStr = $t02513127293._7 | |
685 | + | let newBalanceA = $t02557727845._1 | |
686 | + | let newBalanceB = $t02557727845._2 | |
687 | + | let shareTokenToPayAmount = $t02557727845._3 | |
688 | + | let govReward = $t02557727845._4 | |
689 | + | let teamReward = $t02557727845._5 | |
690 | + | let govRewardAsset = $t02557727845._6 | |
691 | + | let govRewardAssetStr = $t02557727845._7 | |
692 | + | let pmtAssetIdStr = $t02557727845._8 | |
681 | 693 | if ((shareTokenToPayAmount == 0)) | |
682 | 694 | then throw("Too small amount to replenish") | |
683 | 695 | else { | |
684 | 696 | let stake1 = if (contains(stakingAssets, pmtAssetIdStr)) | |
685 | 697 | then invoke(i.caller, "stakeUnstake", [true, pmtAmount, pmtAssetIdStr], nil) | |
686 | 698 | else 0 | |
687 | 699 | if ((stake1 == stake1)) | |
688 | 700 | then { | |
689 | 701 | let stake2 = if (contains(stakingAssets, govRewardAssetStr)) | |
690 | - | then invoke(i.caller, "stakeUnstake", [false, govReward, govRewardAssetStr], nil) | |
702 | + | then invoke(i.caller, "stakeUnstake", [false, (govReward + teamReward), govRewardAssetStr], nil) | |
691 | 703 | else 0 | |
692 | 704 | if ((stake2 == stake2)) | |
693 | 705 | then { | |
694 | 706 | let shareTokenST = if (stakeFarming) | |
695 | 707 | then { | |
696 | 708 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(pAmounts) == 2)) | |
697 | 709 | then [AttachedPayment(if ((pAssetIds[1] == base58'')) | |
698 | 710 | then unit | |
699 | 711 | else pAssetIds[1], pAmounts[1])] | |
700 | 712 | else nil)) | |
701 | 713 | let reissue = invoke(i.caller, "reissueShareToken", [shareTokenToPayAmount], nil) | |
702 | 714 | if ((reissue == reissue)) | |
703 | 715 | then { | |
704 | 716 | let stake3 = invoke(farmingAddress, "lockShareTokensFromPool", [callerBytes, toString(i.caller), lockType], stPayments) | |
705 | 717 | if ((stake3 == stake3)) | |
706 | 718 | then nil | |
707 | 719 | else throw("Strict value is not equal to itself.") | |
708 | 720 | } | |
709 | 721 | else throw("Strict value is not equal to itself.") | |
710 | 722 | } | |
711 | 723 | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(caller, shareTokenToPayAmount, shareAssetId)] | |
712 | - | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(moneyBoxAddress, govReward, govRewardAsset)] ++ shareTokenST), nil)) | |
724 | + | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(moneyBoxAddress, govReward, govRewardAsset), ScriptTransfer(teamBoxAddress, teamReward, govRewardAsset)] ++ shareTokenST), nil)) | |
713 | 725 | } | |
714 | 726 | else throw("Strict value is not equal to itself.") | |
715 | 727 | } | |
716 | 728 | else throw("Strict value is not equal to itself.") | |
717 | 729 | } | |
718 | 730 | } | |
719 | 731 | }))) | |
720 | 732 | ||
721 | 733 | ||
722 | 734 | ||
723 | 735 | @Callable(i) | |
724 | 736 | func withdraw (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
725 | 737 | let time = lastBlock.timestamp | |
726 | 738 | let caller = Address(callerBytes) | |
727 | - | let $ | |
728 | - | let strAssetIdA = $ | |
729 | - | let strAssetIdB = $ | |
730 | - | let assetIdA = $ | |
731 | - | let assetIdB = $ | |
732 | - | let shareAssetId = $ | |
733 | - | let $ | |
734 | - | let balanceA = $ | |
735 | - | let balanceB = $ | |
736 | - | let accountBalanceA = $ | |
737 | - | let accountBalanceB = $ | |
738 | - | let shareAssetSupply = $ | |
739 | - | let $ | |
739 | + | let $t02985329943 = getPoolAssets(i.caller) | |
740 | + | let strAssetIdA = $t02985329943._1 | |
741 | + | let strAssetIdB = $t02985329943._2 | |
742 | + | let assetIdA = $t02985329943._3 | |
743 | + | let assetIdB = $t02985329943._4 | |
744 | + | let shareAssetId = $t02985329943._5 | |
745 | + | let $t02995230076 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
746 | + | let balanceA = $t02995230076._1 | |
747 | + | let balanceB = $t02995230076._2 | |
748 | + | let accountBalanceA = $t02995230076._3 | |
749 | + | let accountBalanceB = $t02995230076._4 | |
750 | + | let shareAssetSupply = $t02995230076._5 | |
751 | + | let $t03008530465 = if ((size(pAmounts) == 1)) | |
740 | 752 | then { | |
741 | 753 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
742 | 754 | if ((pAsset != shareAssetId)) | |
743 | 755 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
744 | 756 | else $Tuple2(pAmounts[0], pAsset) | |
745 | 757 | } | |
746 | 758 | else $Tuple2(0, shareAssetId) | |
747 | - | let pmtAmount = $ | |
748 | - | let pmtAssetId = $ | |
759 | + | let pmtAmount = $t03008530465._1 | |
760 | + | let pmtAssetId = $t03008530465._2 | |
749 | 761 | if ((size(args) != 1)) | |
750 | 762 | then throw("Wrong args size") | |
751 | 763 | else if ((size(pAmounts) > 1)) | |
752 | 764 | then throw("One attached payment expected") | |
753 | 765 | else if (if ((balanceA > accountBalanceA)) | |
754 | 766 | then true | |
755 | 767 | else (balanceB > accountBalanceB)) | |
756 | 768 | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
757 | 769 | else { | |
758 | 770 | let unlockAmount = parseIntValue(valueOrElse(args[0], "0")) | |
759 | 771 | let unlock = if ((unlockAmount > 0)) | |
760 | 772 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [callerBytes, toString(i.caller), unlockAmount], nil) | |
761 | 773 | else 0 | |
762 | 774 | if ((unlock == unlock)) | |
763 | 775 | then { | |
764 | 776 | let withdrawAmount = (pmtAmount + unlockAmount) | |
765 | 777 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
766 | 778 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
767 | 779 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
768 | 780 | then invoke(i.caller, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
769 | 781 | else 0 | |
770 | 782 | if ((stake1 == stake1)) | |
771 | 783 | then { | |
772 | 784 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
773 | 785 | then invoke(i.caller, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
774 | 786 | else 0 | |
775 | 787 | if ((stake2 == stake2)) | |
776 | 788 | then $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2([IntegerEntry(kBalanceA, (balanceA - amountToPayA)), IntegerEntry(kBalanceB, (balanceB - amountToPayB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(caller, amountToPayA, assetIdA), ScriptTransfer(caller, amountToPayB, assetIdB)], nil)) | |
777 | 789 | else throw("Strict value is not equal to itself.") | |
778 | 790 | } | |
779 | 791 | else throw("Strict value is not equal to itself.") | |
780 | 792 | } | |
781 | 793 | else throw("Strict value is not equal to itself.") | |
782 | 794 | } | |
783 | 795 | })) | |
784 | 796 | ||
785 | 797 | ||
786 | 798 | ||
787 | 799 | @Callable(i) | |
788 | 800 | func withdrawOneToken (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
789 | 801 | let caller = Address(callerBytes) | |
790 | 802 | let withdrawAsset = if ((args[0] == "")) | |
791 | 803 | then unit | |
792 | 804 | else fromBase58String(args[0]) | |
793 | - | let $ | |
794 | - | let strAssetIdA = $ | |
795 | - | let strAssetIdB = $ | |
796 | - | let assetIdA = $ | |
797 | - | let assetIdB = $ | |
798 | - | let shareAssetId = $ | |
799 | - | let $ | |
800 | - | let balanceA = $ | |
801 | - | let balanceB = $ | |
802 | - | let accountBalanceA = $ | |
803 | - | let accountBalanceB = $ | |
804 | - | let shareAssetSupply = $ | |
805 | - | let $ | |
805 | + | let $t03268332773 = getPoolAssets(i.caller) | |
806 | + | let strAssetIdA = $t03268332773._1 | |
807 | + | let strAssetIdB = $t03268332773._2 | |
808 | + | let assetIdA = $t03268332773._3 | |
809 | + | let assetIdB = $t03268332773._4 | |
810 | + | let shareAssetId = $t03268332773._5 | |
811 | + | let $t03278232906 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
812 | + | let balanceA = $t03278232906._1 | |
813 | + | let balanceB = $t03278232906._2 | |
814 | + | let accountBalanceA = $t03278232906._3 | |
815 | + | let accountBalanceB = $t03278232906._4 | |
816 | + | let shareAssetSupply = $t03278232906._5 | |
817 | + | let $t03291533267 = if ((size(pAmounts) == 1)) | |
806 | 818 | then { | |
807 | 819 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
808 | 820 | if ((pAsset != shareAssetId)) | |
809 | 821 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
810 | 822 | else $Tuple2(pAmounts[0], pAsset) | |
811 | 823 | } | |
812 | 824 | else $Tuple2(0, shareAssetId) | |
813 | - | let pmtAmount = $ | |
814 | - | let pmtAssetId = $ | |
825 | + | let pmtAmount = $t03291533267._1 | |
826 | + | let pmtAssetId = $t03291533267._2 | |
815 | 827 | let virtMinToRecive = parseIntValue(args[1]) | |
816 | 828 | if ((size(args) != 3)) | |
817 | 829 | then throw("Wrong args size") | |
818 | 830 | else if ((size(pAmounts) > 1)) | |
819 | 831 | then throw("One attached payment expected") | |
820 | 832 | else if ((pmtAssetId != shareAssetId)) | |
821 | 833 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
822 | 834 | else if (!(containsElement([assetIdA, assetIdB], withdrawAsset))) | |
823 | 835 | then throw("Incorrect withdraw asset.") | |
824 | 836 | else if (if ((balanceA > accountBalanceA)) | |
825 | 837 | then true | |
826 | 838 | else (balanceB > accountBalanceB)) | |
827 | 839 | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
828 | 840 | else { | |
829 | 841 | let unlockAmount = parseIntValue(valueOrElse(args[2], "0")) | |
830 | 842 | let unlock = if ((unlockAmount > 0)) | |
831 | 843 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [callerBytes, toString(i.caller), unlockAmount], nil) | |
832 | 844 | else 0 | |
833 | 845 | if ((unlock == unlock)) | |
834 | 846 | then { | |
835 | 847 | let withdrawAmount = (pmtAmount + unlockAmount) | |
836 | 848 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
837 | 849 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
838 | - | let $t03388933947 = getFeeParams(i.caller, i.originCaller) | |
839 | - | let fee = $t03388933947._1 | |
840 | - | let govFee = $t03388933947._2 | |
841 | - | let $t03396034344 = if ((withdrawAsset == assetIdA)) | |
842 | - | then calculateFees(amountToPayB, virtMinToRecive, (balanceB - amountToPayB), (balanceA - amountToPayA), fee, govFee) | |
843 | - | else calculateFees(amountToPayA, virtMinToRecive, (balanceA - amountToPayA), (balanceB - amountToPayB), fee, govFee) | |
844 | - | let amountWithoutFee = $t03396034344._1 | |
845 | - | let amountWithFee = $t03396034344._2 | |
846 | - | let governanceReward = $t03396034344._3 | |
847 | - | let $t03435735615 = if ((withdrawAsset == assetIdA)) | |
850 | + | let $t03453434601 = getFeeParams(i.caller, i.originCaller) | |
851 | + | let fee = $t03453434601._1 | |
852 | + | let govFee = $t03453434601._2 | |
853 | + | let teamFee = $t03453434601._3 | |
854 | + | let $t03461435028 = if ((withdrawAsset == assetIdA)) | |
855 | + | then calculateFees(amountToPayB, virtMinToRecive, (balanceB - amountToPayB), (balanceA - amountToPayA), fee, govFee, teamFee) | |
856 | + | else calculateFees(amountToPayA, virtMinToRecive, (balanceA - amountToPayA), (balanceB - amountToPayB), fee, govFee, teamFee) | |
857 | + | let amountWithoutFee = $t03461435028._1 | |
858 | + | let amountWithFee = $t03461435028._2 | |
859 | + | let governanceReward = $t03461435028._3 | |
860 | + | let teamReward = $t03461435028._4 | |
861 | + | let $t03504136351 = if ((withdrawAsset == assetIdA)) | |
848 | 862 | then { | |
849 | 863 | let unstake = if (contains(stakingAssets, strAssetIdA)) | |
850 | - | then invoke(i.caller, "stakeUnstake", [false, ((amountToPayA + amountWithFee) + governanceReward), strAssetIdA], nil) | |
864 | + | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayA + amountWithFee) + governanceReward) + teamReward), strAssetIdA], nil) | |
851 | 865 | else 0 | |
852 | 866 | if ((unstake == unstake)) | |
853 | - | then $Tuple4((((balanceA - amountToPayA) - amountWithFee) - governanceReward), balanceB, assetIdA, [ScriptTransfer(caller, (amountToPayA + amountWithFee), assetIdA)]) | |
867 | + | then $Tuple4(((((balanceA - amountToPayA) - amountWithFee) - governanceReward) - teamReward), balanceB, assetIdA, [ScriptTransfer(caller, (amountToPayA + amountWithFee), assetIdA)]) | |
854 | 868 | else throw("Strict value is not equal to itself.") | |
855 | 869 | } | |
856 | 870 | else { | |
857 | 871 | let unstake = if (contains(stakingAssets, strAssetIdB)) | |
858 | - | then invoke(i.caller, "stakeUnstake", [false, ((amountToPayB + amountWithFee) + governanceReward), strAssetIdB], nil) | |
872 | + | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayB + amountWithFee) + governanceReward) + teamReward), strAssetIdB], nil) | |
859 | 873 | else 0 | |
860 | 874 | if ((unstake == unstake)) | |
861 | - | then $Tuple4(balanceA, (((balanceB - amountToPayB) - amountWithFee) - governanceReward), assetIdB, [ScriptTransfer(caller, (amountToPayB + amountWithFee), assetIdB)]) | |
875 | + | then $Tuple4(balanceA, ((((balanceB - amountToPayB) - amountWithFee) - governanceReward) - teamReward), assetIdB, [ScriptTransfer(caller, (amountToPayB + amountWithFee), assetIdB)]) | |
862 | 876 | else throw("Strict value is not equal to itself.") | |
863 | 877 | } | |
864 | - | let newBalanceA = $ | |
865 | - | let newBalanceB = $ | |
866 | - | let govRewardAssetId = $ | |
867 | - | let userTransfer = $ | |
868 | - | $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceReward, govRewardAssetId)] ++ userTransfer), nil)) | |
878 | + | let newBalanceA = $t03504136351._1 | |
879 | + | let newBalanceB = $t03504136351._2 | |
880 | + | let govRewardAssetId = $t03504136351._3 | |
881 | + | let userTransfer = $t03504136351._4 | |
882 | + | $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceReward, govRewardAssetId), ScriptTransfer(teamBoxAddress, teamReward, govRewardAssetId)] ++ userTransfer), nil)) | |
869 | 883 | } | |
870 | 884 | else throw("Strict value is not equal to itself.") | |
871 | 885 | } | |
872 | 886 | }))) | |
873 | 887 | ||
874 | 888 | ||
875 | 889 | ||
876 | 890 | @Callable(i) | |
877 | 891 | func takeIntoAccountExtraFunds (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
878 | - | let $ | |
879 | - | let strAssetIdA = $ | |
880 | - | let strAssetIdB = $ | |
881 | - | let assetIdA = $ | |
882 | - | let assetIdB = $ | |
892 | + | let $t03711137187 = getPoolAssets(i.caller) | |
893 | + | let strAssetIdA = $t03711137187._1 | |
894 | + | let strAssetIdB = $t03711137187._2 | |
895 | + | let assetIdA = $t03711137187._3 | |
896 | + | let assetIdB = $t03711137187._4 | |
883 | 897 | let claim = if (if ((assetIdA == USDN)) | |
884 | 898 | then true | |
885 | 899 | else (assetIdB == USDN)) | |
886 | 900 | then invoke(i.caller, "claimNetrinoRewards", nil, nil) | |
887 | 901 | else 0 | |
888 | 902 | if ((claim == claim)) | |
889 | 903 | then { | |
890 | - | let $ | |
891 | - | let balanceA = $ | |
892 | - | let balanceB = $ | |
893 | - | let accountBalanceA = $ | |
894 | - | let accountBalanceB = $ | |
904 | + | let $t03734737453 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
905 | + | let balanceA = $t03734737453._1 | |
906 | + | let balanceB = $t03734737453._2 | |
907 | + | let accountBalanceA = $t03734737453._3 | |
908 | + | let accountBalanceB = $t03734737453._4 | |
895 | 909 | let amountEnrollA = (accountBalanceA - balanceA) | |
896 | 910 | let amountEnrollB = (accountBalanceB - balanceB) | |
897 | 911 | if ((size(args) != 0)) | |
898 | 912 | then throw("Wrong args size") | |
899 | 913 | else if ((moneyBoxAddress != i.originCaller)) | |
900 | 914 | then throw("Only the wallet can call this function") | |
901 | 915 | else if (if ((0 > amountEnrollA)) | |
902 | 916 | then true | |
903 | 917 | else (0 > amountEnrollB)) | |
904 | 918 | then suspend("Enroll amount negative") | |
905 | 919 | else if (if ((amountEnrollA == 0)) | |
906 | 920 | then (amountEnrollB == 0) | |
907 | 921 | else false) | |
908 | 922 | then throw("No money to take") | |
909 | 923 | else { | |
910 | 924 | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
911 | 925 | then (amountEnrollA > 0) | |
912 | 926 | else false) | |
913 | 927 | then invoke(i.caller, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
914 | 928 | else 0 | |
915 | 929 | if ((stake1 == stake1)) | |
916 | 930 | then { | |
917 | 931 | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
918 | 932 | then (amountEnrollB > 0) | |
919 | 933 | else false) | |
920 | 934 | then invoke(i.caller, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
921 | 935 | else 0 | |
922 | 936 | if ((stake2 == stake2)) | |
923 | 937 | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))], nil)) | |
924 | 938 | else throw("Strict value is not equal to itself.") | |
925 | 939 | } | |
926 | 940 | else throw("Strict value is not equal to itself.") | |
927 | 941 | } | |
928 | 942 | } | |
929 | 943 | else throw("Strict value is not equal to itself.") | |
930 | 944 | })) | |
931 | 945 | ||
932 | 946 | ||
933 | 947 | @Verifier(tx) | |
934 | 948 | func verify () = { | |
935 | 949 | let multiSignedByAdmins = { | |
936 | 950 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
937 | 951 | then 1 | |
938 | 952 | else 0 | |
939 | 953 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
940 | 954 | then 1 | |
941 | 955 | else 0 | |
942 | 956 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
943 | 957 | then 1 | |
944 | 958 | else 0 | |
945 | 959 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
946 | 960 | } | |
947 | 961 | multiSignedByAdmins | |
948 | 962 | } | |
949 | 963 |
github/deemru/w8io/169f3d6 173.46 ms ◑