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
Parameter | Type | Description |
---|---|---|
user | address | Address of the user who owns the stake (payer for staking) |
service | address | Address of the smart contract performing the staking (stake recipient) |
isStaking | bool | true = Stake, false = Unstake |
amountOfStaking | uint256 | Amount of staking tokens to stake/unstake |
priorityFee_EVVM | uint256 | EVVM priority fee (0 for unstaking operations) |
nonce_EVVM | uint256 | EVVM nonce (0 for unstaking operations) |
priorityFlag_EVVM | bool | EVVM priority flag (false for unstaking operations) |
signature_EVVM | bytes | EVVM 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
- Direct Delegation: Calls
stakingBaseProcess()
with all provided parameters - Parameter Mapping:
user
→userAccount
(who pays for the transaction)service
→stakingAccount
(who receives the stake)
- Payment Processing: Full EVVM parameters used for user payment processing
- Service Stake:
service
address receives the staking status and benefits
Unstaking Process
- Direct Delegation: Calls
stakingBaseProcess()
with conditional parameters - Parameter Mapping:
user
→userAccount
(same as service for unstaking)service
→stakingAccount
(service unstaking itself)
- No Payment Required: EVVM parameters are zeroed (priorityFee_EVVM=0, nonce_EVVM=0, priorityFlag_EVVM=false, signature_EVVM=empty)
- Token Return: Staking tokens are returned to the
service
address
info
This function directly calls stakingBaseProcess with user
as userAccount
and service
as stakingAccount
, enabling different payer and stake recipient addresses.