tx · 9LDX1qWA7kjJHKGKizdxveLAQb9cdb4tVMWToNyKQx45 3NAMiUq5LDz5Cs1QmrFyxE9ERfw5FviKNg3: -0.02500000 Waves 2022.07.06 11:09 [2127566] smart account 3NAMiUq5LDz5Cs1QmrFyxE9ERfw5FviKNg3 > SELF 0.00000000 Waves
{ "type": 13, "id": "9LDX1qWA7kjJHKGKizdxveLAQb9cdb4tVMWToNyKQx45", "fee": 2500000, "feeAssetId": null, "timestamp": 1657094964161, "version": 2, "chainId": 84, "sender": "3NAMiUq5LDz5Cs1QmrFyxE9ERfw5FviKNg3", "senderPublicKey": "CrhBQ3EirHV3itLiADANEmGMthAWUCQMuCkTXrAxJvyQ", "proofs": [ "2Zim5eyxgVAy39DJ7rtYJAKc58acLrajgo3XryQBmNqyoRWp8PcuEY3aqGxCyJPoARuvgssS2Y3LvGEjoH9n63WL", "5wtnbimJ73FKDnuRXrEfzsv99NGQxjhKQK575XgxRVWFJzfKj2Q58KRKd1J7wdRAgdz6d5PCeY6cTnqJaHnoXYwz" ], "script": "base64:AAIFAAAAAAAAAB4IAhIDCgEEEgUKAwgBARIAEgASAwoBARIFCgMEAQgAAABRAAAAAAd2ZXJzaW9uAgAAAAUyLjAuMAAAAAAIa1ZlcnNpb24CAAAAB3ZlcnNpb24AAAAAB2tBY3RpdmUCAAAABmFjdGl2ZQAAAAAHa0Fzc2V0cwIAAAAJYXNzZXRfaWRzAAAAAA1rQXNzZXRCYWxhbmNlAgAAAA5fYXNzZXRfYmFsYW5jZQAAAAANa1NoYXJlQXNzZXRJZAIAAAAOc2hhcmVfYXNzZXRfaWQAAAAAEWtTaGFyZUFzc2V0U3VwcGx5AgAAABJzaGFyZV9hc3NldF9zdXBwbHkAAAAABGtGZWUCAAAACmNvbW1pc3Npb24AAAAACmtJbnZhcmlhbnQCAAAACWludmFyaWFudAAAAAAGa0NhdXNlAgAAAA5zaHV0ZG93bl9jYXVzZQAAAAAMa1VTRE5BZGRyZXNzAgAAABhzdGFraW5nX3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RtaW5QdWJLZXkyBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADGFkbWluUHViS2V5MwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABFhZG1pblB1YktleUludm9rZQMDBQAAABNjYWxsVGFrZUludG9BY2NvdW50BQAAAA1zaWduZWRCeUFkbWluBwYFAAAAE211bHRpU2lnbmVkQnlBZG1pbnMFAAAAE211bHRpU2lnbmVkQnlBZG1pbnOwM2YY", "height": 2127566, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DPeGDW8zQk1YMbSFraj12hNYkK8DXnoy44q9d4iiUPA3 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
178 | 178 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
179 | 179 | then { | |
180 | 180 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
181 | - | let stepInvariant = invariantCalc(balanceFrom, (balanceTo - amountToSend)) | |
181 | + | let stepInvariant = invariantCalc((balanceFrom + tokenReceiveAmount), (balanceTo - amountToSend)) | |
182 | 182 | if ((stepInvariant > invariant)) | |
183 | 183 | then $Tuple2(amountToSend, stepInvariant) | |
184 | 184 | else $Tuple2(-1, 0) | |
189 | 189 | if ((0 > amountToSendMin._1)) | |
190 | 190 | then throw("Price is worse than minReceived") | |
191 | 191 | else { | |
192 | - | let invEstimated = invariantCalc(balanceFrom, (balanceTo - amountToSendEstimated)) | |
192 | + | let invEstimated = invariantCalc((balanceFrom + tokenReceiveAmount), (balanceTo - amountToSendEstimated)) | |
193 | 193 | if ((invariant > invEstimated)) | |
194 | 194 | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, invEstimated))) | |
195 | 195 | then throw("The requested price is too not profitable for user") | |
285 | 285 | ||
286 | 286 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
287 | 287 | then { | |
288 | - | let $ | |
289 | - | let call = $ | |
290 | - | let stakingAddr = $ | |
288 | + | let $t087078773 = calcStakingFuncAndAddres(stake, assetId) | |
289 | + | let call = $t087078773._1 | |
290 | + | let stakingAddr = $t087078773._2 | |
291 | 291 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
292 | 292 | } | |
293 | 293 | else { | |
294 | - | let $ | |
295 | - | let call = $ | |
296 | - | let stakingAddr = $ | |
294 | + | let $t088598925 = calcStakingFuncAndAddres(stake, assetId) | |
295 | + | let call = $t088598925._1 | |
296 | + | let stakingAddr = $t088598925._2 | |
297 | 297 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
298 | 298 | } | |
299 | 299 | ||
340 | 340 | then throwIsActive() | |
341 | 341 | else { | |
342 | 342 | func parseInitPayments (acc,payment) = { | |
343 | - | let $ | |
344 | - | let entries = $ | |
345 | - | let assetIds = $ | |
346 | - | let sum = $ | |
347 | - | let $ | |
348 | - | let amount = $ | |
349 | - | let assetId = $ | |
343 | + | let $t01083310867 = acc | |
344 | + | let entries = $t01083310867._1 | |
345 | + | let assetIds = $t01083310867._2 | |
346 | + | let sum = $t01083310867._3 | |
347 | + | let $t01088010962 = $Tuple2(payment.amount, toBase58String(value(payment.assetId))) | |
348 | + | let amount = $t01088010962._1 | |
349 | + | let assetId = $t01088010962._2 | |
350 | 350 | let stake = if (containsElement(stakingAssets, assetId)) | |
351 | 351 | then invoke(this, "stakeUnstake", [true, amount, assetId], nil) | |
352 | 352 | else 0 | |
359 | 359 | else throw("Strict value is not equal to itself.") | |
360 | 360 | } | |
361 | 361 | ||
362 | - | let $ | |
362 | + | let $t01153711627 = { | |
363 | 363 | let $l = i.payments | |
364 | 364 | let $s = size($l) | |
365 | 365 | let $acc0 = $Tuple3(nil, "", 0) | |
373 | 373 | ||
374 | 374 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
375 | 375 | } | |
376 | - | let balanceEntries = $ | |
377 | - | let assetIds = $ | |
378 | - | let sum = $ | |
376 | + | let balanceEntries = $t01153711627._1 | |
377 | + | let assetIds = $t01153711627._2 | |
378 | + | let sum = $t01153711627._3 | |
379 | 379 | let shareName = "s_Multi_USD" | |
380 | 380 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
381 | 381 | let shareDecimals = 6 | |
392 | 392 | ||
393 | 393 | @Callable(i) | |
394 | 394 | func exchange (exchangeAseetId,estimatedAmountToReceive,minAmountToReceive) = { | |
395 | - | let $ | |
396 | - | let pmtAmount = $ | |
397 | - | let pmtAssetId = $ | |
398 | - | let $ | |
399 | - | let balanceFrom = $ | |
400 | - | let balanceTo = $ | |
401 | - | let accountBalanceFrom = $ | |
402 | - | let accountBalanceTo = $ | |
395 | + | let $t01309813173 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
396 | + | let pmtAmount = $t01309813173._1 | |
397 | + | let pmtAssetId = $t01309813173._2 | |
398 | + | let $t01317813318 = getPoolBalances(value(pmtAssetId), fromBase58String(exchangeAseetId)) | |
399 | + | let balanceFrom = $t01317813318._1 | |
400 | + | let balanceTo = $t01317813318._2 | |
401 | + | let accountBalanceFrom = $t01317813318._3 | |
402 | + | let accountBalanceTo = $t01317813318._4 | |
403 | 403 | let pmtStrAssetId = toBase58String(value(pmtAssetId)) | |
404 | 404 | if ((0 >= estimatedAmountToReceive)) | |
405 | 405 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
427 | 427 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
428 | 428 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
429 | 429 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
430 | - | let $ | |
431 | - | let newBalanceFrom = $ | |
432 | - | let newBalanceTo = $ | |
430 | + | let $t01495515064 = $Tuple2((balanceFrom + pmtAmount), ((balanceTo - amountMinusFee) - governanceReward)) | |
431 | + | let newBalanceFrom = $t01495515064._1 | |
432 | + | let newBalanceTo = $t01495515064._2 | |
433 | 433 | let dAppThresholdAmount = fraction((newBalanceFrom + newBalanceTo), dAppThreshold, (2 * dAppThresholdScale2)) | |
434 | 434 | if (if ((dAppThresholdAmount > newBalanceFrom)) | |
435 | 435 | then true | |
478 | 478 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
479 | 479 | then throw("Only contract itself can invoke this function") | |
480 | 480 | else { | |
481 | - | let $ | |
482 | - | let call = $ | |
483 | - | let addr = $ | |
484 | - | let params = $ | |
485 | - | let payments = $ | |
481 | + | let $t01740917512 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
482 | + | let call = $t01740917512._1 | |
483 | + | let addr = $t01740917512._2 | |
484 | + | let params = $t01740917512._3 | |
485 | + | let payments = $t01740917512._4 | |
486 | 486 | let inv = invoke(addr, call, params, payments) | |
487 | 487 | if ((inv == inv)) | |
488 | 488 | then nil |
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 kAssets = "asset_ids" | |
11 | 11 | ||
12 | 12 | let kAssetBalance = "_asset_balance" | |
13 | 13 | ||
14 | 14 | let kShareAssetId = "share_asset_id" | |
15 | 15 | ||
16 | 16 | let kShareAssetSupply = "share_asset_supply" | |
17 | 17 | ||
18 | 18 | let kFee = "commission" | |
19 | 19 | ||
20 | 20 | let kInvariant = "invariant" | |
21 | 21 | ||
22 | 22 | let kCause = "shutdown_cause" | |
23 | 23 | ||
24 | 24 | let kUSDNAddress = "staking_usdnnsbt_address" | |
25 | 25 | ||
26 | 26 | let kEURNAddress = "staking_eurn_address" | |
27 | 27 | ||
28 | 28 | let kDiscounts = "discounts" | |
29 | 29 | ||
30 | 30 | let kDiscountValues = "discount_values" | |
31 | 31 | ||
32 | 32 | let kUserSwopInGov = "_SWOP_amount" | |
33 | 33 | ||
34 | 34 | let kFirstHarvest = "first_harvest" | |
35 | 35 | ||
36 | 36 | let kFirstHarvestHeight = "first_harvest_height" | |
37 | 37 | ||
38 | 38 | let kShareLimit = "share_limit_on_first_harvest" | |
39 | 39 | ||
40 | 40 | let kBasePeriod = "base_period" | |
41 | 41 | ||
42 | 42 | let kPeriodLength = "period_length" | |
43 | 43 | ||
44 | 44 | let kStartHeight = "start_height" | |
45 | 45 | ||
46 | 46 | let kAdminPubKey1 = "admin_pub_1" | |
47 | 47 | ||
48 | 48 | let kAdminPubKey2 = "admin_pub_2" | |
49 | 49 | ||
50 | 50 | let kAdminPubKey3 = "admin_pub_3" | |
51 | 51 | ||
52 | 52 | let kAdminInvokePubKey = "admin_invoke_pub" | |
53 | 53 | ||
54 | 54 | let kMoneyBoxAddress = "money_box_address" | |
55 | 55 | ||
56 | 56 | let kGovAddress = "governance_address" | |
57 | 57 | ||
58 | 58 | let kVotingAddress = "voting_address" | |
59 | 59 | ||
60 | 60 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
61 | 61 | ||
62 | 62 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
63 | 63 | case string: String => | |
64 | 64 | fromBase58String(string) | |
65 | 65 | case nothing => | |
66 | 66 | throw((key + "is empty")) | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
71 | 71 | ||
72 | 72 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
73 | 73 | ||
74 | 74 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
75 | 75 | ||
76 | 76 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
77 | 77 | ||
78 | 78 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
79 | 79 | ||
80 | 80 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
81 | 81 | ||
82 | 82 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
83 | 83 | ||
84 | 84 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
85 | 85 | ||
86 | 86 | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
87 | 87 | ||
88 | 88 | let stakingAssets = [toBase58String(USDN)] | |
89 | 89 | ||
90 | 90 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
91 | 91 | ||
92 | 92 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
93 | 93 | ||
94 | 94 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
95 | 95 | ||
96 | 96 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
97 | 97 | ||
98 | 98 | let active = getBooleanValue(this, kActive) | |
99 | 99 | ||
100 | 100 | let shareSupply = getIntegerValue(this, kShareAssetSupply) | |
101 | 101 | ||
102 | 102 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
103 | 103 | ||
104 | 104 | let exchangeAssets = getString(this, kAssets) | |
105 | 105 | ||
106 | 106 | let fee = getIntegerValue(this, kFee) | |
107 | 107 | ||
108 | 108 | let feeGovernance = fraction(fee, 40, 100) | |
109 | 109 | ||
110 | 110 | let feeScale6 = 1000000 | |
111 | 111 | ||
112 | 112 | let scale3 = 1000 | |
113 | 113 | ||
114 | 114 | let scale8 = 100000000 | |
115 | 115 | ||
116 | 116 | let scale16 = 10000000000000000 | |
117 | 117 | ||
118 | 118 | let slippageScale3 = 1000 | |
119 | 119 | ||
120 | 120 | let digits8 = 8 | |
121 | 121 | ||
122 | 122 | let dAppThreshold = 50 | |
123 | 123 | ||
124 | 124 | let dAppThresholdScale2 = 100 | |
125 | 125 | ||
126 | 126 | let exchangeRatioLimitMin = 90000000 | |
127 | 127 | ||
128 | 128 | let exchangeRatioLimitMax = 110000000 | |
129 | 129 | ||
130 | 130 | let alpha = 50 | |
131 | 131 | ||
132 | 132 | let alphaDigits = 2 | |
133 | 133 | ||
134 | 134 | let beta = 4600000000000000 | |
135 | 135 | ||
136 | 136 | func accountBalance (assetId) = match assetId { | |
137 | 137 | case id: ByteVector => | |
138 | 138 | assetBalance(this, id) | |
139 | 139 | case waves: Unit => | |
140 | 140 | wavesBalance(this).available | |
141 | 141 | case _ => | |
142 | 142 | throw("Match error") | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func stakedAmount (assetId) = { | |
147 | 147 | let stakedAmountCalculated = match assetId { | |
148 | 148 | case aId: ByteVector => | |
149 | 149 | if ((aId == USDN)) | |
150 | 150 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
151 | 151 | else 0 | |
152 | 152 | case _: Unit => | |
153 | 153 | 0 | |
154 | 154 | case _ => | |
155 | 155 | throw("Match error") | |
156 | 156 | } | |
157 | 157 | match stakedAmountCalculated { | |
158 | 158 | case i: Int => | |
159 | 159 | i | |
160 | 160 | case _ => | |
161 | 161 | 0 | |
162 | 162 | } | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func invariantCalc (x,y) = { | |
170 | 170 | let sk = skewness(x, y) | |
171 | 171 | (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))) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func calculateSendAmount (balanceFrom,balanceTo,invariant,amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount) = { | |
176 | 176 | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
177 | 177 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
178 | 178 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
179 | 179 | then { | |
180 | 180 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
181 | - | let stepInvariant = invariantCalc(balanceFrom, (balanceTo - amountToSend)) | |
181 | + | let stepInvariant = invariantCalc((balanceFrom + tokenReceiveAmount), (balanceTo - amountToSend)) | |
182 | 182 | if ((stepInvariant > invariant)) | |
183 | 183 | then $Tuple2(amountToSend, stepInvariant) | |
184 | 184 | else $Tuple2(-1, 0) | |
185 | 185 | } | |
186 | 186 | else acc | |
187 | 187 | ||
188 | 188 | let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000) | |
189 | 189 | if ((0 > amountToSendMin._1)) | |
190 | 190 | then throw("Price is worse than minReceived") | |
191 | 191 | else { | |
192 | - | let invEstimated = invariantCalc(balanceFrom, (balanceTo - amountToSendEstimated)) | |
192 | + | let invEstimated = invariantCalc((balanceFrom + tokenReceiveAmount), (balanceTo - amountToSendEstimated)) | |
193 | 193 | if ((invariant > invEstimated)) | |
194 | 194 | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, invEstimated))) | |
195 | 195 | then throw("The requested price is too not profitable for user") | |
196 | 196 | else { | |
197 | 197 | let a = { | |
198 | 198 | let $l = [25, 200, 500] | |
199 | 199 | let $s = size($l) | |
200 | 200 | let $acc0 = $Tuple2(-1, 0) | |
201 | 201 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
202 | 202 | then $a | |
203 | 203 | else getStepAmount($a, $l[$i]) | |
204 | 204 | ||
205 | 205 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
206 | 206 | then $a | |
207 | 207 | else throw("List size exceeds 3") | |
208 | 208 | ||
209 | 209 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
210 | 210 | } | |
211 | 211 | if ((0 > a._1)) | |
212 | 212 | then amountToSendMin._1 | |
213 | 213 | else a._1 | |
214 | 214 | } | |
215 | 215 | else { | |
216 | 216 | let a = { | |
217 | 217 | let $l = [-500, -200, -25] | |
218 | 218 | let $s = size($l) | |
219 | 219 | let $acc0 = $Tuple2(-1, 0) | |
220 | 220 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
221 | 221 | then $a | |
222 | 222 | else getStepAmount($a, $l[$i]) | |
223 | 223 | ||
224 | 224 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
225 | 225 | then $a | |
226 | 226 | else throw("List size exceeds 3") | |
227 | 227 | ||
228 | 228 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
229 | 229 | } | |
230 | 230 | let tupleSendBetter = if ((0 > a._1)) | |
231 | 231 | then $Tuple2(amountToSendEstimated, invEstimated) | |
232 | 232 | else a | |
233 | 233 | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, tupleSendBetter._2))) | |
234 | 234 | then throw("The requested price is too not profitable for user") | |
235 | 235 | else tupleSendBetter._1 | |
236 | 236 | } | |
237 | 237 | } | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func getAssetInfo (assetId) = match assetId { | |
242 | 242 | case id: ByteVector => | |
243 | 243 | let stringId = toBase58String(id) | |
244 | 244 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
245 | 245 | $Tuple3(stringId, info.name, info.decimals) | |
246 | 246 | case waves: Unit => | |
247 | 247 | $Tuple3("WAVES", "WAVES", 8) | |
248 | 248 | case _ => | |
249 | 249 | throw("Match error") | |
250 | 250 | } | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func throwIsActive () = throw("DApp is already active") | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func isActive () = if (active) | |
260 | 260 | then unit | |
261 | 261 | else throw("DApp is inactive at this moment") | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
265 | 265 | then unit | |
266 | 266 | else throw("Only admin can call this function") | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func throwAssets () = throw("Incorrect assets attached.") | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func throwOnePayment () = throw("One attached payment expected") | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func throwThreshold (threshold,amountA,amountB,assetIdA,assetIdB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + toBase58String(assetIdA)) + ", ") + toString(amountB)) + " ") + toBase58String(assetIdB))) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func suspendSuspicious (balanceA,assetIdA,balanceB,assetIdB) = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + toBase58String(assetIdA)) + ", ") + toString(balanceB)) + " ") + toBase58String(assetIdB)) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + toBase58String(assetIdA)) + ", ") + toString(accountBalance(assetIdB))) + " ") + toBase58String(assetIdB))) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
282 | 282 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
283 | 283 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
287 | 287 | then { | |
288 | - | let $ | |
289 | - | let call = $ | |
290 | - | let stakingAddr = $ | |
288 | + | let $t087078773 = calcStakingFuncAndAddres(stake, assetId) | |
289 | + | let call = $t087078773._1 | |
290 | + | let stakingAddr = $t087078773._2 | |
291 | 291 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
292 | 292 | } | |
293 | 293 | else { | |
294 | - | let $ | |
295 | - | let call = $ | |
296 | - | let stakingAddr = $ | |
294 | + | let $t088598925 = calcStakingFuncAndAddres(stake, assetId) | |
295 | + | let call = $t088598925._1 | |
296 | + | let stakingAddr = $t088598925._2 | |
297 | 297 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
298 | 298 | } | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func calculateFeeDiscount (userAddr) = { | |
302 | 302 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
303 | 303 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
304 | 304 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
305 | 305 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
306 | 306 | then (parseIntValue(discountValues[1]) > swopAmount) | |
307 | 307 | else false) | |
308 | 308 | then (feeScale6 - parseIntValue(discounts[0])) | |
309 | 309 | else if (if ((swopAmount >= parseIntValue(discountValues[1]))) | |
310 | 310 | then (parseIntValue(discountValues[2]) > swopAmount) | |
311 | 311 | else false) | |
312 | 312 | then (feeScale6 - parseIntValue(discounts[1])) | |
313 | 313 | else if (if ((swopAmount >= parseIntValue(discountValues[2]))) | |
314 | 314 | then (parseIntValue(discountValues[3]) > swopAmount) | |
315 | 315 | else false) | |
316 | 316 | then (feeScale6 - parseIntValue(discounts[2])) | |
317 | 317 | else if (if ((swopAmount >= parseIntValue(discountValues[3]))) | |
318 | 318 | then (parseIntValue(discountValues[4]) > swopAmount) | |
319 | 319 | else false) | |
320 | 320 | then (feeScale6 - parseIntValue(discounts[3])) | |
321 | 321 | else if ((swopAmount >= parseIntValue(discountValues[4]))) | |
322 | 322 | then (feeScale6 - parseIntValue(discounts[4])) | |
323 | 323 | else feeScale6 | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | func getPoolBalances (assetIdA,assetIdB) = { | |
328 | 328 | let balanceA = getIntegerValue(this, (toBase58String(assetIdA) + kAssetBalance)) | |
329 | 329 | let balanceB = getIntegerValue(this, (toBase58String(assetIdB) + kAssetBalance)) | |
330 | 330 | let stakedAmountA = stakedAmount(assetIdA) | |
331 | 331 | let stakedAmountB = stakedAmount(assetIdB) | |
332 | 332 | let accountBalanceA = (accountBalance(assetIdA) + stakedAmountA) | |
333 | 333 | let accountBalanceB = (accountBalance(assetIdB) + stakedAmountB) | |
334 | 334 | $Tuple4(balanceA, balanceB, accountBalanceA, accountBalanceB) | |
335 | 335 | } | |
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(i) | |
339 | 339 | func init (firstHarvest) = if (isDefined(getBoolean(this, kActive))) | |
340 | 340 | then throwIsActive() | |
341 | 341 | else { | |
342 | 342 | func parseInitPayments (acc,payment) = { | |
343 | - | let $ | |
344 | - | let entries = $ | |
345 | - | let assetIds = $ | |
346 | - | let sum = $ | |
347 | - | let $ | |
348 | - | let amount = $ | |
349 | - | let assetId = $ | |
343 | + | let $t01083310867 = acc | |
344 | + | let entries = $t01083310867._1 | |
345 | + | let assetIds = $t01083310867._2 | |
346 | + | let sum = $t01083310867._3 | |
347 | + | let $t01088010962 = $Tuple2(payment.amount, toBase58String(value(payment.assetId))) | |
348 | + | let amount = $t01088010962._1 | |
349 | + | let assetId = $t01088010962._2 | |
350 | 350 | let stake = if (containsElement(stakingAssets, assetId)) | |
351 | 351 | then invoke(this, "stakeUnstake", [true, amount, assetId], nil) | |
352 | 352 | else 0 | |
353 | 353 | if ((stake == stake)) | |
354 | 354 | then if (contains(assetIds, assetId)) | |
355 | 355 | then throw("Assets must be different") | |
356 | 356 | else $Tuple3((entries :+ IntegerEntry((assetId + kAssetBalance), amount)), if ((size(assetIds) == 0)) | |
357 | 357 | then assetId | |
358 | 358 | else ((assetIds + ",") + assetId), (sum + amount)) | |
359 | 359 | else throw("Strict value is not equal to itself.") | |
360 | 360 | } | |
361 | 361 | ||
362 | - | let $ | |
362 | + | let $t01153711627 = { | |
363 | 363 | let $l = i.payments | |
364 | 364 | let $s = size($l) | |
365 | 365 | let $acc0 = $Tuple3(nil, "", 0) | |
366 | 366 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
367 | 367 | then $a | |
368 | 368 | else parseInitPayments($a, $l[$i]) | |
369 | 369 | ||
370 | 370 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
371 | 371 | then $a | |
372 | 372 | else throw("List size exceeds 10") | |
373 | 373 | ||
374 | 374 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
375 | 375 | } | |
376 | - | let balanceEntries = $ | |
377 | - | let assetIds = $ | |
378 | - | let sum = $ | |
376 | + | let balanceEntries = $t01153711627._1 | |
377 | + | let assetIds = $t01153711627._2 | |
378 | + | let sum = $t01153711627._3 | |
379 | 379 | let shareName = "s_Multi_USD" | |
380 | 380 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
381 | 381 | let shareDecimals = 6 | |
382 | 382 | let shareInitialSupply = sum | |
383 | 383 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
384 | 384 | let shareIssueId = calculateAssetId(shareIssue) | |
385 | 385 | let baseEntry = ([StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssets, assetIds), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] ++ balanceEntries) | |
386 | 386 | if (firstHarvest) | |
387 | 387 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
388 | 388 | else baseEntry | |
389 | 389 | } | |
390 | 390 | ||
391 | 391 | ||
392 | 392 | ||
393 | 393 | @Callable(i) | |
394 | 394 | func exchange (exchangeAseetId,estimatedAmountToReceive,minAmountToReceive) = { | |
395 | - | let $ | |
396 | - | let pmtAmount = $ | |
397 | - | let pmtAssetId = $ | |
398 | - | let $ | |
399 | - | let balanceFrom = $ | |
400 | - | let balanceTo = $ | |
401 | - | let accountBalanceFrom = $ | |
402 | - | let accountBalanceTo = $ | |
395 | + | let $t01309813173 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
396 | + | let pmtAmount = $t01309813173._1 | |
397 | + | let pmtAssetId = $t01309813173._2 | |
398 | + | let $t01317813318 = getPoolBalances(value(pmtAssetId), fromBase58String(exchangeAseetId)) | |
399 | + | let balanceFrom = $t01317813318._1 | |
400 | + | let balanceTo = $t01317813318._2 | |
401 | + | let accountBalanceFrom = $t01317813318._3 | |
402 | + | let accountBalanceTo = $t01317813318._4 | |
403 | 403 | let pmtStrAssetId = toBase58String(value(pmtAssetId)) | |
404 | 404 | if ((0 >= estimatedAmountToReceive)) | |
405 | 405 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
406 | 406 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
407 | 407 | then throw("Minimal amount can't be greater than estimated.") | |
408 | 408 | else if ((size(i.payments) != 1)) | |
409 | 409 | then throwOnePayment() | |
410 | 410 | else if (if ((balanceFrom > accountBalanceFrom)) | |
411 | 411 | then true | |
412 | 412 | else (balanceTo > accountBalanceTo)) | |
413 | 413 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(balanceFrom, value(pmtAssetId), balanceTo, fromBase58String(exchangeAseetId))) | |
414 | 414 | else if (if (!(contains(value(exchangeAssets), pmtStrAssetId))) | |
415 | 415 | then true | |
416 | 416 | else !(contains(value(exchangeAssets), exchangeAseetId))) | |
417 | 417 | then throwAssets() | |
418 | 418 | else if ((10000000 > pmtAmount)) | |
419 | 419 | then throw("Only swap of 10.000000 or more tokens is allowed") | |
420 | 420 | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
421 | 421 | then true | |
422 | 422 | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
423 | 423 | then throw("Incorrect args and pmt ratio") | |
424 | 424 | else { | |
425 | 425 | let invariant = invariantCalc(balanceFrom, balanceTo) | |
426 | 426 | let amount = calculateSendAmount(balanceFrom, balanceTo, invariant, estimatedAmountToReceive, minAmountToReceive, pmtAmount) | |
427 | 427 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
428 | 428 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
429 | 429 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
430 | - | let $ | |
431 | - | let newBalanceFrom = $ | |
432 | - | let newBalanceTo = $ | |
430 | + | let $t01495515064 = $Tuple2((balanceFrom + pmtAmount), ((balanceTo - amountMinusFee) - governanceReward)) | |
431 | + | let newBalanceFrom = $t01495515064._1 | |
432 | + | let newBalanceTo = $t01495515064._2 | |
433 | 433 | let dAppThresholdAmount = fraction((newBalanceFrom + newBalanceTo), dAppThreshold, (2 * dAppThresholdScale2)) | |
434 | 434 | if (if ((dAppThresholdAmount > newBalanceFrom)) | |
435 | 435 | then true | |
436 | 436 | else (dAppThresholdAmount > newBalanceTo)) | |
437 | 437 | then throwThreshold(dAppThresholdAmount, newBalanceFrom, newBalanceTo, value(pmtAssetId), fromBase58String(exchangeAseetId)) | |
438 | 438 | else { | |
439 | 439 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
440 | 440 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
441 | 441 | else 0 | |
442 | 442 | if ((stake1 == stake1)) | |
443 | 443 | then { | |
444 | 444 | let stake2 = if (containsElement(stakingAssets, exchangeAseetId)) | |
445 | 445 | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), exchangeAseetId], nil) | |
446 | 446 | else 0 | |
447 | 447 | if ((stake2 == stake2)) | |
448 | 448 | then $Tuple2([IntegerEntry((pmtStrAssetId + kAssetBalance), newBalanceFrom), IntegerEntry((exchangeAseetId + kAssetBalance), newBalanceTo), ScriptTransfer(i.caller, amountMinusFee, fromBase58String(exchangeAseetId)), ScriptTransfer(moneyBoxAddress, governanceReward, fromBase58String(exchangeAseetId))], $Tuple2(amountMinusFee, fromBase58String(exchangeAseetId))) | |
449 | 449 | else throw("Strict value is not equal to itself.") | |
450 | 450 | } | |
451 | 451 | else throw("Strict value is not equal to itself.") | |
452 | 452 | } | |
453 | 453 | } | |
454 | 454 | } | |
455 | 455 | ||
456 | 456 | ||
457 | 457 | ||
458 | 458 | @Callable(i) | |
459 | 459 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
460 | 460 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
461 | 461 | else suspend("Paused by admin")) | |
462 | 462 | ||
463 | 463 | ||
464 | 464 | ||
465 | 465 | @Callable(i) | |
466 | 466 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
467 | 467 | then throwIsActive() | |
468 | 468 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
469 | 469 | ||
470 | 470 | ||
471 | 471 | ||
472 | 472 | @Callable(i) | |
473 | 473 | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), [IntegerEntry(kShareLimit, shareLimit)])) | |
474 | 474 | ||
475 | 475 | ||
476 | 476 | ||
477 | 477 | @Callable(i) | |
478 | 478 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
479 | 479 | then throw("Only contract itself can invoke this function") | |
480 | 480 | else { | |
481 | - | let $ | |
482 | - | let call = $ | |
483 | - | let addr = $ | |
484 | - | let params = $ | |
485 | - | let payments = $ | |
481 | + | let $t01740917512 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
482 | + | let call = $t01740917512._1 | |
483 | + | let addr = $t01740917512._2 | |
484 | + | let params = $t01740917512._3 | |
485 | + | let payments = $t01740917512._4 | |
486 | 486 | let inv = invoke(addr, call, params, payments) | |
487 | 487 | if ((inv == inv)) | |
488 | 488 | then nil | |
489 | 489 | else throw("Strict value is not equal to itself.") | |
490 | 490 | } | |
491 | 491 | ||
492 | 492 | ||
493 | 493 | @Verifier(tx) | |
494 | 494 | func verify () = { | |
495 | 495 | let multiSignedByAdmins = { | |
496 | 496 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
497 | 497 | then 1 | |
498 | 498 | else 0 | |
499 | 499 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
500 | 500 | then 1 | |
501 | 501 | else 0 | |
502 | 502 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
503 | 503 | then 1 | |
504 | 504 | else 0 | |
505 | 505 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
506 | 506 | } | |
507 | 507 | match tx { | |
508 | 508 | case inv: InvokeScriptTransaction => | |
509 | 509 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
510 | 510 | then (inv.function == "takeIntoAccountExtraFunds") | |
511 | 511 | else false | |
512 | 512 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
513 | 513 | then true | |
514 | 514 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
515 | 515 | then true | |
516 | 516 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
517 | 517 | then true | |
518 | 518 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
519 | 519 | if (if (callTakeIntoAccount) | |
520 | 520 | then signedByAdmin | |
521 | 521 | else false) | |
522 | 522 | then true | |
523 | 523 | else multiSignedByAdmins | |
524 | 524 | case _ => | |
525 | 525 | multiSignedByAdmins | |
526 | 526 | } | |
527 | 527 | } | |
528 | 528 |
github/deemru/w8io/026f985 91.64 ms ◑