Repository navigation
Conversation
… contributor subsidization - Add unspent field to Contribution to track unspent balances per sponsor - In release_issue, deduct released amounts pro-rata across active unspent contributions - In refund_remaining_budget, calculate proportional refunds using unspent balances instead of total_budget - Fix late contributors subsidizing earlier spent releases on milestone cancellation - Add unit tests for late contributor refund accounting and subsequent releases Closes MergeFi#531
|
@dwaddle is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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
Tracks unspent contribution remainders per sponsor in
mergefi-milestonesso that late contributors do not subsidize milestone releases that occurred before they joined.Related issues
Closes #531
Changes
unspent: i128toContributionincontracts/milestones/src/types.rs, initialized on milestone creation and append.release_issue, deduct released amounts pro-rata across currently active unspent contributions (deduct_release_from_contributions), with largest-remainder dust distribution.refund_remaining_budget, calculate proportional refunds using actual unspent balances instead oftotal_budget, returning each sponsor's true unconsumed funds without subsidizing prior releases.contract::*to ensureMilestonesContractandMilestonesContractClientare accessible in the crate root.test_late_contributor_does_not_subsidize_earlier_releasesandtest_late_contributor_with_subsequent_release_shares_costs_pro_rata).Test plan
cargo test -p mergefi-milestones)test_late_contributor_does_not_subsidize_earlier_releases)Checklist
maincargo fmtandcargo clippyare clean