feat(creator-keys): add dividend reinvestment function (#805) - #811
Merged
Chucks1093 merged 9 commits intoSep 5, 2026
Conversation
|
@Oluwasuyi-Oluwatimilehin-Daniel 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! 🚀 |
Oluwasuyi-Oluwatimilehin-Daniel
force-pushed
the
issue-805-dividend-reinvestment
branch
from
August 30, 2026 04:22
1fb2001 to
94928af
Compare
Member
✅ CI Passed —
|
…ests for flash loan protection
Member
|
Fix MC |
Member
|
Merge Conflict |
5 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
reinvest_dividendentry point onCreatorKeysContractallowing key holders to atomically convert their unclaimed dividend balance into additional creator keys via the bonding curve in a single transaction.remaining >= key_priceand supply/wallet caps permit.ContractError::NoDividendToClaimwhen called with zero unclaimed dividend balance.last_buy_timestampfor anti-flash-trade sell lockups.DividendReinvestedEvent(div_reinv) containingwallet,key_id,keys_bought,remainder_returned, andledger.creator-keys/tests/dividend_reinvestment.rscovering happy path compounding, remainder returns, zero dividend errors, security guards, and event verification.Closes #805
Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspaceChecklist
creator-keysunit/integration tests for every changed contract behavior, including failure paths for new or reachableContractErrorvariantscargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspace, or explained exactly why a command was not rundocs/storage-key-invariants.md; any storage layout change includes a migration/backward-compatibility notedocs/contract-event-conventions.md, or documented the breaking change and versioning plan