Skip to content

cal-a-mari/vaults-assignment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • 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%