This project is a DeFi application that enables users to stake their tokens and earn rewards using Chainlink oracles. Users can stake any token listed on a decentralized exchange and verified by the Chainlink oracle network.
The Chainlink oracle network provides real-time price feeds, ensuring accurate reflection of the staked tokens' value in the system. This is crucial for maintaining the integrity of the staking process and ensuring fair distribution of rewards.
- ERC20 Token Staking: Stake any ERC20 token listed on a decentralized exchange and verified by the Chainlink oracle network.
- Real-Time Price Feeds: Receive real-time price feeds from the Chainlink oracle network, ensuring accurate valuation of staked tokens.
- Reward Distribution: Earn rewards based on the value of the staked tokens.
- Chainlink - Provides real-time price feeds to smart contracts, enabling accurate valuation of staked tokens.
- Solidity - The programming language used to write smart contracts for the Ethereum blockchain.
- Hardhat - A development environment for Ethereum that allows for compiling, testing, and deploying smart contracts. It includes advanced features like mainnet forking and account impersonation for comprehensive testing.
- OpenZeppelin - Library for secure smart contract development
- JavaScript - Used for scripting and deployment tasks.
- contracts: Contains the smart contracts (
StakingWithChainlink.sol
,RewardToken.sol
), library contracts (ChainlinkManager.sol
,Utilis.sol
), and test files for the smart contracts includingTestChainlink.sol
. - deploy: Contains deployment scripts for the smart contracts. Includes files such as
01-TestChainlink-deploy.js
,02-RewardToken-deploy-.js
, and03-StakingWithChainlink-deploy.js
. - scripts: Contains additional scripts for the project.
- utils: Contains utility scripts for the project. Includes scripts such as
approveTokens.js
,fundAllAccounts.js
, andgetTotalStakedAmount.js
. - test: Contains unit tests for the project. Includes files such as
01-StakingWithChainlink-unit-test.js
andimport-All.js
.
To get started with this project, clone the repository and install the dependencies:
- Node.js and npm or yarn
- Hardhat
- Ethereum wallet
-
Clone the repository and navigate to the newly created folder:
git clone https://github.com/Ehsan-The-Coder/StakingWithChainlink.git cd StakingWithChainlink
-
Install the dependencies:
yarn
-
Compile the smart contracts:
yarn hardhat compile
-
Deploy the contracts:
yarn hardhat deploy
To run the tests, use the following command:
yarn hardhat test
This project is licensed under the MIT License.
- Chainlink
- Ethereum Foundation
- OpenZeppelin
- https://github.com/PatrickAlphaC