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