This smart contract project allows users to stake their crypto assets to earn passive income.
By staking tokens, users can receive rewards throughout the year.
The contract operates on a decentralized system, ensuring both security and transparency.
It targets investors, crypto enthusiasts, and similar audiences.
Additional features are planned for the future.
- Install the required
sc-meta
andmxpy
libraries. - Write the smart contract.
- Build the contract.
- Connect with wallet.
- Deploy the contract to the desired network (devnet, testnet, or mainnet).
-
stake:
Allows users to stake EGLD tokens, adding them to their current balance. -
unstake:
Enables users to withdraw their staked tokens. -
claim_rewards:
Lets users collect rewards earned from staking. -
calculate_rewards:
Computes rewards based on the staked amount. -
staked_addresses:
Returns all addresses with active stakes. -
staking_position:
Displays users' staking positions. -
apy:
Stores the Annual Percentage Yield (APY).
-
Stake Tokens:
Users can stake EGLD tokens and earn rewards based on the stake amount and duration. -
Unstake Tokens:
Users can withdraw staked tokens and claim rewards.
If the entire stake is withdrawn, the staking position is reset. -
Claim Rewards:
Users can claim rewards calculated based on their stake and duration. -
Reward Calculation:
Rewards are calculated using the APY and the staking period.