{"id":13565754,"url":"https://github.com/masaun/NFT-yield-farming","last_synced_at":"2025-04-03T23:30:32.893Z","repository":{"id":54230714,"uuid":"338471608","full_name":"masaun/NFT-yield-farming","owner":"masaun","description":"This is a smart contract that enable a user to farm yield by staking LP tokens into a NFT pool. (on BSC testnet)","archived":false,"fork":false,"pushed_at":"2021-03-02T06:48:06.000Z","size":240,"stargazers_count":98,"open_issues_count":1,"forks_count":82,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-28T19:21:13.890Z","etag":null,"topics":["bep20","binance-smart-chain","bsc","layer2","nft","solidity","truffle","web3js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masaun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-13T01:14:09.000Z","updated_at":"2024-11-30T13:15:19.000Z","dependencies_parsed_at":"2022-08-13T09:40:50.511Z","dependency_job_id":null,"html_url":"https://github.com/masaun/NFT-yield-farming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2FNFT-yield-farming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2FNFT-yield-farming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2FNFT-yield-farming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2FNFT-yield-farming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masaun","download_url":"https://codeload.github.com/masaun/NFT-yield-farming/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097581,"owners_count":20883121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bep20","binance-smart-chain","bsc","layer2","nft","solidity","truffle","web3js"],"created_at":"2024-08-01T13:01:54.745Z","updated_at":"2025-04-03T23:30:32.603Z","avatar_url":"https://github.com/masaun.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# NFT Yield Farming on BSC\n\n***\n## 【Introduction of the NFT Yield Farming on BSC】\n- This is a smart contract that enable a user to farm yield by staking LP tokens (BEP20) into a NFT pool.\n  - Once a user stake LP tokens into a NFT pool, reward token (Governance Token) are mined every block.\n  - User who staked can receive the Governance Tokens as rewards (as farmed-yield) when that user un-stake.\n- This smart contract works on BSC (Binance Smart Chain).\n\n\u0026nbsp;\n\n***\n\n## 【Workflow】\n- Diagram / Workflow  \n![【Diagram】NFT Yield Farming on BSC](https://user-images.githubusercontent.com/19357502/108629603-1888a900-74a4-11eb-9337-581f757d7b4c.jpg)\n\n\u0026nbsp;\n\n***\n\n## 【Setup】\n### ① Install modules\n- Install npm modules in the root directory\n```\n$ npm install\n```\n\n\u003cbr\u003e\n\n### ② Add `.env` to the root directory.\n- Please copy code of `.env.example` into your `.env` \n  (Then, please input your information of wallets, private keys, etc... by following code of `.env.example` )\nhttps://github.com/masaun/NFT-yield-farming/blob/main/.env.example  \n\n\u003cbr\u003e\n\n### ③ Compile contracts (on BSC testnet)\n```\n$ npm run compile:bsc-testnet\n```\n\n\u003cbr\u003e\n\n### ④ Test\n- Execute test of the smart-contracts (on the BSC testnet)\n  - [Note]: Sometime, timeout happen on this test. So I recommend that you try `⑤ Script` below instead of this test.   \n```\n$ npm run test:nft-yield-farming_bsc-testnet\n($ truffle test ./test/test-bsc/NFTYieldFarmingOnBSC.test.js --network bsc_testnet)\n```\n\n\u003cbr\u003e\n\n### ⑤ Script\n- Execute script of the smart-contracts on the BSC testnet (with `truffle exec` command)\n```\n$ npm run script:nft-yield-farming_bsc-testnet\n($ truffle exec ./scripts/script-bsc/NFTYieldFarmingOnBSC.script.js --network bsc_testnet)\n```\n(※ Note: In advance, please check whether your deployer' wallet address on BSC testnet has enough BNB balance or not)\n\n\n\u0026nbsp;\n\n***\n\n## 【Remarks】\n- When 503 Error happen, please select a new `BSC RPC Endpoints` to change by referencing the list below\nhttps://docs.binance.org/smart-chain/developer/rpc.html\n![Screen Shot 2021-02-21 at 08 44 38](https://user-images.githubusercontent.com/19357502/108611369-64463e80-7421-11eb-9e56-166a3321ca22.png)\n↓\n- Then, please replace `BSC RPC Endpoints` for 2 files below.\n  - truffle-config.js\n    https://github.com/masaun/NFT-yield-farming/blob/main/truffle-config.js#L9\n  - NFTYieldFarmingOnBSC.script.js\n    https://github.com/masaun/NFT-yield-farming/blob/main/scripts/script-bsc/NFTYieldFarmingOnBSC.script.js#L5\n\n\u003cbr\u003e\n\n- Governance Token\n  - At the moment, Governance Token is used as a reward token.\n  - 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.\n\n\u003cbr\u003e\n\n- LP tokens\n  - LP token is created by BEP20.\n  - Assuming LP tokens is a pair between the Governance Token and BNB. \n  - But, pool to create this pair (LP tokens) has not been implemented yet. (at the mement)\n\n\u003cbr\u003e\n\n- Version\n  - Solidity (Solc): v0.6.12\n  - Truffle: v5.1.60\n  - web3.js: v1.2.9\n  - openzeppelin-solidity: v3.2.0\n\n\n\u003cbr\u003e  \n\n***\n\n## 【References】\n- BSC\n  - Getting Started with BSC:\n    https://binancex.dev/blog.html?p=making-the-move-from-ethereum-to-bsc\n  - BSC blockchain explorer\nhttps://explorer.binance.org/smart-testnet\n  - BSC testnet faucet\nhttps://testnet.binance.org/faucet-smart\n  - BSC smart contract IDE\nhttp://remix.ethereum.org/#optimize=false\u0026runs=200\u0026evmVersion=null\u0026version=soljson-v0.7.4+commit.3f05b770.js\n  - BSC development ecosystem and tools\nhttps://github.com/binance-chain/bsc-develop-ecosystem/\n  - BSC FAQ\nhttps://docs.google.com/document/d/1JF_P-AokXhSe38bNqLTNhlhKIu0JrcNRVReGdoBA-0o/edit?usp=sharing\n\n\u003cbr\u003e\n\n- BSC\n  - BEP20Token.template: \n    https://github.com/binance-chain/bsc-genesis-contract/blob/master/contracts/bep20_template/BEP20Token.template\n  \n\u003cbr\u003e\n\n- BSC RPC Endpoints:  \n  https://docs.binance.org/smart-chain/developer/rpc.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasaun%2FNFT-yield-farming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasaun%2FNFT-yield-farming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasaun%2FNFT-yield-farming/lists"}