Skip to content

fix: snapshot fee_bps at deposit time to prevent retroactive fee changes - #64

Open
Ugooweb wants to merge 2 commits into
MergeFi:mainfrom
Ugooweb:fix-fee-retroactivity
Open

fix: snapshot fee_bps at deposit time to prevent retroactive fee changes#64
Ugooweb wants to merge 2 commits into
MergeFi:mainfrom
Ugooweb:fix-fee-retroactivity

Conversation

@Ugooweb

@Ugooweb Ugooweb commented Aug 16, 2026

Copy link
Copy Markdown

Closes #53

Fixes a potential bait-and-switch bug where fee_bps was fetched at payout time instead of deposit time. With the introduction of mutable fees (issue #20), this would have caused sponsors to retroactively pay a different fee rate than they agreed to.

  • Escrow & Milestones: Added fee_bps snapshotting during fund/create_milestone. The payout calculations now rely on this captured value. Added tests simulating an interim fee hike to verify the original rate is honored.
  • Maintenance Pool: Explicitly documented why we retain "fresh-at-withdrawal" for pools (complexity of blending recurring deposits).

This PR is coordinated to land prior to or alongside #20 to prevent a window of exploitability in production.

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

@Ugooweb is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chonilius

Copy link
Copy Markdown
Contributor

ci test failed

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.

All three contracts: fee_bps is read fresh at payout time, not snapshotted at deposit — #20's mutable-fee design would enable retroactive fee changes

2 participants