Skip to main content

stakingServiceProcess

Function Type: internal

Internal wrapper function that processes service staking operations by calling the base staking process with service-specific parameters. This function is called by publicServiceStaking to handle both user-authorized staking and service-initiated unstaking.

Parameters

ParameterTypeDescription
useraddressAddress of the user who owns the stake (payer for staking)
serviceaddressAddress of the smart contract performing the staking (stake recipient)
isStakingbooltrue = Stake, false = Unstake
amountOfStakinguint256Amount of staking tokens to stake/unstake
priorityFee_EVVMuint256EVVM priority fee (0 for unstaking operations)
nonce_EVVMuint256EVVM nonce (0 for unstaking operations)
priorityFlag_EVVMboolEVVM priority flag (false for unstaking operations)
signature_EVVMbytesEVVM signature (empty for unstaking operations)

Workflow

The function supports two execution paths based on the operation type:

  • Staking Operations: User pays for staking, service receives stake status
  • Unstaking Operations: Service executes its own unstaking operation

Staking Process

  1. Direct Delegation: Calls stakingBaseProcess() with all provided parameters
  2. Parameter Mapping:
    • useruserAccount (who pays for the transaction)
    • servicestakingAccount (who receives the stake)
  3. Payment Processing: Full EVVM parameters used for user payment processing
  4. Service Stake: service address receives the staking status and benefits

stakingServiceProcess Staking Process - Happy Path stakingServiceProcess Staking Process - Failed Path

Unstaking Process

  1. Direct Delegation: Calls stakingBaseProcess() with conditional parameters
  2. Parameter Mapping:
    • useruserAccount (same as service for unstaking)
    • servicestakingAccount (service unstaking itself)
  3. No Payment Required: EVVM parameters are zeroed (priorityFee_EVVM=0, nonce_EVVM=0, priorityFlag_EVVM=false, signature_EVVM=empty)
  4. Token Return: Staking tokens are returned to the service address

stakingServiceProcess Unstaking Process - Happy Path stakingServiceProcess Unstaking Process - Failed Path

info

This function directly calls stakingBaseProcess with user as userAccount and service as stakingAccount, enabling different payer and stake recipient addresses.