FluidLendingFactory

Git Source

Inherits:LendingFactoryVariables, LendingFactoryAdmin

creates Fluid lending protocol fTokens, which are interacting with Fluid Liquidity. fTokens are ERC20 & ERC4626 compatible tokens that allow to deposit to Fluid Liquidity to earn interest. Tokens are created at a deterministic address (see computeToken()), only executable by allow-listed auths.

Note the deployed token starts out with no config at Liquidity contract. This must be done by Liquidity auths in a separate step, otherwise no deposits will be possible. This contract is not upgradeable. It supports adding new fToken creation codes for future new fToken types.

Functions

constructor

initialize liquidity contract address & owner

constructor(IFluidLiquidity liquidity_, address owner_)
    validAddress(address(liquidity_))
    validAddress(owner)
    LendingFactoryVariables(liquidity_, owner_);

computeToken

computes deterministic token address for asset_ for a lending protocol

function computeToken(address asset_, string calldata fTokenType_) public view returns (address token_);

Parameters

NameTypeDescription
asset_addressaddress of the asset
fTokenType_stringtype of fToken: - if it's the native token, it should use NativeUnderlying - otherwise it should use fToken - could be more types available, check fTokenTypes()

Returns

NameTypeDescription
token_addressdetemrinistic address of the computed token