Skip to main content

presaleStaking

Function Type: external
Function Signature: presaleStaking(address,bool,uint256,bytes,uint256,uint256,bool,bytes)
Function Selector: 0x6257deec

The presaleStaking function enables presale participants to stake or unstake their MATE tokens under specific restrictions. This function ensures exclusive access for qualifying presale users while enforcing operational limits.

Restrictions

  • Limited to one operation per transaction
  • Maximum allocation of 2 staking tokens per user
  • Requires active allowPresaleStaking flag
  • Not available when allowPublicStaking flag is active (presale users must use publicStaking instead)

Parameters

ParameterTypeDescription
useraddressPresale participant's wallet address
isStakingbooltrue = Stake, false = Unstake
nonceuint256Staking contract nonce for replay protection
signaturebytesUser authorization signature
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. Signature Verification: Validates the authenticity of the user signature
  2. Nonce Validation: Confirms the contract nonce is valid and unused
  3. Presale Eligibility Check: Verifies presale participation status and token limit compliance
  4. Presale Staking Status: Verifies allowPresaleStaking.flag is enabled
  5. Process Execution: Calls the internal stakingUserProcess function to handle:
    • Historical record updates
    • Unstaking cooldown management
    • Re-staking restrictions
    • EVVM payment processing
    • Reward distribution
  6. Nonce Update: Increments the contract nonce for the user to prevent replay attacks
info

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

Presale Staking

Presale Staking

Unstaking Process

  1. Signature Verification: Validates the authenticity of the user signature
  2. Nonce Validation: Confirms the contract nonce is valid and unused
  3. Presale Eligibility Check: Verifies presale participation status and token limit compliance
  4. Presale Staking Status: Verifies allowPresaleStaking.flag is enabled
  5. Process Execution: Calls the internal stakingUserProcess function to handle:
    • Historical record updates
    • Unstaking cooldown management
    • Re-staking restrictions
    • EVVM payment processing
    • Reward distribution
  6. Nonce Update: Increments the contract nonce for the user to prevent replay attacks
info

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

Presale Staking

Presale Staking