Skip to content

Commit b76f0de

Browse files
committed
feat: Add workflow for accepting admin role transfer with Safe integration
1 parent 40ab8c3 commit b76f0de

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Accept Admin Role Transfer - Safe
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
network:
7+
description: 'Network to accept admin role on'
8+
required: true
9+
type: choice
10+
options:
11+
- ethereum
12+
- arbitrum
13+
- sepolia
14+
- arbitrum_sepolia
15+
default: sepolia
16+
17+
jobs:
18+
transfer-admin-role:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: ${{ inputs.network }}
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Execute Transfer Admin Role
28+
id: transfer-admin
29+
uses: iExecBlockchainComputing/safe-tx-proposer@feature/wrap-it-gha
30+
with:
31+
safe-address: ${{ secrets.SAFE_ADDRESS }}
32+
safe-api-key: ${{ secrets.SAFE_API_KEY }}
33+
rpc-url: ${{ secrets.RPC_URL }}
34+
proposer-private-key: ${{ secrets.PROPOSER_PRIVATE_KEY }}
35+
foundry-script-path: 'script/TransferAdminRole.s.sol:AcceptAdminRole'
36+
env:
37+
CHAIN: ${{ inputs.network }}
38+
39+
# - name: Display Results
40+
# run: |
41+
# echo "Operation Status: ${{ steps.transfer-admin.outputs.status }}"
42+
# echo "Transaction Count: ${{ steps.transfer-admin.outputs.transaction-count }}"
43+
44+
# if [[ "${{ inputs.action-mode }}" == "propose" ]]; then
45+
# echo "Transaction Hash: ${{ steps.transfer-admin.outputs.transaction-hash }}"
46+
# echo "All Transaction Hashes: ${{ steps.transfer-admin.outputs.transaction-hashes }}"
47+
# echo "✅ Admin role transfer transaction has been proposed to the Safe multisig"
48+
# echo "📋 Please review and approve the transaction in the Safe interface"
49+
# elif [[ "${{ inputs.action-mode }}" == "list-pending" ]]; then
50+
# echo "Pending Transactions:"
51+
# echo '${{ steps.transfer-admin.outputs.pending-transactions }}' | jq '.'
52+
# fi
53+
54+
# - name: Summary
55+
# run: |
56+
# echo "## Transfer Admin Role Summary" >> $GITHUB_STEP_SUMMARY
57+
# echo "- **Safe Address**: ${{ inputs.safe-address }}" >> $GITHUB_STEP_SUMMARY
58+
# echo "- **Chain**: ${{ inputs.chain }}" >> $GITHUB_STEP_SUMMARY
59+
# echo "- **Script**: ${{ inputs.script-path }}" >> $GITHUB_STEP_SUMMARY
60+
# echo "- **Mode**: ${{ inputs.action-mode }}" >> $GITHUB_STEP_SUMMARY
61+
# echo "- **Status**: ${{ steps.transfer-admin.outputs.status }}" >> $GITHUB_STEP_SUMMARY
62+
# echo "- **Transaction Count**: ${{ steps.transfer-admin.outputs.transaction-count }}" >> $GITHUB_STEP_SUMMARY
63+
64+
# if [[ "${{ inputs.action-mode }}" == "propose" ]]; then
65+
# echo "- **Transaction Hash**: ${{ steps.transfer-admin.outputs.transaction-hash }}" >> $GITHUB_STEP_SUMMARY
66+
# fi

.github/workflows/accept-admin.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Accept Admin Role Transfer
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
network:
7+
description: 'Network to accept admin role on'
8+
required: true
9+
type: choice
10+
options:
11+
- ethereum
12+
- arbitrum
13+
- sepolia
14+
- arbitrum_sepolia
15+
default: sepolia
16+
17+
jobs:
18+
accept-admin:
19+
runs-on: ubuntu-latest
20+
21+
environment:
22+
name: ${{ inputs.network }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
29+
- name: Install Foundry
30+
uses: foundry-rs/foundry-toolchain@v1
31+
with:
32+
version: stable
33+
cache: true
34+
35+
- name: Accept default admin role
36+
env:
37+
ADMIN_PRIVATE_KEY: ${{ secrets.ADMIN_PRIVATE_KEY }}
38+
CHAIN: ${{ inputs.network }}
39+
RPC_URL: ${{ secrets.RPC_URL }}
40+
run: make accept-default-admin-transfer

0 commit comments

Comments
 (0)