|
| 1 | +name: Bridge Pause/Unpause via Safe Multisig |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + operation: |
| 7 | + description: 'Pause operation to perform' |
| 8 | + required: true |
| 9 | + type: choice |
| 10 | + options: |
| 11 | + - pause-bridge |
| 12 | + - unpause-bridge |
| 13 | + - pause-outbound |
| 14 | + - unpause-outbound |
| 15 | + network: |
| 16 | + description: 'Network to perform operation on' |
| 17 | + required: true |
| 18 | + type: choice |
| 19 | + options: |
| 20 | + - ethereum |
| 21 | + - arbitrum |
| 22 | + - sepolia |
| 23 | + - arbitrum_sepolia |
| 24 | + default: sepolia |
| 25 | + |
| 26 | +jobs: |
| 27 | + prepare-pause-operation: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + environment: ${{ inputs.network }} |
| 30 | + outputs: |
| 31 | + transaction-data: ${{ steps.prepare.outputs.transaction-data }} |
| 32 | + safe-address: ${{ steps.prepare.outputs.safe-address }} |
| 33 | + bridge-address: ${{ steps.prepare.outputs.bridge-address }} |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Checkout repository |
| 37 | + uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + submodules: recursive |
| 40 | + |
| 41 | + - name: Install Foundry |
| 42 | + uses: foundry-rs/foundry-toolchain@v1 |
| 43 | + with: |
| 44 | + version: stable |
| 45 | + cache: true |
| 46 | + |
| 47 | + - name: Prepare pause/unpause transaction calldata |
| 48 | + id: prepare |
| 49 | + env: |
| 50 | + CHAIN: ${{ inputs.network }} |
| 51 | + run: | |
| 52 | + # Get bridge address from config |
| 53 | + BRIDGE_ADDRESS=$(jq -r ".${CHAIN}.iexecLayerZeroBridgeAddress" config/config.json) |
| 54 | + echo "bridge-address=$BRIDGE_ADDRESS" >> $GITHUB_OUTPUT |
| 55 | + |
| 56 | + # Determine the function selector based on operation |
| 57 | + case "${{ inputs.operation }}" in |
| 58 | + "pause-bridge") |
| 59 | + # pause() function selector |
| 60 | + SELECTOR="0x8456cb59" |
| 61 | + ;; |
| 62 | + "unpause-bridge") |
| 63 | + # unpause() function selector |
| 64 | + SELECTOR="0x3f4ba83a" |
| 65 | + ;; |
| 66 | + "pause-outbound") |
| 67 | + # pauseOutboundTransfers() function selector |
| 68 | + SELECTOR="0x47e7ef24" |
| 69 | + ;; |
| 70 | + "unpause-outbound") |
| 71 | + # unpauseOutboundTransfers() function selector |
| 72 | + SELECTOR="0x63ba0d00" |
| 73 | + ;; |
| 74 | + esac |
| 75 | + |
| 76 | + echo "transaction-data=$SELECTOR" >> $GITHUB_OUTPUT |
| 77 | + echo "safe-address=${{ secrets.SAFE_ADDRESS }}" >> $GITHUB_OUTPUT |
| 78 | +
|
| 79 | + propose-to-safe: |
| 80 | + needs: prepare-pause-operation |
| 81 | + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/propose-safe-multisig-tx.yml@main |
| 82 | + secrets: |
| 83 | + safe-proposer-private-key: ${{ secrets.SAFE_PROPOSER_PRIVATE_KEY }} |
| 84 | + safe-api-key: ${{ secrets.SAFE_API_KEY }} |
| 85 | + with: |
| 86 | + rpc-url: ${{ secrets.RPC_URL }} |
| 87 | + safe-address: ${{ needs.prepare-pause-operation.outputs.safe-address }} |
| 88 | + transaction-to: ${{ needs.prepare-pause-operation.outputs.bridge-address }} |
| 89 | + transaction-value: '0' |
| 90 | + transaction-data: ${{ needs.prepare-pause-operation.outputs.transaction-data }} |
0 commit comments