Skip to content

Commit

Permalink
governance deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
aazhou1 committed Nov 18, 2024
1 parent dc9dda9 commit 1a39f6b
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-sepolia-governance.yaml
Original file line number Diff line number Diff line change
@@ -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 }}


33 changes: 33 additions & 0 deletions script/DeployGovernance.s.sol
Original file line number Diff line number Diff line change
@@ -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();
}

}

0 comments on commit 1a39f6b

Please sign in to comment.