DepositSplitter

Git Source

Inherits: IDepositSplitter

This contract handles functionality for splitting deposits between the Payer Registry and App Chain.

State Variables

feeToken

The address of the fee token contract used for deposits.

address public immutable feeToken;

payerRegistry

The address of the payer registry.

address public immutable payerRegistry;

settlementChainGateway

The address of the settlement chain gateway.

address public immutable settlementChainGateway;

appChainId

The app chain ID.

uint256 public immutable appChainId;

_underlyingFeeToken

The address of the token underlying the fee token.

address internal immutable _underlyingFeeToken;

Functions

constructor

constructor(address feeToken_, address payerRegistry_, address settlementChainGateway_, uint256 appChainId_);

deposit

function deposit(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_
) external;

depositWithPermit

function depositWithPermit(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_,
    uint256 deadline_,
    uint8 v_,
    bytes32 r_,
    bytes32 s_
) external;

depositFromUnderlying

function depositFromUnderlying(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_
) external;

depositFromUnderlyingWithPermit

function depositFromUnderlyingWithPermit(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_,
    uint256 deadline_,
    uint8 v_,
    bytes32 r_,
    bytes32 s_
) external;

_depositFeeToken

Transfers in the total fee tokens from the caller, then performs the required deposit(s).

function _depositFeeToken(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_
) internal;

_depositFromUnderlying

Transfers in the total underlying fee tokens from the caller, then performs the required deposit(s).

function _depositFromUnderlying(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_
) internal;

_deposit

Satisfies both deposits, if needed, and reverts if neither are needed.

function _deposit(
    address payer_,
    uint96 payerRegistryAmount_,
    address appChainRecipient_,
    uint96 appChainAmount_,
    uint256 appChainGasLimit_,
    uint256 appChainMaxFeePerGas_
) internal;

_usePermit

Uses a permit to approve the deposit of amount_ of token_ from the caller to this contract.

Silently ignore a failing permit, as it may indicate that the permit was already used and/or the allowance has already been approved.

function _usePermit(address token_, uint256 amount_, uint256 deadline_, uint8 v_, bytes32 r_, bytes32 s_) internal;

_isZero

function _isZero(address input_) internal pure returns (bool isZero_);