Bridge Pause/Unpause via Safe Multisig #27
Workflow file for this run
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: Bridge Pause/Unpause via Safe Multisig | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| operation: | |
| description: 'Pause operation to perform' | |
| required: true | |
| type: choice | |
| options: | |
| - pause-bridge | |
| - unpause-bridge | |
| - pause-outbound | |
| - unpause-outbound | |
| network: | |
| description: 'Network to perform operation on' | |
| required: true | |
| type: choice | |
| options: | |
| - ethereum | |
| - arbitrum | |
| - sepolia | |
| - arbitrum_sepolia | |
| default: sepolia | |
| dry-run: | |
| description: 'Dry run mode (only prepare and display transaction, do not propose to Safe)' | |
| required: false | |
| type: boolean | |
| default: true | |
| jobs: | |
| prepare-transaction-calldata: | |
| runs-on: ubuntu-latest | |
| environment: ${{ inputs.network }} | |
| outputs: | |
| transaction-data: ${{ steps.prepare.outputs.transaction-data }} | |
| safe-address: ${{ steps.prepare.outputs.safe-address }} | |
| bridge-address: ${{ steps.prepare.outputs.bridge-address }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: stable | |
| cache: true | |
| - name: Prepare transaction calldata | |
| id: prepare | |
| env: | |
| CHAIN: ${{ inputs.network }} | |
| run: | | |
| # Get bridge address from config | |
| BRIDGE_ADDRESS=$(jq -r ".chains.${CHAIN}.iexecLayerZeroBridgeAddress" config/config.json) | |
| echo "bridge-address=$BRIDGE_ADDRESS" >> $GITHUB_OUTPUT | |
| # Determine the function selector and name based on operation | |
| case "${{ inputs.operation }}" in | |
| "pause-bridge") | |
| TRANSACTION_DATA=$(cast calldata "pause()") | |
| FUNCTION_NAME="pause()" | |
| ;; | |
| "unpause-bridge") | |
| TRANSACTION_DATA=$(cast calldata "unpause()") | |
| FUNCTION_NAME="unpause()" | |
| ;; | |
| "pause-outbound") | |
| TRANSACTION_DATA=$(cast calldata "pauseOutboundTransfers()") | |
| FUNCTION_NAME="pauseOutboundTransfers()" | |
| ;; | |
| "unpause-outbound") | |
| TRANSACTION_DATA=$(cast calldata "unpauseOutboundTransfers()") | |
| FUNCTION_NAME="unpauseOutboundTransfers()" | |
| ;; | |
| esac | |
| echo "transaction-data=$TRANSACTION_DATA" >> $GITHUB_OUTPUT | |
| echo "safe-address=${{ vars.SAFE_ADDRESS }}" >> $GITHUB_OUTPUT | |
| # Display transaction details | |
| echo "==========================================" | |
| echo "Transaction Details" | |
| echo "==========================================" | |
| echo "Workflow Configuration:" | |
| echo " • Network: ${{ inputs.network }}" | |
| echo " • Operation: ${{ inputs.operation }}" | |
| echo " • Function: $FUNCTION_NAME" | |
| echo " • Safe Address: ${{ vars.SAFE_ADDRESS }}" | |
| echo " • Dry Run: ${{ inputs.dry-run }}" | |
| echo "" | |
| echo "Transaction Details:" | |
| echo " • Target: $BRIDGE_ADDRESS" | |
| echo " • Value: 0 ETH" | |
| echo " • Data: $TRANSACTION_DATA" | |
| echo "" | |
| if [ "${{ inputs.dry-run }}" == "true" ]; then | |
| echo "✅ DRY RUN MODE: Transaction prepared successfully" | |
| fi | |
| propose-to-safe-tx: | |
| needs: prepare-transaction-calldata | |
| runs-on: ubuntu-latest | |
| environment: ${{ inputs.network }} | |
| steps: | |
| - name: Checkout Safe proposal repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: iExecBlockchainComputing/github-actions-workflows | |
| path: .github-actions | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| working-directory: .github-actions/propose-safe-multisig-tx | |
| run: npm ci | |
| - name: Build the action | |
| working-directory: .github-actions/propose-safe-multisig-tx | |
| run: npm run build | |
| - name: Propose transaction to Safe | |
| working-directory: .github-actions/propose-safe-multisig-tx | |
| env: | |
| SAFE_ADDRESS: ${{ needs.prepare-transaction-calldata.outputs.safe-address }} | |
| TRANSACTION_TO: ${{ needs.prepare-transaction-calldata.outputs.bridge-address }} | |
| TRANSACTION_VALUE: "0" | |
| TRANSACTION_DATA: ${{ needs.prepare-transaction-calldata.outputs.transaction-data }} | |
| RPC_URL: ${{ secrets.RPC_URL }} | |
| SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.SAFE_PROPOSER_PRIVATE_KEY }} | |
| SAFE_API_KEY: ${{ secrets.SAFE_API_KEY }} | |
| DRY_RUN: ${{ inputs.dry-run }} | |
| run: npm run propose |