Skip to main content

stakingUserProcess

Function Type: internal

Internal wrapper function that processes user staking operations by calling the base staking process with the user as both payer and stake recipient. This function is called by presaleStaking, publicStaking, and goldenStaking for standard user operations.

Parameters

ParameterTypeDescription
useraddressAddress of the user performing the staking operation (both payer and recipient)
amountOfStakinguint256Amount of staking tokens to stake/unstake
isStakingbooltrue = Stake, false = Unstake
priorityFee_EVVMuint256EVVM priority fee
nonce_EVVMuint256EVVM nonce
priorityFlag_EVVMboolEVVM priority flag
signature_EVVMbytesEVVM signature

Workflow

The function supports two execution paths for standard user operations:

  • Staking Operations: User pays for and receives staking status
  • Unstaking Operations: User unstakes their own tokens

Staking Process

  1. Direct Delegation: Calls stakingBaseProcess() with user as both userAccount and stakingAccount
  2. Parameter Mapping:
    • useruserAccount (who pays for the transaction)
    • userstakingAccount (who receives the stake - same address)
  3. Payment Processing: User pays for staking tokens through EVVM transaction
  4. Stake Assignment: User receives the staking status and benefits

stakingUserProcess Staking Process - Happy Path stakingUserProcess Staking Process - Failed Path

Unstaking Process

  1. Direct Delegation: Calls stakingBaseProcess() with user as both userAccount and stakingAccount
  2. Parameter Mapping:
    • useruserAccount (who initiates unstaking)
    • userstakingAccount (who loses stake - same address)
  3. Optional Payment: User may pay priority fee for unstaking (if priorityFee_EVVM > 0)
  4. Token Return: Staking tokens are returned to the user address

stakingUserProcess Unstaking Process - Happy Path stakingUserProcess Unstaking Process - Failed Path

info

This function calls stakingBaseProcess with the user address as both userAccount and stakingAccount, ensuring the user is both the payer and recipient for all operations.