Fraction ProtocolinternalFacetsbuybackPhaseFacetsbuybackAmountFacetsfixedInterest

FixedInterestBuybackAmountFacetStorage

FixedInterestBuybackAmountFacetStorage

AlreadyInitialized

error AlreadyInitialized()

Thrown when attempting to re-initialize.

MinPercentageGreaterThanMax

error MinPercentageGreaterThanMax(uint256 minInterestPercentage, uint256 maxInterestPercentage)

Thrown when min percentage is greater than max.

InterestPercentageNotWithinLimits

error InterestPercentageNotWithinLimits(uint256 interestPercentage)

Thrown when interest percentage is not within the supported limits.

WrongBuybackAmount

error WrongBuybackAmount(uint256 requiredBuybackAmount, uint256 buybackAmount)

Thrown when buybackAmount is not equal to required one.

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: 0xc7af75288b482e955cf63ed727aba6946f12b51f055b5042bf806d79b1d92c00

Layout

struct Layout {
  bool isInitialized;
  uint256 minInterestPercentage;
  uint256 maxInterestPercentage;
  mapping(uint256 => uint256) interestPercentageForId;
}

layout

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

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

initBuybackAmountFacet

function initBuybackAmountFacet(struct FixedInterestBuybackAmountFacetStorage.Layout l, bytes initBuybackAmountData) internal returns (uint256, uint256)

setAndCheckBuybackAmounts

function setAndCheckBuybackAmounts(struct FixedInterestBuybackAmountFacetStorage.Layout l, bytes postFractionsInterestPercentageData) internal returns (uint256, uint256)

handleBuybackAmounts

function handleBuybackAmounts(struct FixedInterestBuybackAmountFacetStorage.Layout l, uint256 campaignId, uint256 packetsBuybackAmount) internal

getPacketsBuybackAmount

function getPacketsBuybackAmount(struct FixedInterestBuybackAmountFacetStorage.Layout l, uint256 campaignId) internal view returns (uint256 requiredPacketsBuybackAmount)

This function is only called by Lending Oracle when the setPriceLimitsOnPostReceive hook is invoked.

Parameters

NameTypeDescription
lstruct FixedInterestBuybackAmountFacetStorage.LayoutA reference to the Layout struct in storage.
campaignIduint256The ID of the targeted campaign.

setMinInterestPercentage

function setMinInterestPercentage(struct FixedInterestBuybackAmountFacetStorage.Layout l, uint256 minInterestPercentage) internal

Function that sets the minimum interest percentage.

This function is only callable by the admin.

Parameters

NameTypeDescription
lstruct FixedInterestBuybackAmountFacetStorage.Layout
minInterestPercentageuint256The minimum interest percentage.

setMaxInterestPercentage

function setMaxInterestPercentage(struct FixedInterestBuybackAmountFacetStorage.Layout l, uint256 maxInterestPercentage) internal

Function that sets the maximum interest percentage.

This function is only callable by the admin.

Parameters

NameTypeDescription
lstruct FixedInterestBuybackAmountFacetStorage.Layout
maxInterestPercentageuint256The maximum interest percentage.

_getObligationPerFraction

function _getObligationPerFraction(struct FixedInterestBuybackAmountFacetStorage.Layout l, uint256 campaignId) internal view returns (uint256)