Skip to content

Commit

Permalink
mainnet deploy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aazhou1 committed Nov 25, 2024
1 parent 280159b commit d35f392
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy-mainnet-governance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "[mainnet-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'
governorVaults:
description: 'Governor vaults as comma separated'
required: false
default: ''

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: mainnet
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 }}
VAULT_GOVERNORS: ${{ github.event.inputs.governorVaults }}
GOVERNANCE_FACTORY: ${{ vars.GOVERNANCE_FACTORY }}




84 changes: 84 additions & 0 deletions .github/workflows/deploy-mainnet-strategy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: "[mainnet-deploy] deploy strategy"
on:
workflow_dispatch:
inputs:
asset:
description: 'Asset address'
required: true
default: '0x'
strategyName:
description: 'Yearn strategy name'
required: true
default: '0x'
strategyManagementAddress:
description: 'Strategy management address'
required: true
default: '0x'
discountRateMarkup:
description: 'Discount rate markup'
required: false
default: '0.01'
timeToMaturityThreshold:
description: 'Time to maturity threshold'
required: false
default: '0'
repoTokenConcentrationLimit:
description: 'Repo token concentration limit'
required: false
default: '0.01'
requiredReserveRatio:
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
default: '0x'
minCollateralRatios:
description: 'Minimum collateral ratio comma separated'
required: false
default: '0.01'

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: mainnet
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/Strategy.s.sol:DeployStrategy --rpc-url $RPC_URL --broadcast --gas-price 500000000000 --verify --verbosity 4
env:
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
GOVERNOR_DEPLOYER_KEY: ${{ secrets.GOVERNANCE_DEPLOYER_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ASSET_ADDRESS: ${{ github.event.inputs.asset }}
YEARN_VAULT_ADDRESS: ${{ vars.YEARN_VAULT_ADDRESS }}
IS_TEST: true
STRATEGY_NAME: ${{ github.event.inputs.strategyName }}
TERM_CONTROLLER_ADDRESS: ${{ vars.TERM_CONTROLLER_ADDRESS }}
DISCOUNT_RATE_ADAPTER_ADDRESS: ${{ vars.DISCOUNT_RATE_ADAPTER_ADDRESS }}
DISCOUNT_RATE_MARKUP: ${{ github.event.inputs.discountRateMarkup }}
TIME_TO_MATURITY_THRESHOLD: ${{ github.event.inputs.timeToMaturityThreshold }}
REPOTOKEN_CONCENTRATION_LIMIT: ${{ github.event.inputs.repoTokenConcentrationLimit }}
ADMIN_ADDRESS: ${{ vars.ADMIN_ADDRESS }}
DEVOPS_ADDRESS: ${{ vars.DEVOPS_ADDRESS }}
GOVERNOR_ROLE_ADDRESS: ${{ vars.GOVERNANCE_FACTORY }}
STRATEGY_MANAGEMENT_ADDRESS: ${{ github.event.inputs.strategyManagementAddress }}
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 }}

50 changes: 50 additions & 0 deletions .github/workflows/deploy-mainnet-vault-governance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "[sepolia-deploy] deploy governance for vault"
on:
workflow_dispatch:
inputs:
proposer:
description: 'Proposer address'
required: true
default: '0x'
vault:
description: 'Vault Address'
required: true
default: '0x'
accountant:
description: 'Accountant 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/VaultGovernanceDeploy.s.sol:VaultGovernanceDeploy --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 }}
VAULT: ${{ github.event.inputs.vault }}
ACCOUNTANT: ${{ github.event.inputs.accountant }}
GOVERNOR: ${{ github.event.inputs.governorRoleAddress }}
GOVERNANCE_FACTORY: ${{ vars.VAULT_GOVERNANCE_FACTORY }}




78 changes: 78 additions & 0 deletions .github/workflows/deploy-mainnet-vault.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "[mainnet-deploy] deploy vault"
on:
workflow_dispatch:
inputs:
asset:
description: 'Asset address'
required: true
default: '0x'
vaultName:
description: 'Yearn vault name'
required: true
default: '0x'
vaultSymbol:
description: 'Yearn vault symbol'
required: true
default: '0x'
profitMaxUnlockTime:
description: 'Profit max unlock time'
required: true
default: '0'
depositLimit:
description: 'Deposit limit'
required: false
default: '0'
defaultPerformance:
description: 'Default performance fee'
required: false
default: '0'
defaultMaxFee:
description: 'Default max fee'
required: false
default: '0'
defaultMaxGain:
description: 'Default max gain'
required: false
default: '0'
defaultMaxLoss:
description: 'Default max loss'
required: false
default: '0'


jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: mainnet
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/VaultManagement.s.sol:SetupVaultManagement --rpc-url $RPC_URL --broadcast --verify --verbosity 4
env:
RPC_URL: ${{ secrets.RPC_URL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ASSET_ADDRESS: ${{ github.event.inputs.asset }}
VAULT_FACTORY: ${{ vars.VAULT_FACTORY }}
ACCOUNTANT_FACTORY: ${{ vars.ACCOUNTANT_FACTORY }}
VAULT_NAME: ${{ github.event.inputs.vaultName }}
VAULT_SYMBOL: ${{ github.event.inputs.vaultSymbol }}
FEE_RECIPIENT: ${{ vars.FEE_RECIPIENT }}
DEPOSIT_LIMIT: ${{ github.event.inputs.depositLimit }}
VAULT_GOVERNANCE_FACTORY: ${{ vars.VAULT_GOVERNANCE_FACTORY }}
KEEPER_ADDRESS: ${{ vars.KEEPER }}
PROFIT_MAX_UNLOCK_TIME: ${{ github.event.inputs.profitMaxUnlockTime }}
DEFAULT_PERFORMANCE: ${{ github.event.inputs.defaultPerformance }}
DEFAULT_MAX_FEE: ${{ github.event.inputs.defaultMaxFee }}
DEFAULT_MAX_GAIN: ${{ github.event.inputs.defaultMaxGain }}
DEFAULT_MAX_LOSS: ${{ github.event.inputs.defaultMaxLoss }}


0 comments on commit d35f392

Please sign in to comment.