Upgrade Contracts #1
This file contains hidden or 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
| name: Upgrade Contracts | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| network: | |
| description: 'Network (same as deployment)' | |
| required: true | |
| type: choice | |
| options: | |
| - base_sepolia | |
| - base | |
| proxy_address: | |
| description: 'Proxy contract address (not implementation!)' | |
| required: true | |
| jobs: | |
| upgrade: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Deploy new implementation | |
| env: | |
| PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
| BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} | |
| PROXY_ADDRESS: ${{ inputs.proxy_address }} | |
| run: | | |
| echo "Deploying new implementation..." | |
| forge script script/DeployProxy.s.sol \ | |
| --rpc-url ${{ inputs.network }} \ | |
| --broadcast \ | |
| --verify \ | |
| -vvvv | |
| echo "⚠️ Manual upgrade required:" | |
| echo "Call upgradeToAndCall() on proxy at $PROXY_ADDRESS" | |
| echo "with new implementation address from deployment" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: upgrade-${{ inputs.network }} | |
| path: broadcast/ |