Giter Club home page Giter Club logo

vaults-assignment's Introduction

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.

vaults-assignment's People

Contributors

shubham-kanodia avatar codingnirvana avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.