Skip to content

eminesa/staking-smart

Repository files navigation

Smart Contract Project

Brief Overview of the Project

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.


How to Compile and Deploy the Smart Contract

Compile Instructions:

  1. Install the required sc-meta and mxpy libraries.
  2. Write the smart contract.
  3. Build the contract.

Deploy Instructions:

  1. Connect with wallet.
  2. Deploy the contract to the desired network (devnet, testnet, or mainnet).

Functions and Features

Functions:

  • 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).


Features:

  • 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.


Screenshots:

Screenshot 2024-12-28 at 13 27 48 Screenshot 2024-12-28 at 13 30 38 Screenshot 2024-12-28 at 13 33 10 Screenshot 2024-12-28 at 13 36 04 Screenshot 2024-12-28 at 13 32 11

About

staking smart contract created

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages