BookKeeper
https://github.com/Into-the-Fathom/fathom-stablecoin-smart-contracts/blob/master/contracts/main/stablecoin-core/BookKeeper.sol
Structs
CollateralPool: Contains detailed metrics and settings for each collateral pool, including debt shares, rates, ceilings, and specific fees.
CollateralPool: Contains detailed metrics and settings for each collateral pool, including debt shares, rates, ceilings, and specific fees.CollateralPoolInfo: Simplified version focused on essential metrics like debt rate, total debt share, and debt ceilings.
CollateralPoolInfo: Simplified version focused on essential metrics like debt rate, total debt share, and debt ceilings.Position: Structure representing individual positions within the collateral pools, focused on collateral and debt metrics.
Position: Structure representing individual positions within the collateral pools, focused on collateral and debt metrics.State Variables
positions
positionscollateralToken
collateralTokenstablecoin
stablecoinsystemBadDebt
systemBadDebtpoolStablecoinIssued
poolStablecoinIssuedpositionWhitelist
positionWhitelistSet Functions
setPriceWithSafetyMargin(bytes32 collateralPoolId, uint256 priceWithSafetyMargin)
setPriceWithSafetyMargin(bytes32 collateralPoolId, uint256 priceWithSafetyMargin)setTotalDebtShare(bytes32 collateralPoolId, uint256 totalDebtShare)
setTotalDebtShare(bytes32 collateralPoolId, uint256 totalDebtShare)setDebtAccumulatedRate(bytes32 collateralPoolId, uint256 debtAccumulatedRate)
setDebtAccumulatedRate(bytes32 collateralPoolId, uint256 debtAccumulatedRate)setPositionDebtCeiling(bytes32 collateralPoolId, uint256 positionDebtCeiling)
setPositionDebtCeiling(bytes32 collateralPoolId, uint256 positionDebtCeiling)updateLastAccumulationTime(bytes32 collateralPoolId)
updateLastAccumulationTime(bytes32 collateralPoolId)collateralPools(bytes32 collateralPoolId)
collateralPools(bytes32 collateralPoolId)getTotalDebtShare(bytes32 collateralPoolId)
getTotalDebtShare(bytes32 collateralPoolId)getDebtAccumulatedRate(bytes32 collateralPoolId)
getDebtAccumulatedRate(bytes32 collateralPoolId)getPriceWithSafetyMargin(bytes32 collateralPoolId)
getPriceWithSafetyMargin(bytes32 collateralPoolId)getDebtCeiling(bytes32 collateralPoolId)
getDebtCeiling(bytes32 collateralPoolId)getDebtFloor(bytes32 collateralPoolId)
getDebtFloor(bytes32 collateralPoolId)getPositionDebtCeiling(bytes32 collateralPoolId)
getPositionDebtCeiling(bytes32 collateralPoolId)getPriceFeed(bytes32 collateralPoolId)
getPriceFeed(bytes32 collateralPoolId)getLiquidationRatio(bytes32 collateralPoolId)
getLiquidationRatio(bytes32 collateralPoolId)getStabilityFeeRate(bytes32 collateralPoolId)
getStabilityFeeRate(bytes32 collateralPoolId)getLastAccumulationTime(bytes32 collateralPoolId)
getLastAccumulationTime(bytes32 collateralPoolId)getAdapter(bytes32 collateralPoolId)
getAdapter(bytes32 collateralPoolId)getCloseFactorBps(bytes32 collateralPoolId)
getCloseFactorBps(bytes32 collateralPoolId)Events
LogSetTotalDebtCeiling
LogSetTotalDebtCeilingLogSetAccessControlConfig
LogSetAccessControlConfigLogSetCollateralPoolConfig
LogSetCollateralPoolConfigLogAdjustPosition
LogAdjustPositionLogAddCollateral
LogAddCollateralLogMoveCollateral
LogMoveCollateralLogMoveStablecoin
LogMoveStablecoinStablecoinIssuedAmount
StablecoinIssuedAmountRole Management
Events
RoleAdminChanged: Emitted when there is a change in the administration of a role within the system.
RoleAdminChanged: Emitted when there is a change in the administration of a role within the system.RoleGranted: Indicates that a role has been granted to an account.
RoleGranted: Indicates that a role has been granted to an account.RoleRevoked: Signals that a role has been revoked from an account.
RoleRevoked: Signals that a role has been revoked from an account.Functions
hasRole(bytes32 role, address account)
hasRole(bytes32 role, address account)getRoleAdmin(bytes32 role)
getRoleAdmin(bytes32 role)grantRole(bytes32 role, address account)
grantRole(bytes32 role, address account)revokeRole(bytes32 role, address account)
revokeRole(bytes32 role, address account)renounceRole(bytes32 role, address account)
renounceRole(bytes32 role, address account)Last updated