Payment

Inherits: State, PayableMulticall, SelfPermit, IPayment

Payment helper function that lets user sweep ERC20 tokens off the router and liquidity manager. Also provides mechanism to wrap and unwrap ETH/WETH so that it can be used in the Maverick pools.

Functions

receive

receive() external payable;

unwrapWETH9

Unwrap WETH9 tokens into ETH and send that balance to recipient. If less than amountMinimum WETH is avialble, then revert.

function unwrapWETH9(uint256 amountMinimum, address recipient) public payable;

sweepToken

Sweep entire ERC20 token balance on this contract to recipient. If less than amountMinimum balance is avialble, then revert.

function sweepToken(IERC20 token, uint256 amountMinimum, address recipient) public payable;

sweepTokenAmount

Transfers specified token amount to recipient

function sweepTokenAmount(IERC20 token, uint256 amount, address recipient) public payable;

unwrapAndSweep

For tokenA and tokenB, sweep all of the non-WETH tokens to msg.sender. Any WETH balance is unwrapped to ETH and then all the ETH on this contract is sent to msg.sender.

function unwrapAndSweep(IERC20 tokenA, IERC20 tokenB, uint256 tokenAAmountMin, uint256 tokenBAmountMin)
    public
    payable;

refundETH

Send any ETH on this contract to msg.sender.

function refundETH() public payable;

pay

Internal function to pay tokens or eth.

function pay(IERC20 token, address payer, address recipient, uint256 value) internal;

Parameters

NameTypeDescription

token

IERC20

ERC20 token to pay.

payer

address

Address of the payer.

recipient

address

Address of the recipient.

value

uint256

Amount of tokens to pay.

Last updated