Simple Defi Vault

This is the Cairo adaptation of the Solidity by Example - Vault. Here’s how it works:
  • When a user deposits a token, the contract calculates the amount of shares to mint.
  • When a user withdraws, the contract burns their shares, calculates the yield, and withdraws both the yield and the initial amount of tokens deposited.
// [!include ~/listings/applications/simple_vault/src/simple_vault.cairo]