Giter Site home page Giter Site logo

chiasheng96 / erc721-staking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scotchnoblemen/erc721-staking

0.0 1.0 0.0 391 KB

On-chain ERC721 Staking contract for generating yield in any ERC20 token.

License: Other

TypeScript 73.25% Solidity 26.75%

erc721-staking's Introduction

ERC721 Yield Farming

License: MIT

Overview

The repository contains contracts for 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

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

erc721-staking's People

Watchers

James Cloos avatar

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.