fTokenNativeUnderlyingActions

Git Source

Inherits:fTokenNativeUnderlyingOverrides

implements deposit / mint / withdraw / redeem actions with Native token being used as interaction token.

Functions

depositNative

deposits msg.value amount of native token for receiver_. msg.value must be at least minDeposit() amount; reverts otherwise. Recommended to use depositNative() with a minAmountOut_ param instead to set acceptable limit.

function depositNative(address receiver_) public payable nonReentrant returns (uint256 shares_);

Returns

NameTypeDescription
shares_uint256actually minted shares

depositNative

deposits msg.value amount of native token for receiver_. msg.value must be at least minDeposit() amount; reverts otherwise. Recommended to use depositNative() with a minAmountOut_ param instead to set acceptable limit.

function depositNative(address receiver_, uint256 minAmountOut_) external payable returns (uint256 shares_);

Returns

NameTypeDescription
shares_uint256actually minted shares

mintNative

mints shares_ for receiver_, paying with underlying native token. shares_ must at least be minMint() amount; reverts otherwise. shares_ set to type(uint256).max not supported. Note there might be tiny inaccuracies between requested shares_ and actually received shares amount. Recommended to use depositNative() over mint because it is more gas efficient and less likely to revert. Recommended to use mintNative() with a minAmountOut_ param instead to set acceptable limit.

function mintNative(uint256 shares_, address receiver_) public payable nonReentrant returns (uint256 assets_);

Returns

NameTypeDescription
assets_uint256deposited assets amount

mintNative

mints shares_ for receiver_, paying with underlying native token. shares_ must at least be minMint() amount; reverts otherwise. shares_ set to type(uint256).max not supported. Note there might be tiny inaccuracies between requested shares_ and actually received shares amount. Recommended to use depositNative() over mint because it is more gas efficient and less likely to revert. Recommended to use mintNative() with a minAmountOut_ param instead to set acceptable limit.

function mintNative(uint256 shares_, address receiver_, uint256 maxAssets_)
    external
    payable
    returns (uint256 assets_);

Returns

NameTypeDescription
assets_uint256deposited assets amount

withdrawNative

withdraws assets_ amount in native underlying to receiver_, burning shares of owner_. If assets_ equals uint256.max then the whole fToken balance of owner_ is withdrawn.This does not consider withdrawal limit at liquidity so best to check with maxWithdraw() before. Note there might be tiny inaccuracies between requested assets_ and actually received assets amount. Recommended to use withdrawNative() with a maxSharesBurn_ param instead to set acceptable limit.

function withdrawNative(uint256 assets_, address receiver_, address owner_)
    public
    nonReentrant
    returns (uint256 shares_);

Returns

NameTypeDescription
shares_uint256burned shares

withdrawNative

withdraws assets_ amount in native underlying to receiver_, burning shares of owner_. If assets_ equals uint256.max then the whole fToken balance of owner_ is withdrawn.This does not consider withdrawal limit at liquidity so best to check with maxWithdraw() before. Note there might be tiny inaccuracies between requested assets_ and actually received assets amount. Recommended to use withdrawNative() with a maxSharesBurn_ param instead to set acceptable limit.

function withdrawNative(uint256 assets_, address receiver_, address owner_, uint256 maxSharesBurn_)
    external
    returns (uint256 shares_);

Returns

NameTypeDescription
shares_uint256burned shares

redeemNative

redeems shares_ to native underlying to receiver_, burning shares of owner_. If shares_ equals uint256.max then the whole balance of owner_ is withdrawn.This does not consider withdrawal limit at liquidity so best to check with maxRedeem() before. Recommended to use withdrawNative() over redeem because it is more gas efficient and can set specific amount. Recommended to use redeemNative() with a minAmountOut_ param instead to set acceptable limit.

function redeemNative(uint256 shares_, address receiver_, address owner_)
    public
    nonReentrant
    returns (uint256 assets_);

Returns

NameTypeDescription
assets_uint256withdrawn assets amount

redeemNative

redeems shares_ to native underlying to receiver_, burning shares of owner_. If shares_ equals uint256.max then the whole balance of owner_ is withdrawn.This does not consider withdrawal limit at liquidity so best to check with maxRedeem() before. Recommended to use withdrawNative() over redeem because it is more gas efficient and can set specific amount. Recommended to use redeemNative() with a minAmountOut_ param instead to set acceptable limit.

function redeemNative(uint256 shares_, address receiver_, address owner_, uint256 minAmountOut_)
    external
    returns (uint256 assets_);

Returns

NameTypeDescription
assets_uint256withdrawn assets amount