fTokenNativeUnderlyingOverrides ​
Inherits:fTokenNativeUnderlyingHelpers, fToken
overrides certain methods from the inherited fToken used as base contract to make them compatible with the native token being used as underlying.
Functions ​
_getLiquiditySlotLinksAsset ​
gets asset address for liquidity slot links, overridden to set native token address
function _getLiquiditySlotLinksAsset() internal view virtual override returns (address);_getLiquidityUnderlyingBalance ​
Gets current Liquidity underlying token balance
function _getLiquidityUnderlyingBalance() internal view virtual override returns (uint256);rescueFunds ​
Sends stuck native or ERC20 funds to Liquidity.
function rescueFunds(address token_) external virtual override(fTokenAdmin) nonReentrant;rebalance ​
function rebalance() external payable virtual override(fTokenAdmin) nonReentrant returns (uint256 assets_);_depositToLiquidity ​
Deposit assets_ amount of tokens to Liquidity
function _depositToLiquidity(uint256 assets_, bytes memory liquidityCallbackData_)
internal
virtual
override
returns (uint256 exchangePrice_);Parameters
| Name | Type | Description |
|---|---|---|
assets_ | uint256 | The amount of tokens to deposit |
liquidityCallbackData_ | bytes | callback data passed to Liquidity for liquidityCallback |
Returns
| Name | Type | Description |
|---|---|---|
exchangePrice_ | uint256 | liquidity exchange price for token |
_executeDeposit ​
deposits assets_ into liquidity and mints shares for receiver_. Returns amount of sharesMinted_.
function _executeDeposit(
uint256 assets_,
address receiver_,
// liquidityCallbackData_ not needed for native transfer, sent along as msg.value. But used to recognize Permit2 transfers.
bytes memory liquidityCallbackData_
)
internal
virtual
override
returns (uint256 sharesMinted_);_executeDepositNative ​
deposits assets_ amount of native token into liquidity and mints shares for receiver_. Returns amount of sharesMinted_.
function _executeDepositNative(uint256 assets_, address receiver_)
internal
virtual
returns (uint256 sharesMinted_);_withdrawFromLiquidity ​
Withdraw assets_ amount of tokens from Liquidity directly to receiver_
function _withdrawFromLiquidity(uint256 assets_, address receiver_)
internal
virtual
override
returns (uint256 exchangePrice_);Parameters
| Name | Type | Description |
|---|---|---|
assets_ | uint256 | The amount of tokens to withdraw |
receiver_ | address | the receiver address of withdraw amount |
Returns
| Name | Type | Description |
|---|---|---|
exchangePrice_ | uint256 | liquidity exchange price for token |
_executeWithdraw ​
withdraws assets_ from liquidity to liquidityReceiver_ and burns shares from owner_. Returns amount of sharesBurned_. requires nonReentrant! modifier on calling method otherwise ERC777s could reenter!
function _executeWithdraw(uint256 assets_, address, address owner_, address finalReceiver_)
internal
virtual
override
validAddress(finalReceiver_)
returns (uint256 sharesBurned_);_executeWithdrawNative ​
withdraws assets_ from liquidity to receiver_ and burns shares from owner_. Returns amount of sharesBurned_.
function _executeWithdrawNative(uint256 assets_, address receiver_, address owner_)
internal
virtual
returns (uint256 sharesBurned_);