Skip to content

The Stakenet Smart Contract is an Ethereum-based contract that allows users to stake a certain ERC20 token and earn rewards based on a predefined yield percentage. This contract is implemented using Solidity and utilizes OpenZeppelin libraries for ERC20 functionality.

Notifications You must be signed in to change notification settings

Svetoslavb04/Stakenet

Repository files navigation

Stakenet

Overview

The Stakenet Smart Contract is an Ethereum-based contract that allows users to stake a certain ERC20 token and earn rewards based on a predefined yield percentage. This contract is implemented using Solidity and utilizes OpenZeppelin libraries for ERC20 functionality.

Features

  • Stake ERC20 tokens to earn rewards.
  • Transfer staking position to another address.
  • Withdraw staked tokens along with accumulated yield after a lock duration.
  • Dynamic yield calculation based on the total rewards and stake limits.
  • User-specific stake limits and minimum staking amount.

Prerequisites

Getting Started

  1. Clone the repository:

    git clone https://github.com/Svetoslavb04/Stakenet.git
  2. Navigate to the project directory:

    cd Stakenet
  3. Setup environment variables

    Create .env file or fulfill .env.example.
    The following environment variables are required:
    SEPOLIA_URL, SEPOLIA_PRIVATE_KEY, ETHERSCAN_API_KEY

  4. Compile the smart contracts:

    npx hardhat compile
  5. Deploy the LimeSpark smart contract to Sepolia testnet:

    npx hardhat deploy-lime-spark --network sepolia --starter-tokens <STARTER_TOKENS>
  6. Deploy the Stakenet smart contract to Sepolia testnet:

    npx hardhat deploy-stakenet --network sepolia --erc20-token-address <ADDRESS_OF_ERC20> --lock-duration-in-seconds <LOCK_DURATION> --rewards <REWARDS> --contract-stake-limit <CONTRACT_STAKE_LIMIT> --user-stake-limit <USER_STAKE_LIMIT>

    Run npx hardhat help to see all available commands

License

This project is licensed under the MIT License.

Disclaimer

This smart contract is provided as-is and has not been audited for security. Use it at your own risk.

LimeSpark Contract address: 0x2BdFb6a7B89e933B0A8c34E3dcc32E8C684c7738
LimeSpark Contract link: https://sepolia.etherscan.io/address/0x2BdFb6a7B89e933B0A8c34E3dcc32E8C684c7738#code

Stakenet Contract address: 0x25eF4D21979a2dB912183c133A3e576cf710d1A7
Stakenet Contract link: https://sepolia.etherscan.io/address/0x25eF4D21979a2dB912183c133A3e576cf710d1A7#code

Example Stakenet deploy command:
npx hardhat deploy-stakenet --erc20-token-address 0x2BdFb6a7B89e933B0A8c34E3dcc32E8C684c7738 --lock-duration-in-seconds 86400 --rewards 100000000000000000000 --contract-stake-limit 300000000000000000000 --user-stake-limit 100000000000000000000

About

The Stakenet Smart Contract is an Ethereum-based contract that allows users to stake a certain ERC20 token and earn rewards based on a predefined yield percentage. This contract is implemented using Solidity and utilizes OpenZeppelin libraries for ERC20 functionality.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published