The purpose of this Path
A Vault is a smart contract that receives an asset from users and issues shares representing their claim on the Vault’s assets.
In this introductory Path, you will learn why Vaults use shares, how deposits and withdrawals change the accounting state, and how to identify the most important functions before working with more complex Vault implementations.
Learning objectives
Explain what a Vault is and why users deposit assets into it.
Distinguish between the Vault’s underlying asset and its shares.
Describe what happens during a deposit.
Describe what happens during a withdrawal.
Identify totalAssets, totalSupply, and balanceOf in a simple Vault.
Write basic Foundry tests for deposit and withdrawal behavior.
Your learning journey
You will first build a simple mental model of how a Vault receives assets and issues shares. You will then read the core Solidity functions and finish by writing Foundry tests for a basic deposit and withdrawal flow.