publicServiceStaking
Function Type: external
Function Signature: publicServiceStaking(address,address,bool,uint256,uint256,bytes,uint256,uint256,bool,bytes)
The publicServiceStaking
function allows smart contracts (services) to stake on behalf of users when public staking is enabled. This function includes additional verification to ensure the service address contains contract code.
Parameters
Parameter | Type | Description |
---|---|---|
user | address | Address of the user who owns the stake |
service | address | Address of the smart contract performing the staking |
isStaking | bool | true = Stake, false = Unstake |
amountOfStaking | uint256 | Amount of staking tokens to stake/unstake |
nonce | uint256 | Unique nonce for this staking operation |
signature | bytes | Signature proving authorization for service staking |
priorityFee_EVVM | uint256 | EVVM priority fee (only for staking) |
nonce_EVVM | uint256 | EVVM nonce (only for staking) |
priorityFlag_EVVM | bool | EVVM priority flag (only for staking) |
signature_EVVM | bytes | EVVM signature (only for staking) |
note
- If you want to know more about the signature structure for public service staking, refer to the Public Service Staking Signature Structure.
- The EVVM payment signature (
signature_EVVM
) follows the Single Payment Signature Structure.
Workflow
- Public Staking Status: Verifies
allowPublicStaking.flag
is enabled - Service Verification: Confirms the service address contains contract code using
extcodesize
- Signature Verification: For staking operations, validates the service staking signature
- Service Matching: For unstaking operations, ensures service equals user address
- Nonce Validation: Confirms the contract nonce is valid and unused
- Process Execution: Calls the internal
stakingServiceProcess
function - Nonce Update: Increments the contract nonce for the user