From 6b19639ca97430b3c906a6bb4ac25d6bc9578e29 Mon Sep 17 00:00:00 2001 From: aazhou1 Date: Mon, 18 Nov 2024 17:25:42 -0500 Subject: [PATCH] set governor to factory and set manager to input --- .github/workflows/deploy-sepolia-strategy.yaml | 6 +++++- script/DeployGovernance.s.sol | 3 --- script/Strategy.s.sol | 8 +++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-sepolia-strategy.yaml b/.github/workflows/deploy-sepolia-strategy.yaml index f547f812..daa9bcde 100644 --- a/.github/workflows/deploy-sepolia-strategy.yaml +++ b/.github/workflows/deploy-sepolia-strategy.yaml @@ -10,6 +10,10 @@ on: description: 'Yearn strategy name' required: true default: '0x' + strategyManagementAddress: + description: 'Strategy management address' + required: true + default: '0x' discountRateMarkup: description: 'Discount rate markup' required: false @@ -60,6 +64,6 @@ jobs: ADMIN_ADDRESS: ${{ vars.ADMIN_ADDRESS }} DEVOPS_ADDRESS: ${{ vars.DEVOPS_ADDRESS }} GOVERNOR_ROLE_ADDRESS: ${{ vars.GOVERNANCE_FACTORY }} - STRATEGY_MANAGEMENT_ADDRESS: ${{ vars.GOVERNANCE_FACTORY }} + STRATEGY_MANAGEMENT_ADDRESS: ${{ github.events.strategyManagementAddress }} NEW_REQUIRED_RESERVE_RATIO: ${{ github.event.inputs.requiredReserveRatio }} \ No newline at end of file diff --git a/script/DeployGovernance.s.sol b/script/DeployGovernance.s.sol index 20350fb3..3066be8b 100644 --- a/script/DeployGovernance.s.sol +++ b/script/DeployGovernance.s.sol @@ -26,9 +26,6 @@ contract DeployGovernance is Script { address governor = vm.envAddress("GOVERNOR"); uint256 saltNonce = block.number; - Strategy strategyContract = Strategy(strategy); - strategyContract.setPendingGovernor(factory); - factory.deploySafe(proposer, strategy, governor, saltNonce); vm.stopBroadcast(); diff --git a/script/Strategy.s.sol b/script/Strategy.s.sol index c8f99d53..9e318551 100644 --- a/script/Strategy.s.sol +++ b/script/Strategy.s.sol @@ -138,14 +138,11 @@ 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(); - address deployer = vm.addr(governorDeployerPK); - Strategy.StrategyParams memory params = buildStrategyParams(address(eventEmitter), deployer); Strategy strategy = new Strategy( @@ -168,12 +165,13 @@ contract DeployStrategy is Script { vm.stopBroadcast(); } - function buildStrategyParams(address eventEmitter, address deployer) internal returns(Strategy.StrategyParams memory) { + function buildStrategyParams(address eventEmitter) 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 termController = vm.envAddress("TERM_CONTROLLER_ADDRESS"); uint256 discountRateMarkup = vm.envUint("DISCOUNT_RATE_MARKUP"); + address governorRoleAddress = vm.envAddress("GOVERNOR_ROLE_ADDRESS"); uint256 timeToMaturityThreshold = vm.envUint("TIME_TO_MATURITY_THRESHOLD"); uint256 repoTokenConcentrationLimit = vm.envUint("REPOTOKEN_CONCENTRATION_LIMIT"); uint256 newRequiredReserveRatio = vm.envUint("NEW_REQUIRED_RESERVE_RATIO"); @@ -185,7 +183,7 @@ contract DeployStrategy is Script { yearnVaultAddress, discountRateAdapterAddress, address(eventEmitter), - deployer, + governorRoleAddress, termController, repoTokenConcentrationLimit, timeToMaturityThreshold,