Coder Social home page Coder Social logo

exactly-finance-challenge's Introduction

Exactly Finance's ETHPool challenge

This is my submission for Exactly Finance's ETHPool challenge. The contract was deployed at 0xB06296feC71f80B62D0C85AD823DA9f6413913F9 on the Goerli network (Etherscan)

Considerations

  • This is an ETH to ETH pool, meaning you stake ETH and receive ETH rewards, and not any kind of ERC20 token (for simplicity's sake)
  • Like the system described in Scalable Reward Distribution on the Ethereum Blockchain, this system DOES NOT compound the reward. The user must manually do so
  • Unlike the paper mentioned above, this system DOES ALLOW users to change the stake size once it's deposited
  • The entire pending rewards amount is sent to the user when depositing or withdrawing any amount. This is a design choice, the alternative is to have a separate function for withdrawing rewards (and keeping track of the reward tally)

Commands

Test:

npx hardhat test

Coverage:

npx hardhat coverage

Check contract balance:

npx hardhat balance --network goerli

Be sure to create an .env file with your keys in it in order to run the following scripts.

Feel free to edit the ETH values inside them to test the contract.

Deposit:

npx hardhat run scripts/deposit.ts --network goerli

Withdraw:

npx hardhat run scripts/withdraw.ts --network goerli

Distribute:

npx hardhat run scripts/distribute.ts --network goerli

References

exactly-finance-challenge's People

Contributors

gabrielgruber avatar gaspardip avatar lucaslain avatar

Stargazers

 avatar

Watchers

 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.