VaultSol Simple example of vault contract, commonly used in DeFi.
This contract demonstrates practical math for calculating shares to mint on deposit and the amount of token to withdraw.
How the contract works
Some amount of shares are minted when an user deposits. The DeFi protocol would use the users' deposits to generate yield (somehow). User burn shares to withdraw his tokens + yield.