ImTokenGateway

Git Source

Functions

rolesOperator

Roles

function rolesOperator() external view returns (IRoles);

blacklistOperator

Blacklist

function blacklistOperator() external view returns (IBlacklister);

underlying

Returns the address of the underlying token

function underlying() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of the underlying token

isPaused

returns pause state for operation

function isPaused(ImTokenOperationTypes.OperationType _type) external view returns (bool);

Parameters

NameTypeDescription
_typeImTokenOperationTypes.OperationTypethe operation type

accAmountIn

Returns accumulated amount in per user

function accAmountIn(address user) external view returns (uint256);

accAmountOut

Returns accumulated amount out per user

function accAmountOut(address user) external view returns (uint256);

getProofData

Returns the proof data journal

function getProofData(address user, uint32 dstId) external view returns (uint256, uint256);

extractForRebalancing

Extract amount to be used for rebalancing operation

function extractForRebalancing(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256The amount to rebalance

setPaused

Set pause for a specific operation

function setPaused(ImTokenOperationTypes.OperationType _type, bool state) external;

Parameters

NameTypeDescription
_typeImTokenOperationTypes.OperationTypeThe pause operation type
stateboolThe pause operation status

updateAllowedCallerStatus

Set caller status for msg.sender

function updateAllowedCallerStatus(address caller, bool status) external;

Parameters

NameTypeDescription
calleraddressThe caller address
statusboolThe status to set for caller

supplyOnHost

Supply underlying to the contract

function supplyOnHost(uint256 amount, address receiver, bytes4 lineaSelector) external payable;

Parameters

NameTypeDescription
amountuint256The supplied amount
receiveraddressThe receiver address
lineaSelectorbytes4The method selector to be called on Linea by our relayer. If empty, user has to submit it

liquidate

Liquidate a user

function liquidate(address userToLiquidate, uint256 liquidateAmount, address collateral, address receiver)
    external
    payable;

Parameters

NameTypeDescription
userToLiquidateaddressThe user to liquidate
liquidateAmountuint256The amount to liquidate
collateraladdressThe collateral address
receiveraddressThe receiver address

outHere

Extract tokens

function outHere(bytes calldata journalData, bytes calldata seal, uint256[] memory amounts, address receiver)
    external;

Parameters

NameTypeDescription
journalDatabytesThe supplied journal
sealbytesThe seal address
amountsuint256[]The amounts to withdraw for each journal
receiveraddressThe receiver address

Events

AllowedCallerUpdated

Emitted when a user updates allowed callers

event AllowedCallerUpdated(address indexed sender, address indexed caller, bool status);

mTokenGateway_Supplied

Emitted when a supply operation is initiated

event mTokenGateway_Supplied(
    address indexed from,
    address indexed receiver,
    uint256 accAmountIn,
    uint256 accAmountOut,
    uint256 amount,
    uint32 srcChainId,
    uint32 dstChainId,
    bytes4 lineaMethodSelector
);

mTokenGateway_Liquidate

Emitted when a liquidate operation is initiated

event mTokenGateway_Liquidate(
    address indexed from,
    address indexed receiver,
    uint256 amount,
    uint32 srcChainId,
    uint32 dstChainId,
    address userToLiquidate,
    address collateral
);

mTokenGateway_Extracted

Emitted when an extract was finalized

event mTokenGateway_Extracted(
    address indexed msgSender,
    address indexed srcSender,
    address indexed receiver,
    uint256 accAmountIn,
    uint256 accAmountOut,
    uint256 amount,
    uint32 srcChainId,
    uint32 dstChainId
);

mTokenGateway_Skipped

Emitted when a proof was skipped

event mTokenGateway_Skipped(
    address indexed msgSender,
    address indexed srcSender,
    address indexed receiver,
    uint256 accAmountIn,
    uint256 accAmountOut,
    uint256 amount,
    uint32 srcChainId,
    uint32 dstChainId
);

mTokenGateway_GasFeeUpdated

Emitted when the gas fee is updated

event mTokenGateway_GasFeeUpdated(uint256 amount);

mTokenGateway_PausedState

event mTokenGateway_PausedState(ImTokenOperationTypes.OperationType indexed _type, bool _status);

ZkVerifierUpdated

event ZkVerifierUpdated(address indexed oldVerifier, address indexed newVerifier);

mTokenGateway_UserWhitelisted

event mTokenGateway_UserWhitelisted(address indexed user, bool status);

mTokenGateway_WhitelistEnabled

event mTokenGateway_WhitelistEnabled();

mTokenGateway_WhitelistDisabled

event mTokenGateway_WhitelistDisabled();

Errors

mTokenGateway_ChainNotValid

Thrown when the chain id is not LINEA

error mTokenGateway_ChainNotValid();

mTokenGateway_AddressNotValid

Thrown when the address is not valid

error mTokenGateway_AddressNotValid();

mTokenGateway_AmountNotValid

Thrown when the amount specified is invalid (e.g., zero)

error mTokenGateway_AmountNotValid();

mTokenGateway_JournalNotValid

Thrown when the journal data provided is invalid

error mTokenGateway_JournalNotValid();

mTokenGateway_AmountTooBig

Thrown when there is insufficient cash to release the specified amount

error mTokenGateway_AmountTooBig();

mTokenGateway_ReleaseCashNotAvailable

Thrown when there is insufficient cash to release the specified amount

error mTokenGateway_ReleaseCashNotAvailable();

mTokenGateway_NonTransferable

Thrown when token is tranferred

error mTokenGateway_NonTransferable();

mTokenGateway_CallerNotAllowed

Thrown when caller is not allowed

error mTokenGateway_CallerNotAllowed();

mTokenGateway_Paused

Thrown when market is paused for operation type

error mTokenGateway_Paused(ImTokenOperationTypes.OperationType _type);

mTokenGateway_NotRebalancer

Thrown when caller is not rebalancer

error mTokenGateway_NotRebalancer();

mTokenGateway_LengthNotValid

Thrown when length is not valid

error mTokenGateway_LengthNotValid();

mTokenGateway_NotEnoughGasFee

Thrown when not enough gas fee was received

error mTokenGateway_NotEnoughGasFee();

mTokenGateway_L1InclusionRequired

Thrown when L1 inclusion is required

error mTokenGateway_L1InclusionRequired();

mTokenGateway_UserNotWhitelisted

Thrown when user is not whitelisted

error mTokenGateway_UserNotWhitelisted();

mTokenGateway_UserBlacklisted

Thrown when user is blacklisted

error mTokenGateway_UserBlacklisted();