payNoStaker Functions
The payNoStaker functions enable single payments where the transaction executor (msg.sender) is not required to hold staking tokens. This provides a more accessible execution model compared to staking-required payment functions.
A key characteristic of these functions is that the priorityFee parameter is not utilized in non-staker payments, simplifying the transaction structure for users who don't participate in the staking mechanism.
These functions are available in two variants: synchronous (_sync) for sequential transaction ordering and asynchronous (_async) for flexible transaction ordering. For details on nonce types, see Nonce Types in EVVM. For signature details, see Payment Signature Structure.
payNoStaker_sync
Function Type: external
Function Signature: payNoStaker_sync(address,address,string,address,uint256,uint256,address,bytes)
Function Selector: 0x4faa1fa2
Executes a single, synchronous payment without requiring the executor (msg.sender) to hold staking tokens. It uses an implicitly managed synchronous nonce. The executor does not receive the priorityFee or rewards.
Parameters
| Field | Type | Description |
|---|---|---|
from | address | The address of the payment sender whose funds are being transferred and whose signature/nonce are validated. |
to_address | address | Direct recipient address. Used when to_identity is empty. |
to_identity | string | Username/identity of the recipient. If provided, the contract resolves it to an address via the NameService. |
token | address | The token address for the transfer. |
amount | uint256 | The quantity of tokens to transfer from from to the recipient. |
priorityFee | uint256 | Additional fee for transaction priority (not used in non-staker payments). |
executor | address | Address authorized to execute this transaction. Use address(0) to allow any address to execute (sender-only restriction removed). |
signature | bytes | Cryptographic signature (EIP-191) from the from address authorizing this payment. |
There is no explicit nonce parameter; the synchronous nonce is automatically managed and validated as part of the signature verification process.
Execution Methods
The function can be executed in two ways:
Fisher Execution
- A user signs the payment details and sends the request (parameters + signature) to a fishing spot.
- The fisher (who must hold staking) captures the transaction and validates the request.
- The fisher submits the transaction to the function for processing.
Direct Execution
- The user or any authorized service directly calls the
payNoStaker_syncfunction. - If an
executoraddress is specified, only that address can submit the transaction. - If
executoris set toaddress(0), anyone can execute the transaction with a valid signature.
When using a service as the executor, we recommend specifying the service's address in the executor parameter for additional security.
Workflow
- Signature Verification: Validates the
signatureagainst thefromaddress and other parameters usingverifyMessageSignedForPay. This includes checking that the synchronous nonce matches the expected next nonce for thefromaddress. Reverts withInvalidSignatureon failure. - Executor Validation: If
executoris notaddress(0), checks thatmsg.sendermatches theexecutoraddress. Reverts withSenderIsNotTheExecutorif they don't match. - Resolve Recipient Address: Determines the final recipient address:
- If
to_identityis provided (not empty), resolves the identity to an owner address usingverifyStrictAndGetOwnerOfIdentityfrom the NameService contract. - If
to_identityis empty, uses the providedto_address.
- If
- Balance Update: Executes the payment transfer using the
_updateBalancefunction, sendingamountoftokenfrom thefromaddress to the resolved recipient address. Reverts withUpdateBalanceFailedon transfer failure. - Nonce Increment: Increments the synchronous nonce counter for the
fromaddress to prevent replay attacks.
For more information about the signature structure, refer to the Payment Signature Structure section.
payNoStaker_async
Function Type: external
Function Signature: payNoStaker_async(address,address,string,address,uint256,uint256,uint256,address,bytes)
Function Selector: 0xf4e1895b
Executes a single, asynchronous payment without requiring the executor (msg.sender) to hold staking tokens. Asynchronous execution uses an explicit nonce parameter, allowing for out-of-order processing relative to other async transactions from the same sender. The executor does not receive the priorityFee or rewards.
Parameters
| Field | Type | Description |
|---|---|---|
from | address | The address of the payment sender whose funds are being transferred and whose signature/nonce are validated. |
to_address | address | Direct recipient address. Used when to_identity is empty. |
to_identity | string | Username/identity of the recipient. If provided, the contract resolves it to an address via the NameService. |
token | address | The token address for the transfer. |
amount | uint256 | The quantity of tokens to transfer from from to the recipient. |
priorityFee | uint256 | Additional fee for transaction priority (not used in non-staker payments). |
nonce | uint256 | Custom nonce value for transaction ordering and replay protection. |
executor | address | Address authorized to execute this transaction. Use address(0) to allow any address to execute (sender-only restriction removed). |
signature | bytes | Cryptographic signature (EIP-191) from the from address authorizing this payment. |
Execution Methods
This function can be executed by any address since it doesn't require the executor to hold staking tokens:
Direct Execution
- The user or any authorized service directly calls the
payNoStaker_asyncfunction. - If an
executoraddress is specified, only that address can submit the transaction. - If
executoris set toaddress(0), anyone can execute the transaction with a valid signature.
When using a service as the executor, we recommend specifying the service's address in the executor parameter for additional security.
Workflow
- Signature Verification: Validates the
signatureagainst thefromaddress and other parameters usingverifyMessageSignedForPay. Reverts withInvalidSignatureon failure. - Executor Validation: If
executoris notaddress(0), checks thatmsg.sendermatches theexecutoraddress. Reverts withSenderIsNotTheExecutorif they don't match. - Async Nonce Verification: Checks if the provided
noncehas already been used for thefromaddress by consulting theasyncUsedNoncemapping. Reverts withInvalidAsyncNonceif the nonce has already been used. - Resolve Recipient Address: Determines the final recipient address:
- If
to_identityis provided (not empty), resolves the identity to an owner address usingverifyStrictAndGetOwnerOfIdentityfrom the NameService contract. - If
to_identityis empty, uses the providedto_address.
- If
- Balance Update: Executes the payment transfer using the
_updateBalancefunction, sendingamountoftokenfrom thefromaddress to the resolved recipient address. Reverts withUpdateBalanceFailedon transfer failure. - Nonce Marking: Marks the specific asynchronous
nonceas used (true) for thefromaddress in theasyncUsedNoncemapping to prevent replay attacks.
If you want to know more about the signature structure, refer to the Payment Signature Structure section.