Repository navigation
Fix holder pruning, jurisdiction attestation and revenue-sharing authorization - #1861
Merged
yusuftomilola merged 18 commits intoNov 24, 2026
Conversation
Closes DistinctCodes#1792 After a full transfer the sender no longer appears in TokenHoldersList and token_holders_count is decremented. The TokenHolder ownership record is kept so unclaimed dividends remain claimable.
Closes DistinctCodes#1791 set_address_jurisdiction now authenticates a caller who must be the admin or an admin-managed KYC/compliance attester. Holders can no longer self-attest. Adds admin-gated entrypoints to manage the attester set.
…ted update Closes DistinctCodes#1790 set_transfer_restriction now reads the stored restriction and changes only require_accredited, so a previously configured geographic allow-list survives.
…ither write order
Closes DistinctCodes#1786 enable_revenue_sharing and disable_revenue_sharing now authenticate a caller and allow only the token's tokenizer or the contract admin.
|
@ykargeee-bit is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@ykargeee-bit Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
2 tasks
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
This change closes four issues in the
assetsupcontract, all in the token-compliance and revenue-sharing area.#1792 — zero-balance holders are never pruned from
TokenHoldersListtokenization::transfer_tokensnow removes the sender fromTokenHoldersListwhen their balance reaches zero after a transfer, and keepstoken_holders_countin sync (both pruning and adding a holder). TheTokenHolderownership record is deliberately retained so dividends already accrued remain claimable by an address that no longer holds tokens. A self-transfer is excluded so the credited balance stays represented. Tests cover the resulting holder list, the count, and claiming accrued dividends after pruning.#1791 — holders self-declare their jurisdiction
set_address_jurisdictionno longer authenticates the subject address. It takes acallerwho must authenticate and be either the contract admin or a member of a new admin-managed KYC/compliance attester set, so a holder cannot self-attest a jurisdiction to satisfy a geographic allow-list. The attester set is stored under a newTokenDataKeyvariant (appended last to preserve existing key discriminants) and is managed through the admin-gatedadd_jurisdiction_attester/remove_jurisdiction_attesterentrypoints, with read-onlyis_jurisdiction_attester/get_jurisdiction_attesters. Tests prove a signing holder is rejected withUnauthorized, that missing authorization fails, and that attesters/admins can record jurisdictions.#1790 —
set_transfer_restrictionwipes the geographic allow-listtransfer_restrictions::set_transfer_restrictionnow reads the stored restriction and updates onlyrequire_accredited, leavinggeographic_allowedintact — mirroringset_geographic_restriction. The public wrapper also takes acallerthat must authenticate as the token's tokenizer or the admin. Tests assert both fields survive when written in either order, plus the new authorization checks.#1786 —
enable/disable_revenue_sharinghave no authorizationBoth entrypoints now take a
callerthat authenticates and must be the token's tokenizer or the contract admin; any other signer getsUnauthorized. A small shared helper inlib.rscentralizes this check for the privileged token-level setters, keeping the module functions unchanged for direct unit tests. All existing call sites were updated, and tests cover success with mocks, missing auth, and rejection of a third party.Documentation:
contracts/AUTHORIZATION.mdnow records the new required signers and the attester role.Tests were not run locally per the task instructions.
Closes #1792
Closes #1791
Closes #1790
Closes #1786