Git Product home page Git Product logo

lp-token-staking's Introduction

Staking Dapp for the ETB token

A Dapp to stake Cake-LP tokens into a pool contract and earn ETB tokens in return.

This project was developed for the "ETB Project #2" Hackathon organised by EatTheBlocks

Features implemented:

  • The staking contract allows an admin to allocate a certain amount of reward tokens to a period of time called "reward phase".
  • Users staking their LP tokens into the pool during a reward phase, will earn a certain amount of reward tokens.
  • The amount of reward tokens earned is proportional to the amount of tokens staked and the length of the staking period.
  • The pool contract will distribute reward tokens at a constant rate (e.g reward tokens per second) amoung all active stakes.
  • Users can start and end multiple stakes at any time during a reward phase.
  • When a user ends a stake, he will immediatleu receive the reward tokens earned by that stake.

To run the tests

truffle develop   // starts a local blockchain on port 7545
truffle test      // runs the test

To run the dapp locally

  1. Start a local blockchain and deploy the contracts in truffle
truffle develop   // starts a local blockchain on port 7545
truffle migrate   // deploy the contracts
  1. Start the nextjs server npm run dev

  2. Connect Metamask to the local netwotk on http://127.0.0.1:7545/

  3. Access the dapp http://localhost:3000/

Note: Metamask has to be connected to the local truffle netowork on port 7545 :

 New RPC URL:  http://127.0.0.1:7545/
 Chain ID: 1337

User Page

  • The user page allows to stake and unstake Cake-LP tokens and earn a reward

Userr Page

Admin Page

  • The admin page allows to create a reward phase to distribute an allocated amount of reward tokens among stakers. Admin Page

lp-token-staking's People

Contributors

cpascoli avatar

Watchers

James Cloos avatar

Forkers

jerrywebman

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.