Skip to content

fix(contract): enforce independent milestone time windows - #8

Merged
misaka10111 merged 3 commits into
mainfrom
fix/milestone-time-windows
Nov 4, 2026
Merged

misaka10111 merged 3 commits into
mainfrom
fix/milestone-time-windows

Conversation

@misaka10111

Copy link
Copy Markdown
Owner

What

Give each milestone its own submission and approval windows and enforce the same deadlines on writes and refunds.

Case Before After
Second milestone Submission time still ran from funding success The second submission window opens when the first payout succeeds
Submission or approval reaches its deadline A late write could still beat the first refund The deadline second closes the write window and opens expiry refunds
Approved milestone The creator can withdraw after approval An on-time approval still permits withdrawal after the deadline

Contract

  • The first submission window starts when funding succeeds. Each approval window starts when its evidence is submitted.
  • Evidence, votes, and the refund quote use the same deadline calculation. The fixed refund pool from fix(contract): make expired refunds independent of claim order #7 continues to determine amounts.
  • getMilestoneWindow exposes the active deadline and open flag without changing either existing project or milestone tuple.

UI

Read the deadline and open flag at the same block as the project and refund quote. The local clock is used for the countdown on current deployments.

Tests

100 local tests passed. Both compiler profiles cover deadline - 1, the exact cutoff, a late payout that starts a fresh second window, and refunds from the remaining escrow. The wallet tests cover ABI decoding and older deployments without the window getter. Format check and production build passed.

Deployment

Deploy this contract version on Sepolia and configure the new address to enforce these rules.

@misaka10111
misaka10111 merged commit 36a8fe3 into main Nov 4, 2026
1 check passed
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