Vault Fundamentals Overview
What will you learn in 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.
- 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.
This is an introductory Path. You only need a basic understanding of Solidity, ERC-20 tokens, and simple Foundry tests. No prior knowledge of ERC-4626 or Vault security is required.
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.