The repository contains contracts for yield farming with any ERC721 compatible NFTs. Any specified ERC-721 can be used to farm any ERC-20 compatible tokens, by depositing/locking them into the ERC721Staking contract that uses ERC-721 instead of the normal ERC-20 token. The basis of the staking contract is the stripped down version of Synthetix's StakingRewards contract and modified version of EnterDAO's LandWorks-YF-Contracts. Credit to EnterDAO and Synthetix.
NFT owners can stake or withdraw his/hers NFTs at any time.
Prerequisites
- hardhat - framework used for the development and testing of the contracts
node version >= 14.14.0
- After cloning, run:
cd ERC721Staking
npm install
- Set up the config file by executing:
cp config.sample.ts config.ts
Before you deploy the contracts, you will need to compile them using:
npx hardhat compile
Prerequisite
Before running the deployment npx hardhat
script, you need to create and populate the config.ts
file. You can use
the config.sample.ts
file and populate the following variables:
YOUR-INFURA-API-KEY YOUR-ETHERSCAN-API-KEY
ERC721 Staking
- Deploys the
ERC721Staking
contract
npx hardhat deploy-erc721-staking \
--network <network name> \
--staking-token <address of the staking token> \
--rewards-token <address of the rewards token> \
--duration <duration of farming in seconds> \
npx hardhat test
npm run coverage
or
npx hardhat coverage --solcoverjs .solcover.ts