tx · D9DTL56wMz4KpxYu2QYMcRNYE9iNFFfDieJBXenjahhf 3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW: -0.14000000 Waves 2022.05.04 10:15 [2036629] smart account 3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW > SELF 0.00000000 Waves
{ "type": 13, "id": "D9DTL56wMz4KpxYu2QYMcRNYE9iNFFfDieJBXenjahhf", "fee": 14000000, "feeAssetId": null, "timestamp": 1651648603755, "version": 2, "chainId": 84, "sender": "3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW", "senderPublicKey": "DfbjpZJBbZwnUKysUkxCbWTE1ZWuoUb6Y6BZdu5iAE8j", "proofs": [ "3uHbzrGNefu1NTsVvyTiAFgNxB5Bz5RmuUuVXcWjdRKe4oK62ipXyM8BKy6oJqqmv5oco8uguVTcp9JGToWATbLt", "t7o9nVbidQgfKiPYNQKQvUFPNunRZoLfC85oejPFMbNwmGwx1gACL2QhTyMTZiexZdooRqhFCv6t4yeGrwSnGpt" ], "script": "base64:AAIFAAAAAAAAACEIAhIAEgASBAoCAQESABIECgIBARIAEgASABIFCgMEAQgAAABPAAAAAAd2ZXJzaW9uAgAAAAUyLjAuMAAAAAAIa1ZlcnNpb24CAAAAB3ZlcnNpb24AAAAAB2tBY3RpdmUCAAAABmFjdGl2ZQAAAAAJa0Fzc2V0SWRBAgAAAApBX2Fzc2V0X2lkAAAAAAlrQXNzZXRJZEICAAAACkJfYXNzZXRfaWQAAAAACWtCYWxhbmNlQQIAAAAPQV9hc3NldF9iYWxhbmNlAAAAAAlrQmFsYW5jZUICAAAAD0JfYXNzZXRfYmFsYW5jZQAAAAANa1NoYXJlQXNzZXRJZAIAAAAOc2hhcmVfYXNzZXRfaWQAAAAAEWtTaGFyZUFzc2V0U3VwcGx5AgAAABJzaGFyZV9hc3NldF9zdXBwbHkAAAAABGtGZWUCAAAACmNvbW1pc3Npb24AAAAACmtJbnZhcmlhbnQCAAAACWludmFyaWFudAAAAAAGa0NhdXN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WRtaW5zMnN/KQ==", "height": 2036629, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3oNdnKiyuANEpJbMupk5q8pj7NGcrCTzG6KLYQUSQvmv Next: HvBX6rbes7Xe22P7b79zbtoEr41F1zck2pEQyJzGUW7q Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | ||
22 | 22 | let kFee = "commission" | |
23 | 23 | ||
24 | - | let kFeeScaleDelimiter = "commission_scale_delimiter" | |
25 | - | ||
26 | 24 | let kInvariant = "invariant" | |
27 | 25 | ||
28 | 26 | let kCause = "shutdown_cause" | |
29 | 27 | ||
30 | - | let | |
28 | + | let kUSDNAddress = "staking_usdnnsbt_address" | |
31 | 29 | ||
32 | - | let | |
30 | + | let kEURNAddress = "staking_eurn_address" | |
33 | 31 | ||
34 | - | let | |
32 | + | let kAdminPubKey1 = "admin_pub_1" | |
35 | 33 | ||
36 | - | let | |
34 | + | let kAdminPubKey2 = "admin_pub_2" | |
37 | 35 | ||
38 | - | let | |
36 | + | let kAdminPubKey3 = "admin_pub_3" | |
39 | 37 | ||
40 | - | let USDNToWavesExchanger = Address(base58'3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37') | |
38 | + | let kAdminInvokePubKey = "admin_invoke_pub" | |
39 | + | ||
40 | + | let kMoneyBoxAddress = "money_box_address" | |
41 | 41 | ||
42 | 42 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
43 | 43 | ||
44 | - | func | |
44 | + | func getBase58FromOracle (key) = match getString(oracle, key) { | |
45 | 45 | case string: String => | |
46 | 46 | fromBase58String(string) | |
47 | 47 | case nothing => | |
48 | - | throw( | |
48 | + | throw((key + "is empty")) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | - | let adminPubKey1 = | |
52 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
53 | 53 | ||
54 | - | let adminPubKey2 = | |
54 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
55 | 55 | ||
56 | - | let adminPubKey3 = | |
56 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
57 | 57 | ||
58 | - | let | |
58 | + | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
59 | 59 | ||
60 | - | let | |
60 | + | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
61 | 61 | ||
62 | - | let | |
62 | + | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
63 | 63 | ||
64 | 64 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
65 | 65 | ||
66 | - | let EURN = base58'ECBCkHS68DckpBrzLeoRgYbFg7sCVqR176mPqbXsj9pA' | |
67 | - | ||
68 | - | let stakingAssets = [toBase58String(USDN), toBase58String(EURN)] | |
69 | - | ||
70 | - | let stakingUSDNNSBTAddress = Address(fromBase58String(valueOrErrorMessage(getString(oracle, keyUSDNNSBTAddress), "no usdn staking address"))) | |
71 | - | ||
72 | - | let stakingEURNAddress = Address(fromBase58String(valueOrErrorMessage(getString(oracle, keyEURNAddress), "no usdn staking address"))) | |
66 | + | let stakingAssets = [toBase58String(USDN)] | |
73 | 67 | ||
74 | 68 | let active = getBooleanValue(this, kActive) | |
75 | 69 | ||
113 | 107 | ||
114 | 108 | let invariant = getIntegerValue(this, kInvariant) | |
115 | 109 | ||
116 | - | let fee = | |
110 | + | let fee = getIntegerValue(this, kFee) | |
117 | 111 | ||
118 | - | let feeGovernance = | |
112 | + | let feeGovernance = fraction(fee, 40, 100) | |
119 | 113 | ||
120 | 114 | let feeScale6 = 1000000 | |
121 | 115 | ||
157 | 151 | let stakedAmountCalculated = match assetId { | |
158 | 152 | case aId: ByteVector => | |
159 | 153 | if ((aId == USDN)) | |
160 | - | then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
161 | - | else if ((aId == EURN)) | |
162 | - | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this))) | |
163 | - | else 0 | |
154 | + | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
155 | + | else 0 | |
164 | 156 | case _: Unit => | |
165 | 157 | 0 | |
166 | 158 | case _ => | |
201 | 193 | ||
202 | 194 | ||
203 | 195 | func calculateSendAmount (amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId) = { | |
204 | - | let worstAllowedNewInvariantRatio = ( | |
196 | + | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
205 | 197 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
206 | 198 | let x = (balanceA + tokenReceiveAmount) | |
207 | 199 | let y = (balanceB + tokenReceiveAmount) | |
226 | 218 | else if ((tokenId == assetIdB)) | |
227 | 219 | then invariantCalc((balanceA - amountToSendEstimated), y) | |
228 | 220 | else throw("Wrong asset in payment") | |
229 | - | | |
230 | - | then if ((worstAllowedNewInvariantRatio >= fraction( | |
231 | - | then throw(" | |
221 | + | if ((invariant > invEstimated)) | |
222 | + | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, invEstimated))) | |
223 | + | then throw("The requested price is too not profitable for user") | |
232 | 224 | else { | |
233 | 225 | let a = { | |
234 | 226 | let $l = [25, 200, 500] | |
245 | 237 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
246 | 238 | } | |
247 | 239 | if ((0 > a._1)) | |
248 | - | then amountToSendMin | |
249 | - | else a | |
240 | + | then amountToSendMin._1 | |
241 | + | else a._1 | |
250 | 242 | } | |
251 | 243 | else { | |
252 | 244 | let a = { | |
266 | 258 | let tupleSendBetter = if ((0 > a._1)) | |
267 | 259 | then $Tuple2(amountToSendEstimated, invEstimated) | |
268 | 260 | else a | |
269 | - | if ((worstAllowedNewInvariantRatio >= fraction( | |
270 | - | then throw(" | |
271 | - | else tupleSendBetter | |
261 | + | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, tupleSendBetter._2))) | |
262 | + | then throw("The requested price is too not profitable for user") | |
263 | + | else tupleSendBetter._1 | |
272 | 264 | } | |
273 | - | amountToSendBest | |
274 | 265 | } | |
275 | 266 | } | |
276 | 267 | ||
316 | 307 | ||
317 | 308 | ||
318 | 309 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
319 | - | then if ((assetId == USDN)) | |
320 | - | then $Tuple2("lockNeutrino", stakingUSDNNSBTAddress) | |
321 | - | else $Tuple2("startStaking", stakingEURNAddress) | |
322 | - | else if ((assetId == USDN)) | |
323 | - | then $Tuple2("unlockNeutrino", stakingUSDNNSBTAddress) | |
324 | - | else $Tuple2("stopStaking", stakingEURNAddress) | |
310 | + | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
311 | + | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
325 | 312 | ||
326 | 313 | ||
327 | 314 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
328 | 315 | then { | |
329 | - | let $ | |
330 | - | let call = $ | |
331 | - | let stakingAddr = $ | |
316 | + | let $t091419207 = calcStakingFuncAndAddres(stake, assetId) | |
317 | + | let call = $t091419207._1 | |
318 | + | let stakingAddr = $t091419207._2 | |
332 | 319 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
333 | 320 | } | |
334 | 321 | else { | |
335 | - | let $ | |
336 | - | let call = $ | |
337 | - | let stakingAddr = $ | |
322 | + | let $t092939359 = calcStakingFuncAndAddres(stake, assetId) | |
323 | + | let call = $t092939359._1 | |
324 | + | let stakingAddr = $t092939359._2 | |
338 | 325 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
339 | 326 | } | |
340 | 327 | ||
341 | 328 | ||
342 | 329 | @Callable(i) | |
343 | 330 | func init () = { | |
344 | - | let $ | |
345 | - | let pmtAmountA = $ | |
346 | - | let pmtAssetIdA = $ | |
347 | - | let $ | |
348 | - | let pmtAmountB = $ | |
349 | - | let pmtAssetIdB = $ | |
350 | - | let $ | |
351 | - | let pmtStrAssetIdA = $ | |
352 | - | let pmtAssetNameA = $ | |
353 | - | let pmtDecimalsA = $ | |
354 | - | let $ | |
355 | - | let pmtStrAssetIdB = $ | |
356 | - | let pmtAssetNameB = $ | |
357 | - | let pmtDecimalsB = $ | |
331 | + | let $t094649541 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
332 | + | let pmtAmountA = $t094649541._1 | |
333 | + | let pmtAssetIdA = $t094649541._2 | |
334 | + | let $t095469623 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
335 | + | let pmtAmountB = $t095469623._1 | |
336 | + | let pmtAssetIdB = $t095469623._2 | |
337 | + | let $t096289705 = getAssetInfo(pmtAssetIdA) | |
338 | + | let pmtStrAssetIdA = $t096289705._1 | |
339 | + | let pmtAssetNameA = $t096289705._2 | |
340 | + | let pmtDecimalsA = $t096289705._3 | |
341 | + | let $t097109787 = getAssetInfo(pmtAssetIdB) | |
342 | + | let pmtStrAssetIdB = $t097109787._1 | |
343 | + | let pmtAssetNameB = $t097109787._2 | |
344 | + | let pmtDecimalsB = $t097109787._3 | |
358 | 345 | if (isDefined(getBoolean(this, kActive))) | |
359 | 346 | then throwIsActive() | |
360 | 347 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
376 | 363 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
377 | 364 | else 0 | |
378 | 365 | if ((stake2 == stake2)) | |
379 | - | then [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, | |
366 | + | then [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
380 | 367 | else throw("Strict value is not equal to itself.") | |
381 | 368 | } | |
382 | 369 | else throw("Strict value is not equal to itself.") | |
391 | 378 | let pmtAssetIdB = i.payments[1].assetId | |
392 | 379 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
393 | 380 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
394 | - | let $ | |
395 | - | let pmtStrAssetIdA = $ | |
396 | - | let pmtAssetNameA = $ | |
397 | - | let pmtDecimalsA = $ | |
398 | - | let $ | |
399 | - | let pmtStrAssetIdB = $ | |
400 | - | let pmtAssetNameB = $ | |
401 | - | let pmtDecimalsB = $ | |
402 | - | let $ | |
381 | + | let $t01243512512 = getAssetInfo(pmtAssetIdA) | |
382 | + | let pmtStrAssetIdA = $t01243512512._1 | |
383 | + | let pmtAssetNameA = $t01243512512._2 | |
384 | + | let pmtDecimalsA = $t01243512512._3 | |
385 | + | let $t01251712634 = getAssetInfo(pmtAssetIdB) | |
386 | + | let pmtStrAssetIdB = $t01251712634._1 | |
387 | + | let pmtAssetNameB = $t01251712634._2 | |
388 | + | let pmtDecimalsB = $t01251712634._3 | |
389 | + | let $t01263913143 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
403 | 390 | then { | |
404 | 391 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
405 | 392 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
406 | 393 | } | |
407 | 394 | else { | |
408 | - | let pmt = fraction( | |
395 | + | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
409 | 396 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
410 | 397 | } | |
411 | - | let pmtAmountA = $ | |
412 | - | let pmtAmountB = $ | |
413 | - | let change = $ | |
414 | - | let changeAssetId = $ | |
415 | - | let shareTokenRatio = $ | |
398 | + | let pmtAmountA = $t01263913143._1 | |
399 | + | let pmtAmountB = $t01263913143._2 | |
400 | + | let change = $t01263913143._3 | |
401 | + | let changeAssetId = $t01263913143._4 | |
402 | + | let shareTokenRatio = $t01263913143._5 | |
416 | 403 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
417 | 404 | if ((size(i.payments) != 2)) | |
418 | 405 | then throw("Two attached assets expected") | |
447 | 434 | ||
448 | 435 | @Callable(i) | |
449 | 436 | func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), { | |
450 | - | let $ | |
451 | - | let pmtAmount = $ | |
452 | - | let pmtAssetId = $ | |
453 | - | let $ | |
454 | - | let pmtStrAssetId = $ | |
455 | - | let pmtAssetName = $ | |
456 | - | let pmtDecimals = $ | |
437 | + | let $t01487614951 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
438 | + | let pmtAmount = $t01487614951._1 | |
439 | + | let pmtAssetId = $t01487614951._2 | |
440 | + | let $t01495615029 = getAssetInfo(pmtAssetId) | |
441 | + | let pmtStrAssetId = $t01495615029._1 | |
442 | + | let pmtAssetName = $t01495615029._2 | |
443 | + | let pmtDecimals = $t01495615029._3 | |
457 | 444 | let pmtMinThreshold = 5000000 | |
458 | 445 | let thresholdValueForMinTolerance = 50000000 | |
459 | 446 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
473 | 460 | else false) | |
474 | 461 | then throwAssets() | |
475 | 462 | else { | |
476 | - | let $t01638617151 = if ((pmtAssetId == assetIdA)) | |
477 | - | then $Tuple7((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), invariantCalc((balanceA + pmtAmount), balanceB), (balanceA + pmtAmount), balanceB) | |
478 | - | else $Tuple7(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), invariantCalc(balanceA, (balanceB + pmtAmount)), balanceA, (balanceB + pmtAmount)) | |
479 | - | let virtualReplenishA = $t01638617151._1 | |
480 | - | let virtualReplenishB = $t01638617151._2 | |
481 | - | let balanceAfterSwapA = $t01638617151._3 | |
482 | - | let balanceAfterSwapB = $t01638617151._4 | |
483 | - | let invariantCalculated = $t01638617151._5 | |
484 | - | let newBalanceA = $t01638617151._6 | |
485 | - | let newBalanceB = $t01638617151._7 | |
486 | - | let newBalanceEntry = if ((pmtAssetId == assetIdA)) | |
487 | - | then IntegerEntry(kBalanceA, newBalanceA) | |
488 | - | else IntegerEntry(kBalanceB, newBalanceB) | |
463 | + | let $t01600716649 = if ((pmtAssetId == assetIdA)) | |
464 | + | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
465 | + | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
466 | + | let virtualReplenishA = $t01600716649._1 | |
467 | + | let virtualReplenishB = $t01600716649._2 | |
468 | + | let balanceAfterSwapA = $t01600716649._3 | |
469 | + | let balanceAfterSwapB = $t01600716649._4 | |
470 | + | let newBalanceA = $t01600716649._5 | |
471 | + | let newBalanceB = $t01600716649._6 | |
489 | 472 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
490 | - | let invariantEstimatedRatio = fraction(scale8, invariant, invariantNew) | |
491 | - | let ratioVirtualBalanceToVirtualReplenish = (fraction((scale8 * scale8), balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
473 | + | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
492 | 474 | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
493 | - | if (if ((slippageValueMinForSwap >= | |
475 | + | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
494 | 476 | then true | |
495 | 477 | else (invariant > invariantNew)) | |
496 | 478 | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
503 | 485 | else (dAppThresholdAmount > newBalanceB)) | |
504 | 486 | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
505 | 487 | else { | |
488 | + | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
489 | + | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
490 | + | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
491 | + | let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6) | |
492 | + | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
493 | + | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
494 | + | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
495 | + | let $t01863618931 = if ((pmtStrAssetId == strAssetIdA)) | |
496 | + | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
497 | + | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
498 | + | let stakeAmount = $t01863618931._1 | |
499 | + | let unstakeAmount = $t01863618931._2 | |
500 | + | let unstakeAsset = $t01863618931._3 | |
506 | 501 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
507 | - | then invoke(this, "stakeUnstake", [true, | |
502 | + | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
508 | 503 | else 0 | |
509 | 504 | if ((stake1 == stake1)) | |
510 | 505 | then { | |
511 | - | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
512 | - | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
513 | - | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
514 | - | [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), newBalanceEntry, IntegerEntry(kInvariant, invariantCalculated)] | |
506 | + | let stake2 = if (containsElement(stakingAssets, unstakeAsset)) | |
507 | + | then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil) | |
508 | + | else 0 | |
509 | + | if ((stake2 == stake2)) | |
510 | + | then [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB), IntegerEntry(kBalanceA, (newBalanceA - governanceRewardTokenA)), IntegerEntry(kBalanceB, (newBalanceB - governanceRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB)))] | |
511 | + | else throw("Strict value is not equal to itself.") | |
515 | 512 | } | |
516 | 513 | else throw("Strict value is not equal to itself.") | |
517 | 514 | } | |
522 | 519 | ||
523 | 520 | @Callable(i) | |
524 | 521 | func withdraw () = valueOrElse(isActive(), { | |
525 | - | let $ | |
526 | - | let pmtAmount = $ | |
527 | - | let pmtAssetId = $ | |
522 | + | let $t02021820293 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
523 | + | let pmtAmount = $t02021820293._1 | |
524 | + | let pmtAssetId = $t02021820293._2 | |
528 | 525 | let amountToPayA = fraction(pmtAmount, balanceA, shareAssetSupply) | |
529 | 526 | let amountToPayB = fraction(pmtAmount, balanceB, shareAssetSupply) | |
530 | 527 | let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB)) | |
555 | 552 | ||
556 | 553 | @Callable(i) | |
557 | 554 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
558 | - | let $ | |
559 | - | let pmtAmount = $ | |
560 | - | let pmtAssetId = $ | |
555 | + | let $t02184421919 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
556 | + | let pmtAmount = $t02184421919._1 | |
557 | + | let pmtAssetId = $t02184421919._2 | |
561 | 558 | if ((0 >= estimatedAmountToReceive)) | |
562 | 559 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
563 | 560 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
564 | - | then throw | |
561 | + | then throw("Minimal amount can't be greater than estimated.") | |
565 | 562 | else if ((size(i.payments) != 1)) | |
566 | 563 | then throwOnePayment() | |
567 | 564 | else if (!(hasEnoughBalance)) | |
580 | 577 | let sendAssetId = if ((pmtAssetId == assetIdA)) | |
581 | 578 | then assetIdB | |
582 | 579 | else assetIdA | |
583 | - | let $t02217322292 = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId) | |
584 | - | let amount = $t02217322292._1 | |
585 | - | let amountInvarian = $t02217322292._2 | |
580 | + | let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId) | |
586 | 581 | let governanceReward = fraction(amount, feeGovernance, feeScale6) | |
587 | 582 | let amountMinusFee = fraction(amount, (feeScale6 - fee), feeScale6) | |
588 | - | let $ | |
583 | + | let $t02322523487 = if ((pmtAssetId == assetIdA)) | |
589 | 584 | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
590 | 585 | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
591 | - | let newBalanceA = $ | |
592 | - | let newBalanceB = $ | |
586 | + | let newBalanceA = $t02322523487._1 | |
587 | + | let newBalanceB = $t02322523487._2 | |
593 | 588 | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
594 | 589 | if (if ((dAppThresholdAmount > newBalanceA)) | |
595 | 590 | then true | |
596 | 591 | else (dAppThresholdAmount > newBalanceB)) | |
597 | 592 | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
598 | 593 | else { | |
599 | - | let $ | |
600 | - | let pmtStrAssetId = $ | |
601 | - | let pmtAssetName = $ | |
602 | - | let pmtDecimals = $ | |
603 | - | let $ | |
604 | - | let sendStrAssetId = $ | |
605 | - | let sendAssetName = $ | |
606 | - | let sendDecimals = $ | |
594 | + | let $t02378623859 = getAssetInfo(pmtAssetId) | |
595 | + | let pmtStrAssetId = $t02378623859._1 | |
596 | + | let pmtAssetName = $t02378623859._2 | |
597 | + | let pmtDecimals = $t02378623859._3 | |
598 | + | let $t02387223949 = getAssetInfo(sendAssetId) | |
599 | + | let sendStrAssetId = $t02387223949._1 | |
600 | + | let sendAssetName = $t02387223949._2 | |
601 | + | let sendDecimals = $t02387223949._3 | |
607 | 602 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
608 | 603 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
609 | 604 | else 0 | |
613 | 608 | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil) | |
614 | 609 | else 0 | |
615 | 610 | if ((stake2 == stake2)) | |
616 | - | then [IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, | |
611 | + | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], $Tuple2(amountMinusFee, sendAssetId)) | |
617 | 612 | else throw("Strict value is not equal to itself.") | |
618 | 613 | } | |
619 | 614 | else throw("Strict value is not equal to itself.") | |
642 | 637 | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
643 | 638 | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
644 | 639 | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
645 | - | if ((i.caller != | |
646 | - | then throw("Only the | |
640 | + | if ((i.caller != moneyBoxAddress)) | |
641 | + | then throw("Only the money box can call this function") | |
647 | 642 | else if (if ((0 > amountEnrollA)) | |
648 | 643 | then true | |
649 | 644 | else (0 > amountEnrollB)) | |
666 | 661 | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
667 | 662 | else 0 | |
668 | 663 | if ((stake2 == stake2)) | |
669 | - | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB)) | |
664 | + | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
670 | 665 | else throw("Strict value is not equal to itself.") | |
671 | 666 | } | |
672 | 667 | else throw("Strict value is not equal to itself.") | |
676 | 671 | ||
677 | 672 | ||
678 | 673 | @Callable(i) | |
679 | - | func writeBigIntInvariant () = valueOrElse(isAdminCall(i), { | |
680 | - | let invariantNew = invariantCalc(balanceA, balanceB) | |
681 | - | [IntegerEntry(kInvariant, invariantNew)] | |
682 | - | }) | |
683 | - | ||
684 | - | ||
685 | - | ||
686 | - | @Callable(i) | |
687 | 674 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
688 | 675 | then throw("Only contract itself can invoke this function") | |
689 | 676 | else { | |
690 | - | let $ | |
691 | - | let call = $ | |
692 | - | let addr = $ | |
693 | - | let params = $ | |
694 | - | let payments = $ | |
677 | + | let $t02695327056 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
678 | + | let call = $t02695327056._1 | |
679 | + | let addr = $t02695327056._2 | |
680 | + | let params = $t02695327056._3 | |
681 | + | let payments = $t02695327056._4 | |
695 | 682 | let inv = invoke(addr, call, params, payments) | |
696 | 683 | if ((inv == inv)) | |
697 | 684 | then nil | |
724 | 711 | then true | |
725 | 712 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
726 | 713 | then true | |
727 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], | |
714 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
728 | 715 | if (if (callTakeIntoAccount) | |
729 | 716 | then signedByAdmin | |
730 | 717 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "2.0.0" | |
5 | 5 | ||
6 | 6 | let kVersion = "version" | |
7 | 7 | ||
8 | 8 | let kActive = "active" | |
9 | 9 | ||
10 | 10 | let kAssetIdA = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let kAssetIdB = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let kBalanceA = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let kBalanceB = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let kShareAssetId = "share_asset_id" | |
19 | 19 | ||
20 | 20 | let kShareAssetSupply = "share_asset_supply" | |
21 | 21 | ||
22 | 22 | let kFee = "commission" | |
23 | 23 | ||
24 | - | let kFeeScaleDelimiter = "commission_scale_delimiter" | |
25 | - | ||
26 | 24 | let kInvariant = "invariant" | |
27 | 25 | ||
28 | 26 | let kCause = "shutdown_cause" | |
29 | 27 | ||
30 | - | let | |
28 | + | let kUSDNAddress = "staking_usdnnsbt_address" | |
31 | 29 | ||
32 | - | let | |
30 | + | let kEURNAddress = "staking_eurn_address" | |
33 | 31 | ||
34 | - | let | |
32 | + | let kAdminPubKey1 = "admin_pub_1" | |
35 | 33 | ||
36 | - | let | |
34 | + | let kAdminPubKey2 = "admin_pub_2" | |
37 | 35 | ||
38 | - | let | |
36 | + | let kAdminPubKey3 = "admin_pub_3" | |
39 | 37 | ||
40 | - | let USDNToWavesExchanger = Address(base58'3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37') | |
38 | + | let kAdminInvokePubKey = "admin_invoke_pub" | |
39 | + | ||
40 | + | let kMoneyBoxAddress = "money_box_address" | |
41 | 41 | ||
42 | 42 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
43 | 43 | ||
44 | - | func | |
44 | + | func getBase58FromOracle (key) = match getString(oracle, key) { | |
45 | 45 | case string: String => | |
46 | 46 | fromBase58String(string) | |
47 | 47 | case nothing => | |
48 | - | throw( | |
48 | + | throw((key + "is empty")) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | - | let adminPubKey1 = | |
52 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
53 | 53 | ||
54 | - | let adminPubKey2 = | |
54 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
55 | 55 | ||
56 | - | let adminPubKey3 = | |
56 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
57 | 57 | ||
58 | - | let | |
58 | + | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
59 | 59 | ||
60 | - | let | |
60 | + | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
61 | 61 | ||
62 | - | let | |
62 | + | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
63 | 63 | ||
64 | 64 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
65 | 65 | ||
66 | - | let EURN = base58'ECBCkHS68DckpBrzLeoRgYbFg7sCVqR176mPqbXsj9pA' | |
67 | - | ||
68 | - | let stakingAssets = [toBase58String(USDN), toBase58String(EURN)] | |
69 | - | ||
70 | - | let stakingUSDNNSBTAddress = Address(fromBase58String(valueOrErrorMessage(getString(oracle, keyUSDNNSBTAddress), "no usdn staking address"))) | |
71 | - | ||
72 | - | let stakingEURNAddress = Address(fromBase58String(valueOrErrorMessage(getString(oracle, keyEURNAddress), "no usdn staking address"))) | |
66 | + | let stakingAssets = [toBase58String(USDN)] | |
73 | 67 | ||
74 | 68 | let active = getBooleanValue(this, kActive) | |
75 | 69 | ||
76 | 70 | let strAssetIdA = getStringValue(this, kAssetIdA) | |
77 | 71 | ||
78 | 72 | let strAssetIdB = getStringValue(this, kAssetIdB) | |
79 | 73 | ||
80 | 74 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
81 | 75 | then unit | |
82 | 76 | else fromBase58String(strAssetIdA) | |
83 | 77 | ||
84 | 78 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
85 | 79 | then unit | |
86 | 80 | else fromBase58String(strAssetIdB) | |
87 | 81 | ||
88 | 82 | let assetNameA = match assetIdA { | |
89 | 83 | case id: ByteVector => | |
90 | 84 | value(assetInfo(id)).name | |
91 | 85 | case waves: Unit => | |
92 | 86 | "WAVES" | |
93 | 87 | case _ => | |
94 | 88 | throw("Match error") | |
95 | 89 | } | |
96 | 90 | ||
97 | 91 | let assetNameB = match assetIdB { | |
98 | 92 | case id: ByteVector => | |
99 | 93 | value(assetInfo(id)).name | |
100 | 94 | case waves: Unit => | |
101 | 95 | "WAVES" | |
102 | 96 | case _ => | |
103 | 97 | throw("Match error") | |
104 | 98 | } | |
105 | 99 | ||
106 | 100 | let balanceA = getIntegerValue(this, kBalanceA) | |
107 | 101 | ||
108 | 102 | let balanceB = getIntegerValue(this, kBalanceB) | |
109 | 103 | ||
110 | 104 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
111 | 105 | ||
112 | 106 | let shareAssetSupply = getIntegerValue(this, kShareAssetSupply) | |
113 | 107 | ||
114 | 108 | let invariant = getIntegerValue(this, kInvariant) | |
115 | 109 | ||
116 | - | let fee = | |
110 | + | let fee = getIntegerValue(this, kFee) | |
117 | 111 | ||
118 | - | let feeGovernance = | |
112 | + | let feeGovernance = fraction(fee, 40, 100) | |
119 | 113 | ||
120 | 114 | let feeScale6 = 1000000 | |
121 | 115 | ||
122 | 116 | let scale3 = 1000 | |
123 | 117 | ||
124 | 118 | let scale8 = 100000000 | |
125 | 119 | ||
126 | 120 | let scale16 = 10000000000000000 | |
127 | 121 | ||
128 | 122 | let slippageScale3 = 1000 | |
129 | 123 | ||
130 | 124 | let digits8 = 8 | |
131 | 125 | ||
132 | 126 | let dAppThreshold = 50 | |
133 | 127 | ||
134 | 128 | let dAppThresholdScale2 = 100 | |
135 | 129 | ||
136 | 130 | let exchangeRatioLimitMin = 90000000 | |
137 | 131 | ||
138 | 132 | let exchangeRatioLimitMax = 110000000 | |
139 | 133 | ||
140 | 134 | let alpha = 50 | |
141 | 135 | ||
142 | 136 | let alphaDigits = 2 | |
143 | 137 | ||
144 | 138 | let beta = 4600000000000000 | |
145 | 139 | ||
146 | 140 | func accountBalance (assetId) = match assetId { | |
147 | 141 | case id: ByteVector => | |
148 | 142 | assetBalance(this, id) | |
149 | 143 | case waves: Unit => | |
150 | 144 | wavesBalance(this).available | |
151 | 145 | case _ => | |
152 | 146 | throw("Match error") | |
153 | 147 | } | |
154 | 148 | ||
155 | 149 | ||
156 | 150 | func stakedAmount (assetId) = { | |
157 | 151 | let stakedAmountCalculated = match assetId { | |
158 | 152 | case aId: ByteVector => | |
159 | 153 | if ((aId == USDN)) | |
160 | - | then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
161 | - | else if ((aId == EURN)) | |
162 | - | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this))) | |
163 | - | else 0 | |
154 | + | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
155 | + | else 0 | |
164 | 156 | case _: Unit => | |
165 | 157 | 0 | |
166 | 158 | case _ => | |
167 | 159 | throw("Match error") | |
168 | 160 | } | |
169 | 161 | match stakedAmountCalculated { | |
170 | 162 | case i: Int => | |
171 | 163 | i | |
172 | 164 | case _ => | |
173 | 165 | 0 | |
174 | 166 | } | |
175 | 167 | } | |
176 | 168 | ||
177 | 169 | ||
178 | 170 | let stakedAmountA = stakedAmount(assetIdA) | |
179 | 171 | ||
180 | 172 | let stakedAmountB = stakedAmount(assetIdB) | |
181 | 173 | ||
182 | 174 | let availableBalanceA = (balanceA - stakedAmountA) | |
183 | 175 | ||
184 | 176 | let availableBalanceB = (balanceB - stakedAmountB) | |
185 | 177 | ||
186 | 178 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
187 | 179 | ||
188 | 180 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
189 | 181 | ||
190 | 182 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
191 | 183 | then (accountBalanceWithStakedB >= balanceB) | |
192 | 184 | else false | |
193 | 185 | ||
194 | 186 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
195 | 187 | ||
196 | 188 | ||
197 | 189 | func invariantCalc (x,y) = { | |
198 | 190 | let sk = skewness(x, y) | |
199 | 191 | (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
200 | 192 | } | |
201 | 193 | ||
202 | 194 | ||
203 | 195 | func calculateSendAmount (amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId) = { | |
204 | - | let worstAllowedNewInvariantRatio = ( | |
196 | + | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
205 | 197 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
206 | 198 | let x = (balanceA + tokenReceiveAmount) | |
207 | 199 | let y = (balanceB + tokenReceiveAmount) | |
208 | 200 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
209 | 201 | then { | |
210 | 202 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
211 | 203 | let stepInvariant = if ((tokenId == assetIdA)) | |
212 | 204 | then invariantCalc(x, (balanceB - amountToSend)) | |
213 | 205 | else invariantCalc((balanceA - amountToSend), y) | |
214 | 206 | if ((stepInvariant > invariant)) | |
215 | 207 | then $Tuple2(amountToSend, stepInvariant) | |
216 | 208 | else $Tuple2(-1, 0) | |
217 | 209 | } | |
218 | 210 | else acc | |
219 | 211 | ||
220 | 212 | let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000) | |
221 | 213 | if ((0 > amountToSendMin._1)) | |
222 | 214 | then throw("Price is worse than minReceived") | |
223 | 215 | else { | |
224 | 216 | let invEstimated = if ((tokenId == assetIdA)) | |
225 | 217 | then invariantCalc(x, (balanceB - amountToSendEstimated)) | |
226 | 218 | else if ((tokenId == assetIdB)) | |
227 | 219 | then invariantCalc((balanceA - amountToSendEstimated), y) | |
228 | 220 | else throw("Wrong asset in payment") | |
229 | - | | |
230 | - | then if ((worstAllowedNewInvariantRatio >= fraction( | |
231 | - | then throw(" | |
221 | + | if ((invariant > invEstimated)) | |
222 | + | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, invEstimated))) | |
223 | + | then throw("The requested price is too not profitable for user") | |
232 | 224 | else { | |
233 | 225 | let a = { | |
234 | 226 | let $l = [25, 200, 500] | |
235 | 227 | let $s = size($l) | |
236 | 228 | let $acc0 = $Tuple2(-1, 0) | |
237 | 229 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
238 | 230 | then $a | |
239 | 231 | else getStepAmount($a, $l[$i]) | |
240 | 232 | ||
241 | 233 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
242 | 234 | then $a | |
243 | 235 | else throw("List size exceeds 3") | |
244 | 236 | ||
245 | 237 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
246 | 238 | } | |
247 | 239 | if ((0 > a._1)) | |
248 | - | then amountToSendMin | |
249 | - | else a | |
240 | + | then amountToSendMin._1 | |
241 | + | else a._1 | |
250 | 242 | } | |
251 | 243 | else { | |
252 | 244 | let a = { | |
253 | 245 | let $l = [-500, -200, -25] | |
254 | 246 | let $s = size($l) | |
255 | 247 | let $acc0 = $Tuple2(-1, 0) | |
256 | 248 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
257 | 249 | then $a | |
258 | 250 | else getStepAmount($a, $l[$i]) | |
259 | 251 | ||
260 | 252 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
261 | 253 | then $a | |
262 | 254 | else throw("List size exceeds 3") | |
263 | 255 | ||
264 | 256 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
265 | 257 | } | |
266 | 258 | let tupleSendBetter = if ((0 > a._1)) | |
267 | 259 | then $Tuple2(amountToSendEstimated, invEstimated) | |
268 | 260 | else a | |
269 | - | if ((worstAllowedNewInvariantRatio >= fraction( | |
270 | - | then throw(" | |
271 | - | else tupleSendBetter | |
261 | + | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, tupleSendBetter._2))) | |
262 | + | then throw("The requested price is too not profitable for user") | |
263 | + | else tupleSendBetter._1 | |
272 | 264 | } | |
273 | - | amountToSendBest | |
274 | 265 | } | |
275 | 266 | } | |
276 | 267 | ||
277 | 268 | ||
278 | 269 | func getAssetInfo (assetId) = match assetId { | |
279 | 270 | case id: ByteVector => | |
280 | 271 | let stringId = toBase58String(id) | |
281 | 272 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
282 | 273 | $Tuple3(stringId, info.name, info.decimals) | |
283 | 274 | case waves: Unit => | |
284 | 275 | $Tuple3("WAVES", "WAVES", 8) | |
285 | 276 | case _ => | |
286 | 277 | throw("Match error") | |
287 | 278 | } | |
288 | 279 | ||
289 | 280 | ||
290 | 281 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
291 | 282 | ||
292 | 283 | ||
293 | 284 | func throwIsActive () = throw("DApp is already active") | |
294 | 285 | ||
295 | 286 | ||
296 | 287 | func isActive () = if (active) | |
297 | 288 | then unit | |
298 | 289 | else throw("DApp is inactive at this moment") | |
299 | 290 | ||
300 | 291 | ||
301 | 292 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
302 | 293 | then unit | |
303 | 294 | else throw("Only admin can call this function") | |
304 | 295 | ||
305 | 296 | ||
306 | 297 | func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
307 | 298 | ||
308 | 299 | ||
309 | 300 | func throwOnePayment () = throw("One attached payment expected") | |
310 | 301 | ||
311 | 302 | ||
312 | 303 | func throwThreshold (threshold,amountA,amountB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + assetNameA) + ", ") + toString(amountB)) + " ") + assetNameB)) | |
313 | 304 | ||
314 | 305 | ||
315 | 306 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
316 | 307 | ||
317 | 308 | ||
318 | 309 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
319 | - | then if ((assetId == USDN)) | |
320 | - | then $Tuple2("lockNeutrino", stakingUSDNNSBTAddress) | |
321 | - | else $Tuple2("startStaking", stakingEURNAddress) | |
322 | - | else if ((assetId == USDN)) | |
323 | - | then $Tuple2("unlockNeutrino", stakingUSDNNSBTAddress) | |
324 | - | else $Tuple2("stopStaking", stakingEURNAddress) | |
310 | + | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
311 | + | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
325 | 312 | ||
326 | 313 | ||
327 | 314 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
328 | 315 | then { | |
329 | - | let $ | |
330 | - | let call = $ | |
331 | - | let stakingAddr = $ | |
316 | + | let $t091419207 = calcStakingFuncAndAddres(stake, assetId) | |
317 | + | let call = $t091419207._1 | |
318 | + | let stakingAddr = $t091419207._2 | |
332 | 319 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
333 | 320 | } | |
334 | 321 | else { | |
335 | - | let $ | |
336 | - | let call = $ | |
337 | - | let stakingAddr = $ | |
322 | + | let $t092939359 = calcStakingFuncAndAddres(stake, assetId) | |
323 | + | let call = $t092939359._1 | |
324 | + | let stakingAddr = $t092939359._2 | |
338 | 325 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
339 | 326 | } | |
340 | 327 | ||
341 | 328 | ||
342 | 329 | @Callable(i) | |
343 | 330 | func init () = { | |
344 | - | let $ | |
345 | - | let pmtAmountA = $ | |
346 | - | let pmtAssetIdA = $ | |
347 | - | let $ | |
348 | - | let pmtAmountB = $ | |
349 | - | let pmtAssetIdB = $ | |
350 | - | let $ | |
351 | - | let pmtStrAssetIdA = $ | |
352 | - | let pmtAssetNameA = $ | |
353 | - | let pmtDecimalsA = $ | |
354 | - | let $ | |
355 | - | let pmtStrAssetIdB = $ | |
356 | - | let pmtAssetNameB = $ | |
357 | - | let pmtDecimalsB = $ | |
331 | + | let $t094649541 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
332 | + | let pmtAmountA = $t094649541._1 | |
333 | + | let pmtAssetIdA = $t094649541._2 | |
334 | + | let $t095469623 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
335 | + | let pmtAmountB = $t095469623._1 | |
336 | + | let pmtAssetIdB = $t095469623._2 | |
337 | + | let $t096289705 = getAssetInfo(pmtAssetIdA) | |
338 | + | let pmtStrAssetIdA = $t096289705._1 | |
339 | + | let pmtAssetNameA = $t096289705._2 | |
340 | + | let pmtDecimalsA = $t096289705._3 | |
341 | + | let $t097109787 = getAssetInfo(pmtAssetIdB) | |
342 | + | let pmtStrAssetIdB = $t097109787._1 | |
343 | + | let pmtAssetNameB = $t097109787._2 | |
344 | + | let pmtDecimalsB = $t097109787._3 | |
358 | 345 | if (isDefined(getBoolean(this, kActive))) | |
359 | 346 | then throwIsActive() | |
360 | 347 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
361 | 348 | then throw("Assets must be different") | |
362 | 349 | else { | |
363 | 350 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
364 | 351 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
365 | 352 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
366 | 353 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
367 | 354 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
368 | 355 | let shareIssueId = calculateAssetId(shareIssue) | |
369 | 356 | let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB) | |
370 | 357 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
371 | 358 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
372 | 359 | else 0 | |
373 | 360 | if ((stake1 == stake1)) | |
374 | 361 | then { | |
375 | 362 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
376 | 363 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
377 | 364 | else 0 | |
378 | 365 | if ((stake2 == stake2)) | |
379 | - | then [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, | |
366 | + | then [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
380 | 367 | else throw("Strict value is not equal to itself.") | |
381 | 368 | } | |
382 | 369 | else throw("Strict value is not equal to itself.") | |
383 | 370 | } | |
384 | 371 | } | |
385 | 372 | ||
386 | 373 | ||
387 | 374 | ||
388 | 375 | @Callable(i) | |
389 | 376 | func replenishWithTwoTokens () = valueOrElse(isActive(), { | |
390 | 377 | let pmtAssetIdA = i.payments[0].assetId | |
391 | 378 | let pmtAssetIdB = i.payments[1].assetId | |
392 | 379 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
393 | 380 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
394 | - | let $ | |
395 | - | let pmtStrAssetIdA = $ | |
396 | - | let pmtAssetNameA = $ | |
397 | - | let pmtDecimalsA = $ | |
398 | - | let $ | |
399 | - | let pmtStrAssetIdB = $ | |
400 | - | let pmtAssetNameB = $ | |
401 | - | let pmtDecimalsB = $ | |
402 | - | let $ | |
381 | + | let $t01243512512 = getAssetInfo(pmtAssetIdA) | |
382 | + | let pmtStrAssetIdA = $t01243512512._1 | |
383 | + | let pmtAssetNameA = $t01243512512._2 | |
384 | + | let pmtDecimalsA = $t01243512512._3 | |
385 | + | let $t01251712634 = getAssetInfo(pmtAssetIdB) | |
386 | + | let pmtStrAssetIdB = $t01251712634._1 | |
387 | + | let pmtAssetNameB = $t01251712634._2 | |
388 | + | let pmtDecimalsB = $t01251712634._3 | |
389 | + | let $t01263913143 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
403 | 390 | then { | |
404 | 391 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
405 | 392 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
406 | 393 | } | |
407 | 394 | else { | |
408 | - | let pmt = fraction( | |
395 | + | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
409 | 396 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
410 | 397 | } | |
411 | - | let pmtAmountA = $ | |
412 | - | let pmtAmountB = $ | |
413 | - | let change = $ | |
414 | - | let changeAssetId = $ | |
415 | - | let shareTokenRatio = $ | |
398 | + | let pmtAmountA = $t01263913143._1 | |
399 | + | let pmtAmountB = $t01263913143._2 | |
400 | + | let change = $t01263913143._3 | |
401 | + | let changeAssetId = $t01263913143._4 | |
402 | + | let shareTokenRatio = $t01263913143._5 | |
416 | 403 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
417 | 404 | if ((size(i.payments) != 2)) | |
418 | 405 | then throw("Two attached assets expected") | |
419 | 406 | else if (if ((pmtAssetIdA != assetIdA)) | |
420 | 407 | then true | |
421 | 408 | else (pmtAssetIdB != assetIdB)) | |
422 | 409 | then throwAssets() | |
423 | 410 | else if ((shareTokenToPayAmount == 0)) | |
424 | 411 | then throw("Too small amount to replenish") | |
425 | 412 | else if ((0 > change)) | |
426 | 413 | then throw("Change < 0") | |
427 | 414 | else if (!(hasEnoughBalance)) | |
428 | 415 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
429 | 416 | else { | |
430 | 417 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
431 | 418 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
432 | 419 | else 0 | |
433 | 420 | if ((stake1 == stake1)) | |
434 | 421 | then { | |
435 | 422 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
436 | 423 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
437 | 424 | else 0 | |
438 | 425 | if ((stake2 == stake2)) | |
439 | 426 | then [IntegerEntry(kBalanceA, (balanceA + pmtAmountA)), IntegerEntry(kBalanceB, (balanceB + pmtAmountB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(kInvariant, invariantCalc((balanceA + pmtAmountA), (balanceB + pmtAmountB))), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), ScriptTransfer(i.caller, change, changeAssetId)] | |
440 | 427 | else throw("Strict value is not equal to itself.") | |
441 | 428 | } | |
442 | 429 | else throw("Strict value is not equal to itself.") | |
443 | 430 | } | |
444 | 431 | }) | |
445 | 432 | ||
446 | 433 | ||
447 | 434 | ||
448 | 435 | @Callable(i) | |
449 | 436 | func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), { | |
450 | - | let $ | |
451 | - | let pmtAmount = $ | |
452 | - | let pmtAssetId = $ | |
453 | - | let $ | |
454 | - | let pmtStrAssetId = $ | |
455 | - | let pmtAssetName = $ | |
456 | - | let pmtDecimals = $ | |
437 | + | let $t01487614951 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
438 | + | let pmtAmount = $t01487614951._1 | |
439 | + | let pmtAssetId = $t01487614951._2 | |
440 | + | let $t01495615029 = getAssetInfo(pmtAssetId) | |
441 | + | let pmtStrAssetId = $t01495615029._1 | |
442 | + | let pmtAssetName = $t01495615029._2 | |
443 | + | let pmtDecimals = $t01495615029._3 | |
457 | 444 | let pmtMinThreshold = 5000000 | |
458 | 445 | let thresholdValueForMinTolerance = 50000000 | |
459 | 446 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
460 | 447 | then 100000 | |
461 | 448 | else 1 | |
462 | 449 | let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000)) | |
463 | 450 | let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000)) | |
464 | 451 | let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000)) | |
465 | 452 | if ((pmtMinThreshold > pmtAmount)) | |
466 | 453 | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
467 | 454 | else if ((size(i.payments) != 1)) | |
468 | 455 | then throwOnePayment() | |
469 | 456 | else if (!(hasEnoughBalance)) | |
470 | 457 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
471 | 458 | else if (if ((pmtAssetId != assetIdA)) | |
472 | 459 | then (pmtAssetId != assetIdB) | |
473 | 460 | else false) | |
474 | 461 | then throwAssets() | |
475 | 462 | else { | |
476 | - | let $t01638617151 = if ((pmtAssetId == assetIdA)) | |
477 | - | then $Tuple7((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), invariantCalc((balanceA + pmtAmount), balanceB), (balanceA + pmtAmount), balanceB) | |
478 | - | else $Tuple7(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), invariantCalc(balanceA, (balanceB + pmtAmount)), balanceA, (balanceB + pmtAmount)) | |
479 | - | let virtualReplenishA = $t01638617151._1 | |
480 | - | let virtualReplenishB = $t01638617151._2 | |
481 | - | let balanceAfterSwapA = $t01638617151._3 | |
482 | - | let balanceAfterSwapB = $t01638617151._4 | |
483 | - | let invariantCalculated = $t01638617151._5 | |
484 | - | let newBalanceA = $t01638617151._6 | |
485 | - | let newBalanceB = $t01638617151._7 | |
486 | - | let newBalanceEntry = if ((pmtAssetId == assetIdA)) | |
487 | - | then IntegerEntry(kBalanceA, newBalanceA) | |
488 | - | else IntegerEntry(kBalanceB, newBalanceB) | |
463 | + | let $t01600716649 = if ((pmtAssetId == assetIdA)) | |
464 | + | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
465 | + | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
466 | + | let virtualReplenishA = $t01600716649._1 | |
467 | + | let virtualReplenishB = $t01600716649._2 | |
468 | + | let balanceAfterSwapA = $t01600716649._3 | |
469 | + | let balanceAfterSwapB = $t01600716649._4 | |
470 | + | let newBalanceA = $t01600716649._5 | |
471 | + | let newBalanceB = $t01600716649._6 | |
489 | 472 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
490 | - | let invariantEstimatedRatio = fraction(scale8, invariant, invariantNew) | |
491 | - | let ratioVirtualBalanceToVirtualReplenish = (fraction((scale8 * scale8), balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
473 | + | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
492 | 474 | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
493 | - | if (if ((slippageValueMinForSwap >= | |
475 | + | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
494 | 476 | then true | |
495 | 477 | else (invariant > invariantNew)) | |
496 | 478 | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
497 | 479 | else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
498 | 480 | then true | |
499 | 481 | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
500 | 482 | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
501 | 483 | else if (if ((dAppThresholdAmount > newBalanceA)) | |
502 | 484 | then true | |
503 | 485 | else (dAppThresholdAmount > newBalanceB)) | |
504 | 486 | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
505 | 487 | else { | |
488 | + | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
489 | + | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
490 | + | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
491 | + | let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6) | |
492 | + | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
493 | + | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
494 | + | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
495 | + | let $t01863618931 = if ((pmtStrAssetId == strAssetIdA)) | |
496 | + | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
497 | + | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
498 | + | let stakeAmount = $t01863618931._1 | |
499 | + | let unstakeAmount = $t01863618931._2 | |
500 | + | let unstakeAsset = $t01863618931._3 | |
506 | 501 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
507 | - | then invoke(this, "stakeUnstake", [true, | |
502 | + | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
508 | 503 | else 0 | |
509 | 504 | if ((stake1 == stake1)) | |
510 | 505 | then { | |
511 | - | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
512 | - | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
513 | - | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
514 | - | [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), newBalanceEntry, IntegerEntry(kInvariant, invariantCalculated)] | |
506 | + | let stake2 = if (containsElement(stakingAssets, unstakeAsset)) | |
507 | + | then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil) | |
508 | + | else 0 | |
509 | + | if ((stake2 == stake2)) | |
510 | + | then [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB), IntegerEntry(kBalanceA, (newBalanceA - governanceRewardTokenA)), IntegerEntry(kBalanceB, (newBalanceB - governanceRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB)))] | |
511 | + | else throw("Strict value is not equal to itself.") | |
515 | 512 | } | |
516 | 513 | else throw("Strict value is not equal to itself.") | |
517 | 514 | } | |
518 | 515 | } | |
519 | 516 | }) | |
520 | 517 | ||
521 | 518 | ||
522 | 519 | ||
523 | 520 | @Callable(i) | |
524 | 521 | func withdraw () = valueOrElse(isActive(), { | |
525 | - | let $ | |
526 | - | let pmtAmount = $ | |
527 | - | let pmtAssetId = $ | |
522 | + | let $t02021820293 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
523 | + | let pmtAmount = $t02021820293._1 | |
524 | + | let pmtAssetId = $t02021820293._2 | |
528 | 525 | let amountToPayA = fraction(pmtAmount, balanceA, shareAssetSupply) | |
529 | 526 | let amountToPayB = fraction(pmtAmount, balanceB, shareAssetSupply) | |
530 | 527 | let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB)) | |
531 | 528 | if ((size(i.payments) != 1)) | |
532 | 529 | then throwOnePayment() | |
533 | 530 | else if ((pmtAssetId != shareAssetId)) | |
534 | 531 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
535 | 532 | else if (!(hasEnoughBalance)) | |
536 | 533 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
537 | 534 | else { | |
538 | 535 | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
539 | 536 | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
540 | 537 | else 0 | |
541 | 538 | if ((stake1 == stake1)) | |
542 | 539 | then { | |
543 | 540 | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
544 | 541 | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
545 | 542 | else 0 | |
546 | 543 | if ((stake2 == stake2)) | |
547 | 544 | then [IntegerEntry(kBalanceA, (balanceA - amountToPayA)), IntegerEntry(kBalanceB, (balanceB - amountToPayB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply - pmtAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
548 | 545 | else throw("Strict value is not equal to itself.") | |
549 | 546 | } | |
550 | 547 | else throw("Strict value is not equal to itself.") | |
551 | 548 | } | |
552 | 549 | }) | |
553 | 550 | ||
554 | 551 | ||
555 | 552 | ||
556 | 553 | @Callable(i) | |
557 | 554 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
558 | - | let $ | |
559 | - | let pmtAmount = $ | |
560 | - | let pmtAssetId = $ | |
555 | + | let $t02184421919 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
556 | + | let pmtAmount = $t02184421919._1 | |
557 | + | let pmtAssetId = $t02184421919._2 | |
561 | 558 | if ((0 >= estimatedAmountToReceive)) | |
562 | 559 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
563 | 560 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
564 | - | then throw | |
561 | + | then throw("Minimal amount can't be greater than estimated.") | |
565 | 562 | else if ((size(i.payments) != 1)) | |
566 | 563 | then throwOnePayment() | |
567 | 564 | else if (!(hasEnoughBalance)) | |
568 | 565 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
569 | 566 | else if (if ((pmtAssetId != assetIdA)) | |
570 | 567 | then (pmtAssetId != assetIdB) | |
571 | 568 | else false) | |
572 | 569 | then throwAssets() | |
573 | 570 | else if ((10000000 > pmtAmount)) | |
574 | 571 | then throw("Only swap of 10.000000 or more tokens is allowed") | |
575 | 572 | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
576 | 573 | then true | |
577 | 574 | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
578 | 575 | then throw("Incorrect args and pmt ratio") | |
579 | 576 | else { | |
580 | 577 | let sendAssetId = if ((pmtAssetId == assetIdA)) | |
581 | 578 | then assetIdB | |
582 | 579 | else assetIdA | |
583 | - | let $t02217322292 = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId) | |
584 | - | let amount = $t02217322292._1 | |
585 | - | let amountInvarian = $t02217322292._2 | |
580 | + | let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId) | |
586 | 581 | let governanceReward = fraction(amount, feeGovernance, feeScale6) | |
587 | 582 | let amountMinusFee = fraction(amount, (feeScale6 - fee), feeScale6) | |
588 | - | let $ | |
583 | + | let $t02322523487 = if ((pmtAssetId == assetIdA)) | |
589 | 584 | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
590 | 585 | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
591 | - | let newBalanceA = $ | |
592 | - | let newBalanceB = $ | |
586 | + | let newBalanceA = $t02322523487._1 | |
587 | + | let newBalanceB = $t02322523487._2 | |
593 | 588 | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
594 | 589 | if (if ((dAppThresholdAmount > newBalanceA)) | |
595 | 590 | then true | |
596 | 591 | else (dAppThresholdAmount > newBalanceB)) | |
597 | 592 | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
598 | 593 | else { | |
599 | - | let $ | |
600 | - | let pmtStrAssetId = $ | |
601 | - | let pmtAssetName = $ | |
602 | - | let pmtDecimals = $ | |
603 | - | let $ | |
604 | - | let sendStrAssetId = $ | |
605 | - | let sendAssetName = $ | |
606 | - | let sendDecimals = $ | |
594 | + | let $t02378623859 = getAssetInfo(pmtAssetId) | |
595 | + | let pmtStrAssetId = $t02378623859._1 | |
596 | + | let pmtAssetName = $t02378623859._2 | |
597 | + | let pmtDecimals = $t02378623859._3 | |
598 | + | let $t02387223949 = getAssetInfo(sendAssetId) | |
599 | + | let sendStrAssetId = $t02387223949._1 | |
600 | + | let sendAssetName = $t02387223949._2 | |
601 | + | let sendDecimals = $t02387223949._3 | |
607 | 602 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
608 | 603 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
609 | 604 | else 0 | |
610 | 605 | if ((stake1 == stake1)) | |
611 | 606 | then { | |
612 | 607 | let stake2 = if (containsElement(stakingAssets, sendStrAssetId)) | |
613 | 608 | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil) | |
614 | 609 | else 0 | |
615 | 610 | if ((stake2 == stake2)) | |
616 | - | then [IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, | |
611 | + | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], $Tuple2(amountMinusFee, sendAssetId)) | |
617 | 612 | else throw("Strict value is not equal to itself.") | |
618 | 613 | } | |
619 | 614 | else throw("Strict value is not equal to itself.") | |
620 | 615 | } | |
621 | 616 | } | |
622 | 617 | }) | |
623 | 618 | ||
624 | 619 | ||
625 | 620 | ||
626 | 621 | @Callable(i) | |
627 | 622 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
628 | 623 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
629 | 624 | else suspend("Paused by admin")) | |
630 | 625 | ||
631 | 626 | ||
632 | 627 | ||
633 | 628 | @Callable(i) | |
634 | 629 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
635 | 630 | then throwIsActive() | |
636 | 631 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
637 | 632 | ||
638 | 633 | ||
639 | 634 | ||
640 | 635 | @Callable(i) | |
641 | 636 | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
642 | 637 | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
643 | 638 | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
644 | 639 | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
645 | - | if ((i.caller != | |
646 | - | then throw("Only the | |
640 | + | if ((i.caller != moneyBoxAddress)) | |
641 | + | then throw("Only the money box can call this function") | |
647 | 642 | else if (if ((0 > amountEnrollA)) | |
648 | 643 | then true | |
649 | 644 | else (0 > amountEnrollB)) | |
650 | 645 | then suspend("Enroll amount negative") | |
651 | 646 | else if (if ((amountEnrollA == 0)) | |
652 | 647 | then (amountEnrollB == 0) | |
653 | 648 | else false) | |
654 | 649 | then throw("No money to take") | |
655 | 650 | else { | |
656 | 651 | let stake1 = if (if (containsElement(stakingAssets, strAssetIdA)) | |
657 | 652 | then (amountEnrollA > 0) | |
658 | 653 | else false) | |
659 | 654 | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
660 | 655 | else 0 | |
661 | 656 | if ((stake1 == stake1)) | |
662 | 657 | then { | |
663 | 658 | let stake2 = if (if (containsElement(stakingAssets, strAssetIdB)) | |
664 | 659 | then (amountEnrollB > 0) | |
665 | 660 | else false) | |
666 | 661 | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
667 | 662 | else 0 | |
668 | 663 | if ((stake2 == stake2)) | |
669 | - | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB)) | |
664 | + | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
670 | 665 | else throw("Strict value is not equal to itself.") | |
671 | 666 | } | |
672 | 667 | else throw("Strict value is not equal to itself.") | |
673 | 668 | } | |
674 | 669 | }) | |
675 | 670 | ||
676 | 671 | ||
677 | 672 | ||
678 | 673 | @Callable(i) | |
679 | - | func writeBigIntInvariant () = valueOrElse(isAdminCall(i), { | |
680 | - | let invariantNew = invariantCalc(balanceA, balanceB) | |
681 | - | [IntegerEntry(kInvariant, invariantNew)] | |
682 | - | }) | |
683 | - | ||
684 | - | ||
685 | - | ||
686 | - | @Callable(i) | |
687 | 674 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
688 | 675 | then throw("Only contract itself can invoke this function") | |
689 | 676 | else { | |
690 | - | let $ | |
691 | - | let call = $ | |
692 | - | let addr = $ | |
693 | - | let params = $ | |
694 | - | let payments = $ | |
677 | + | let $t02695327056 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
678 | + | let call = $t02695327056._1 | |
679 | + | let addr = $t02695327056._2 | |
680 | + | let params = $t02695327056._3 | |
681 | + | let payments = $t02695327056._4 | |
695 | 682 | let inv = invoke(addr, call, params, payments) | |
696 | 683 | if ((inv == inv)) | |
697 | 684 | then nil | |
698 | 685 | else throw("Strict value is not equal to itself.") | |
699 | 686 | } | |
700 | 687 | ||
701 | 688 | ||
702 | 689 | @Verifier(tx) | |
703 | 690 | func verify () = { | |
704 | 691 | let multiSignedByAdmins = { | |
705 | 692 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
706 | 693 | then 1 | |
707 | 694 | else 0 | |
708 | 695 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
709 | 696 | then 1 | |
710 | 697 | else 0 | |
711 | 698 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
712 | 699 | then 1 | |
713 | 700 | else 0 | |
714 | 701 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
715 | 702 | } | |
716 | 703 | match tx { | |
717 | 704 | case inv: InvokeScriptTransaction => | |
718 | 705 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
719 | 706 | then (inv.function == "takeIntoAccountExtraFunds") | |
720 | 707 | else false | |
721 | 708 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
722 | 709 | then true | |
723 | 710 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
724 | 711 | then true | |
725 | 712 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
726 | 713 | then true | |
727 | - | else sigVerify(tx.bodyBytes, tx.proofs[0], | |
714 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
728 | 715 | if (if (callTakeIntoAccount) | |
729 | 716 | then signedByAdmin | |
730 | 717 | else false) | |
731 | 718 | then true | |
732 | 719 | else multiSignedByAdmins | |
733 | 720 | case _ => | |
734 | 721 | multiSignedByAdmins | |
735 | 722 | } | |
736 | 723 | } | |
737 | 724 |
github/deemru/w8io/026f985 130.60 ms ◑