TokenFacet

Git Source

Author: Publius

SPDX-License-Identifier: MIT

Functions

transferToken

Transfer

function transferToken(
    IERC20 token,
    address recipient,
    uint256 amount,
    LibTransfer.From fromMode,
    LibTransfer.To toMode
) external payable;

wrapMatic

Weth

function wrapMatic(uint256 amount, LibTransfer.To mode) external payable;

unwrapMatic

function unwrapMatic(uint256 amount, LibTransfer.From mode) external payable;

getInternalBalance

Getters

function getInternalBalance(address account, IERC20 token) public view returns (uint256 balance);

getInternalBalances

function getInternalBalances(address account, IERC20[] memory tokens)
    external
    view
    returns (uint256[] memory balances);

getExternalBalance

function getExternalBalance(address account, IERC20 token) public view returns (uint256 balance);

getExternalBalances

function getExternalBalances(address account, IERC20[] memory tokens)
    external
    view
    returns (uint256[] memory balances);

getBalance

function getBalance(address account, IERC20 token) public view returns (uint256 balance);

getBalances

function getBalances(address account, IERC20[] memory tokens) external view returns (uint256[] memory balances);

getAllBalance

function getAllBalance(address account, IERC20 token) public view returns (Balance memory b);

getAllBalances

function getAllBalances(address account, IERC20[] memory tokens) external view returns (Balance[] memory balances);

Events

InternalBalanceChanged

event InternalBalanceChanged(address indexed user, IERC20 indexed token, int256 delta);

Structs

Balance

struct Balance {
    uint256 internalBalance;
    uint256 externalBalance;
    uint256 totalBalance;
}