Coder Social home page Coder Social logo

hoangcoding / nft-yield-farming Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masaun/nft-yield-farming

0.0 0.0 0.0 240 KB

This is a smart contract that enable a user to farm yield by staking LP tokens into a NFT pool. (on BSC testnet)

Shell 0.85% Solidity 45.87% JavaScript 53.28%

nft-yield-farming's Introduction

NFT Yield Farming on BSC


【Introduction of the NFT Yield Farming on BSC】

  • This is a smart contract that enable a user to farm yield by staking LP tokens (BEP20) into a NFT pool.
    • Once a user stake LP tokens into a NFT pool, reward token (Governance Token) are mined every block.
    • User who staked can receive the Governance Tokens as rewards (as farmed-yield) when that user un-stake.
  • This smart contract works on BSC (Binance Smart Chain).

 


【Workflow】

  • Diagram / Workflow
    【Diagram】NFT Yield Farming on BSC

 


【Setup】

① Install modules

  • Install npm modules in the root directory
$ npm install

② Add .env to the root directory.


③ Compile contracts (on BSC testnet)

$ npm run compile:bsc-testnet

④ Test

  • Execute test of the smart-contracts (on the BSC testnet)
    • [Note]: Sometime, timeout happen on this test. So I recommend that you try ⑤ Script below instead of this test.
$ npm run test:nft-yield-farming_bsc-testnet
($ truffle test ./test/test-bsc/NFTYieldFarmingOnBSC.test.js --network bsc_testnet)

⑤ Script

  • Execute script of the smart-contracts on the BSC testnet (with truffle exec command)
$ npm run script:nft-yield-farming_bsc-testnet
($ truffle exec ./scripts/script-bsc/NFTYieldFarmingOnBSC.script.js --network bsc_testnet)

(※ Note: In advance, please check whether your deployer' wallet address on BSC testnet has enough BNB balance or not)

 


【Remarks】


  • Governance Token
    • At the moment, Governance Token is used as a reward token.
    • Although it has not implemented yet, I will implement Governance Token for governance strucure (e.g. Governance Token holders can vote, etc...) in the future.

  • LP tokens
    • LP token is created by BEP20.
    • Assuming LP tokens is a pair between the Governance Token and BNB.
    • But, pool to create this pair (LP tokens) has not been implemented yet. (at the mement)

  • Version
    • Solidity (Solc): v0.6.12
    • Truffle: v5.1.60
    • web3.js: v1.2.9
    • openzeppelin-solidity: v3.2.0


【References】



nft-yield-farming'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.