General overview of the most important smart-contract interactions.

The two most important smart-contracts that you will be interacting with are:

Please note that some functions differ between both smart contracts.



Returns the length of the _plans array.


Returns the address of the factory contract.


Returns an array of StakingPlan structs representing the available staking plans.


Returns the StakingPlan struct for a specific plan ID. Params:

  • uint256 planId - ID of the plan


Returns the StakingPool struct containing information about the staking pool.


Returns an array of UserStake structs representing the stake information for a specific staker. Params:

  • address staker - address of a staker


Returns the UserStake struct for a specific staker and plan ID. Params:

  • address staker - address of a staker

  • uint256 planId - ID of a plan


Stakes tokens for a specific staking plan. Params:

  • uint256 amount - amount to stake

  • uint256 stakingPlanId - ID of a plan


Unstakes tokens from a specific staking plan. Params:

  • uint256 stakingPlanId - ID of a plan


Unstakes tokens from a specific staking plan before the end of the staking period, with a penalty. Params:

  • uint256 stakingPlanId - ID of a plan


Sends unused reward tokens back to the contract owner.



This function allows the creator of the contract to extend the staking period by specifying a new end date. The creator needs to provide additional staking tokens to cover the extended period. Params:

  • uint256 _newEndDate - new date when staking will end


Any user can deposit a specified amount of tokens into the contract for staking. The tokens must be transferred to the contract address. Params:

  • uint256 _amount - amount of tokens to deposit


Allows users to withdraw a specific amount of their staked tokens from the contract. The function also harvests any pending rewards before withdrawal.

  • uint256 _amount - amount of tokens to withdraw


Enables any user to claim their accumulated staking rewards from the contract.


Allows users to check the amount of unharvested rewards associated with their staked tokens. Params:

  • address _staker - address of a given staker


Returns a summary of key contract data, including reward tokens per second, the total amount of staked tokens, accumulated rewards per share, last reward block timestamp, start timestamp, end timestamp and the address of the staked token.


Allows the protocol owner to withdraw a specified amount of tokens from the contract to their address in emergency situations.

  • address _tokenAddress - address of the token to withraw

  • uint256 _amount - amount to withdraw

If you have any questions, please reach out to Additionally, we can create a staking contract with a custom token on a selected testnet (Sepolia, BNB Testnet). In such scenario, you will be able to test it.

Last updated