View Source: contracts/DefaultPool.sol
↗ Extends: DefaultPoolStorage, CheckContract, IDefaultPool
DefaultPool
Events
event TroveManagerAddressChanged(address _newTroveManagerAddress);
event DefaultPoolZUSDDebtUpdated(uint256 _ZUSDDebt);
event DefaultPoolETHBalanceUpdated(uint256 _ETH);
- setAddresses(address _troveManagerAddress, address _activePoolAddress)
- getETH()
- getZUSDDebt()
- sendETHToActivePool(uint256 _amount)
- increaseZUSDDebt(uint256 _amount)
- decreaseZUSDDebt(uint256 _amount)
- _requireCallerIsActivePool()
- _requireCallerIsTroveManager()
- constructor()
function setAddresses(address _troveManagerAddress, address _activePoolAddress) external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
_troveManagerAddress | address | |
_activePoolAddress | address |
Source Code
function setAddresses(
address _troveManagerAddress,
address _activePoolAddress
)
external
onlyOwner
{
checkContract(_troveManagerAddress);
checkContract(_activePoolAddress);
troveManagerAddress = _troveManagerAddress;
activePoolAddress = _activePoolAddress;
emit TroveManagerAddressChanged(_troveManagerAddress);
emit ActivePoolAddressChanged(_activePoolAddress);
}
function getETH() external view
returns(uint256)
Source Code
function getETH() external view override returns (uint) {
return ETH;
}
function getZUSDDebt() external view
returns(uint256)
Source Code
function getZUSDDebt() external view override returns (uint) {
return ZUSDDebt;
}
function sendETHToActivePool(uint256 _amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_amount | uint256 |
Source Code
function sendETHToActivePool(uint _amount) external override {
_requireCallerIsTroveManager();
address activePool = activePoolAddress; // cache to save an SLOAD
ETH = ETH.sub(_amount);
emit DefaultPoolETHBalanceUpdated(ETH);
emit EtherSent(activePool, _amount);
(bool success, ) = activePool.call{ value: _amount }("");
require(success, "DefaultPool: sending ETH failed");
}
function increaseZUSDDebt(uint256 _amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_amount | uint256 |
Source Code
function increaseZUSDDebt(uint _amount) external override {
_requireCallerIsTroveManager();
ZUSDDebt = ZUSDDebt.add(_amount);
emit DefaultPoolZUSDDebtUpdated(ZUSDDebt);
}
function decreaseZUSDDebt(uint256 _amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_amount | uint256 |
Source Code
function decreaseZUSDDebt(uint _amount) external override {
_requireCallerIsTroveManager();
ZUSDDebt = ZUSDDebt.sub(_amount);
emit DefaultPoolZUSDDebtUpdated(ZUSDDebt);
}
function _requireCallerIsActivePool() internal view
Source Code
function _requireCallerIsActivePool() internal view {
require(msg.sender == activePoolAddress, "DefaultPool: Caller is not the ActivePool");
}
function _requireCallerIsTroveManager() internal view
Source Code
function _requireCallerIsTroveManager() internal view {
require(msg.sender == troveManagerAddress, "DefaultPool: Caller is not the TroveManager");
}
function () external payable
Source Code
receive() external payable {
_requireCallerIsActivePool();
ETH = ETH.add(msg.value);
emit DefaultPoolETHBalanceUpdated(ETH);
}
- 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