diff --git a/.github/workflows/deploy-sepolia-governance.yaml b/.github/workflows/deploy-sepolia-governance.yaml new file mode 100644 index 00000000..a7715f2c --- /dev/null +++ b/.github/workflows/deploy-sepolia-governance.yaml @@ -0,0 +1,42 @@ +name: "[sepolia-deploy] deploy governance for strategy" +on: + workflow_dispatch: + inputs: + proposer: + description: 'Proposer address' + required: true + default: '0x' + strategy: + description: 'Strategy Address' + required: true + default: '0x' + governorRoleAddress: + description: 'Governor role address' + required: true + default: '0x' + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: sepolia + url: https://term-finance.github.io/yearn-v3-term-vault/ + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + submodules: recursive + - uses: foundry-rs/foundry-toolchain@v1 + - run: forge install + - run: forge build + - run: forge tree + - run: forge script script/DeployGovernance.s.sol:DeployGovernance --rpc-url $RPC_URL --broadcast --gas-price 500000000000 --verify --verbosity 4 + env: + RPC_URL: ${{ secrets.RPC_URL }} + PRIVATE_KEY: ${{ secrets.GOVERNANCE_DEPLOYER_KEY }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + PROPOSER: ${{ github.event.inputs.proposer }} + STRATEGY: ${{ github.event.inputs.strategy }} + GOVERNOR: ${{ github.event.inputs.governorRoleAddress }} + + \ No newline at end of file diff --git a/script/DeployGovernance.s.sol b/script/DeployGovernance.s.sol new file mode 100644 index 00000000..45b3768f --- /dev/null +++ b/script/DeployGovernance.s.sol @@ -0,0 +1,33 @@ +import "forge-std/Script.sol"; + +interface TermVaultGovernanceFactory { + function deploySafe( + address proposer, + address strategy, + address governor, + uint256 saltNonce + ) external; +} + +contract DeployGovernance is Script { + + function run() external { + uint256 deployerPK = vm.envUint("PRIVATE_KEY"); + + // Set up the RPC URL (optional if you're using the default foundry config) + string memory rpcUrl = vm.envString("RPC_URL"); + + vm.startBroadcast(deployerPK); + + TermVaultGovernanceFactory factory = TermVaultGovernanceFactory(vm.envAddress("GOVERNANCE_FACTORY")); + address proposer = vm.envAddress("PROPOSER"); + address strategy = vm.envAddress("STRATEGY"); + address governor = vm.envAddress("GOVERNOR"); + uint256 saltNonce = block.number; + + factory.deploySafe(proposer, strategy, governor, saltNonce); + + vm.stopBroadcast(); + } + +} \ No newline at end of file