Fraction ProtocoloracleFacetslendingOracle

LendingOracleFacetStorage

LendingOracleFacetStorage

AlreadyInitialized

error AlreadyInitialized()

Thrown when attempting to re-initialize.

InvalidZeroInterferenceState

error InvalidZeroInterferenceState()

Thrown when attempting to pass zero interference state.

ZeroMinimumProportionOverObligation

error ZeroMinimumProportionOverObligation()

Thrown when attempting to initialize minimumProportionOverObligation as the zero value.

InvalidInputArrays

error InvalidInputArrays()

Thrown when attempting to pass invalid input arrays.

InitializationRequired

error InitializationRequired()

Thrown when attempting to execute the setter function before initialization.

BelowMinimumProportion

error BelowMinimumProportion(uint256 proportion, uint256 minimumProportion)

Thrown when attempting to pass proportion lower than minimum.

NonIncrementalProportions

error NonIncrementalProportions()

Thrown when attempting to pass non incremental proportions.

packetsMarginAmountEnoughForBuyback

error packetsMarginAmountEnoughForBuyback()

Thrown when margin amount added is enough for buyback (so buyback should be called instead).

STORAGE_SLOT

bytes32 STORAGE_SLOT

================================================== STORAGE =================================================

Unique identifier for the storage slot where the Layout struct is stored. Derived from the ERC7201 formula. STORAGE_SLOT: 0x8d2866e4d6c3af7a2dc06ef06ea667fbd60b4e79de15bcf1a662881ae2fbc900

INDEX_OF_INTERFERENCE_STATE

uint256 INDEX_OF_INTERFERENCE_STATE

Index of interference state (which is always 0, because it is not an UNHAPPY_PATH state that oracles handles).

Layout

struct Layout {
  bool checkFromStart;
  address priceSetter;
  uint256 minimumProportionOverObligation;
  uint256 interferenceState;
  bytes4[] hookSelectorsForPrices;
  uint256[] statesForPrices;
  mapping(uint256 => bool) isStateSetByOracle;
  mapping(uint256 => struct LendingOracleFacetStorage.CampaignDetails) campaignDetails;
}

CampaignDetails

struct CampaignDetails {
  uint256 currentCollateralPrice;
  uint256 lastIndexSet;
  uint256[] proportionsOverObligation;
  uint256[] priceLimits;
}

layout

function layout() internal pure returns (struct LendingOracleFacetStorage.Layout l)

Retrieves a reference to the Layout struct stored at a specified storage slot

initLendingOracleFacet

function initLendingOracleFacet(struct LendingOracleFacetStorage.Layout l, bytes initLendingOracleData) internal

setAndCheckLendingOracleFacet

function setAndCheckLendingOracleFacet(struct LendingOracleFacetStorage.Layout l, bytes setAndCheckLendingOracleData) internal returns (uint256, uint256[])

setPriceLimitsOnPostReceive

function setPriceLimitsOnPostReceive(struct LendingOracleFacetStorage.Layout l, uint256 campaignId) internal

setCollateralPrice

function setCollateralPrice(struct LendingOracleFacetStorage.Layout l, uint256 campaignId, uint256 collateralPrice) internal

removeMarginFromPriceLimits

function removeMarginFromPriceLimits(struct LendingOracleFacetStorage.Layout l, uint256 campaignId, uint256 packetsMarginAmount) internal

execute

function execute(bytes4 selectorToExecute, uint256 campaignId) internal returns (bool returnValue)

checkDifferenceBetweenPriceAndCurrentPriceLevel

function checkDifferenceBetweenPriceAndCurrentPriceLevel(struct LendingOracleFacetStorage.Layout l, uint256 campaignId) internal view returns (uint256)

getRemainingObligation

function getRemainingObligation(struct LendingOracleFacetStorage.Layout l, uint256 campaignId) internal view returns (uint256)