Constants
PERMIT2
contract IAllowanceTransfer PERMIT2
permit2 contract, deployed to same address on EVM networks, see https://github.com/Uniswap/permit2
EXCHANGE_PRICES_PRECISION
uint256 EXCHANGE_PRICES_PRECISION
precision for exchange prices
SECONDS_PER_YEAR
uint256 SECONDS_PER_YEAR
Ignoring leap years
MAX_REWARDS_RATE
uint256 MAX_REWARDS_RATE
max allowed reward rate is 50%
LIQUIDITY
contract IFluidLiquidity LIQUIDITY
address of the Liquidity contract.
LENDING_FACTORY
contract IFluidLendingFactory LENDING_FACTORY
address of the Lending factory contract.
ASSET
contract IERC20 ASSET
address of the underlying asset contract.
DECIMALS
uint8 DECIMALS
number of decimals for the fToken, same as ASSET
LIQUIDITY_EXCHANGE_PRICES_SLOT
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
bytes32 LIQUIDITY_TOTAL_AMOUNTS_SLOT
LIQUIDITY_USER_SUPPLY_SLOT
bytes32 LIQUIDITY_USER_SUPPLY_SLOT
constructor
constructor(contract IFluidLiquidity liquidity_, contract IFluidLendingFactory lendingFactory_, contract IERC20 asset_) internal
Parameters
Name | Type | Description |
---|---|---|
liquidity_ | contract IFluidLiquidity | liquidity contract address |
lendingFactory_ | contract IFluidLendingFactory | lending factory contract address |
asset_ | contract IERC20 | underlying token address |
_getLiquiditySlotLinksAsset
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
contract IFluidLendingRewardsRateModel _rewardsRateModel
address of the LendingRewardsRateModel.
_liquidityExchangePrice
uint64 _liquidityExchangePrice
exchange price for the underlying assset in the liquidity protocol (without rewards)
_tokenExchangePrice
uint64 _tokenExchangePrice
exchange price between fToken and the underlying assset (with rewards)
_lastUpdateTimestamp
uint40 _lastUpdateTimestamp
timestamp when exchange prices were updated the last time
_status
uint8 _status
status for reentrancy guard
_rewardsActive
bool _rewardsActive
flag to signal if rewards are active without having to read slot 6
_rebalancer
address _rebalancer
rebalancer address allowed to call rebalance()
and source for funding rewards (ReserveContract).
constructor
constructor(contract IFluidLiquidity liquidity_, contract IFluidLendingFactory lendingFactory_, contract IERC20 asset_) internal
Parameters
Name | Type | Description |
---|---|---|
liquidity_ | contract IFluidLiquidity | liquidity contract address |
lendingFactory_ | contract IFluidLendingFactory | lending factory contract address |
asset_ | contract IERC20 | underlying token address |
_checkValidAddress
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
modifier validAddress(address value_)
validates that an address is not the zero address