ReserveConfiguration
Implements the bitmap logic to handle the reserve configuration
LTV_MASK
LIQUIDATION_THRESHOLD_MASK
LIQUIDATION_BONUS_MASK
DECIMALS_MASK
ACTIVE_MASK
FROZEN_MASK
BORROWING_MASK
STABLE_BORROWING_MASK
PAUSED_MASK
BORROWABLE_IN_ISOLATION_MASK
SILOED_BORROWING_MASK
FLASHLOAN_ENABLED_MASK
RESERVE_FACTOR_MASK
BORROW_CAP_MASK
SUPPLY_CAP_MASK
LIQUIDATION_PROTOCOL_FEE_MASK
EMODE_CATEGORY_MASK
UNBACKED_MINT_CAP_MASK
DEBT_CEILING_MASK
LIQUIDATION_THRESHOLD_START_BIT_POSITION
For the LTV, the start bit is 0 (up to 15), hence no bitshifting is needed
LIQUIDATION_BONUS_START_BIT_POSITION
RESERVE_DECIMALS_START_BIT_POSITION
IS_ACTIVE_START_BIT_POSITION
IS_FROZEN_START_BIT_POSITION
BORROWING_ENABLED_START_BIT_POSITION
STABLE_BORROWING_ENABLED_START_BIT_POSITION
IS_PAUSED_START_BIT_POSITION
BORROWABLE_IN_ISOLATION_START_BIT_POSITION
SILOED_BORROWING_START_BIT_POSITION
FLASHLOAN_ENABLED_START_BIT_POSITION
RESERVE_FACTOR_START_BIT_POSITION
BORROW_CAP_START_BIT_POSITION
SUPPLY_CAP_START_BIT_POSITION
LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION
EMODE_CATEGORY_START_BIT_POSITION
UNBACKED_MINT_CAP_START_BIT_POSITION
DEBT_CEILING_START_BIT_POSITION
MAX_VALID_LTV
MAX_VALID_LIQUIDATION_THRESHOLD
MAX_VALID_LIQUIDATION_BONUS
MAX_VALID_DECIMALS
MAX_VALID_RESERVE_FACTOR
MAX_VALID_BORROW_CAP
MAX_VALID_SUPPLY_CAP
MAX_VALID_LIQUIDATION_PROTOCOL_FEE
MAX_VALID_EMODE_CATEGORY
MAX_VALID_UNBACKED_MINT_CAP
MAX_VALID_DEBT_CEILING
DEBT_CEILING_DECIMALS
MAX_RESERVES_COUNT
setLtv
Sets the Loan to Value of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
ltv
uint256
The new ltv
getLtv
Gets the Loan to Value of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The loan to value
setLiquidationThreshold
Sets the liquidation threshold of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
threshold
uint256
The new liquidation threshold
getLiquidationThreshold
Gets the liquidation threshold of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The liquidation threshold
setLiquidationBonus
Sets the liquidation bonus of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
bonus
uint256
The new liquidation bonus
getLiquidationBonus
Gets the liquidation bonus of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The liquidation bonus
setDecimals
Sets the decimals of the underlying asset of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
decimals
uint256
The decimals
getDecimals
Gets the decimals of the underlying asset of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The decimals of the asset
setActive
Sets the active state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
active
bool
The active state
getActive
Gets the active state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The active state
setFrozen
Sets the frozen state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
frozen
bool
The frozen state
getFrozen
Gets the frozen state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The frozen state
setPaused
Sets the paused state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
paused
bool
The paused state
getPaused
Gets the paused state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The paused state
setBorrowableInIsolation
Sets the borrowable in isolation flag for the reserve.
When this flag is set to true, the asset will be borrowable against isolated collaterals and the borrowed amount will be accumulated in the isolated collateral's total debt exposure. Only assets of the same family (eg USD stablecoins) should be borrowable in isolation mode to keep consistency in the debt ceiling calculations.
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
borrowable
bool
True if the asset is borrowable
getBorrowableInIsolation
Gets the borrowable in isolation flag for the reserve.
If the returned flag is true, the asset is borrowable against isolated collateral. Assets borrowed with isolated collateral is accounted for in the isolated collateral's total debt exposure. Only assets of the same family (eg USD stablecoins) should be borrowable in isolation mode to keep consistency in the debt ceiling calculations.
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The borrowable in isolation flag
setSiloedBorrowing
Sets the siloed borrowing flag for the reserve.
When this flag is set to true, users borrowing this asset will not be allowed to borrow any other asset.
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
siloed
bool
True if the asset is siloed
getSiloedBorrowing
Gets the siloed borrowing flag for the reserve.
When this flag is set to true, users borrowing this asset will not be allowed to borrow any other asset.
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The siloed borrowing flag
setBorrowingEnabled
Enables or disables borrowing on the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
enabled
bool
True if the borrowing needs to be enabled, false otherwise
getBorrowingEnabled
Gets the borrowing state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The borrowing state
setStableRateBorrowingEnabled
Enables or disables stable rate borrowing on the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
enabled
bool
True if the stable rate borrowing needs to be enabled, false otherwise
getStableRateBorrowingEnabled
Gets the stable rate borrowing state of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The stable rate borrowing state
setReserveFactor
Sets the reserve factor of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
reserveFactor
uint256
The reserve factor
getReserveFactor
Gets the reserve factor of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The reserve factor
setBorrowCap
Sets the borrow cap of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
borrowCap
uint256
The borrow cap
getBorrowCap
Gets the borrow cap of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The borrow cap
setSupplyCap
Sets the supply cap of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
supplyCap
uint256
The supply cap
getSupplyCap
Gets the supply cap of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The supply cap
setDebtCeiling
Sets the debt ceiling in isolation mode for the asset
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
ceiling
uint256
The maximum debt ceiling for the asset
getDebtCeiling
Gets the debt ceiling for the asset if the asset is in isolation mode
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The debt ceiling (0 = isolation mode disabled)
setLiquidationProtocolFee
Sets the liquidation protocol fee of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
liquidationProtocolFee
uint256
The liquidation protocol fee
getLiquidationProtocolFee
Gets the liquidation protocol fee
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The liquidation protocol fee
setUnbackedMintCap
Sets the unbacked mint cap of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
unbackedMintCap
uint256
The unbacked mint cap
getUnbackedMintCap
Gets the unbacked mint cap of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The unbacked mint cap
setEModeCategory
Sets the eMode asset category
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
category
uint256
The asset category when the user selects the eMode
getEModeCategory
Gets the eMode asset category
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The eMode category for the asset
setFlashLoanEnabled
Sets the flashloanable flag for the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
flashLoanEnabled
bool
True if the asset is flashloanable, false otherwise
getFlashLoanEnabled
Gets the flashloanable flag for the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The flashloanable flag
getFlags
Gets the configuration flags of the reserve
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
bool
The state flag representing active
[1]
bool
The state flag representing frozen
[2]
bool
The state flag representing borrowing enabled
[3]
bool
The state flag representing stableRateBorrowing enabled
[4]
bool
The state flag representing paused
getParams
Gets the configuration parameters of the reserve from storage
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The state param representing ltv
[1]
uint256
The state param representing liquidation threshold
[2]
uint256
The state param representing liquidation bonus
[3]
uint256
The state param representing reserve decimals
[4]
uint256
The state param representing reserve factor
[5]
uint256
The state param representing eMode category
getCaps
Gets the caps parameters of the reserve from storage
Parameters
self
struct DataTypes.ReserveConfigurationMap
The reserve configuration
Return Values
[0]
uint256
The state param representing borrow cap
[1]
uint256
The state param representing supply cap.