Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giri-aayush/defi-staking
A simple yet robust decentralized finance (DeFi) staking contract. This project demonstrates the implementation of a custom ERC20 token (DEFI) and a staking mechanism that allows users to earn rewards for participating in the ecosystem.
https://github.com/giri-aayush/defi-staking
defi erc20 hardhat staking
Last synced: about 6 hours ago
JSON representation
A simple yet robust decentralized finance (DeFi) staking contract. This project demonstrates the implementation of a custom ERC20 token (DEFI) and a staking mechanism that allows users to earn rewards for participating in the ecosystem.
- Host: GitHub
- URL: https://github.com/giri-aayush/defi-staking
- Owner: Giri-Aayush
- Created: 2024-03-24T21:28:04.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T20:23:03.000Z (3 months ago)
- Last Synced: 2024-11-11T01:37:40.577Z (about 2 months ago)
- Topics: defi, erc20, hardhat, staking
- Language: JavaScript
- Homepage:
- Size: 215 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DeFi Staking Project
This project demonstrates a basic DeFi staking mechanism using Solidity smart contracts. It includes a custom ERC20 token (DEFI) and a staking contract that allows users to stake their DEFI tokens and earn rewards.## Contracts
### DEFI Token (DEFI.sol)
A simple ERC20 token contract for the DEFI token used in staking.
- Token Name: DEFI
- Token Symbol: DEFI
- Implements: ERC20 (OpenZeppelin)### Staking Contract (Staking.sol)
A staking contract that allows users to stake DEFI tokens and earn rewards.Features:
- Stake DEFI tokens
- Withdraw staked tokens and rewards
- View accumulated rewards
- Claim rewards without withdrawing stake
- Reentrancy protection## Getting Started
1. Clone this repository
2. Install dependencies:
```npm install```
3. Compile contracts:
```npx hardhat compile```
4. Deploy contracts (adjust the script as needed):
```npx hardhat run scripts/deploy.js --network ```## Usage
1. Deploy the DEFI token contract
2. Deploy the Staking contract, passing the DEFI token address and reward rate as constructor arguments
3. Users can then interact with the Staking contract to stake tokens, withdraw, and claim rewards## Security
This project uses OpenZeppelin's contracts for enhanced security. However, it has not been audited and should not be used in production without proper review and testing.## License
This project is licensed under the MIT License.