Skip to content

Comments

Async withdrawal + mint(uint256) cleanup#2813

Merged
clement-ux merged 9 commits intomasterfrom
clement/async-withdrawal-and-mint-cleanup
Feb 24, 2026
Merged

Async withdrawal + mint(uint256) cleanup#2813
clement-ux merged 9 commits intomasterfrom
clement/async-withdrawal-and-mint-cleanup

Conversation

@clement-ux
Copy link
Collaborator

@clement-ux clement-ux commented Feb 24, 2026

Why

The synchronous redeem(uint256,uint256) on VaultCore has been removed in favor of the async withdrawal queue (requestWithdrawal + claimWithdrawal). This gives the vault time to source liquidity from strategies before honoring withdrawals, avoiding the need to hold large idle WETH buffers and protecting against bank-run scenarios. Similarly, the legacy mint(address,uint256,uint256) has been superseded by mint(uint256) since all vaults are now single-asset.

This PR migrates all bridge helper modules and downstream callers (zappers, mocks, tests) to the new signatures, and removes Plume bridging from the Ethereum module since Plume is no longer serviced from mainnet.

Changes

Contracts

  • IVault: Remove mint(address,uint256,uint256), redeem(uint256,uint256), calculateRedeemOutputs, calculateRedeemOutput, dripper(), weth(). Add mint(uint256).
  • EthereumBridgeHelperModule: Replace unwrapAndRedeem with two-step unwrapAndRequestWithdrawal + claimWithdrawal. Remove all Plume/LayerZero code (bridgeWOETHToPlume, bridgeWETHToPlume, mintWrapAndBridgeToPlume, unwrapRedeemAndBridgeToPlume). Drop AbstractLZBridgeHelperModule inheritance.
  • BaseBridgeHelperModule: Replace single-tx depositWOETHAndBridgeWETH with depositWOETHAndRequestWithdrawal + claimAndBridgeWETH / claimWithdrawal. Add missing require(success) on wOETH approve.
  • PlumeBridgeHelperModule: Hardcode legacy mint(address,uint256,uint256) and redeem(uint256,uint256) selectors since the deployed Plume vault won't be upgraded.
  • Zappers / Mocks: Update vault.mint() calls to new single-param signature. Point MockRebornMinter.redeem() at requestWithdrawal for reentrancy testing. Clean up unused _asset param in MockNonRebasing.mintOusd.

Deployment

  • Add deploy/mainnet/178_bridge_helper_module.js (EthereumBridgeHelperModule)
  • Add deploy/base/044_bridge_helper_module.js (BaseBridgeHelperModule)

Tests

  • Update vault.mint() calls to new signature across ~30 test files
  • Rewrite Base bridge helper fork tests for async withdrawal flow (deposit + request + time travel + claim)
  • Fix Plume fork tests to use legacy ABI via hardcoded selectors
  • Remove stale mainnet bridge helper tests for deleted Plume functions

Operator workflow (post-change)

Ethereum → Base (unwrap wOETH and bridge WETH):

TX 1: unwrapAndRequestWithdrawal(woethAmount)  → returns requestId
      [wait for withdrawalClaimDelay]
TX 2: claimAndBridgeToBase(requestId)
      — or —
      claimWithdrawal(requestId)

Base → Ethereum (deposit wOETH and bridge WETH):

TX 1: depositWOETHAndRequestWithdrawal(woethAmount)  → returns requestId
      [wait for withdrawalClaimDelay]
TX 2: claimAndBridgeWETH(requestId)
      — or —
      claimWithdrawal(requestId)

…n IVault

Update the IVault interface to use the new single-param mint signature
and fix all contract callers: MockNonRebasing, MockRebornMinter,
AbstractOTokenZapper, OSonicZapper, and PlumeBridgeHelperModule.
…lume

Remove all Plume/LayerZero bridging code and replace synchronous vault
redeem with async withdrawal pattern (requestWithdrawal + claimWithdrawal).
Add unwrapAndRequestWithdrawal, claimAndBridgeToBase, and claimWithdrawal.
Replace synchronous vault redeem with async withdrawal pattern. Remove
depositWOETHAndBridgeWETH (no longer single-TX). Add
depositWOETHAndRequestWithdrawal, claimWithdrawal, and claimAndBridgeWETH.
Replace all vault.mint(asset, amount, minAmount) calls with
vault.mint(amount) across test files. Update bridge helper tests to
match new async withdrawal API. Remove unused variable declarations.
@clement-ux clement-ux changed the title Clement/async withdrawal and mint cleanup Async withdrawal + mint(uint256) cleanup Feb 24, 2026
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 0% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.06%. Comparing base (d459e14) to head (23d2004).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...ts/contracts/automation/BaseBridgeHelperModule.sol 0.00% 21 Missing ⚠️
...ontracts/automation/EthereumBridgeHelperModule.sol 0.00% 18 Missing ⚠️
...ontracts/contracts/zapper/AbstractOTokenZapper.sol 0.00% 1 Missing ⚠️
contracts/contracts/zapper/OSonicZapper.sol 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2813      +/-   ##
==========================================
+ Coverage   43.61%   45.06%   +1.45%     
==========================================
  Files         104      105       +1     
  Lines        4464     4500      +36     
  Branches     1218     1228      +10     
==========================================
+ Hits         1947     2028      +81     
+ Misses       2514     2469      -45     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…elperModule

Deploy scripts for the updated bridge helper modules on mainnet and Base.
Both enable the module on the Safe when running on a fork.
The deployed Plume vault won't be upgraded, so hardcode the old
mint(address,uint256,uint256) selector in PlumeBridgeHelperModule and
use a legacy ABI contract in fork tests for mint and redeem calls.
- Add missing require(success) on wOETH approve in BaseBridgeHelperModule._depositWOETH
- Un-skip Base bridge helper tests and rewrite for async withdrawal flow
- Remove unused _asset param from MockNonRebasing.mintOusd
- Point MockRebornMinter.redeem() at requestWithdrawal instead of reverting
@clement-ux clement-ux merged commit 6f80e57 into master Feb 24, 2026
13 of 17 checks passed
@clement-ux clement-ux deleted the clement/async-withdrawal-and-mint-cleanup branch February 24, 2026 22:15
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.

2 participants