View Source: contracts/Dependencies/LiquityBase.sol
↗ Extends: BaseMath, ILiquityBase ↘ Derived Contracts: BorrowerOperations, HintHelpers, StabilityPool, TroveManagerBase, TroveManagerBase1MinuteBootstrap
LiquityBase
Constants & Variables
uint256 public constant _100pct;
uint256 public constant ZUSD_GAS_COMPENSATION;
uint256 public constant MIN_NET_DEBT;
contract IActivePool public activePool;
contract IDefaultPool public defaultPool;
contract IPriceFeed public priceFeed;
contract ILiquityBaseParams public liquityBaseParams;
- _getCompositeDebt(uint256 _debt)
- _getNetDebt(uint256 _debt)
- _getCollGasCompensation(uint256 _entireColl)
- getEntireSystemColl()
- getEntireSystemDebt()
- _getTCR(uint256 _price)
- _checkRecoveryMode(uint256 _price)
- _requireUserAcceptsFee(uint256 _fee, uint256 _amount, uint256 _maxFeePercentage)
function _getCompositeDebt(uint256 _debt) internal pure
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
_debt | uint256 |
Source Code
function _getCompositeDebt(uint256 _debt) internal pure returns (uint256) {
return _debt.add(ZUSD_GAS_COMPENSATION);
}
function _getNetDebt(uint256 _debt) internal pure
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
_debt | uint256 |
Source Code
function _getNetDebt(uint256 _debt) internal pure returns (uint256) {
return _debt.sub(ZUSD_GAS_COMPENSATION);
}
function _getCollGasCompensation(uint256 _entireColl) internal view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
_entireColl | uint256 |
Source Code
function _getCollGasCompensation(uint256 _entireColl) internal view returns (uint256) {
return _entireColl / liquityBaseParams.PERCENT_DIVISOR();
}
function getEntireSystemColl() public view
returns(entireSystemColl uint256)
Source Code
function getEntireSystemColl() public view returns (uint256 entireSystemColl) {
uint256 activeColl = activePool.getETH();
uint256 liquidatedColl = defaultPool.getETH();
return activeColl.add(liquidatedColl);
}
function getEntireSystemDebt() public view
returns(entireSystemDebt uint256)
Source Code
function getEntireSystemDebt() public view returns (uint256 entireSystemDebt) {
uint256 activeDebt = activePool.getZUSDDebt();
uint256 closedDebt = defaultPool.getZUSDDebt();
return activeDebt.add(closedDebt);
}
function _getTCR(uint256 _price) internal view
returns(TCR uint256)
Arguments
Name | Type | Description |
---|---|---|
_price | uint256 |
Source Code
function _getTCR(uint256 _price) internal view returns (uint256 TCR) {
uint256 entireSystemColl = getEntireSystemColl();
uint256 entireSystemDebt = getEntireSystemDebt();
TCR = LiquityMath._computeCR(entireSystemColl, entireSystemDebt, _price);
return TCR;
}
function _checkRecoveryMode(uint256 _price) internal view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
_price | uint256 |
Source Code
function _checkRecoveryMode(uint256 _price) internal view returns (bool) {
uint256 TCR = _getTCR(_price);
return TCR < liquityBaseParams.CCR();
}
function _requireUserAcceptsFee(uint256 _fee, uint256 _amount, uint256 _maxFeePercentage) internal pure
Arguments
Name | Type | Description |
---|---|---|
_fee | uint256 | |
_amount | uint256 | |
_maxFeePercentage | uint256 |
Source Code
function _requireUserAcceptsFee(
uint256 _fee,
uint256 _amount,
uint256 _maxFeePercentage
) internal pure {
uint256 feePercentage = _fee.mul(DECIMAL_PRECISION).div(_amount);
require(feePercentage <= _maxFeePercentage, "Fee exceeded provided maximum");
}
- ActivePool
- ActivePoolStorage
- BaseMath
- BorrowerOperations
- BorrowerOperationsScript
- BorrowerOperationsStorage
- BorrowerWrappersScript
- CheckContract
- CollSurplusPool
- CollSurplusPoolStorage
- console
- Context
- DefaultPool
- DefaultPoolStorage
- DocsCover
- DSAuth
- DSAuthEvents
- DSAuthority
- DSNote
- DSProxy
- DSProxyCache
- DSProxyFactory
- ERC20
- ETHTransferScript
- FeeDistributor
- FeeDistributorStorage
- GasPool
- HintHelpers
- HintHelpersStorage
- IActivePool
- IBalanceRedirectPresale
- IBorrowerOperations
- ICollSurplusPool
- IDefaultPool
- IERC20
- IERC2612
- IExternalPriceFeed
- IFeeDistributor
- IFeeSharingProxy
- ILiquityBase
- ILiquityBaseParams
- IMasset
- IMoCBaseOracle
- Initializable
- IPool
- IPriceFeed
- IRSKOracle
- ISortedTroves
- IStabilityPool
- ITroveManager
- IWrbtc
- IZUSDToken
- LiquityBase
- LiquityBaseParams
- LiquityMath
- LiquitySafeMath128
- MoCMedianizer
- MultiTroveGetter
- MultiTroveGetterStorage
- NueToken
- Ownable
- PriceFeed
- PriceFeedStorage
- ProxiableContract
- ProxiableContract2
- Proxy
- RskOracle
- SafeMath
- SortedTroves
- SortedTrovesStorage
- StabilityPool
- StabilityPoolScript
- StabilityPoolStorage
- Storage
- Storage2
- TokenScript
- TroveManager
- TroveManagerBase
- TroveManagerBase1MinuteBootstrap
- TroveManagerRedeemOps
- TroveManagerScript
- TroveManagerStorage
- UpgradableProxy
- ZUSDToken
- ZUSDTokenStorage