CollateralAuctionHouseFactory

Git Source

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

NameTypeDescription
_cTypebytes32Bytes32 representation of the collateral type

Returns

NameTypeDescription
_cahParamsICollateralAuctionHouse.CollateralAuctionHouseParamsCollateralAuctionHouse 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

NameTypeDescription
_cTypebytes32Bytes32 representation of the collateral type

Returns

NameTypeDescription
_minimumBiduint256Minimum bid for the collateral auctions [wad]
_minDiscountuint256Minimum discount for the collateral auctions [wad %]
_maxDiscountuint256Maximum discount for the collateral auctions [wad %]
_perSecondDiscountUpdateRateuint256Per 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

NameTypeDescription
_safeEngineaddressAddress of the SAFEEngine contract
_liquidationEngineaddressAddress of the LiquidationEngine contract
_oracleRelayeraddressAddress of the OracleRelayer contract

collateralAuctionHousesList

Getter for the list of CollateralAuctionHouse contracts

function collateralAuctionHousesList() external view returns (address[] memory _collateralAuctionHousesList);

Returns

NameTypeDescription
_collateralAuctionHousesListaddress[]_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

NameTypeDescription
_cTypebytes32String identifier of the collateral to modify
_parambytes32String identifier of the parameter to modify
_databytesEncoded 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;