tx · EoR32oMRz2gZQHeZ4Fkvjp7nQZZzRoQzAhKwJNtbAW99

3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37:  -0.01400000 Waves

2021.07.28 16:24 [1633557] smart account 3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37 > SELF 0.00000000 Waves

{ "type": 13, "id": "EoR32oMRz2gZQHeZ4Fkvjp7nQZZzRoQzAhKwJNtbAW99", "fee": 1400000, "feeAssetId": null, "timestamp": 1627478750437, "version": 2, "chainId": 84, "sender": "3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37", "senderPublicKey": "4bwUHdA4vTBJ1k43dYKiPYTDqm3QqiZXNGXoQstGAD1k", "proofs": [ "1hVdJvoJkQgz62hqzRwKekTYuqs6p9jUq1BiysqMzFoSoWFCQosfoPFZF4cciJKn6TVr7szDGyJZuvGvrd8deER", "2iX3yXkjtjr1ArsefV8sqoR2G6F8EZYKp4z6SpZgknCsFcrgFjBAS89LSwt12KywwDQNCc37xNruWs7yq5H3o4i9" ], "script": "base64:AAIFAAAAAAAAACoIAhIDCgEEEgcKBQEBCAgEEgMKAQESAwoBARIAEgMKAQESABIAEgMKAQEAAABUAAAAAAd2ZXJzaW9uAgAAAAUxLjAuMAAAAAAKa2V5VmVyc2lvbgIAAAAHdmVyc2lvbgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAAC2tleUFzc2V0SWRBAgAAAApBX2Fzc2V0X2lkAAAAAAtrZXlBc3NldElkQgIAAAAKQl9hc3NldF9pZAAAAAALa2V5QmFsYW5jZUECAAAAD0FfYXNzZXRfYmFsYW5jZQAAAAALa2V5QmFsYW5jZUICAAAAD0JfYXNzZXRfYmFsYW5jZQAAAAAPa2V5QmFsYW5jZUluaXRBAgAAAAxBX2Fzc2V0X2luaXQAAAAAD2tleUJhbGFuY2VJbml0QgIAAAAMQl9hc3NldF9pbml0AAAAAA9rZXlTaGFyZUFzc2V0SWQCAAAADnNoYXJlX2Fzc2V0X2lkAAAAAB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eUFkbWluczFCB1g=", "height": 1633557, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3DZ8YCVXx2CaFBKKhRL9NwqtQKm1gsmKyb92UfNmGmLv Next: DbHL2yWygMe7517Buhf8LkGTo1EDgzATCZNkZPhMt4f8 Diff:
OldNewDifferences
7373
7474 let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ')
7575
76-let stakingAddress = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg')
76+let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS'
77+
78+let NSBT = base58'36mg8NZTaFRDygiVwb8uBnLR51hetJruUCZcxhaVcHj9'
79+
80+let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ'
81+
82+let EURN = base58'ECBCkHS68DckpBrzLeoRgYbFg7sCVqR176mPqbXsj9pA'
83+
84+let stakingUSDNNSBTAddress = Address(base58'3N1qKnD3EoFpmFphWeZgmFjAUPXJmGw9cUp')
85+
86+let stakingEURNAddress = Address(base58'3MyVqAbmKWh339gF6hy8faWw1jGeTV2wnGE')
7787
7888 let USDNToWavesExchanger = Address(base58'3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37')
89+
90+let USDNToNSBTExchanger = Address(base58'3MzTHd4e3yukNUURApVLVzH5uxeEsXHD6yY')
91+
92+let stakingFeeInUSDN = 270000
93+
94+let stakingFeeInEURN = 234000
7995
8096 let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod")
8197
84100 let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength")
85101
86102 let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3)
87-
88-let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
89-
90-let stakingFeeInUSDN = 270000
91103
92104 let isActive = getBooleanValue(this, keyActive)
93105
153165 }
154166
155167
156-let stakedAmountUSDN = match getInteger(stakingAddress, ((("rpd_balance_" + toBase58String(USDN)) + "_") + toString(this))) {
157- case staked: Int =>
158- staked
159- case nothing: Unit =>
160- 0
161- case _ =>
162- throw("Match error")
163-}
168+func stakedAmount (assetId) = {
169+ let stakedAmountCalculated = match assetId {
170+ case aId: ByteVector =>
171+ if (if ((aId == USDN))
172+ then true
173+ else (aId == NSBT))
174+ then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this)))
175+ else if ((aId == EURN))
176+ then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this)))
177+ else 0
178+ case _: Unit =>
179+ 0
180+ case _ =>
181+ throw("Match error")
182+ }
183+ match stakedAmountCalculated {
184+ case i: Int =>
185+ i
186+ case _ =>
187+ 0
188+ }
189+ }
190+
191+
192+let stakedAmountA = stakedAmount(assetIdA)
193+
194+let stakedAmountB = stakedAmount(assetIdB)
164195
165196 let assetInitA = getIntegerValue(this, keyBalanceInitA)
166197
167198 let assetInitB = getIntegerValue(this, keyBalanceInitB)
168199
169-let availableBalanceA = (balanceA - (if ((assetIdA == USDN))
170- then stakedAmountUSDN
171- else 0))
200+let availableBalanceA = (balanceA - stakedAmountA)
172201
173-let availableBalanceB = (balanceB - (if ((assetIdB == USDN))
174- then stakedAmountUSDN
175- else 0))
202+let availableBalanceB = (balanceB - stakedAmountB)
176203
177-let accountBalanceWithStakedA = (accountBalance(assetIdA) + (if ((assetIdA == USDN))
178- then stakedAmountUSDN
179- else 0))
204+let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA)
180205
181-let accountBalanceWithStakedB = (accountBalance(assetIdB) + (if ((assetIdB == USDN))
182- then stakedAmountUSDN
183- else 0))
206+let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB)
184207
185208 let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA))
186209 then (accountBalanceWithStakedB >= balanceB)
211234 func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)]
212235
213236
214-func deductStakingFee (amount,assetId) = if ((assetId == USDN))
237+func deductStakingFee (amount,assetId,secondAssetId) = if (if ((assetId == USDN))
238+ then true
239+ else (assetId == EURN))
215240 then {
216- let result = (amount - stakingFeeInUSDN)
241+ let stakinFee = if ((assetId == USDN))
242+ then (stakingFeeInUSDN * (if ((secondAssetId == NSBT))
243+ then 2
244+ else 1))
245+ else if ((assetId == EURN))
246+ then stakingFeeInEURN
247+ else 0
248+ let result = (amount - stakinFee)
217249 if ((0 >= result))
218- then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakingFeeInUSDN)) + " USD-N"))
250+ then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakinFee)) + "USDN/EURN"))
219251 else result
220252 }
221253 else amount
254+
255+
256+func getStakingFee (assetId,secondAssetId) = if ((assetId == USDN))
257+ then (stakingFeeInUSDN * (if ((secondAssetId == NSBT))
258+ then 2
259+ else 1))
260+ else if ((assetId == EURN))
261+ then stakingFeeInEURN
262+ else 0
222263
223264
224265 func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport"))
232273
233274 @Callable(i)
234275 func init (firstHarvest) = {
235- let $t067096786 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
236- let pmtAmountA = $t067096786._1
237- let pmtAssetIdA = $t067096786._2
238- let $t067916868 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
239- let pmtAmountB = $t067916868._1
240- let pmtAssetIdB = $t067916868._2
241- let $t068736950 = getAssetInfo(pmtAssetIdA)
242- let pmtStrAssetIdA = $t068736950._1
243- let pmtAssetNameA = $t068736950._2
244- let pmtDecimalsA = $t068736950._3
245- let $t069557032 = getAssetInfo(pmtAssetIdB)
246- let pmtStrAssetIdB = $t069557032._1
247- let pmtAssetNameB = $t069557032._2
248- let pmtDecimalsB = $t069557032._3
276+ let $t080018078 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
277+ let pmtAmountA = $t080018078._1
278+ let pmtAssetIdA = $t080018078._2
279+ let $t080838160 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
280+ let pmtAmountB = $t080838160._1
281+ let pmtAssetIdB = $t080838160._2
282+ let $t081658242 = getAssetInfo(pmtAssetIdA)
283+ let pmtStrAssetIdA = $t081658242._1
284+ let pmtAssetNameA = $t081658242._2
285+ let pmtDecimalsA = $t081658242._3
286+ let $t082478324 = getAssetInfo(pmtAssetIdB)
287+ let pmtStrAssetIdB = $t082478324._1
288+ let pmtAssetNameB = $t082478324._2
289+ let pmtDecimalsB = $t082478324._3
249290 if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey)))
250291 then throw("Only admin can call this function")
251292 else if (isDefined(getBoolean(this, keyActive)))
273314
274315 @Callable(i)
275316 func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = {
276- let $t092779364 = getAssetInfoFromString(strAssetIdA)
277- let pmtStrAssetIdA = $t092779364._1
278- let pmtAssetNameA = $t092779364._2
279- let pmtDecimalsA = $t092779364._3
280- let $t093699456 = getAssetInfoFromString(strAssetIdB)
281- let pmtStrAssetIdB = $t093699456._1
282- let pmtAssetNameB = $t093699456._2
283- let pmtDecimalsB = $t093699456._3
317+ let $t01056910656 = getAssetInfoFromString(strAssetIdA)
318+ let pmtStrAssetIdA = $t01056910656._1
319+ let pmtAssetNameA = $t01056910656._2
320+ let pmtDecimalsA = $t01056910656._3
321+ let $t01066110748 = getAssetInfoFromString(strAssetIdB)
322+ let pmtStrAssetIdB = $t01066110748._1
323+ let pmtAssetNameB = $t01066110748._2
324+ let pmtDecimalsB = $t01066110748._3
284325 if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey)))
285326 then throw("Only admin can call this function")
286327 else if (isDefined(getBoolean(this, keyActive)))
316357 func replenishWithTwoTokens (slippageTolerance) = {
317358 let pmtAssetIdA = i.payments[0].assetId
318359 let pmtAssetIdB = i.payments[1].assetId
319- let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA)
320- let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB)
360+ let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA, pmtAssetIdB)
361+ let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB, pmtAssetIdA)
321362 if (if ((balanceA == 0))
322363 then (balanceB == 0)
323364 else false)
324365 then {
325- let $t01214112218 = getAssetInfo(pmtAssetIdA)
326- let pmtStrAssetIdA = $t01214112218._1
327- let pmtAssetNameA = $t01214112218._2
328- let pmtDecimalsA = $t01214112218._3
329- let $t01222712304 = getAssetInfo(pmtAssetIdB)
330- let pmtStrAssetIdB = $t01222712304._1
331- let pmtAssetNameB = $t01222712304._2
332- let pmtDecimalsB = $t01222712304._3
366+ let $t01345913536 = getAssetInfo(pmtAssetIdA)
367+ let pmtStrAssetIdA = $t01345913536._1
368+ let pmtAssetNameA = $t01345913536._2
369+ let pmtDecimalsA = $t01345913536._3
370+ let $t01354513622 = getAssetInfo(pmtAssetIdB)
371+ let pmtStrAssetIdB = $t01354513622._1
372+ let pmtAssetNameB = $t01354513622._2
373+ let pmtDecimalsB = $t01354513622._3
333374 let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB))
334375 if ((pmtAssetIdA == pmtAssetIdB))
335376 then throw("Assets must be different")
392433
393434 @Callable(i)
394435 func withdraw () = {
395- let $t01670316853 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
396- let pmtAmount = $t01670316853._1
397- let pmtAssetId = $t01670316853._2
398- let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA)
399- let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB)
436+ let $t01802118171 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
437+ let pmtAmount = $t01802118171._1
438+ let pmtAssetId = $t01802118171._2
439+ let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA, assetIdB)
440+ let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB, assetIdA)
400441 if (!(isActive))
401442 then throw("DApp is inactive at this moment")
402443 else if ((size(i.payments) != 1))
416457
417458 @Callable(i)
418459 func exchange (minAmountToReceive) = {
419- let $t01805918134 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
420- let pmtAmount = $t01805918134._1
421- let pmtAssetId = $t01805918134._2
460+ let $t01939719472 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
461+ let pmtAmount = $t01939719472._1
462+ let pmtAssetId = $t01939719472._2
422463 func calculateFees (tokenFrom,tokenTo) = {
423464 let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom))
424465 let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
443484 else if ((pmtAssetId == assetIdA))
444485 then {
445486 let assetIdSend = assetIdB
446- let $t01940819499 = calculateFees(balanceA, balanceB)
447- let amountWithoutFee = $t01940819499._1
448- let amountWithFee = $t01940819499._2
449- let governanceReward = $t01940819499._3
487+ let $t02074620837 = calculateFees(balanceA, balanceB)
488+ let amountWithoutFee = $t02074620837._1
489+ let amountWithFee = $t02074620837._2
490+ let governanceReward = $t02074620837._3
450491 let newBalanceA = (balanceA + pmtAmount)
451492 let newBalanceB = ((balanceB - amountWithFee) - governanceReward)
452- if (if (if ((assetIdA == USDN))
453- then (stakedAmountUSDN >= newBalanceA)
454- else false)
493+ if (if ((stakedAmountA >= newBalanceA))
455494 then true
456- else if ((assetIdB == USDN))
457- then (stakedAmountUSDN >= newBalanceB)
458- else false)
495+ else (stakedAmountB >= newBalanceB))
459496 then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB)
460497 else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)]
461498 }
462499 else if ((pmtAssetId == assetIdB))
463500 then {
464501 let assetIdSend = assetIdA
465- let $t02036820459 = calculateFees(balanceB, balanceA)
466- let amountWithoutFee = $t02036820459._1
467- let amountWithFee = $t02036820459._2
468- let governanceReward = $t02036820459._3
502+ let $t02165621747 = calculateFees(balanceB, balanceA)
503+ let amountWithoutFee = $t02165621747._1
504+ let amountWithFee = $t02165621747._2
505+ let governanceReward = $t02165621747._3
469506 let newBalanceA = ((balanceA - amountWithFee) - governanceReward)
470507 let newBalanceB = (balanceB + pmtAmount)
471- if (if (if ((assetIdA == USDN))
472- then (stakedAmountUSDN >= newBalanceA)
473- else false)
508+ if (if ((stakedAmountA >= newBalanceA))
474509 then true
475- else if ((assetIdB == USDN))
476- then (stakedAmountUSDN >= newBalanceB)
477- else false)
510+ else (stakedAmountB >= newBalanceB))
478511 then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA)
479512 else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)]
480513 }
530563
531564
532565 @Verifier(tx)
533-func verify () = match tx {
534- case inv: InvokeScriptTransaction =>
535- let callTakeIntoAccount = if ((inv.dApp == this))
536- then (inv.function == "takeIntoAccountExtraFunds")
537- else false
538- let callStaking = if ((inv.dApp == stakingAddress))
539- then if (if (if ((inv.function == "lockNeutrino"))
540- then (size(inv.payments) == 1)
541- else false)
542- then (inv.payments[0].assetId == USDN)
543- else false)
544- then true
545- else if ((inv.function == "unlockNeutrino"))
546- then (size(inv.payments) == 0)
547- else false
548- else false
549- let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger))
550- then (inv.function == "exchange")
551- else false)
552- then (assetIdA == USDN)
553- else false)
554- then true
555- else if ((assetIdB == USDN))
556- then (inv.payments[0].assetId == USDN)
557- else false
558- let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
559- then true
560- else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
561- then true
562- else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
563- then true
564- else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
565- if (if (if (callTakeIntoAccount)
566- then true
567- else callStaking)
568- then true
569- else exchangeToWaves)
570- then signedByAdmin
571- else false
572- case _ =>
566+func verify () = {
567+ let multiSignedByAdmins = {
573568 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
574569 then 1
575570 else 0
580575 then 1
581576 else 0
582577 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
583-}
578+ }
579+ match tx {
580+ case inv: InvokeScriptTransaction =>
581+ let callTakeIntoAccount = if ((inv.dApp == this))
582+ then (inv.function == "takeIntoAccountExtraFunds")
583+ else false
584+ let callStaking = if (if ((inv.dApp == stakingUSDNNSBTAddress))
585+ then if (if (if ((inv.function == "lockNeutrino"))
586+ then (size(inv.payments) == 1)
587+ else false)
588+ then if ((inv.payments[0].assetId == USDN))
589+ then true
590+ else (inv.payments[0].assetId == NSBT)
591+ else false)
592+ then true
593+ else if ((inv.function == "unlockNeutrino"))
594+ then (size(inv.payments) == 0)
595+ else false
596+ else false)
597+ then true
598+ else if ((inv.dApp == stakingEURNAddress))
599+ then if (if (if ((inv.function == "startStaking"))
600+ then (size(inv.payments) == 1)
601+ else false)
602+ then (inv.payments[0].assetId == EURN)
603+ else false)
604+ then true
605+ else if ((inv.function == "stopStaking"))
606+ then (size(inv.payments) == 0)
607+ else false
608+ else false
609+ let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger))
610+ then (inv.function == "exchange")
611+ else false)
612+ then (assetIdA == USDN)
613+ else false)
614+ then true
615+ else if (if ((assetIdB == USDN))
616+ then (size(inv.payments) == 1)
617+ else false)
618+ then (inv.payments[0].assetId == USDN)
619+ else false
620+ let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger))
621+ then (inv.function == "exchange")
622+ else false)
623+ then (assetIdA == NSBT)
624+ else false)
625+ then true
626+ else if (if ((assetIdB == NSBT))
627+ then (size(inv.payments) == 1)
628+ else false)
629+ then (inv.payments[0].assetId == USDN)
630+ else false
631+ let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
632+ then true
633+ else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
634+ then true
635+ else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
636+ then true
637+ else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
638+ if (if (if (if (if (callTakeIntoAccount)
639+ then true
640+ else callStaking)
641+ then true
642+ else exchangeToWaves)
643+ then true
644+ else exchangeToNSBTs)
645+ then signedByAdmin
646+ else false)
647+ then true
648+ else multiSignedByAdmins
649+ case _ =>
650+ multiSignedByAdmins
651+ }
652+ }
584653
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let version = "1.0.0"
55
66 let keyVersion = "version"
77
88 let keyActive = "active"
99
1010 let keyAssetIdA = "A_asset_id"
1111
1212 let keyAssetIdB = "B_asset_id"
1313
1414 let keyBalanceA = "A_asset_balance"
1515
1616 let keyBalanceB = "B_asset_balance"
1717
1818 let keyBalanceInitA = "A_asset_init"
1919
2020 let keyBalanceInitB = "B_asset_init"
2121
2222 let keyShareAssetId = "share_asset_id"
2323
2424 let keyShareAssetSupply = "share_asset_supply"
2525
2626 let keyCommission = "commission"
2727
2828 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
2929
3030 let keyCause = "shutdown_cause"
3131
3232 let keyFirstHarvest = "first_harvest"
3333
3434 let keyFirstHarvestHeight = "first_harvest_height"
3535
3636 let kShareLimit = "share_limit_on_first_harvest"
3737
3838 let kBasePeriod = "base_period"
3939
4040 let kPeriodLength = "period_length"
4141
4242 let kStartHeight = "start_height"
4343
4444 let kFirstHarvestHeight = "first_harvest_height"
4545
4646 let keyAdminPubKey1 = "admin_pub_1"
4747
4848 let keyAdminPubKey2 = "admin_pub_2"
4949
5050 let keyAdminPubKey3 = "admin_pub_3"
5151
5252 let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
5353
5454 func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) {
5555 case string: String =>
5656 fromBase58String(string)
5757 case nothing =>
5858 throw("Admin public key is empty")
5959 }
6060
6161
6262 let adminPubKey1 = getAdminPub(keyAdminPubKey1)
6363
6464 let adminPubKey2 = getAdminPub(keyAdminPubKey2)
6565
6666 let adminPubKey3 = getAdminPub(keyAdminPubKey3)
6767
6868 let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
6969
7070 let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
7171
7272 let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4')
7373
7474 let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ')
7575
76-let stakingAddress = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg')
76+let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS'
77+
78+let NSBT = base58'36mg8NZTaFRDygiVwb8uBnLR51hetJruUCZcxhaVcHj9'
79+
80+let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ'
81+
82+let EURN = base58'ECBCkHS68DckpBrzLeoRgYbFg7sCVqR176mPqbXsj9pA'
83+
84+let stakingUSDNNSBTAddress = Address(base58'3N1qKnD3EoFpmFphWeZgmFjAUPXJmGw9cUp')
85+
86+let stakingEURNAddress = Address(base58'3MyVqAbmKWh339gF6hy8faWw1jGeTV2wnGE')
7787
7888 let USDNToWavesExchanger = Address(base58'3N77kfPbQyjXWpDALX3xjKw3iEGMWEctV37')
89+
90+let USDNToNSBTExchanger = Address(base58'3MzTHd4e3yukNUURApVLVzH5uxeEsXHD6yY')
91+
92+let stakingFeeInUSDN = 270000
93+
94+let stakingFeeInEURN = 234000
7995
8096 let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod")
8197
8298 let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight")
8399
84100 let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength")
85101
86102 let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3)
87-
88-let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
89-
90-let stakingFeeInUSDN = 270000
91103
92104 let isActive = getBooleanValue(this, keyActive)
93105
94106 let strAssetIdA = getStringValue(this, keyAssetIdA)
95107
96108 let strAssetIdB = getStringValue(this, keyAssetIdB)
97109
98110 let assetIdA = if ((strAssetIdA == "WAVES"))
99111 then unit
100112 else fromBase58String(strAssetIdA)
101113
102114 let assetIdB = if ((strAssetIdB == "WAVES"))
103115 then unit
104116 else fromBase58String(strAssetIdB)
105117
106118 let assetNameA = match assetIdA {
107119 case id: ByteVector =>
108120 value(assetInfo(id)).name
109121 case waves: Unit =>
110122 "WAVES"
111123 case _ =>
112124 throw("Match error")
113125 }
114126
115127 let assetNameB = match assetIdB {
116128 case id: ByteVector =>
117129 value(assetInfo(id)).name
118130 case waves: Unit =>
119131 "WAVES"
120132 case _ =>
121133 throw("Match error")
122134 }
123135
124136 let balanceA = getIntegerValue(this, keyBalanceA)
125137
126138 let balanceB = getIntegerValue(this, keyBalanceB)
127139
128140 let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId))
129141
130142 let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply)
131143
132144 let commission = 3000
133145
134146 let commissionGovernance = 1200
135147
136148 let commissionScaleDelimiter = 1000000
137149
138150 let scaleValue3 = 1000
139151
140152 let scaleValue8 = 100000000
141153
142154 let slippageToleranceDelimiter = 1000
143155
144156 let scaleValue8Digits = 8
145157
146158 func accountBalance (assetId) = match assetId {
147159 case id: ByteVector =>
148160 assetBalance(this, id)
149161 case waves: Unit =>
150162 wavesBalance(this).available
151163 case _ =>
152164 throw("Match error")
153165 }
154166
155167
156-let stakedAmountUSDN = match getInteger(stakingAddress, ((("rpd_balance_" + toBase58String(USDN)) + "_") + toString(this))) {
157- case staked: Int =>
158- staked
159- case nothing: Unit =>
160- 0
161- case _ =>
162- throw("Match error")
163-}
168+func stakedAmount (assetId) = {
169+ let stakedAmountCalculated = match assetId {
170+ case aId: ByteVector =>
171+ if (if ((aId == USDN))
172+ then true
173+ else (aId == NSBT))
174+ then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this)))
175+ else if ((aId == EURN))
176+ then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this)))
177+ else 0
178+ case _: Unit =>
179+ 0
180+ case _ =>
181+ throw("Match error")
182+ }
183+ match stakedAmountCalculated {
184+ case i: Int =>
185+ i
186+ case _ =>
187+ 0
188+ }
189+ }
190+
191+
192+let stakedAmountA = stakedAmount(assetIdA)
193+
194+let stakedAmountB = stakedAmount(assetIdB)
164195
165196 let assetInitA = getIntegerValue(this, keyBalanceInitA)
166197
167198 let assetInitB = getIntegerValue(this, keyBalanceInitB)
168199
169-let availableBalanceA = (balanceA - (if ((assetIdA == USDN))
170- then stakedAmountUSDN
171- else 0))
200+let availableBalanceA = (balanceA - stakedAmountA)
172201
173-let availableBalanceB = (balanceB - (if ((assetIdB == USDN))
174- then stakedAmountUSDN
175- else 0))
202+let availableBalanceB = (balanceB - stakedAmountB)
176203
177-let accountBalanceWithStakedA = (accountBalance(assetIdA) + (if ((assetIdA == USDN))
178- then stakedAmountUSDN
179- else 0))
204+let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA)
180205
181-let accountBalanceWithStakedB = (accountBalance(assetIdB) + (if ((assetIdB == USDN))
182- then stakedAmountUSDN
183- else 0))
206+let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB)
184207
185208 let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA))
186209 then (accountBalanceWithStakedB >= balanceB)
187210 else false
188211
189212 func getAssetInfo (assetId) = match assetId {
190213 case id: ByteVector =>
191214 let stringId = toBase58String(id)
192215 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
193216 $Tuple3(stringId, info.name, info.decimals)
194217 case waves: Unit =>
195218 $Tuple3("WAVES", "WAVES", 8)
196219 case _ =>
197220 throw("Match error")
198221 }
199222
200223
201224 func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES"))
202225 then $Tuple3("WAVES", "WAVES", 8)
203226 else {
204227 let stringId = assetStr
205228 let id = fromBase58String(assetStr)
206229 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
207230 $Tuple3(stringId, info.name, info.decimals)
208231 }
209232
210233
211234 func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)]
212235
213236
214-func deductStakingFee (amount,assetId) = if ((assetId == USDN))
237+func deductStakingFee (amount,assetId,secondAssetId) = if (if ((assetId == USDN))
238+ then true
239+ else (assetId == EURN))
215240 then {
216- let result = (amount - stakingFeeInUSDN)
241+ let stakinFee = if ((assetId == USDN))
242+ then (stakingFeeInUSDN * (if ((secondAssetId == NSBT))
243+ then 2
244+ else 1))
245+ else if ((assetId == EURN))
246+ then stakingFeeInEURN
247+ else 0
248+ let result = (amount - stakinFee)
217249 if ((0 >= result))
218- then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakingFeeInUSDN)) + " USD-N"))
250+ then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakinFee)) + "USDN/EURN"))
219251 else result
220252 }
221253 else amount
254+
255+
256+func getStakingFee (assetId,secondAssetId) = if ((assetId == USDN))
257+ then (stakingFeeInUSDN * (if ((secondAssetId == NSBT))
258+ then 2
259+ else 1))
260+ else if ((assetId == EURN))
261+ then stakingFeeInEURN
262+ else 0
222263
223264
224265 func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport"))
225266
226267
227268 func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport"))
228269
229270
230271 func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceWithStakedA)) + " ") + assetNameA) + ", ") + toString(accountBalanceWithStakedB)) + " ") + assetNameB) + ". State: ") + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB))
231272
232273
233274 @Callable(i)
234275 func init (firstHarvest) = {
235- let $t067096786 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
236- let pmtAmountA = $t067096786._1
237- let pmtAssetIdA = $t067096786._2
238- let $t067916868 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
239- let pmtAmountB = $t067916868._1
240- let pmtAssetIdB = $t067916868._2
241- let $t068736950 = getAssetInfo(pmtAssetIdA)
242- let pmtStrAssetIdA = $t068736950._1
243- let pmtAssetNameA = $t068736950._2
244- let pmtDecimalsA = $t068736950._3
245- let $t069557032 = getAssetInfo(pmtAssetIdB)
246- let pmtStrAssetIdB = $t069557032._1
247- let pmtAssetNameB = $t069557032._2
248- let pmtDecimalsB = $t069557032._3
276+ let $t080018078 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
277+ let pmtAmountA = $t080018078._1
278+ let pmtAssetIdA = $t080018078._2
279+ let $t080838160 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
280+ let pmtAmountB = $t080838160._1
281+ let pmtAssetIdB = $t080838160._2
282+ let $t081658242 = getAssetInfo(pmtAssetIdA)
283+ let pmtStrAssetIdA = $t081658242._1
284+ let pmtAssetNameA = $t081658242._2
285+ let pmtDecimalsA = $t081658242._3
286+ let $t082478324 = getAssetInfo(pmtAssetIdB)
287+ let pmtStrAssetIdB = $t082478324._1
288+ let pmtAssetNameB = $t082478324._2
289+ let pmtDecimalsB = $t082478324._3
249290 if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey)))
250291 then throw("Only admin can call this function")
251292 else if (isDefined(getBoolean(this, keyActive)))
252293 then throw("DApp is already active")
253294 else if ((pmtAssetIdA == pmtAssetIdB))
254295 then throw("Assets must be different")
255296 else {
256297 let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7))
257298 let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this))
258299 let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2)
259300 let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN)
260301 let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN)
261302 let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN)
262303 let shareInitialSupply = fraction(arg1, arg2, arg3)
263304 let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true)
264305 let shareIssueId = calculateAssetId(shareIssue)
265306 let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)]
266307 if (firstHarvest)
267308 then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))])
268309 else baseEntry
269310 }
270311 }
271312
272313
273314
274315 @Callable(i)
275316 func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = {
276- let $t092779364 = getAssetInfoFromString(strAssetIdA)
277- let pmtStrAssetIdA = $t092779364._1
278- let pmtAssetNameA = $t092779364._2
279- let pmtDecimalsA = $t092779364._3
280- let $t093699456 = getAssetInfoFromString(strAssetIdB)
281- let pmtStrAssetIdB = $t093699456._1
282- let pmtAssetNameB = $t093699456._2
283- let pmtDecimalsB = $t093699456._3
317+ let $t01056910656 = getAssetInfoFromString(strAssetIdA)
318+ let pmtStrAssetIdA = $t01056910656._1
319+ let pmtAssetNameA = $t01056910656._2
320+ let pmtDecimalsA = $t01056910656._3
321+ let $t01066110748 = getAssetInfoFromString(strAssetIdB)
322+ let pmtStrAssetIdB = $t01066110748._1
323+ let pmtAssetNameB = $t01066110748._2
324+ let pmtDecimalsB = $t01066110748._3
284325 if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey)))
285326 then throw("Only admin can call this function")
286327 else if (isDefined(getBoolean(this, keyActive)))
287328 then throw("DApp is already active")
288329 else if ((strAssetIdA == strAssetIdB))
289330 then throw("Assets must be different")
290331 else {
291332 let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7))
292333 let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this))
293334 let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2)
294335 let shareInitialSupply = 0
295336 let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true)
296337 let shareIssueId = calculateAssetId(shareIssue)
297338 let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply)]
298339 if (firstHarvest)
299340 then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))])
300341 else baseEntry
301342 }
302343 }
303344
304345
305346
306347 @Callable(i)
307348 func keepLimitForFirstHarvest (shareLimit) = if (!(isActive))
308349 then throw("DApp is inactive at this moment")
309350 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey)))
310351 then throw("Only admin can call this function")
311352 else [IntegerEntry(kShareLimit, shareLimit)]
312353
313354
314355
315356 @Callable(i)
316357 func replenishWithTwoTokens (slippageTolerance) = {
317358 let pmtAssetIdA = i.payments[0].assetId
318359 let pmtAssetIdB = i.payments[1].assetId
319- let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA)
320- let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB)
360+ let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA, pmtAssetIdB)
361+ let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB, pmtAssetIdA)
321362 if (if ((balanceA == 0))
322363 then (balanceB == 0)
323364 else false)
324365 then {
325- let $t01214112218 = getAssetInfo(pmtAssetIdA)
326- let pmtStrAssetIdA = $t01214112218._1
327- let pmtAssetNameA = $t01214112218._2
328- let pmtDecimalsA = $t01214112218._3
329- let $t01222712304 = getAssetInfo(pmtAssetIdB)
330- let pmtStrAssetIdB = $t01222712304._1
331- let pmtAssetNameB = $t01222712304._2
332- let pmtDecimalsB = $t01222712304._3
366+ let $t01345913536 = getAssetInfo(pmtAssetIdA)
367+ let pmtStrAssetIdA = $t01345913536._1
368+ let pmtAssetNameA = $t01345913536._2
369+ let pmtDecimalsA = $t01345913536._3
370+ let $t01354513622 = getAssetInfo(pmtAssetIdB)
371+ let pmtStrAssetIdB = $t01354513622._1
372+ let pmtAssetNameB = $t01354513622._2
373+ let pmtDecimalsB = $t01354513622._3
333374 let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB))
334375 if ((pmtAssetIdA == pmtAssetIdB))
335376 then throw("Assets must be different")
336377 else {
337378 let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2)
338379 let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN))
339380 if (!(isActive))
340381 then throw("DApp is inactive at this moment")
341382 else if (if ((0 > slippageTolerance))
342383 then true
343384 else (slippageTolerance > slippageToleranceDelimiter))
344385 then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance)))
345386 else if ((size(i.payments) != 2))
346387 then throw("Two attached assets expected")
347388 else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio))
348389 then true
349390 else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter)))
350391 then throw("Incorrect assets amount: amounts must have the contract ratio")
351392 else if (if ((pmtAssetIdA != assetIdA))
352393 then true
353394 else (pmtAssetIdB != assetIdB))
354395 then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB))
355396 else if ((shareInitialSupply == 0))
356397 then throw("Too small amount to replenish")
357398 else if (!(hasEnoughBalance))
358399 then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious())
359400 else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)]
360401 }
361402 }
362403 else {
363404 let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB))
364405 let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA)
365406 let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB)
366407 let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
367408 if (!(isActive))
368409 then throw("DApp is inactive at this moment")
369410 else if (if ((0 > slippageTolerance))
370411 then true
371412 else (slippageTolerance > slippageToleranceDelimiter))
372413 then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance)))
373414 else if ((size(i.payments) != 2))
374415 then throw("Two attached assets expected")
375416 else if (if ((pmtAssetIdA != assetIdA))
376417 then true
377418 else (pmtAssetIdB != assetIdB))
378419 then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB))
379420 else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio))
380421 then true
381422 else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter)))
382423 then throw("Incorrect assets amount: amounts must have the contract ratio")
383424 else if ((shareTokenToPayAmount == 0))
384425 then throw("Too small amount to replenish")
385426 else if (!(hasEnoughBalance))
386427 then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious())
387428 else [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)]
388429 }
389430 }
390431
391432
392433
393434 @Callable(i)
394435 func withdraw () = {
395- let $t01670316853 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
396- let pmtAmount = $t01670316853._1
397- let pmtAssetId = $t01670316853._2
398- let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA)
399- let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB)
436+ let $t01802118171 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
437+ let pmtAmount = $t01802118171._1
438+ let pmtAssetId = $t01802118171._2
439+ let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA, assetIdB)
440+ let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB, assetIdA)
400441 if (!(isActive))
401442 then throw("DApp is inactive at this moment")
402443 else if ((size(i.payments) != 1))
403444 then throw("One attached payment expected")
404445 else if ((pmtAssetId != shareAssetId))
405446 then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
406447 else if (!(hasEnoughBalance))
407448 then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
408449 else if (if ((amountToPayA > availableBalanceA))
409450 then true
410451 else (amountToPayB > availableBalanceB))
411452 then throwInsufficientAvailableBalances(amountToPayA, amountToPayB)
412453 else [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)]
413454 }
414455
415456
416457
417458 @Callable(i)
418459 func exchange (minAmountToReceive) = {
419- let $t01805918134 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
420- let pmtAmount = $t01805918134._1
421- let pmtAssetId = $t01805918134._2
460+ let $t01939719472 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
461+ let pmtAmount = $t01939719472._1
462+ let pmtAssetId = $t01939719472._2
422463 func calculateFees (tokenFrom,tokenTo) = {
423464 let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom))
424465 let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
425466 let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter)
426467 if ((minAmountToReceive > amountWithFee))
427468 then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive)))
428469 else $Tuple3(amountWithoutFee, amountWithFee, governanceReward)
429470 }
430471
431472 if (!(isActive))
432473 then throw("DApp is inactive at this moment")
433474 else if (if ((balanceA == 0))
434475 then true
435476 else (balanceB == 0))
436477 then throw("Can't exchange with zero balance")
437478 else if ((0 >= minAmountToReceive))
438479 then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive)))
439480 else if ((size(i.payments) != 1))
440481 then throw("One attached payment expected")
441482 else if (!(hasEnoughBalance))
442483 then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
443484 else if ((pmtAssetId == assetIdA))
444485 then {
445486 let assetIdSend = assetIdB
446- let $t01940819499 = calculateFees(balanceA, balanceB)
447- let amountWithoutFee = $t01940819499._1
448- let amountWithFee = $t01940819499._2
449- let governanceReward = $t01940819499._3
487+ let $t02074620837 = calculateFees(balanceA, balanceB)
488+ let amountWithoutFee = $t02074620837._1
489+ let amountWithFee = $t02074620837._2
490+ let governanceReward = $t02074620837._3
450491 let newBalanceA = (balanceA + pmtAmount)
451492 let newBalanceB = ((balanceB - amountWithFee) - governanceReward)
452- if (if (if ((assetIdA == USDN))
453- then (stakedAmountUSDN >= newBalanceA)
454- else false)
493+ if (if ((stakedAmountA >= newBalanceA))
455494 then true
456- else if ((assetIdB == USDN))
457- then (stakedAmountUSDN >= newBalanceB)
458- else false)
495+ else (stakedAmountB >= newBalanceB))
459496 then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB)
460497 else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)]
461498 }
462499 else if ((pmtAssetId == assetIdB))
463500 then {
464501 let assetIdSend = assetIdA
465- let $t02036820459 = calculateFees(balanceB, balanceA)
466- let amountWithoutFee = $t02036820459._1
467- let amountWithFee = $t02036820459._2
468- let governanceReward = $t02036820459._3
502+ let $t02165621747 = calculateFees(balanceB, balanceA)
503+ let amountWithoutFee = $t02165621747._1
504+ let amountWithFee = $t02165621747._2
505+ let governanceReward = $t02165621747._3
469506 let newBalanceA = ((balanceA - amountWithFee) - governanceReward)
470507 let newBalanceB = (balanceB + pmtAmount)
471- if (if (if ((assetIdA == USDN))
472- then (stakedAmountUSDN >= newBalanceA)
473- else false)
508+ if (if ((stakedAmountA >= newBalanceA))
474509 then true
475- else if ((assetIdB == USDN))
476- then (stakedAmountUSDN >= newBalanceB)
477- else false)
510+ else (stakedAmountB >= newBalanceB))
478511 then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA)
479512 else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)]
480513 }
481514 else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB))
482515 }
483516
484517
485518
486519 @Callable(i)
487520 func shutdown () = if (!(isActive))
488521 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified")))
489522 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey)))
490523 then throw("Only admin can call this function")
491524 else suspend("Paused by admin")
492525
493526
494527
495528 @Callable(i)
496529 func activate () = if (isActive)
497530 then throw("DApp is already active")
498531 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey)))
499532 then throw("Only admin can call this function")
500533 else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)]
501534
502535
503536
504537 @Callable(i)
505538 func takeIntoAccountExtraFunds (amountLeave) = {
506539 let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA)
507540 let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB)
508541 let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == unit))
509542 then amountLeave
510543 else 0))
511544 let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == unit))
512545 then amountLeave
513546 else 0))
514547 if (!(isActive))
515548 then throw("DApp is inactive at this moment")
516549 else if ((i.caller != this))
517550 then throw("Only the DApp itself can call this function")
518551 else if ((0 > amountLeave))
519552 then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave)))
520553 else if (if ((0 > uncountableAmountEnrollAssetA))
521554 then true
522555 else (0 > uncountableAmountEnrollAssetB))
523556 then suspend("Enroll amount negative")
524557 else if (if ((0 > amountEnrollA))
525558 then true
526559 else (0 > amountEnrollB))
527560 then throw("Too large amountLeave")
528561 else [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB)), IntegerEntry(("last_income_" + strAssetIdA), amountEnrollA), IntegerEntry(("last_income_" + strAssetIdB), amountEnrollB)]
529562 }
530563
531564
532565 @Verifier(tx)
533-func verify () = match tx {
534- case inv: InvokeScriptTransaction =>
535- let callTakeIntoAccount = if ((inv.dApp == this))
536- then (inv.function == "takeIntoAccountExtraFunds")
537- else false
538- let callStaking = if ((inv.dApp == stakingAddress))
539- then if (if (if ((inv.function == "lockNeutrino"))
540- then (size(inv.payments) == 1)
541- else false)
542- then (inv.payments[0].assetId == USDN)
543- else false)
544- then true
545- else if ((inv.function == "unlockNeutrino"))
546- then (size(inv.payments) == 0)
547- else false
548- else false
549- let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger))
550- then (inv.function == "exchange")
551- else false)
552- then (assetIdA == USDN)
553- else false)
554- then true
555- else if ((assetIdB == USDN))
556- then (inv.payments[0].assetId == USDN)
557- else false
558- let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
559- then true
560- else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
561- then true
562- else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
563- then true
564- else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
565- if (if (if (callTakeIntoAccount)
566- then true
567- else callStaking)
568- then true
569- else exchangeToWaves)
570- then signedByAdmin
571- else false
572- case _ =>
566+func verify () = {
567+ let multiSignedByAdmins = {
573568 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
574569 then 1
575570 else 0
576571 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
577572 then 1
578573 else 0
579574 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
580575 then 1
581576 else 0
582577 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
583-}
578+ }
579+ match tx {
580+ case inv: InvokeScriptTransaction =>
581+ let callTakeIntoAccount = if ((inv.dApp == this))
582+ then (inv.function == "takeIntoAccountExtraFunds")
583+ else false
584+ let callStaking = if (if ((inv.dApp == stakingUSDNNSBTAddress))
585+ then if (if (if ((inv.function == "lockNeutrino"))
586+ then (size(inv.payments) == 1)
587+ else false)
588+ then if ((inv.payments[0].assetId == USDN))
589+ then true
590+ else (inv.payments[0].assetId == NSBT)
591+ else false)
592+ then true
593+ else if ((inv.function == "unlockNeutrino"))
594+ then (size(inv.payments) == 0)
595+ else false
596+ else false)
597+ then true
598+ else if ((inv.dApp == stakingEURNAddress))
599+ then if (if (if ((inv.function == "startStaking"))
600+ then (size(inv.payments) == 1)
601+ else false)
602+ then (inv.payments[0].assetId == EURN)
603+ else false)
604+ then true
605+ else if ((inv.function == "stopStaking"))
606+ then (size(inv.payments) == 0)
607+ else false
608+ else false
609+ let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger))
610+ then (inv.function == "exchange")
611+ else false)
612+ then (assetIdA == USDN)
613+ else false)
614+ then true
615+ else if (if ((assetIdB == USDN))
616+ then (size(inv.payments) == 1)
617+ else false)
618+ then (inv.payments[0].assetId == USDN)
619+ else false
620+ let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger))
621+ then (inv.function == "exchange")
622+ else false)
623+ then (assetIdA == NSBT)
624+ else false)
625+ then true
626+ else if (if ((assetIdB == NSBT))
627+ then (size(inv.payments) == 1)
628+ else false)
629+ then (inv.payments[0].assetId == USDN)
630+ else false
631+ let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
632+ then true
633+ else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
634+ then true
635+ else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
636+ then true
637+ else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
638+ if (if (if (if (if (callTakeIntoAccount)
639+ then true
640+ else callStaking)
641+ then true
642+ else exchangeToWaves)
643+ then true
644+ else exchangeToNSBTs)
645+ then signedByAdmin
646+ else false)
647+ then true
648+ else multiSignedByAdmins
649+ case _ =>
650+ multiSignedByAdmins
651+ }
652+ }
584653

github/deemru/w8io/026f985 
108.72 ms