fTokenNativeUnderlyingActions ​
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
| Name | Type | Description |
|---|---|---|
shares_ | uint256 | actually minted shares |
depositNative ​
same as {depositNative} but with an additional setting for minimum output amount. reverts with fToken__MinAmountOut() if minAmountOut_ of shares is not reached
function depositNative(address receiver_, uint256 minAmountOut_) external payable returns (uint256 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
| Name | Type | Description |
|---|---|---|
assets_ | uint256 | deposited assets amount |
mintNative ​
same as {mintNative} but with an additional setting for minimum output amount. reverts with fToken__MaxAmount() if maxAssets_ of assets is surpassed to mint shares_.
function mintNative(uint256 shares_, address receiver_, uint256 maxAssets_)
external
payable
returns (uint256 assets_);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
| Name | Type | Description |
|---|---|---|
shares_ | uint256 | burned shares |
withdrawNative ​
same as {withdrawNative} but with an additional setting for minimum output amount. reverts with fToken__MaxAmount() if maxSharesBurn_ of shares burned is surpassed.
function withdrawNative(uint256 assets_, address receiver_, address owner_, uint256 maxSharesBurn_)
external
returns (uint256 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
| Name | Type | Description |
|---|---|---|
assets_ | uint256 | withdrawn assets amount |
redeemNative ​
same as {redeemNative} but with an additional setting for minimum output amount. reverts with fToken__MinAmountOut() if minAmountOut_ of assets is not reached.
function redeemNative(uint256 shares_, address receiver_, address owner_, uint256 minAmountOut_)
external
returns (uint256 assets_);
