fToken

Git Source

Inherits:fTokenAdmin, fTokenActions, fTokenEIP2612Withdrawals, fTokenPermit2Deposits, fTokenEIP2612Deposits

fToken is a token that can be used to supply liquidity to the Fluid Liquidity pool and earn interest for doing so. The fToken is backed by the underlying balance and can be redeemed for the underlying token at any time. The interest is earned via Fluid Liquidity, e.g. because borrowers pay a borrow rate on it. In addition, fTokens may also have active rewards going on that count towards the earned yield for fToken holders.

The fToken implements the ERC20 and ERC4626 standard, which means it can be transferred, minted and burned. The fToken supports EIP-2612 permit approvals via signature. The fToken implements withdrawals via EIP-2612 permits and deposits with Permit2 or EIP-2612 (if underlying supports it) signatures. fTokens are not upgradeable.

For view methods / accessing data, use the "LendingResolver" periphery contract.

Functions

constructor

constructor(IFluidLiquidity liquidity_, IFluidLendingFactory lendingFactory_, IERC20 asset_)
    Variables(liquidity_, lendingFactory_, asset_);

Parameters

NameTypeDescription
liquidity_IFluidLiquidityliquidity contract address
lendingFactory_IFluidLendingFactorylending factory contract address
asset_IERC20underlying token address

decimals

Returns the decimals places of the token.

function decimals() public view virtual override(ERC20, IERC20Metadata) returns (uint8);

liquidityCallback

transfers amount_ of token_ to liquidity. Only callable by liquidity contract.

this callback is used to optimize gas consumption (reducing necessary token transfers).

function liquidityCallback(address token_, uint256 amount_, bytes calldata data_) external virtual override;