ReserveConfiguration

Implements the bitmap logic to handle the reserve configuration

LTV_MASK

uint256 LTV_MASK

LIQUIDATION_THRESHOLD_MASK

uint256 LIQUIDATION_THRESHOLD_MASK

LIQUIDATION_BONUS_MASK

uint256 LIQUIDATION_BONUS_MASK

DECIMALS_MASK

uint256 DECIMALS_MASK

ACTIVE_MASK

uint256 ACTIVE_MASK

FROZEN_MASK

uint256 FROZEN_MASK

BORROWING_MASK

uint256 BORROWING_MASK

STABLE_BORROWING_MASK

uint256 STABLE_BORROWING_MASK

PAUSED_MASK

uint256 PAUSED_MASK

SILOED_BORROWING_MASK

uint256 SILOED_BORROWING_MASK

RESERVE_FACTOR_MASK

uint256 RESERVE_FACTOR_MASK

BORROW_CAP_MASK

uint256 BORROW_CAP_MASK

SUPPLY_CAP_MASK

uint256 SUPPLY_CAP_MASK

LIQUIDATION_PROTOCOL_FEE_MASK

uint256 LIQUIDATION_PROTOCOL_FEE_MASK

ASSET_TYPE_MASK

uint256 ASSET_TYPE_MASK

LIQUIDATION_THRESHOLD_START_BIT_POSITION

uint256 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

uint256 LIQUIDATION_BONUS_START_BIT_POSITION

RESERVE_DECIMALS_START_BIT_POSITION

uint256 RESERVE_DECIMALS_START_BIT_POSITION

IS_ACTIVE_START_BIT_POSITION

uint256 IS_ACTIVE_START_BIT_POSITION

IS_FROZEN_START_BIT_POSITION

uint256 IS_FROZEN_START_BIT_POSITION

BORROWING_ENABLED_START_BIT_POSITION

uint256 BORROWING_ENABLED_START_BIT_POSITION

STABLE_BORROWING_ENABLED_START_BIT_POSITION

uint256 STABLE_BORROWING_ENABLED_START_BIT_POSITION

IS_PAUSED_START_BIT_POSITION

uint256 IS_PAUSED_START_BIT_POSITION

SILOED_BORROWING_START_BIT_POSITION

uint256 SILOED_BORROWING_START_BIT_POSITION

RESERVE_FACTOR_START_BIT_POSITION

uint256 RESERVE_FACTOR_START_BIT_POSITION

bit 63 reserved

BORROW_CAP_START_BIT_POSITION

uint256 BORROW_CAP_START_BIT_POSITION

SUPPLY_CAP_START_BIT_POSITION

uint256 SUPPLY_CAP_START_BIT_POSITION

LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION

uint256 LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION

ASSET_TYPE_START_BIT_POSITION

uint256 ASSET_TYPE_START_BIT_POSITION

MAX_VALID_LTV

uint256 MAX_VALID_LTV

MAX_VALID_LIQUIDATION_THRESHOLD

uint256 MAX_VALID_LIQUIDATION_THRESHOLD

MAX_VALID_LIQUIDATION_BONUS

uint256 MAX_VALID_LIQUIDATION_BONUS

MAX_VALID_DECIMALS

uint256 MAX_VALID_DECIMALS

MAX_VALID_RESERVE_FACTOR

uint256 MAX_VALID_RESERVE_FACTOR

MAX_VALID_BORROW_CAP

uint256 MAX_VALID_BORROW_CAP

MAX_VALID_SUPPLY_CAP

uint256 MAX_VALID_SUPPLY_CAP

MAX_VALID_LIQUIDATION_PROTOCOL_FEE

uint256 MAX_VALID_LIQUIDATION_PROTOCOL_FEE

MAX_ASSET_TYPE

uint256 MAX_ASSET_TYPE

MAX_RESERVES_COUNT

uint16 MAX_RESERVES_COUNT

setLtv

function setLtv(struct DataTypes.ReserveConfigurationMap self, uint256 ltv) internal pure

Sets the Loan to Value of the reserve

Parameters

getLtv

function getLtv(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the Loan to Value of the reserve

Parameters

Return Values

setLiquidationThreshold

function setLiquidationThreshold(struct DataTypes.ReserveConfigurationMap self, uint256 threshold) internal pure

Sets the liquidation threshold of the reserve

Parameters

getLiquidationThreshold

function getLiquidationThreshold(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the liquidation threshold of the reserve

Parameters

Return Values

setLiquidationBonus

function setLiquidationBonus(struct DataTypes.ReserveConfigurationMap self, uint256 bonus) internal pure

Sets the liquidation bonus of the reserve

Parameters

getLiquidationBonus

function getLiquidationBonus(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the liquidation bonus of the reserve

Parameters

Return Values

setDecimals

function setDecimals(struct DataTypes.ReserveConfigurationMap self, uint256 decimals) internal pure

Sets the decimals of the underlying asset of the reserve

Parameters

getDecimals

function getDecimals(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the decimals of the underlying asset of the reserve

Parameters

Return Values

setAssetType

function setAssetType(struct DataTypes.ReserveConfigurationMap self, enum DataTypes.AssetType assetType) internal pure

Sets the asset type of the reserve

Parameters

getAssetType

function getAssetType(struct DataTypes.ReserveConfigurationMap self) internal pure returns (enum DataTypes.AssetType)

Gets the asset type of the reserve

Parameters

Return Values

setActive

function setActive(struct DataTypes.ReserveConfigurationMap self, bool active) internal pure

Sets the active state of the reserve

Parameters

getActive

function getActive(struct DataTypes.ReserveConfigurationMap self) internal pure returns (bool)

Gets the active state of the reserve

Parameters

Return Values

setFrozen

function setFrozen(struct DataTypes.ReserveConfigurationMap self, bool frozen) internal pure

Sets the frozen state of the reserve

Parameters

getFrozen

function getFrozen(struct DataTypes.ReserveConfigurationMap self) internal pure returns (bool)

Gets the frozen state of the reserve

Parameters

Return Values

setPaused

function setPaused(struct DataTypes.ReserveConfigurationMap self, bool paused) internal pure

Sets the paused state of the reserve

Parameters

getPaused

function getPaused(struct DataTypes.ReserveConfigurationMap self) internal pure returns (bool)

Gets the paused state of the reserve

Parameters

Return Values

setSiloedBorrowing

function setSiloedBorrowing(struct DataTypes.ReserveConfigurationMap self, bool siloed) internal pure

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

getSiloedBorrowing

function getSiloedBorrowing(struct DataTypes.ReserveConfigurationMap self) internal pure returns (bool)

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

Return Values

setBorrowingEnabled

function setBorrowingEnabled(struct DataTypes.ReserveConfigurationMap self, bool enabled) internal pure

Enables or disables borrowing on the reserve

Parameters

getBorrowingEnabled

function getBorrowingEnabled(struct DataTypes.ReserveConfigurationMap self) internal pure returns (bool)

Gets the borrowing state of the reserve

Parameters

Return Values

setReserveFactor

function setReserveFactor(struct DataTypes.ReserveConfigurationMap self, uint256 reserveFactor) internal pure

Sets the reserve factor of the reserve

Parameters

getReserveFactor

function getReserveFactor(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the reserve factor of the reserve

Parameters

Return Values

setBorrowCap

function setBorrowCap(struct DataTypes.ReserveConfigurationMap self, uint256 borrowCap) internal pure

Sets the borrow cap of the reserve

Parameters

getBorrowCap

function getBorrowCap(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the borrow cap of the reserve

Parameters

Return Values

setSupplyCap

function setSupplyCap(struct DataTypes.ReserveConfigurationMap self, uint256 supplyCap) internal pure

Sets the supply cap of the reserve

Parameters

getSupplyCap

function getSupplyCap(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the supply cap of the reserve

Parameters

Return Values

setLiquidationProtocolFee

function setLiquidationProtocolFee(struct DataTypes.ReserveConfigurationMap self, uint256 liquidationProtocolFee) internal pure

Sets the liquidation protocol fee of the reserve

Parameters

getLiquidationProtocolFee

function getLiquidationProtocolFee(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256)

Gets the liquidation protocol fee

Parameters

Return Values

getFlags

function getFlags(struct DataTypes.ReserveConfigurationMap self) internal pure returns (bool, bool, bool, bool, enum DataTypes.AssetType)

Gets the configuration flags of the reserve

Parameters

Return Values

getParams

function getParams(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256, uint256, uint256, uint256, uint256)

Gets the configuration parameters of the reserve from storage

Parameters

Return Values

getCaps

function getCaps(struct DataTypes.ReserveConfigurationMap self) internal pure returns (uint256, uint256)

Gets the caps parameters of the reserve from storage

Parameters

Return Values