feat: implement token holder lock/unlock with transfer gate#491
Merged
truthixify merged 6 commits intoDistinctCodes:mainfrom Feb 21, 2026
Merged
feat: implement token holder lock/unlock with transfer gate#491truthixify merged 6 commits intoDistinctCodes:mainfrom
truthixify merged 6 commits intoDistinctCodes:mainfrom
Conversation
|
@7maylord is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
Token holders needed to be temporarily non-transferable during events like voting windows or vesting periods. The transfer gate and storage key (TokenLockedUntil) were already in place, but lock_tokens had no authorization enforcement and is_tokens_locked did not exist at all, leaving the feature incomplete and insecure.
is_tokens_locked — a missing read-only check to query whether a holder's tokens are currently locked
Add caller: Address parameter to lock_tokens and enforce that only the asset's tokenizer can lock a holder's tokens (previously unauthenticated — any caller could lock anyone's tokens)
Fixed existing test_lock_tokens call to pass the new caller argument
Added setup_tokenized helper to avoid repeating the tokenize boilerplate across the new tests
Fixed Compatibility Bugs by refactoring the entire AssetsUp Soroban smart contract codebase to be compatible with Soroban SDK v22. On the source side, this involved migrating all numeric types from BigInt to native i128 across types.rs, tokenization.rs, dividends.rs, voting.rs, detokenization.rs, and lib.rs; removing the custom ContractEvent struct and replacing all event emissions with inline tuples passed directly to env.events().publish(); restructuring DetokenizationProposal from a flat enum to wrapper structs (ActiveProposal, ExecutedProposal, RejectedProposal) each annotated with #[contracttype]; and fixing all persistent storage reads from the old double-ok_or pattern (store.get().ok_or(E)?.ok_or(E)?) and Some(Some(v)) match arms to the SDK v22 single-Option
closes #469