-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
margin loanmanager mainnet deploy (#253)
* scripts: deploy loanmanager * scripts: loanmanager permission setup script * abiniser: deployment info for mainnet loanmanager (manual) * scripts: loanmanager product setup script * bump package version to 1.1.1
- Loading branch information
Showing
7 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
31 changes: 31 additions & 0 deletions
31
contracts/SB_scripts/mainnet/Main0029_setup_loanmanager_permissions.sol
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Setup new margin loan manager permissions */ | ||
|
||
pragma solidity 0.4.24; | ||
|
||
import "../../LoanManager.sol"; | ||
import "../../StabilityBoardProxy.sol"; | ||
import "../../FeeAccount.sol"; | ||
import "../../MonetarySupervisor.sol"; | ||
|
||
contract Main0029_setup_loanmanager_permissions { | ||
|
||
StabilityBoardProxy public constant STABILITY_BOARD_PROXY = StabilityBoardProxy(0xde36a8773531406dCBefFdfd3C7b89fCed7A9F84); | ||
LoanManager public constant LOAN_MANAGER = LoanManager(0xEb57c12b1E69b4d10b1eD7a33231d31b811464b7); | ||
|
||
FeeAccount public constant FEE_ACCOUNT = FeeAccount(0xE3ED84A163b9EeaF4f69B4890ae45cC52171Aa7E); | ||
MonetarySupervisor public constant MONETARY_SUPERVISOR = MonetarySupervisor(0x27484AFe9e6c332fB07F21Fac82d442EBe1D22c3); | ||
|
||
function execute(Main0029_setup_loanmanager_permissions /* self, not used */) external { | ||
// called via StabilityBoardProxy | ||
require(address(this) == address(STABILITY_BOARD_PROXY), "only execute via StabilityBoardProxy"); | ||
|
||
// StabilityBoard permission | ||
LOAN_MANAGER.grantPermission(address(STABILITY_BOARD_PROXY), "StabilityBoard"); | ||
|
||
// NoTransferFee permission | ||
FEE_ACCOUNT.grantPermission(address(LOAN_MANAGER), "NoTransferFee"); | ||
|
||
// LoanManager permission | ||
MONETARY_SUPERVISOR.grantPermission(address(LOAN_MANAGER), "LoanManager"); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
contracts/SB_scripts/mainnet/Main0030_setup_loanmanager_products.sol
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* Setup new margin loan manager products, disable old loanamnager products */ | ||
|
||
pragma solidity 0.4.24; | ||
|
||
import "../../LoanManager.sol"; | ||
import "../../StabilityBoardProxy.sol"; | ||
|
||
contract Main0030_setup_loanmanager_products { | ||
|
||
StabilityBoardProxy public constant STABILITY_BOARD_PROXY = StabilityBoardProxy(0xde36a8773531406dCBefFdfd3C7b89fCed7A9F84); | ||
LoanManager public constant LOAN_MANAGER = LoanManager(0xEb57c12b1E69b4d10b1eD7a33231d31b811464b7); | ||
LoanManager public constant OLD_LOAN_MANAGER = LoanManager(0x1cABc34618ecf2949F0405A86353e7705E01C38b); | ||
|
||
function execute(Main0030_setup_loanmanager_products /* self, not used */) external { | ||
// called via StabilityBoardProxy | ||
require(address(this) == address(STABILITY_BOARD_PROXY), "only execute via StabilityBoardProxy"); | ||
|
||
/****************************************************************************** | ||
* Add loan products | ||
******************************************************************************/ | ||
// term (in sec), discountRate, initialCollateralRatio (ppm), minDisbursedAmount (token), | ||
// defaultingFeePt (ppm), isActive, minCollateralRatio (ppm) | ||
// 4.9% => [976406, 988063, 995989, 998125, 999062] | ||
|
||
LOAN_MANAGER.addLoanProduct(180 days, 976406, 1600000, 800, 100000, true, 1200000); | ||
LOAN_MANAGER.addLoanProduct(90 days, 988063, 1600000, 800, 100000, true, 1200000); | ||
LOAN_MANAGER.addLoanProduct(30 days, 995989, 1600000, 800, 100000, true, 1200000); | ||
LOAN_MANAGER.addLoanProduct(14 days, 998125, 1600000, 800, 100000, true, 1200000); | ||
LOAN_MANAGER.addLoanProduct(7 days, 999062, 1600000, 800, 100000, true, 1200000); | ||
|
||
|
||
/****************************************************************************** | ||
* Disable previous loan products | ||
******************************************************************************/ | ||
|
||
OLD_LOAN_MANAGER.setLoanProductActiveState(6, false); | ||
OLD_LOAN_MANAGER.setLoanProductActiveState(7, false); | ||
OLD_LOAN_MANAGER.setLoanProductActiveState(8, false); | ||
OLD_LOAN_MANAGER.setLoanProductActiveState(9, false); | ||
OLD_LOAN_MANAGER.setLoanProductActiveState(10, false); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* deploy new (margin) LoanManager contract */ | ||
const LoanManager = artifacts.require("./LoanManager.sol"); | ||
|
||
const STABILITYBOARD_PROXY_ADDRESS = "0xde36a8773531406dCBefFdfd3C7b89fCed7A9F84"; | ||
const TOKENAEUR_ADDRESS = "0xc994a2dEb02543Db1f48688438b9903c4b305ce3"; | ||
const MONETARY_SUPERVISOR_ADDRESS = "0x27484AFe9e6c332fB07F21Fac82d442EBe1D22c3"; | ||
const RATES_ADDRESS = "0x4272dB2EB82068E898588C3D6e4B5D55c3848793"; | ||
|
||
module.exports = function(deployer) { | ||
deployer.then(async () => { | ||
await deployer.deploy(LoanManager, STABILITYBOARD_PROXY_ADDRESS, TOKENAEUR_ADDRESS, MONETARY_SUPERVISOR_ADDRESS, RATES_ADDRESS); | ||
}); | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const Main0029_setup_loanmanager_permissions = artifacts.require("./Main0029_setup_loanmanager_permissions.sol"); | ||
|
||
module.exports = function(deployer) { | ||
deployer.then(async () => { | ||
await deployer.deploy(Main0029_setup_loanmanager_permissions); | ||
}); | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const Main0030_setup_loanmanager_products = artifacts.require("./Main0030_setup_loanmanager_products.sol"); | ||
|
||
module.exports = function(deployer) { | ||
deployer.then(async () => { | ||
await deployer.deploy(Main0030_setup_loanmanager_products); | ||
}); | ||
}; |
This file contains 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