SingleSpotDebtCeilingSetter
is meant to recompute the debtCeiling
for a single collateral type inside the SAFEEngine
.
The setter inherits functionality from the IncreasingTreasuryReimbursement.manualSetters[usr: address]
- addManualSetter
/removeManualSetter
- auth mechanism for addresses that can call manualUpdateCeiling
maxCollateralCeiling
- the max amount of system coins that can be generated using the collateral type with collateralName
minCollateralCeiling
- the min amount of system coins that must be generated using the collateral type with collateralName
ceilingPercentageChange
- premium on top of the current amount of debt (backed by the collateral type with collateralName
) minted. This is used to calculate a new ceilinglastUpdateTime
- when the debt ceiling was last updatedupdateDelay
- enforced time gap between callslastManualUpdateTime
- last timestamp of a manual updateblockIncreaseWhenRevalue
- flag that blocks an increase in the debt ceiling when the redemption rate is positiveblockDecreaseWhenDevalue
- flag that blocks a decrease in the debt ceiling when the redemption rate is negativecollateralName
- the targeted collateral's namesafeEngine
- the SAFEEngine
contractoracleRelayer
- the OracleRelayer
contractmodifyParameters
- modifies contract parametersautoUpdateCeiling(feeReceiver: address) external
- periodically updates the debt ceiling for the collateral type with collateralName
. Can be called by anyonemanualUpdateCeiling()
- authed function that allows manualSetters
to update the debt ceiling whenever they wantgetNextCollateralCeiling() public view returns (uint256)
- view function meant to return the new and upcoming debt ceiling. It also checks for allowsIncrease
and allowsDecrease
getRawUpdatedCeiling() external view returns (uint256)
- view function meant to return the new and upcoming debt ceiling. It does not perform checks for allowsIncrease
and allowsDecrease
allowsIncrease(redemptionRate: uint256
, currentDebtCeiling: uint256
, updatedCeiling: uint256) public view returns (allowsIncrease: bool)
- view function meant to return whether an increase in the debt ceiling is currently allowedallowsDecrease(redemptionRate: uint256
, currentDebtCeiling: uint256
, updatedCeiling: uint256) public view returns (allowsDecrease: bool)
- view function meant to return whether a decrease in the debt ceiling is currently allowedisManualSetter
- checks whether an address is part of manualSetters
.AddManualSetter
- emitted when a new manual setter is added. Contains:account
- new manual setter addressRemoveManualSetter
- emitted when a manual setter address is removed/blacklisted. Contains:account
- the setter address that's removedUpdateCeiling
- emitted when a new ceiling is computed and set. Contains:nextCeiling
- the new ceilingautoUpdateCeiling
and manualUpdateCeiling
can both be used to recompute the debt ceiling for the collateral type with collateralName, although manualUpdateCeiling
can only be called by whitelisted manualSetters
. Both autoUpdateCeiling
and manualUpdateCeiling
call getNextCollateralCeiling
to calculate the new ceiling.getNextCollateralCeiling
takes into account allowsIncrease
and allowsDecrease
to determine whether it is allowed to computed a higher or a lower ceiling (compared to the current one).allowsIncrease
and allowsDecrease
look at the current redemptionRate
as well as at blockIncreaseWhenRevalue
and blockDecreaseWhenDevalue
to see whether they should allow or disallow an increase or decrease in the debt ceiling. blockIncreaseWhenRevalue
and blockDecreaseWhenDevalue
are by default set to zero so increases or decreases are always allowed, no matter what sign the redemption rate has.