Skip to main content

publicStaking

Function Type: external
Function Signature: publicStaking(address,bool,uint256,uint256,bytes,uint256,uint256,bool,bytes)
Function Selector: 0x21cc1749

The publicStaking function enables universal access to MATE token staking when the allowPublicStaking.flag is enabled, regardless of presale participation status or account type.

info

For all EVVM testnets allowPublicStaking.flag is enabled by default.

Parameters

ParameterTypeDescription
useraddressUser address
isStakingbooltrue = Stake, false = Unstake
amountOfStakinguint256Amount of staking tokens to stake/unstake
nonceuint256Staking contract nonce for replay protection
signaturebytesStaking contract signature for replay protection
priorityFee_EVVMuint256EVVM priority fee
nonce_EVVMuint256EVVM payment operation nonce
priorityFlag_EVVMboolEVVM execution mode (true = async, false = sync)
signature_EVVMbytesEVVM payment authorization
note

Workflow

The function supports two execution paths:

  • Fisher-Mediated: A designated fisher captures the transaction from the fishing spot and submits it to the contract
  • Direct User Submission: The user directly submits the transaction to the contract

Staking Process

  1. Feature Status Verification: Confirms allowPublicStaking.flag is enabled
  2. Signature Verification: Validates the authenticity of the user signature
  3. Nonce Validation: Confirms the contract nonce is valid and unused
  4. Process Execution: Calls the internal stakingBaseProcess function with:
    • User address and IsAService=false in AccountMetadata
    • Specified amount of staking tokens
    • Standard EVVM payment processing
    • Historical record updates and reward distribution
  5. Nonce Update: Marks the staking nonce as used to prevent replay attacks
info

For detailed information about the stakingBaseProcess function, refer to the stakingBaseProcess.

publicStaking Staking Staking Flow - Happy Path publicStaking Staking Flow - Failed Path

Unstaking Process

  1. Feature Status Verification: Confirms allowPublicStaking.flag is enabled
  2. Signature Verification: Validates the authenticity of the user signature
  3. Nonce Validation: Confirms the contract nonce is valid and unused
  4. Process Execution: Calls the internal stakingBaseProcess function with:
    • User address and IsAService=false in AccountMetadata
    • Specified amount of staking tokens
    • Standard EVVM payment processing
    • Historical record updates and reward distribution
  5. Nonce Update: Marks the staking nonce as used to prevent replay attacks
info

For detailed information about the stakingBaseProcess function, refer to the stakingBaseProcess.

publicStaking Unstaking Flow - Happy Path publicStaking Unstaking Flow - Failed Path