PayMaster

Git Source

Inherits: IPayMaster, LiquidityHandler

Author: ZeroPoint Labs

State Variables

superRegistry

ISuperRegistry public superRegistry;

totalFeesPaid

mapping(address => uint256) public totalFeesPaid;

Functions

onlyPaymentAdmin

modifier onlyPaymentAdmin();

constructor

constructor(address superRegistry_);

withdrawTo

withdraws funds from pay master to target id from superRegistry

function withdrawTo(bytes32 superRegistryId_, uint256 nativeAmount_) external override onlyPaymentAdmin;

Parameters

NameTypeDescription
superRegistryId_bytes32is the id of the target address in superRegistry
nativeAmount_uint256is the amount to withdraw from pay master

rebalanceTo

withdraws fund from pay master to target id from superRegistry

function rebalanceTo(
    bytes32 superRegistryId_,
    LiqRequest memory req_,
    uint64 dstChainId_
)
    external
    override
    onlyPaymentAdmin;

Parameters

NameTypeDescription
superRegistryId_bytes32is the id of the target address in superRegistry
req_LiqRequestis the off-chain generated liquidity request to move funds
dstChainId_uint64is the destination chain id

makePayment

accepts payment from user

function makePayment(address user_) external payable override;

Parameters

NameTypeDescription
user_addressis the wallet address of the paying user

_withdrawNative

helper to move native tokens same chain

function _withdrawNative(address receiver_, uint256 amount_) internal;

_validateAndDispatchTokens

helper to move native tokens cross-chain

function _validateAndDispatchTokens(LiqRequest memory liqRequest_, address receiver_) internal;