Skip to content

Add synchronous Midas withdrawal helper - #229

Closed
LukeHackett12 wants to merge 3 commits into
mainfrom
codex/sync-midas-withdrawal
Closed

LukeHackett12 wants to merge 3 commits into
mainfrom
codex/sync-midas-withdrawal

Conversation

@LukeHackett12

@LukeHackett12 LukeHackett12 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds a stateless SyncMidasWithdrawal helper in the same style as SyncWithdrawal. The caller supplies withdrawAmount, repayAmount, useTarget, and strategy; the helper calls withdrawManager → commit → unlock.

The redeem order must already exist, its bond leg must be complete, and instant redemption must be unlocked. Facility, position manager, and fund contracts enforce their existing validation and lifecycle checks.

Only the helper and MorphoFlashLoanRequest.t.sol change, based on clean main (6998ffd). The integration test covers both withdrawal strategies, exact repayment, settlement, and flash-loan repayment using the existing MockFund.

Validation:

  • CI-profile request suite: 65 passed, including 256 fuzz runs covering both withdrawal strategies.
  • FOUNDRY_PROFILE=ci forge build --sizes and git diff --check pass.
  • Root review, GPT-5.6-sol correctness review, and GPT-5.6-sol Ponytail pass: no remaining findings.

@LukeHackett12 LukeHackett12 changed the title Add synchronous Midas withdrawal settlement script Add synchronous Midas withdrawal helper Sep 29, 2026
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