Skip to content

Add CLI instruction to transfer an authority - #157

Merged
fedgiac merged 5 commits into
mainfrom
federico/sc-417-add-cli-instruction-to-transfer-an-authority
Sep 18, 2026
Merged

fedgiac merged 5 commits into
mainfrom
federico/sc-417-add-cli-instruction-to-transfer-an-authority

Conversation

@fedgiac

@fedgiac fedgiac commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Add a path for the CLI to transfer an authority. This is specifically to transfer solver management to the solver team.

I also isolated the code that reads a keypair from a file or uses a default, since it's reused in the solver command and will be used again in the future. I also gave it a separate folder for future new commands.

How to test

Manually try on devnet that the authority gets changed as expected.

Example.

I decoded the account data before and after execution. Note that the second word of the account was changed, as expected for reclaim-authority.

$ cow authority transfer --keypair ../deployer.json  reclaim-authority 11111111111111111111111111111111 
   signature = qhUqBvQFstjhh4m4JJ92YNMe7TYxRnT6PoTeYgowR5ZqaHeGF5EbzK8PxnCmKRocF1WDpQwihXWwpRSBVw8q68E
        role = ReclaimAuthority
newAuthority = 11111111111111111111111111111111
      signer = B6acm3swJK9pJ7fe4i4GQgP7x5A3RndvsdV2bKhcA1i5
    statePda = 9t7yR5UvhuQvApxSqsZFL7wxqq4u78DAkQQhxKxMxkJt
$ solana account 9t7yR5UvhuQvApxSqsZFL7wxqq4u78DAkQQhxKxMxkJt

Public Key: 9t7yR5UvhuQvApxSqsZFL7wxqq4u78DAkQQhxKxMxkJt
Balance: 0.001143 SOL
Owner: C7PXyLpLQBh3Ce7e9DNj3rDVUvwqa5orDwQG5hs1rfNi
Executable: false
Rent Epoch: 18446744073709551615
Length: 97 (0x61) bytes
0000:   81 96 02 c8  9d 9b 92 0a  c1 bc d7 ae  14 49 64 12   .............Id.
0010:   b3 df f8 4a  83 dc 36 7a  83 82 da c4  88 8a 8b 1d   ...J..6z........
0020:   66 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   f...............
0030:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0040:   00 96 02 c8  9d 9b 92 0a  c1 bc d7 ae  14 49 64 12   .............Id.
0050:   b3 df f8 4a  83 dc 36 7a  83 82 da c4  88 8a 8b 1d   ...J..6z........
0060:   66                                                   f

$ cow authority transfer --keypair ../deployer.json  reclaim-authority B6acm3swJK9pJ7fe4i4GQgP7x5A3RndvsdV2bKhcA1i5
   signature = 2LirnCqmBuyPAdmG8YZb68v6nPiLN5ipQRTig3yTaxgr8HJ8vbzSzWA922d9uTnUpqfk4DCe8GFL6zMMmxCWvy2s
        role = ReclaimAuthority
newAuthority = B6acm3swJK9pJ7fe4i4GQgP7x5A3RndvsdV2bKhcA1i5
      signer = B6acm3swJK9pJ7fe4i4GQgP7x5A3RndvsdV2bKhcA1i5
    statePda = 9t7yR5UvhuQvApxSqsZFL7wxqq4u78DAkQQhxKxMxkJt
$ solana account 9t7yR5UvhuQvApxSqsZFL7wxqq4u78DAkQQhxKxMxkJt

Public Key: 9t7yR5UvhuQvApxSqsZFL7wxqq4u78DAkQQhxKxMxkJt
Balance: 0.001143 SOL
Owner: C7PXyLpLQBh3Ce7e9DNj3rDVUvwqa5orDwQG5hs1rfNi
Executable: false
Rent Epoch: 18446744073709551615
Length: 97 (0x61) bytes
0000:   81 96 02 c8  9d 9b 92 0a  c1 bc d7 ae  14 49 64 12   .............Id.
0010:   b3 df f8 4a  83 dc 36 7a  83 82 da c4  88 8a 8b 1d   ...J..6z........
0020:   66 96 02 c8  9d 9b 92 0a  c1 bc d7 ae  14 49 64 12   f............Id.
0030:   b3 df f8 4a  83 dc 36 7a  83 82 da c4  88 8a 8b 1d   ...J..6z........
0040:   66 96 02 c8  9d 9b 92 0a  c1 bc d7 ae  14 49 64 12   f............Id.
0050:   b3 df f8 4a  83 dc 36 7a  83 82 da c4  88 8a 8b 1d   ...J..6z........
0060:   66                                                   f

@fedgiac
fedgiac requested a review from a team as a code owner September 17, 2026 14:32
@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

SC-417

Comment thread test-cli/src/cmd/authority/transfer.rs Outdated
@fedgiac
fedgiac requested a review from kaze-cow September 18, 2026 08:57

@kaze-cow kaze-cow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beauty

@fedgiac
fedgiac merged commit 6365843 into main Sep 18, 2026
18 checks passed
@fedgiac
fedgiac deleted the federico/sc-417-add-cli-instruction-to-transfer-an-authority branch September 18, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants