From b12f8ed6d85ab514170aabf55155f73ffc9097de Mon Sep 17 00:00:00 2001 From: aazhou1 Date: Mon, 11 Nov 2024 17:50:52 -0500 Subject: [PATCH] vault reporting role add github action --- .../actions-sepolia-vault-keeper.yml | 37 +++++++++++++++++++ script/VaultReportingManagement.s.sol | 23 ++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/actions-sepolia-vault-keeper.yml create mode 100644 script/VaultReportingManagement.s.sol diff --git a/.github/workflows/actions-sepolia-vault-keeper.yml b/.github/workflows/actions-sepolia-vault-keeper.yml new file mode 100644 index 00000000..6ed07aa1 --- /dev/null +++ b/.github/workflows/actions-sepolia-vault-keeper.yml @@ -0,0 +1,37 @@ +name: "[sepolia-deploy] manage vault keeper" +on: + workflow_dispatch: + inputs: + keeper: + description: 'keeper address' + required: true + default: '0x' + vault: + description: 'vault address' + required: true + default: '0x' + + +jobs: + acceptManagement: + 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/VaultReportingManagement.s.sol:VaultReportingManagement --rpc-url $RPC_URL --broadcast --gas-price 500000000000 --verify --verbosity 4 + env: + RPC_URL: ${{ secrets.RPC_URL }} + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + KEEPER_ADDRESS: ${{ github.event.inputs.keeper }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + VAULT: ${{ github.event.inputs.vault }} + \ No newline at end of file diff --git a/script/VaultReportingManagement.s.sol b/script/VaultReportingManagement.s.sol new file mode 100644 index 00000000..e6bc2d6e --- /dev/null +++ b/script/VaultReportingManagement.s.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "forge-std/Script.sol"; +import "@yearn-vaults/interfaces/IVault.sol"; + + +contract VaultReportingManagement is Script { + function run() external { + uint256 deployerPK = vm.envUint("PRIVATE_KEY"); + + address keeperAddress = vm.envAddress("KEEPER_ADDRESS"); + address vault = vm.envAddress("VAULT"); + + // Set up the RPC URL (optional if you're using the default foundry config) + string memory rpcUrl = vm.envString("RPC_URL"); + + vm.startBroadcast(deployerPK); + IVault(vault).add_role(keeperAddress, 32); + console.log("keeper given reporting role"); + vm.stopBroadcast(); + } +} \ No newline at end of file