Skip to content

Commit

Permalink
governance added to deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
aazhou1 committed Nov 18, 2024
1 parent 41a0fd8 commit ca4d27f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-sepolia-strategy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
REPOTOKEN_CONCENTRATION_LIMIT: ${{ github.event.inputs.repoTokenConcentrationLimit }}
ADMIN_ADDRESS: ${{ vars.ADMIN_ADDRESS }}
DEVOPS_ADDRESS: ${{ vars.DEVOPS_ADDRESS }}
GOVERNOR_ROLE_ADDRESS: ${{ github.event.inputs.governorRoleAddress }}
GOVERNOR_ROLE_ADDRESS: ${{ vars.GOVERNANCE_FACTORY }}
STRATEGY_MANAGEMENT_ADDRESS: ${{ vars.GOVERNANCE_FACTORY }}
NEW_REQUIRED_RESERVE_RATIO: ${{ github.event.inputs.requiredReserveRatio }}

12 changes: 8 additions & 4 deletions script/Strategy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,15 @@ contract DeployStrategy is Script {
// Retrieve environment variables
string memory name = vm.envString("STRATEGY_NAME");
address strategyManagement = vm.envAddress("STRATEGY_MANAGEMENT_ADDRESS");
address governorRoleAddress = vm.envAddress("GOVERNOR_ROLE_ADDRESS");
bool isTest = vm.envBool("IS_TEST");


TermVaultEventEmitter eventEmitter = _deployEventEmitter();

Strategy.StrategyParams memory params = buildStrategyParams(address(eventEmitter));
address deployer = vm.addr(deployerPK);

Strategy.StrategyParams memory params = buildStrategyParams(address(eventEmitter), deployer);

Strategy strategy = new Strategy(
name,
Expand All @@ -156,6 +159,8 @@ contract DeployStrategy is Script {
console.log("set pending management");
console.log(strategyManagement);

strategy.setPendingGovernor(governorRoleAddress);

if (isTest) {
eventEmitter.pairVaultContract(address(strategy));
console.log("paired strategy contract with event emitter");
Expand All @@ -164,11 +169,10 @@ contract DeployStrategy is Script {
vm.stopBroadcast();
}

function buildStrategyParams(address eventEmitter) internal returns(Strategy.StrategyParams memory) {
function buildStrategyParams(address eventEmitter, address deployer) internal returns(Strategy.StrategyParams memory) {
address asset = vm.envAddress("ASSET_ADDRESS");
address yearnVaultAddress = vm.envAddress("YEARN_VAULT_ADDRESS");
address discountRateAdapterAddress = vm.envAddress("DISCOUNT_RATE_ADAPTER_ADDRESS");
address governorRoleAddress = vm.envAddress("GOVERNOR_ROLE_ADDRESS");
address termController = vm.envAddress("TERM_CONTROLLER_ADDRESS");
uint256 discountRateMarkup = vm.envUint("DISCOUNT_RATE_MARKUP");
uint256 timeToMaturityThreshold = vm.envUint("TIME_TO_MATURITY_THRESHOLD");
Expand All @@ -182,7 +186,7 @@ contract DeployStrategy is Script {
yearnVaultAddress,
discountRateAdapterAddress,
address(eventEmitter),
governorRoleAddress,
deployer,
termController,
repoTokenConcentrationLimit,
timeToMaturityThreshold,
Expand Down

0 comments on commit ca4d27f

Please sign in to comment.