IPaymentProcessor_v1.sol

Git Source

Functions

processPayments

Processes all payments from an {IERC20PaymentClientBase_v1} instance. Please note: this function does not support callbacks on transfer of tokens.

It's up to the the implementation to keep up with what has been paid out or not.

Currently callback functions on token transfers are not supported and thus not checked. This could lead to a failed transaction which could influence the batched processing of payments.

function processPayments(IERC20PaymentClientBase_v1 client) external;

Parameters

Name
Type
Description

client

IERC20PaymentClientBase_v1

The {IERC20PaymentClientBase_v1} instance to process its to payments.

cancelRunningPayments

Cancels all unfinished payments from an {IERC20PaymentClientBase_v1} instance.

It's up to the the implementation to keep up with what has been paid out or not.

function cancelRunningPayments(IERC20PaymentClientBase_v1 client) external;

Parameters

Name
Type
Description

client

IERC20PaymentClientBase_v1

The {IERC20PaymentClientBase_v1} instance to process its to payments.

unclaimable

Getter for the amount of tokens that could not be claimed.

function unclaimable(address client, address token, address paymentReceiver)
    external
    view
    returns (uint amount);

Parameters

Name
Type
Description

client

address

address of the payment client.

token

address

address of the payment token.

paymentReceiver

address

PaymentReceiver's address.

Returns

Name
Type
Description

amount

uint256

Amount of tokens that could not be claimed.

claimPreviouslyUnclaimable

claim every unclaimable amount that the paymentClient owes to the _msgSender and send it to a specified receiver.

This function should be callable if the _msgSender has unclaimedAmounts.

function claimPreviouslyUnclaimable(
    address client,
    address token,
    address receiver
) external;

Parameters

Name
Type
Description

client

address

The IERC20PaymentClientBase_v1 instance address that processes all claims from _msgSender.

token

address

address of the payment token.

receiver

address

The address that will receive the previously unclaimable amount.

validPaymentOrder

Function that checks if the given PaymentOrder was valid.

function validPaymentOrder(IERC20PaymentClientBase_v1.PaymentOrder memory order)
    external
    returns (bool);

Parameters

Name
Type
Description

order

IERC20PaymentClientBase_v1.PaymentOrder

The IERC20PaymentClientBase_v1 Order that needs to be checked.

Returns

Name
Type
Description

<none>

bool

valid Bool if the Payment Order is valid.

Events

PaymentOrderProcessed

Emitted when a payment gets processed for execution.

event PaymentOrderProcessed(
    address indexed paymentClient,
    address indexed recipient,
    address indexed paymentToken,
    uint amount,
    uint originChainId,
    uint targetChainId,
    bytes32 flags,
    bytes32[] data
);

Parameters

Name
Type
Description

paymentClient

address

The payment client that originated the order.

recipient

address

The address that will receive the payment.

paymentToken

address

The address of the token that will be used for the payment.

amount

uint256

The amount of tokens the payment consists of.

originChainId

uint256

The id of the origin chain.

targetChainId

uint256

The id of the target chain.

flags

bytes32

Flags that indicate additional data used by the payment order.

data

bytes32[]

Array of additional data regarding the payment order.

TokensReleased

Emitted when an amount of ERC20 tokens gets sent out of the contract.

event TokensReleased(
    address indexed recipient, address indexed token, uint amount
);

Parameters

Name
Type
Description

recipient

address

The address that will receive the payment.

token

address

The token address in which the payment should have happened.

amount

uint256

The amount of tokens the payment consists of.

UnclaimableAmountAdded

Emitted when a payment was unclaimable due to a token error.

event UnclaimableAmountAdded(
    address indexed paymentClient,
    address indexed token,
    address indexed recipient,
    uint amount
);

Parameters

Name
Type
Description

paymentClient

address

The payment client that originated the order.

token

address

recipient

address

The address that should have received the payment.

amount

uint256

The amount of tokens that were unclaimable.

Errors

Module__PaymentProcessor__OnlyCallableByModule

invalid caller.

error Module__PaymentProcessor__OnlyCallableByModule();

Module__PaymentProcessor__CannotCallOnOtherClientsOrders

a client can only execute on its own orders.

error Module__PaymentProcessor__CannotCallOnOtherClientsOrders();

Module__PaymentProcessor__NothingToClaim

the paymentReceiver is not owed any money by the paymentClient.

error Module__PaymentProcessor__NothingToClaim(
    address paymentClient, address paymentReceiver
);

Last updated