PayMaster
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
Name | Type | Description |
---|---|---|
superRegistryId_ | bytes32 | is the id of the target address in superRegistry |
nativeAmount_ | uint256 | is 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
Name | Type | Description |
---|---|---|
superRegistryId_ | bytes32 | is the id of the target address in superRegistry |
req_ | LiqRequest | is the off-chain generated liquidity request to move funds |
dstChainId_ | uint64 | is the destination chain id |
makePayment
accepts payment from user
function makePayment(address user_) external payable override;
Parameters
Name | Type | Description |
---|---|---|
user_ | address | is 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;