CollateralAuctionHouseFactory
Inherits: Authorizable, Modifiable, ModifiablePerCollateral, Disableable, ICollateralAuctionHouseFactory
This contract is used to deploy CollateralAuctionHouse contracts
The deployed contracts are CollateralAuctionHouseChild instances
State Variables
safeEngine
Address of the SAFEEngine contract
address public safeEngine;
liquidationEngine
Address of the LiquidationEngine contract
address public liquidationEngine;
oracleRelayer
Address of the OracleRelayer contract
address public oracleRelayer;
collateralAuctionHouses
Getter for the address of the CollateralAuctionHouse contract associated with a collateral type
mapping(bytes32 _cType => address) public collateralAuctionHouses;
Functions
cParams
Getter for the collateral parameters struct
function cParams(bytes32 _cType)
external
view
returns (ICollateralAuctionHouse.CollateralAuctionHouseParams memory _cahParams);
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Bytes32 representation of the collateral type |
Returns
Name | Type | Description |
---|---|---|
_cahParams | ICollateralAuctionHouse.CollateralAuctionHouseParams | CollateralAuctionHouse parameters struct |
_cParams
Getter for the unpacked collateral parameters struct
function _cParams(bytes32 _cType)
external
view
returns (uint256 _minimumBid, uint256 _minDiscount, uint256 _maxDiscount, uint256 _perSecondDiscountUpdateRate);
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Bytes32 representation of the collateral type |
Returns
Name | Type | Description |
---|---|---|
_minimumBid | uint256 | Minimum bid for the collateral auctions [wad] |
_minDiscount | uint256 | Minimum discount for the collateral auctions [wad %] |
_maxDiscount | uint256 | Maximum discount for the collateral auctions [wad %] |
_perSecondDiscountUpdateRate | uint256 | Per second rate at which the discount is updated [ray] |
constructor
Adds authorization to the LiquidationEngine (extended to all child contracts)
constructor(
address _safeEngine,
address _liquidationEngine,
address _oracleRelayer
) Authorizable(msg.sender) validParams;
Parameters
Name | Type | Description |
---|---|---|
_safeEngine | address | Address of the SAFEEngine contract |
_liquidationEngine | address | Address of the LiquidationEngine contract |
_oracleRelayer | address | Address of the OracleRelayer contract |
collateralAuctionHousesList
Getter for the list of CollateralAuctionHouse contracts
function collateralAuctionHousesList() external view returns (address[] memory _collateralAuctionHousesList);
Returns
Name | Type | Description |
---|---|---|
_collateralAuctionHousesList | address[] | _collateralAuctionHouses List of CollateralAuctionHouse contracts |
_initializeCollateralType
function _initializeCollateralType(bytes32 _cType, bytes memory _collateralParams) internal override whenEnabled;
_modifyParameters
Internal function to be overriden with custom logic to modify parameters
This function is set to revert if not overriden
function _modifyParameters(bytes32 _param, bytes memory _data) internal override;
_modifyParameters
Set a new value for a collateral specific parameter
function _modifyParameters(bytes32 _cType, bytes32 _param, bytes memory _data) internal override;
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | String identifier of the collateral to modify |
_param | bytes32 | String identifier of the parameter to modify |
_data | bytes | Encoded data to modify the parameter |
_setLiquidationEngine
Sets the LiquidationEngine contract address, revoking the previous, and granting the new one authorization
function _setLiquidationEngine(address _newLiquidationEngine) internal;
_validateParameters
Internal function to be overriden with custom logic to validate parameters
function _validateParameters() internal view override;