Project #2: Basic Vault
Last updated
Last updated
This is a single-token Vault that holds a pre-specified ERC-20 token.
Users can send tokens to the Vault contract.
Vault contract records the user's token deposits.
Users can withdraw their tokens only to the address they deposited from.
ERC20Mock.sol
BasicVault.sol
Deposit: After approval (handled by front-end), token is deposited via transferFrom.
Withdraw: Token is returned, and the Vault updates its user records.
Vault contract should import the IERC20 interface, take the Token address in the Vault constructor, and cast it into an IERC20 state variable
Public, unrestricted mint() function: anyone should be able to mint
Import
Come up with your own fun token name
Add full NatSpec: the contract as well as every event and function should have complete NatSpec.
contracts should have @title, @notice, @dev, @author.
functions should have @notice, @dev, @param, @return.
Implement CI so when you push to gh, your tests are run automatically:
Vault contract should be fully tested.
No need to test ERC20Mock. Assume it works as intended.
All state variable changes in the contracts that you code.
All state variable changes in other contracts caused by calls from contracts that you code.
All require or revert in the contracts that you code.
All events being emitted.
All return values in contracts that you code.
events should have @notice (no need param or return).