-
Notifications
You must be signed in to change notification settings - Fork 7
DDHubBase
senamakel edited this page Aug 26, 2024
·
1 revision
This is the main contract responsible for managing pools.
Has permissions to mint/burn ZAI
contract IStablecoin zaiThe ZAI stablecoin contract
bytes32 RISK_ROLEThe risk manager role
bytes32 EXECUTOR_ROLEThe executor role
address feeCollectorThe fee collector address
uint256 globalDebtCeilingThe total debt ceiling for all pools
| Name | Type | Description |
|---|
mapping(contract IDDPool => struct IDDHub.PoolInfo) _poolInfosfunction initialize(address _feeCollector, uint256 _globalDebtCeiling, address _zai, address _governance) externalInitializes the contract
| Name | Type | Description |
|---|---|---|
| _feeCollector | address | The address to send fees to |
| _globalDebtCeiling | uint256 | The global debt ceiling |
| _zai | address | The ZAI stablecoin contract |
| _governance | address | The governance contract for ownership |
function poolInfos(contract IDDPool pool) external view returns (struct IDDHub.PoolInfo info)The pool info for a given pool
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to get the info for |
| Name | Type | Description |
|---|---|---|
| info | struct IDDHub.PoolInfo | The pool info |
function isPool(address pool) external view returns (bool what)Checks if a pool is registered
| Name | Type | Description |
|---|---|---|
| pool | address | The pool to check |
function exec(contract IDDPool pool) externalExecutes the actions for a pool
This is a permission-less function
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to execute actions for |
function registerPool(contract IDDPool pool, contract IDDPlan plan, uint256 debtCeiling) externalRegisters a pool
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to register |
| plan | contract IDDPlan | The plan to use for the pool |
| debtCeiling | uint256 | The debt ceiling for the pool |
function reduceDebtCeiling(contract IDDPool pool, uint256 amountToReduce) externalReduces the debt ceiling for a pool
Callable by the risk manager only
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to reduce the debt ceiling for |
| amountToReduce | uint256 | The amount to reduce the debt ceiling by |
function setDebtCeiling(contract IDDPool pool, uint256 amount) externalSets the debt ceiling for a pool
Callable by the governance only
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to set the debt ceiling for |
| amount | uint256 | The new debt ceiling |
function setFeeCollector(address who) externalSets the fee collector
Callable by governance only
| Name | Type | Description |
|---|---|---|
| who | address | The new fee collector |
function setGlobalDebtCeiling(uint256 amount) externalSets the global debt ceiling
Callable by governance only
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The new global debt ceiling |
function shutdownPool(contract IDDPool pool) externalShuts down a pool
Callable by governance only
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to shutdown |
function sweepFees(contract IDDPool pool) externalSweeps fees from a specific pool
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to sweep fees for |
function evaluatePoolAction(contract IDDPool pool) public view returns (uint256 toWithdraw, uint256 toSupply)Evaluates the actions to take for a pool
| Name | Type | Description |
|---|---|---|
| pool | contract IDDPool | The pool to evaluate |
| Name | Type | Description |
|---|---|---|
| toWithdraw | uint256 | The amount of ZAI to withdraw |
| toSupply | uint256 | The amount of ZAI to supply |
function _mint(uint256 amount, address dest) internal virtualfunction _burn(uint256 amount, address dest) internal virtual