Skip to content

Constants ​

PERMIT2 ​

solidity
contract IAllowanceTransfer PERMIT2

_permit2 contract, deployed to same address on EVM networks, see https://github.com/Uniswap/permit2_

EXCHANGE_PRICES_PRECISION ​

solidity
uint256 EXCHANGE_PRICES_PRECISION

precision for exchange prices

SECONDS_PER_YEAR ​

solidity
uint256 SECONDS_PER_YEAR

Ignoring leap years

MAX_REWARDS_RATE ​

solidity
uint256 MAX_REWARDS_RATE

max allowed reward rate is 50%

LIQUIDITY ​

solidity
contract IFluidLiquidity LIQUIDITY

address of the Liquidity contract.

LENDING_FACTORY ​

solidity
contract IFluidLendingFactory LENDING_FACTORY

address of the Lending factory contract.

ASSET ​

solidity
contract IERC20 ASSET

address of the underlying asset contract.

DECIMALS ​

solidity
uint8 DECIMALS

number of decimals for the fToken, same as ASSET

LIQUIDITY_EXCHANGE_PRICES_SLOT ​

solidity
bytes32 LIQUIDITY_EXCHANGE_PRICES_SLOT

slot ids in Liquidity contract for underlying token. Helps in low gas fetch from liquidity contract by skipping delegate call with readFromStorage

LIQUIDITY_TOTAL_AMOUNTS_SLOT ​

solidity
bytes32 LIQUIDITY_TOTAL_AMOUNTS_SLOT

LIQUIDITY_USER_SUPPLY_SLOT ​

solidity
bytes32 LIQUIDITY_USER_SUPPLY_SLOT

constructor ​

solidity
constructor(contract IFluidLiquidity liquidity_, contract IFluidLendingFactory lendingFactory_, contract IERC20 asset_) internal

Parameters ​

NameTypeDescription
liquidity_contract IFluidLiquidityliquidity contract address
lendingFactory_contract IFluidLendingFactorylending factory contract address
asset_contract IERC20underlying token address

_getLiquiditySlotLinksAsset ​

solidity
function _getLiquiditySlotLinksAsset() internal view virtual returns (address)

gets asset address for liquidity slot links, extracted to separate method so it can be overridden if needed

Variables ​

_rewardsRateModel ​

solidity
contract IFluidLendingRewardsRateModel _rewardsRateModel

address of the LendingRewardsRateModel.

_liquidityExchangePrice ​

solidity
uint64 _liquidityExchangePrice

exchange price for the underlying assset in the liquidity protocol (without rewards)

_tokenExchangePrice ​

solidity
uint64 _tokenExchangePrice

exchange price between fToken and the underlying assset (with rewards)

_lastUpdateTimestamp ​

solidity
uint40 _lastUpdateTimestamp

timestamp when exchange prices were updated the last time

_status ​

solidity
uint8 _status

status for reentrancy guard

_rewardsActive ​

solidity
bool _rewardsActive

flag to signal if rewards are active without having to read slot 6

_rebalancer ​

solidity
address _rebalancer

rebalancer address allowed to call rebalance() and source for funding rewards (ReserveContract).

constructor ​

solidity
constructor(contract IFluidLiquidity liquidity_, contract IFluidLendingFactory lendingFactory_, contract IERC20 asset_) internal

Parameters ​

NameTypeDescription
liquidity_contract IFluidLiquidityliquidity contract address
lendingFactory_contract IFluidLendingFactorylending factory contract address
asset_contract IERC20underlying token address

_checkValidAddress ​

solidity
function _checkValidAddress(address value_) internal pure

checks that address is not the zero address, reverts if so. Calling the method in the modifier reduces bytecode size as modifiers are inlined into bytecode

validAddress ​

solidity
modifier validAddress(address value_)

validates that an address is not the zero address