Coder Social home page Coder Social logo

hoangcoding / glm-stake-pool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masaun/glm-stake-pool

0.0 0.0 0.0 320 KB

Yield farming opportunity for Golem's GLM token holders. (By staking uniswap-LP tokens that is a pair between GLM and ETH into the stake pool)

License: GNU General Public License v3.0

Shell 0.23% Solidity 67.13% JavaScript 17.75% TypeScript 14.89%

glm-stake-pool's Introduction

GLM Stake Pool


【Introduction of GLM Stake Pool】

  • This is a smart contract in order to provide the opportunity of yield farming for Golem's GLM token holders. (By staking uniswap-LP tokens that is a pair between GLM and ETH into the stake pool)

 


【Workflow】

  • ① Create UniswapV2-Pool between GLM token and ETH. (Add Liquidity)
  • ② Create UNI-V2 LP tokens (GLM-ETH).
  • ③ Stake UNI-V2 LP tokens (GLM-ETH) into the GLM stake pool contract.
  • ④ Smart contract (the GLM stake pool contract) automatically generate rewards every week.
    • The Golem Governance Token (GGC) is generated as rewards.
    • Current formula of generating rewards is that:
      • 10% of staked UNI-V2 LP tokens (GLM-ETH) amount in a week is generated each week.
      • Staker can receive rewards ( Golem Governance Token ) depends on their share of pool when they claim rewards.
  • ⑤ Claim rewards and distributes rewards into claimed-staker. (or, Un-Stake UNI-V2 LP tokens. At that time, claiming rewards will be executed at the same time)

 

  • Diagram of workflow. 【Diagram】GLM Stake Pool

 


【Technical Stack】

  • Solidity (Solc): v0.5.16
  • Truffle: v5.1.60
  • web3.js: v1.2.9
  • Node.js: v11.15.0
  • Libraries
    • @openzeppelin/contracts: v2.5.1 etc,...  

【Setup】

① Install modules

$ npm install

② Add .env to the root directory.

  • Please reference .env.example to create .env

③ Compile & migrate contracts (on Rinkeby testnet)

$ npm run migrate:local

④ Test (Mainnet-fork approach with Ganache-CLI)

$ ganache-cli --fork https://mainnet.infura.io/v3/{YOUR INFURA KEY}

(Ref:https://medium.com/@samajammin/how-to-interact-with-ethereums-mainnet-in-a-development-environment-with-ganache-3d8649df0876
(Current block number @ mainnet: https://etherscan.io/blocks )

Then,

  • All of tests
$ npm run test
  • Only test of the Stake Pool contract
$ npm run test:stake

 


【Remaining tasks and next steps】

  • Replace GLMMockToken contract (GLMMockToken.sol) with official GLM token contract (NewGolemNetworkToken.sol).
  • Additional implementation of GLM stake pool between GLM-ERC20. (Currently, this is in progress)
  • Additional implementation of the Golem Governance Token (GGC) and governance structures (e.g. Community voting function by GLM token holders)
  • Add liquidity pool of the Golem Governance Token (GGC).
  • Implement the front-end (UI).

 


【References】


glm-stake-pool's People

Contributors

masaun 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.