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.
Parameters
Parameter | Type | Description |
---|---|---|
user | address | User address |
isStaking | bool | true = Stake, false = Unstake |
amountOfStaking | uint256 | Amount of staking tokens to stake/unstake |
nonce | uint256 | Staking contract nonce for replay protection |
signature | bytes | Staking contract signature for replay protection |
priorityFee_EVVM | uint256 | EVVM priority fee |
nonce_EVVM | uint256 | EVVM payment operation nonce |
priorityFlag_EVVM | bool | EVVM execution mode (true = async, false = sync) |
signature_EVVM | bytes | EVVM payment authorization |
note
- If you want to know more about the signature structure, refer to the Standard Staking/Unstaking Signature Structure.
- The EVVM payment signature (
signature_EVVM
) follows the Single Payment Signature Structure.
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
- Feature Status Verification: Confirms
allowPublicStaking.flag
is enabled - Signature Verification: Validates the authenticity of the user signature
- Nonce Validation: Confirms the contract nonce is valid and unused
- Process Execution: Calls the internal
stakingBaseProcess
function to handle:- Historical record updates
- Unstaking cooldown management
- Re-staking restrictions
- EVVM payment processing
- Reward distribution
- Nonce Update: Increments the contract nonce for the user to prevent replay attacks
info
For detailed information about the stakingBaseProcess
function, refer to the stakingBaseProcess.
Unstaking Process
- Signature Verification: Validates the authenticity of the user signature
- Nonce Validation: Confirms the contract nonce is valid and unused
- Process Execution: Calls the internal
stakingUserProcess
function to handle:- Historical record updates
- Unstaking cooldown management
- Re-staking restrictions
- EVVM payment processing
- Reward distribution
- 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.