Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 1.98 KB

README.md

File metadata and controls

87 lines (57 loc) · 1.98 KB

ERC721 Staking

License: MIT

Overview

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.

Development

Prerequisites

  • hardhat - framework used for the development and testing of the contracts
  • node version >= 14.14.0
  1. After cloning, run:
cd ERC721Staking
npm install
  1. Set up the config file by executing:
cp config.sample.ts config.ts

Compilation

Before you deploy the contracts, you will need to compile them using:

npx hardhat compile

Deployment

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> \

Tests

Unit Tests

npx hardhat test

Coverage

npm run coverage

or

npx hardhat coverage --solcoverjs .solcover.ts