Skip to content

robertistok/vaults-assignment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note - The expectation is for you to write the tests to validate the contracts follow the specs. Once you understand whats asked of the contracts, you will realize thats its not that hard to get a basic working version. Tests will take a little more work though. You can take a look at the pet park assignment tests for some inspiration and use this for reference

Vault 1 Assignment

Goal

Develop a vault where users can deposit and withdraw any ERC20 token. Complete this contract in contracts/Vault1.sol.

Specifications

  • function deposit(_amount) - Should take in deposit amount. Assume that the contract is pre-approved to transfer that amount
  • function withdraw(_amount) - Should allow users to withdraw amount lesser than or equal to what they have deposited

Vault 2 Assignment

Goal

Develop a vault where users can wrap their ether. Users should be able to send ether and receive an equal amount of VAULT tokens. On burning those tokens, users should get ether back. Complete this contract in contracts/Vault2.sol

Specifications

  • function mint(_amount) - A payable function which should take ether and mint equal amount of VAULT tokens.
  • function burn(_amount) - Should allow users to burn their tokens and get equal amount of ether back.

Steps

  • Create a fork of this repo

  • Create a new branch with your name. You can use the following command

    git checkout -b my-name
    
  • Install all dependencies

    npm install
    
  • Run Tests

    npx hardhat test
    
  • Submit a PR from forked repo to main branch of this repo

Notes

  • Prefer using OpenZeppelin contracts instead of implementing your own.
  • Use events where necessary.
  • Write tests for your contracts. Add them in test directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.0%
  • Solidity 13.0%