feat: add jurisdiction gating and per-holder dividend accrual ledger`#499
Open
ryzen-xp wants to merge 1 commit into
Open
feat: add jurisdiction gating and per-holder dividend accrual ledger`#499ryzen-xp wants to merge 1 commit into
ryzen-xp wants to merge 1 commit into
Conversation
|
@ryzen-xp 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! 🚀 |
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.
PR Description
Summary
This PR combines
#451and#449into a single compliance + payout correctness update forRevora-Contracts.It adds per-holder jurisdiction tagging with an issuer-managed allowlist that gates new share assignments and snapshot share imports, and it introduces a per-holder dividend accrual ledger so already-deposited revenue is claimed using the holder's historical share at accrual time rather than the holder's current share at claim time.
What Changed
Jurisdiction tagging and compliance gating (
#451)set_holder_sharemeta_set_holder_shareapply_snapshot_sharesRevoraError::JurisdictionDisallowed.jur_setfor jurisdiction / allowlist updatesjur_rejectfor blocked share writes or snapshot importsDividend accrual ledger (
#449)deposit_revenuenow updates the global accrual index and emitsacc_upd.claimand claim previews no longer reprice all pending history using the holder's current share.Important Implementation Note
Issue
#449suggested updating accrual onreport_revenue, but in this codebase actual claimable value is created bydeposit_revenue, notreport_revenue. The accrual index is therefore updated ondeposit_revenueso the ledger matches the real payout path.Why This Matters
Before this PR, a holder's share could be changed before claim and unintentionally reprice already-deposited revenue. After this PR, share changes are forward-looking only, which makes claim outcomes stable, auditable, and compliance-safe.
Testing
Ran:
cargo test --allResult:
Added coverage for:
Security Notes
Docs
docs/jurisdiction-tagging.mddocs/dividend-accrual-ledger.mdREADME.mdfor new events, behavior, and invariants