Code Monkey home page Code Monkey logo

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nft-yield-farming's Issues

help wanted

i didn't quite get how you stake nfts into pools. i can see "nftToken" parameter never used except for adding pools. is there anything i'm missing?

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.