Skip to content

feat: implement token holder lock/unlock with transfer gate#491

Merged
truthixify merged 6 commits intoDistinctCodes:mainfrom
7maylord:feat/tokenLock
Feb 21, 2026
Merged

feat: implement token holder lock/unlock with transfer gate#491
truthixify merged 6 commits intoDistinctCodes:mainfrom
7maylord:feat/tokenLock

Conversation

@7maylord
Copy link
Contributor

@7maylord 7maylord commented Feb 21, 2026

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

@vercel
Copy link

vercel bot commented Feb 21, 2026

@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.

@truthixify truthixify merged commit ee223c4 into DistinctCodes:main Feb 21, 2026
4 of 5 checks passed
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.

[Contract] Implement Token Lock/Unlock and Ownership Percentage

2 participants