There should be a ‘deposit’, and ‘withdraw’ function that any user can use to deposit and withdraw any whitelisted ERC-20 token on the contract.
-
pause
prevents new deposits or withdrawals from occurring. -
unpause
enables new deposits or withdrawals from occurring. -
whitelistToken
admins call to whitelist tokens.
- The repository should also contain instructions in the readme for running tests.
-
pause()
Pause new deposits / withdraws. -
unpause()
Enables new deposits / withdraws. -
whitelistToken(address token, bool whitelist)
Add/remove token from whitelist.
-
deposit(address token, uint256 amount)
Deposits ERC20 token. -
withdraw(address token, uint256 amount)
Withdraws ERC20 token.
-
isWhitelistedToken(address token)
Returns if token is whitelisted or not. -
allWhitelistedTokens()
Returns all whitelisted tokens in array.
yarn install
yarn compile
yarn test
yarn coverage
------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
---|---|---|---|---|---|
contracts/ | 100 | 100 | 100 | 100 | |
Vault.sol | 100 | 100 | 100 | 100 | |
contracts/mocks/ | 100 | 100 | 100 | 100 | |
ERC20Mock.sol | 100 | 100 | 100 | 100 | |
------------------ | ---------- | ---------- | ---------- | ---------- | ---------------- |
All files | 100 | 100 | 100 | 100 | |
------------------ | ---------- | ---------- | ---------- | ---------- | ---------------- |