LM_PC_PaymentRouter_v1.sol

Git Source

Inherits: ILM_PC_PaymentRouter_v1, ERC20PaymentClientBase_v1

Author: Inverter Network

This module enables pushing payments directly to the Payment Processor.

Extends {ERC20PaymentClientBase_v1} to integrate payment processing with bounty management, supporting dynamic additions, updates, and the locking of bounties. Utilizes roles for managing permissions and maintaining robust control over bounty operations.

State Variables

PAYMENT_PUSHER_ROLE

The role that allows the pushing of payments.

bytes32 public constant PAYMENT_PUSHER_ROLE = "PAYMENT_PUSHER";

Functions

supportsInterface

See {IERC165-supportsInterface}.

function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(ERC20PaymentClientBase_v1)
    returns (bool);

init

function init(
    IOrchestrator_v1 orchestrator_,
    Metadata memory metadata,
    bytes memory configData
) external override(Module_v1) initializer;

pushPayment

Adds a new Payment Order.

Reverts if an argument invalid.

function pushPayment(
    address recipient,
    address paymentToken,
    uint amount,
    uint start,
    uint cliff,
    uint end
) public onlyModuleRole(PAYMENT_PUSHER_ROLE);

Parameters

Name
Type
Description

recipient

address

The address that will receive the payment.

paymentToken

address

The token in which to pay.

amount

uint256

The amount of tokens the payment consists of.

start

uint256

The timestamp at which the payment SHOULD be fulfilled.

cliff

uint256

The duration of the payment cliff.

end

uint256

The timestamp at which the payment SHOULD be fulfilled.

pushPaymentBatched

Adds multiple Payment Orders in one batch. These PaymentOrders will share start, cliff and end timestamps.

Reverts if an argument invalid. The number of orders to be added in one batch is capped at 255.

function pushPaymentBatched(
    uint8 numOfOrders,
    address[] calldata recipients,
    address[] calldata paymentTokens,
    uint[] calldata amounts,
    uint start,
    uint cliff,
    uint end
) public onlyModuleRole(PAYMENT_PUSHER_ROLE);

Parameters

Name
Type
Description

numOfOrders

uint8

The number of orders to add.

recipients

address[]

The addresses that will receive the payments.

paymentTokens

address[]

The tokens in which to pay.

amounts

uint256[]

The amounts of tokens the payments consist of.

start

uint256

The timestamp at which the payments should start.

cliff

uint256

The duration of the payment cliff.

end

uint256

The timestamps at which the payments SHOULD be fulfilled.

Last updated