Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hpmaxi
marked this pull request as ready for review
October 17, 2026 18:05
This branch was successfully deployed
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.
Summary
Until now the compliance key alone could move any holder's shares, the vault's escrow included, and freeze the vault's address. A legal-order transfer now needs governance's signature in the same call, never moves shares out of or into the vault's address, and only lands on an allowlisted account. A recovery needs the same co-signature and goes only to the new address the identity verifier names. Both move wallet shares only; value the vault holds for a frozen holder waits for an unfreeze.
Changes
legal_transfer(from, to, amount, reference, operator): compliance asks, the token admin co-signs, two different accounts; publishesLegalTransferwith the order referenceforced_transferis manager-only; the vault's escrow is unchangedrecover_balanceneeds the admin's co-signature and never moves shares out of or into the vault's addressVaultAddress); unfreezing it stays possiblehealth()reportsvault_unfrozen, and the vault'sfinish_setuprefuses while its address is frozenvault_unfrozen; the docs describe the co-signatureDeviations
recover_balancealso refuses the vault as the new account: OpenZeppelin's recovery copies a freeze onto it.grant_roleduring setup; this base does not refuse that grant yet.Miswire::VaultFrozen, frozen through the token beforebind_vault, instead of a new test incontrols.rs.Acceptance criteria
legal_transferneeds the compliance authority and the admin as two different accounts in one callforced_transferis manager-only; the vault's escrow still worksrecover_balanceneeds the admin's co-signature and never moves the vault's balancefinish_setuprefuses while its address is frozenTest plan
Automated tests
CARGO_TARGET_DIR=<repo>/target SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2=1 nix develop -c cargo test --locked -p share-token legal_transfer: 13 tests pass.CARGO_TARGET_DIR=<repo>/target SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2=1 nix develop -c cargo test --locked: the workspace passes (share-token 64, async-vault 370), includingevery_wiring_step_is_checked_before_setup_finishesandeach_missing_wiring_step_shows_in_its_own_flagwith the frozen vault.npm run deploy, thentest:happy-path(24/24),test:guards(46/46) andtest:wind-down(6/6). The deploy prints"vault_unfrozen":true.Manual verification
On the same local network, a script signed as compliance: alone, the SDK asks for governance's signature; co-signed by governance, one share moved; from or to the vault, and freezing the vault, returned
VaultAddress; compliance'sforced_transferreturnedUnauthorized.Breaking changes
forced_transferrefuses the compliance role. On the next deployment the console's compliance transfer must calllegal_transferwith governance's co-signature, and recovery needs it too.health()gainsvault_unfrozen, and the token's spec gainslegal_transfer, theLegalTransferevent and errors 7012, 7013 and 7015, so clients must be regenerated.Checklist
Screenshots
None.