This smart contract enables staking on the Core network, allowing users to stake Y tokens and earn X tokens as rewards based on a predefined locking period. A reward pool is preloaded with X tokens, which are distributed to stakers according to their stake amount and duration.
- Secure & Efficient Staking: Users can stake Y tokens and earn X token rewards.
- Preloaded Reward Pool: Rewards are sourced from a preloaded pool.
- Time-Based Rewards: Rewards are distributed based on the staking duration.
- Fair Distribution: Users receive rewards proportional to their stake and lock period.
- Optimized for Gas Efficiency: Designed to minimize transaction costs on the Core network.
- Reward Pool Funding: The contract owner deposits X tokens into the reward pool.
- User Staking: Users stake Y tokens and choose a locking period.
- Reward Calculation: Rewards are calculated based on the stake amount and duration.
- Claiming Rewards: Users can withdraw their stake and claim earned rewards after the locking period.
- Contract Security: Ensures fair distribution and prevents manipulation.
To deploy the contract:
- Compile the smart contract using a Solidity-compatible IDE or Hardhat.
- Deploy it on the Core network using a Web3 provider.
- Fund the reward pool with X tokens.
- Interact with the contract using a frontend or direct Web3 calls.
Users can stake their Y tokens by calling:
stake(uint256 amount, uint256 lockPeriod)
amount
: Number of Y tokens to stake.lockPeriod
: Duration in seconds for locking the stake.
After the lock period, users can claim their rewards:
claimRewards()
This will transfer the earned X tokens to the user’s wallet.
- Smart Contract Audits: Ensure the contract is thoroughly reviewed before deployment.
- Fair Reward Distribution: Prevents unfair advantage to early stakers.
- Gas Optimization: Transactions are optimized to minimize fees.
This project is released under the MIT License.
To ensure this documentation remains up-to-date, please refer to the README.me file for the latest instructions, updates, and usage guidelines.