Understanding vaults
There are many cases where people treat smart contracts as vaults. What I mean is people store money in smart contracts. You’ve seen it in Chapter 3, Using Vyper to Implement a Smart Contract, where the owner of the smart contract solicits donations in the smart contract. However, a vault is not just any smart contract that can accept money. There must be a way for a user to withdraw their money from the vault. The money can be ETH or any other ERC-20 cryptocurrencies.
Note
A vault is not just a passive place where money is kept. A vault can be a way to pool resources. The resources can later be put into productive ventures to get a yield or profit.
To make things clearer, consider this case. User A deposits 1000 USDT into a vault smart contract. User B deposits 2000 USDT into the vault. User C deposits 500 USDT into the vault. Now, the vault has accumulated assets of as much as 3500 USDT. These assets can be put into many investments that give...