Summary
In this chapter, you learned about the concept of vaults. The vault is where people deposit and withdraw assets. There are categories of vaults, such as lending vaults, liquidity vaults, and staking vaults. Then, you studied the ERC-4626 standard, which is the vault smart contract standard. You learned about all of the standard functions, including functions to deposit and withdraw assets. You also wrote the vault smart contract. Then, you learned about lending by writing the lending smart contract. You understood how the lending smart contract implements lending. Lastly, you saw how to combine the lending smart contract and vault smart contract into a lending vault smart contract. This chapter gave you skills in building two of the most important and popular protocols in the blockchain, which are the vault protocol and the lending protocol. In the next chapter, you’ll learn how to write an automated market maker decentralized exchange smart contract.