Skip to content

The repository contains contracts for farming with any ERC721 compatible NFTs.

License

Notifications You must be signed in to change notification settings

0xHustling/ERC721-Staking

Repository files navigation

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

About

The repository contains contracts for farming with any ERC721 compatible NFTs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published