From 51e7032aebe7f8b28b6388fbbb1aaae5e998f2fe Mon Sep 17 00:00:00 2001 From: aazhou1 Date: Thu, 21 Nov 2024 12:56:57 -0500 Subject: [PATCH] set profit max unlock time for strategy deploy --- .github/workflows/deploy-sepolia-strategy.yaml | 5 +++++ script/Strategy.s.sol | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/deploy-sepolia-strategy.yaml b/.github/workflows/deploy-sepolia-strategy.yaml index 1328e57d..849adb30 100644 --- a/.github/workflows/deploy-sepolia-strategy.yaml +++ b/.github/workflows/deploy-sepolia-strategy.yaml @@ -30,6 +30,10 @@ on: description: 'Required reserve ratio' required: false default: '0.01' + profitMaxUnlock: + description: 'Profit max unlock time' + required: false + default: '0' collateralTokens: description: 'Collateral tokens comma separated' required: false @@ -76,4 +80,5 @@ jobs: NEW_REQUIRED_RESERVE_RATIO: ${{ github.event.inputs.requiredReserveRatio }} COLLATERAL_TOKEN_ADDRESSES: ${{ github.event.inputs.collateralTokens }} MIN_COLLATERAL_RATIOS: ${{ github.event.inputs.minCollateralRatios }} + PROFIT_MAX_UNLOCK_TIME: ${{ github.event.inputs.profitMaxUnlock }} \ No newline at end of file diff --git a/script/Strategy.s.sol b/script/Strategy.s.sol index 054289f1..56eba271 100644 --- a/script/Strategy.s.sol +++ b/script/Strategy.s.sol @@ -148,6 +148,7 @@ contract DeployStrategy is Script { address[] memory collateralTokens = stringToAddressArray(vm.envString("COLLATERAL_TOKEN_ADDRESSES")); uint256[] memory minCollateralRatios = stringToUintArray(vm.envString("MIN_COLLATERAL_RATIOS")); address governorRoleAddress = vm.envAddress("GOVERNOR_ROLE_ADDRESS"); + uint256 profitMaxUnlockTime = vm.envUint("PROFIT_MAX_UNLOCK_TIME"); bool isTest = vm.envBool("IS_TEST"); @@ -166,6 +167,8 @@ contract DeployStrategy is Script { console.log("deployed strategy contract to"); console.log(address(strategy)); + ITokenizedStrategy(address(strategy)).setProfitMaxUnlockTime(profitMaxUnlockTime); + ITokenizedStrategy(address(strategy)).setPendingManagement(strategyManagement); console.log("set pending management"); console.log(strategyManagement); @@ -179,6 +182,7 @@ contract DeployStrategy is Script { strategy.setCollateralTokenParams(collateralTokens[i], minCollateralRatios[i]); } + strategy.setPendingGovernor(governorRoleAddress); console.log("set pending governor"); console.log(governorRoleAddress);