Skip to content

[codex] prove same-block reserve mint removes pending dilution - #150

Draft
mejango wants to merge 3 commits into
mainfrom
codex/security-proof-reserve-snapshot
Draft

mejango wants to merge 3 commits into
mainfrom
codex/security-proof-reserve-snapshot

Conversation

@mejango

@mejango mejango commented Jun 23, 2026 •

Copy link
Copy Markdown

What changed

Adds regression tests and an implementation fix for same-timestamp reserve minting before scorecard submission.

DefifaHook now records lastReserveMintTimestamp when reserves are minted. DefifaGovernor.submitScorecardFor rejects scorecard submission in the same timestamp as the most recent reserve mint, then allows submission in the next timestamp with the reserve holder included normally.

What this fixes

A same-block reserve mint before scorecard submission could remove pending-reserve dilution from the denominator while the historical checkpoint still excluded the newly minted reserve. That could inflate the paid holder's BWA.

The new ordering guard closes the same-timestamp path without broadly disabling reserve minting during scoring.

Validation

forge test --root defifa --match-path test/regression/FixPendingReserveDilution.t.sol

Result: 4 passed.

forge build --deny notes --skip "*/test/**" --skip "*/script/**"

Result: passed.

forge test --deny notes --fail-fast --summary --detailed --skip "*/script/**"

Result: passed. Full local suite completed with no failures.

@mejango
mejango marked this pull request as ready for review June 23, 2026 13:28
@mejango
mejango marked this pull request as draft June 23, 2026 14:10
@mejango

mejango commented Jun 23, 2026

Copy link
Copy Markdown
Author

This has not been deemed severe to the point where a redeploy is recommended.

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.

1 participant