Add stellar token set-authorized subcommand - #2719
Open
fnando wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the SAC-admin token set-authorized command.
Changes:
- Implements authorization updates with structured receipts and errors.
- Registers CLI routing, help documentation, and JSON handling.
- Adds integration coverage for success and error paths.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
FULL_HELP_DOCS.md |
Documents the command and options. |
cmd/soroban-cli/src/commands/token/set_authorized.rs |
Implements the command. |
cmd/soroban-cli/src/commands/token/mod.rs |
Registers and dispatches the subcommand. |
cmd/soroban-cli/src/cli.rs |
Enables structured JSON errors. |
cmd/crates/soroban-test/tests/it/integration/token/set_authorized.rs |
Tests behavior and failures. |
cmd/crates/soroban-test/tests/it/integration/token/mod.rs |
Registers the integration tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
stellar token set-authorized, a SAC-admin write subcommand that authorizes or deauthorizes an account to hold and transact a token.--adminsigns and authorizes the change,--accountis the target, and--authorize <true|false>sets the state. Returns a JSON receipt with the tx hash.Why
Part of #2620 (typed SEP-41 + SAC client), completing the SAC-admin group (
mint/set-admin/clawback/set-authorized). A thin wrapper overcontract invokereusingargs::invoke_by_positionandargs::not_deployed_error; the admin only authorizes and is not aset_authorizedargument, so only[account, authorize]are passed positionally.set_authorizedis part of the SACStellarAssetInterface, not SEP-41. The happy-path test verifies the change behaviorally via the SAC'sauthorizedgetter.Known limitations
Muxed (
M…) source accounts are rejected with a clear error (same constraint astransfer, see #2645). Deauthorizing an existing trustline requires the issuer to haveAUTH_REVOCABLEset — an asset-configuration prerequisite, not enforced by the command.