Skip to main content

payNoMateStaking Functions

The payNoMateStaking functions facilitate single payments where the transaction executor (msg.sender) is not required to hold sMATE tokens. This offers a more open execution model compared to the payMateStaking counterparts.

A key consequence of not requiring the executor to be an sMATE staker is that the executor does not receive and cannot execute the priorityFee or any MATE token rewards for processing the transaction via these functions.

These functions are available in synchronous (_sync) and asynchronous (_async) variants. For details on nonce types, see Nonce Types in EVVM. For signature details, see Payment Signature Structure.

payNoMateStaking_sync

Function Type: external
Function Signature: payNoMateStaking_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 sMATE tokens. It uses an implicitly managed synchronous nonce. The executor does not receive the priorityFee or MATE rewards.

Parameters

FieldTypeDescription
fromaddressThe address whose funds are being sent and whose signature/nonce are validated for this payment.
to_addressaddresshe recipient's direct address. Used if to_identity is empty.
to_identitystringAn alternative identifier for the recipient. If provided, the contract will attempt to resolve it to an address.
tokenaddressThe specific token address for this individual transfer.
amountuint256The quantity of token to transfer from from to the recipient.
priorityFeeuint256An additional fee, paid in token from the from address to the msg.sender (executor).
executoraddressThe address authorized to submit this transaction to the contract. Can be address(0) for unrestricted execution.
signaturebytesA cryptographic signature (EIP-191) from the from address, authorizing this specific payment's details.
note

There is no explicit nonce parameter; the synchronous nonce is validated as part of the signature verification process

Execution Methods

The function can be executed in two ways:

Fisher Execution

  1. A user signs the payment details and sends the request (parameters + signature) to a fishing spot.
  2. The fisher (who must hold sMATE) captures the transaction and validates the request.
  3. The fisher submits the transaction to the function for processing.

Direct Execution

When the executor is the user or a service:

  1. The user/service (who must hold sMATE) directly calls the payMateStaking_sync function.
tip

If using a service as the direct executor, we recommend adding the service's address as the executor parameter.

Workflow

  1. Signature & Sync Nonce Verification: Validates the signature against the from address and other parameters using verifyMessageSignedForPay. This step also implicitly checks if the synchronous nonce derived from the signature matches the expected next synchronous nonce for the from address. Reverts on failure.
  2. Executor Validation: Checks if the executor parameter matches the transaction sender (msg.sender). If executor is address(0), this check is bypassed, allowing anyone to submit the transaction (provided the signature is valid). Reverts if executor is non-zero and doesn't match msg.sender.
  3. sMATE Holder Check: Verifies that the msg.sender (the executor) holds sMATE tokens using the isMateStaker function. Reverts if msg.sender is not an staker.
  4. Resolve Recipient Address: Determines the final recipient address:
    • If to_identity is provided (not empty), it attempts to resolve the identity to an owner address using verifyStrictAndGetOwnerOfIdentity from the MateNameService contract.
    • If to_identity is empty, it uses the provided to_address.
  5. Balance Check and Update: Executes the main payment transfer using the _updateBalance function sending amount of token from the from address to the resolved recipient address. Reverts on transfer failure.
  6. Nonce Update: Increments the synchronous nonce counter for the from address, marking this nonce as used.
info

For more information about the signature structure, refer to the Payment Signature Structure section.

payNoMateStaking_sync with Fisher payNoMateStaking_sync Direct


payNoMateStaking_async

Function Type: external
Function Signature: payNoMateStaking_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 sMATE 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 MATE rewards.

Parameters

FieldTypeDescription
fromaddressThe address whose funds are being sent and whose signature/nonce are validated for this payment.
to_addressaddresshe recipient's direct address. Used if to_identity is empty.
to_identitystringAn alternative identifier for the recipient. If provided, the contract will attempt to resolve it to an address.
tokenaddressThe specific token address for this individual transfer.
amountuint256The quantity of token to transfer from from to the recipient.
priorityFeeuint256An additional fee, paid in token from the from address to the msg.sender (executor).
nonceuint256The specific asynchronous nonce value provided by the from user for this transaction's replay protection.
executoraddressThe address authorized to submit this transaction to the contract. Can be address(0) for unrestricted execution.
signaturebytesA cryptographic signature (EIP-191) from the from address, authorizing this specific payment's details.

Execution Methods

The function can be executed in two ways:

Fisher Execution

  1. A user signs the payment details and sends the request (parameters + signature) to a fishing spot.
  2. The fisher (who must hold sMATE) captures the transaction and validates the request.
  3. The fisher submits the transaction to the function for processing.

Direct Execution

When the executor is the user or a service:

  1. The user/service (who must hold sMATE) directly calls the payMateStaking_sync function.
tip

If using a service as the direct executor, we recommend adding the service's address as the executor parameter.

Workflow

  1. Signature Verification: Validates the signature against the from address and other parameters using verifyMessageSignedForPay. Reverts on failure.
  2. Executor Validation: Checks if the executor parameter matches the transaction sender (msg.sender). If executor is address(0), this check is bypassed, allowing anyone to submit the transaction (provided the signature is valid). Reverts if executor is non-zero and doesn't match msg.sender.
  3. sMATE Holder Check: Verifies that the msg.sender (the executor) holds sMATE tokens using the isMateStaker function. Reverts if msg.sender is not an staker.
  4. Async Nonce Verification: Checks if the provided nonce has already been used for the from address by consulting the asyncUsedNonce mapping. Reverts if the nonce is invalid or already used.
  5. Resolve Recipient Address: Determines the final recipient address:
    • If to_identity is provided (not empty), it attempts to resolve the identity to an owner address using verifyStrictAndGetOwnerOfIdentity from the MateNameService contract.
    • If to_identity is empty, it uses the provided to_address.
  6. Balance Check and Update: Executes the main payment transfer using the _updateBalance function sending amount of token from the from address to the resolved recipient address. Reverts on transfer failure.
  7. Nonce Update: Marks the specific asynchronous nonce provided in the parameters as used (true) for the from address in the asyncUsedNonce mapping.
info

If you want to know more about the signature structure, refer to the Payment Signature Structure section.

payNoMateStaking_async with Fisher payNoMateStaking_async Direct