GithubHelp home page GithubHelp logo

nutriemp / erc721-staking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andreitoma8/erc721-staking

0.0 0.0 0.0 27 KB

Stake ERC721 Tokens to claim ERC20 Tokens

Shell 0.95% Python 36.86% Solidity 62.19%

erc721-staking's Introduction

ERC721Staking Smart Contract.

Smart Contract where users can Stake their ERC721 Tokens and Owner can distribute rewards.

Smart Contract recieved a free exploratory audit by Marco form Paladin Blockchain Security. All audit notes and issues can be found in their raw form over here.

All issues and recommendations were addressed.

Created using OpenZeppelin's ERC20 and ERC721 Smart Contracts.

This iteration of a Staking Smart Contract for ERC721 is a separate one, so you will need three SC: one for your ERC721 Collection, one for your ERC20 Token and one for the Staking Pool. You will also have to send the ERC20 Token to the Staking Smart Contract so it will be able to pay rewards for your stakers. In the future I will create a ERC20 extension for ERC721 Staking so users will be able to mint ERC20 Tokens directly from the ERC20 SC based on ERC721 Stake. This will also make the developer job easier by only having to manage two Smart Contracts.

Features for users:

  1. Deposit your ERC721 Token/s and claim a fixed amount of ERC20 Tokens calculated hourly.
  2. Withdraw your ERC721 Token/s.
  3. Withdraw rewards.

Features for owner:

  1. Distribute ERC20 Token by ERC721 Tokens Locking(Staking).
  2. Set a fixed hourly reward per ERC721 Token Locked(Staked).
  3. Change the rewards per hour

Prerequisites:

Rinkeby deployment
python3 -m pip install --user pipx
python3 -m pipx ensurepath
# restart terminal
pipx install eth-brownie
  • A free Infura Project Id key for Rinkeby Network

Instalation

Clone this repo:

git clone https://github.com/andreitoma8/ERC721-Staking
cd ERC721-Staking

Deploy to Rinkeby

  • Add a .env file with the same contents of .env.example, but replaced with your variables.

  • Run the command:

brownie run scripts/deploy.py --network rinkeby

The script will:

  1. Deploy the ERC20 Reward Token, mint 1.000.000 for yourself and verify the Smart Contract on .rinkeby.etherscan.io.
  2. Deploy the ERC721 NFT Collection, mint 5 Tokens for yourself and verify the Smart Contract on .rinkeby.etherscan.io.
  3. Deploy the ERC721 Staking Smart Contract and verify it on .rinkeby.etherscan.io.
Any feedback is much apreciated!
If this was helpful please consider donating:

0xA4Ad17ef801Fa4bD44b758E5Ae8B2169f59B666F

Happy hacking!

erc721-staking's People

Contributors

andreitoma8 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.