Implementation Lab

Investigating an Adapter-Backed Vault

Investigate a multi-contract adapter-backed vault, trace how assets and ownership move across both accounting layers, and identify an execution path that no longer preserves the vault’s intended guarantees. Build a reproducible proof, explain the impact, and repair the implementation without breaking the healthy flows.

What you will practice

  • Understand how users, the outer vault, and the adapter share ownership and manage assets.

  • Trace one vault operation from the user-facing function to the final asset transfer.

  • Build a reproducible Foundry scenario that demonstrates the unexpected vault behavior.

  • Repair the implementation without breaking the vault’s healthy operations.

Preparation and completion

Review the associated Learn before starting.

Completion outcome

You will complete this Lab after producing a reproducible demonstration of the broken accounting behavior, explaining which vault guarantee is violated, and repairing the implementation.

Your final submission must preserve the healthy behavior of deposits, exact-share minting, redemptions, delegated withdrawals, idle-liquidity usage, adapter interaction, and preview functions.

A successful patch must restore the user-facing ownership guarantee rather than hiding the issue by disabling withdrawals, forcing unrelated reverts, or changing the adapter’s accounting.