From 1484521be6cd740d3f2d4b7b11a23db3e4698ea1 Mon Sep 17 00:00:00 2001 From: aazhou1 Date: Mon, 16 Dec 2024 10:39:13 -0800 Subject: [PATCH 1/2] avax deployers --- .github/workflows/deploy-avax-strategy.yaml | 85 +++++++++++++++++++++ .github/workflows/deploy-avax-vault.yaml | 79 +++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 .github/workflows/deploy-avax-strategy.yaml create mode 100644 .github/workflows/deploy-avax-vault.yaml diff --git a/.github/workflows/deploy-avax-strategy.yaml b/.github/workflows/deploy-avax-strategy.yaml new file mode 100644 index 00000000..e0e77be0 --- /dev/null +++ b/.github/workflows/deploy-avax-strategy.yaml @@ -0,0 +1,85 @@ +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 }} + KEEPER_ADDRESS: ${{ vars.KEEPER }} + 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 }} + \ No newline at end of file diff --git a/.github/workflows/deploy-avax-vault.yaml b/.github/workflows/deploy-avax-vault.yaml new file mode 100644 index 00000000..369a4eb8 --- /dev/null +++ b/.github/workflows/deploy-avax-vault.yaml @@ -0,0 +1,79 @@ +name: "[avalanche-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: avalanche + 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 }} + STRATEGY_ADDER: ${{ vars.STRATEGY_ADDER }} + 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 }} + + \ No newline at end of file From 18e965945db11bf843f509e2543e355823aa9d82 Mon Sep 17 00:00:00 2001 From: aazhou1 Date: Mon, 16 Dec 2024 10:41:01 -0800 Subject: [PATCH 2/2] avax deployers --- .github/workflows/deploy-avax-strategy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-avax-strategy.yaml b/.github/workflows/deploy-avax-strategy.yaml index e0e77be0..8d8092e1 100644 --- a/.github/workflows/deploy-avax-strategy.yaml +++ b/.github/workflows/deploy-avax-strategy.yaml @@ -1,4 +1,4 @@ -name: "[mainnet-deploy] deploy strategy" +name: "[avalanche-deploy] deploy strategy" on: workflow_dispatch: inputs: @@ -47,7 +47,7 @@ jobs: deploy: runs-on: ubuntu-latest environment: - name: mainnet + name: avalanche url: https://term-finance.github.io/yearn-v3-term-vault/ steps: - uses: actions/checkout@master