WrapAndSupply

Git Source

State Variables

wrappedNative

IWrappedNative public immutable wrappedNative;

Functions

constructor

constructor(address _wrappedNative);

wrapAndSupplyOnHostMarket

Wraps a native coin into its wrapped version and supplies on a host market

function wrapAndSupplyOnHostMarket(address mToken, address receiver, uint256 minAmount) external payable;

Parameters

NameTypeDescription
mTokenaddressThe market address
receiveraddressThe mToken receiver
minAmountuint256

wrapAndSupplyOnExtensionMarket

Wraps a native coin into its wrapped version and supplies on an extension market

function wrapAndSupplyOnExtensionMarket(address mTokenGateway, address receiver, bytes4 selector) external payable;

Parameters

NameTypeDescription
mTokenGatewayaddressThe market address
receiveraddressThe receiver
selectorbytes4The host chain function selector

_wrap

function _wrap() private returns (uint256);

Events

WrappedAndSupplied

event WrappedAndSupplied(address indexed sender, address indexed receiver, address indexed market, uint256 amount);

Errors

WrapAndSupply_AddressNotValid

error WrapAndSupply_AddressNotValid();

WrapAndSupply_AmountNotValid

error WrapAndSupply_AmountNotValid();