Created
June 10, 2018 13:42
-
-
Save szerintedmi/22bd24669ac7a1a106a6ba9605673e68 to your computer and use it in GitHub Desktop.
Rink0004_migrate_MSv0_5_0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* script to switch over to latest MonetarySupervisor and Rates contracts | |
must be executed via StabilityBoardProxy | |
NB: additional updates of old contracts are not part of this contract but executed from deployer account because old contracts | |
*/ | |
pragma solidity 0.4.24; | |
import "../../generic/MultiSig.sol"; | |
import "../../TokenAEur.sol"; | |
import "../../MonetarySupervisor.sol"; | |
import "../../LoanManager.sol"; | |
import "../../Locker.sol"; | |
import "../../Exchange.sol"; | |
contract Rink0004_migrate_MSv0_5_0 { | |
// latest contracts | |
MonetarySupervisor constant monetarySupervisor = MonetarySupervisor(0x01844c9bade08A8ffdB09aD9f1fecE2C83a6E6a8); | |
// Legacy contracts | |
MonetarySupervisor constant oldMonetarySupervisor1 = MonetarySupervisor(0xC19a45F5CbfA93Be512ef07177feB3f7b3ae4518); | |
function execute(Rink0004_migrate_MSv0_5_0 /* self (not used)*/ ) external { | |
/****************************************************************************** | |
* Migrate KPIs from old MonetarySupervisor | |
******************************************************************************/ | |
uint oldTotalLoan = oldMonetarySupervisor1.totalLoanAmount(); | |
uint oldTotalLock = oldMonetarySupervisor1.totalLockedAmount(); | |
monetarySupervisor.adjustKPIs(oldTotalLoan, oldTotalLock); | |
/****************************************************************************** | |
* NB on old System Accounts: | |
* - feeAccount: still have balance in old A-EUR and will get more b/c old A-EUR will be transfered | |
* - interestEarnedAccount: still have balance in old A-EUR and will get more as old loans will be repaid. | |
* - augmintReserves: still have balances in old A-EUR and will have debit/credits as operations might happen on ethereum | |
* | |
* These balances should be transfered (ETH) and converted (from old A-EUR to new) or burnt | |
* when all locks/loans are repaid/collected/released | |
******************************************************************************/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment