You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+90-14Lines changed: 90 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,34 +10,110 @@ This ensures the new authority has signed before accepting, making accidental tr
10
10
11
11
Build with `cargo build-sbf` and test with `cargo test-sbf`.
12
12
13
-
## Scripts
13
+
## Tutorial: Transfer Program Authority to a Squads Multisig
14
14
15
-
TypeScript scripts are provided to interact with the on-chain program. All scripts support:
16
-
- File-based keypairs or Ledger hardware wallets
17
-
- Squads v3 multisig proposals via `--multisig`
15
+
This tutorial walks through transferring a Solana program's upgrade authority from a single keypair to a Squads v3 multisig vault.
18
16
19
-
Install dependencies with `yarn install`. See `scripts/helpers.ts` for documentation on CLI arguments.
17
+
### Prerequisites
20
18
21
-
### Propose
19
+
Install dependencies:
22
20
23
-
Transfer program authority to the escrow. The current authority proposes the transfer:
21
+
```shell
22
+
pnpm install
23
+
```
24
+
25
+
You'll need:
26
+
- The current program authority keypair (file path or Ledger hardware wallet)
27
+
- Your program's address
28
+
- Your Squads v3 multisig address
29
+
- A multisig member keypair to create and approve the proposal
30
+
31
+
### Step 1: Propose the Transfer
32
+
33
+
The current authority proposes transferring the program to the escrow. This moves authority from your keypair to a temporary escrow PDA, where it waits for the new authority to accept.
The `--authority` should be the multisig vault PDA that will become the new program authority. You can find this address in the Squads UI or derive it using vault index 1 (the default).
30
43
31
-
Accept a proposed authority transfer. The new authority accepts:
The new authority (the multisig vault) must accept the transfer. Since a vault can't sign directly, this creates a Squads proposal that members vote on.
57
+
58
+
```shell
59
+
pnpm accept \
60
+
--keypair /path/to/multisig-member.json \
61
+
--program <PROGRAM_ADDRESS> \
62
+
--authority <PREVIOUS_AUTHORITY_ADDRESS> \
63
+
--multisig <MULTISIG_ADDRESS>
64
+
```
65
+
66
+
Here:
67
+
-`--keypair` is a multisig member who will create and initially approve the proposal
68
+
-`--authority` is the previous authority that proposed the transfer (from Step 1)
69
+
-`--multisig` is the Squads multisig address (not the vault)
70
+
71
+
This command:
72
+
1. Creates a new transaction in the multisig
73
+
2. Adds the accept instruction
74
+
3. Activates the transaction
75
+
4. Casts the first approval vote
76
+
77
+
### Step 3: Complete Multisig Approval
78
+
79
+
Other multisig members must now approve the proposal in the Squads UI until it reaches the threshold. Once approved and executed, the program authority transfer is complete.
80
+
81
+
### Reverting a Transfer
82
+
83
+
If you need to cancel before the new authority accepts, the current authority can revert:
84
+
85
+
```shell
86
+
pnpm revert \
87
+
--keypair /path/to/current-authority.json \
88
+
--program <PROGRAM_ADDRESS> \
89
+
--authority <NEW_AUTHORITY_ADDRESS>
90
+
```
91
+
92
+
If the current authority is already a multisig vault:
0 commit comments