forked from yearn/tokenized-strategy-foundry-mix
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |