ModifiablePerCollateral
Inherits: Authorizable, IModifiablePerCollateral
Allows inheriting contracts to modify parameters values and initialize collateral types
Requires inheriting contracts to override _modifyParameters
virtual methods and implement _initializeCollateralType
State Variables
_collateralList
EnumerableSet.Bytes32Set internal _collateralList;
Functions
collateralList
List of all the collateral types registered in the OracleRelayer
function collateralList() external view returns (bytes32[] memory __collateralList);
Returns
Name | Type | Description |
---|---|---|
__collateralList | bytes32[] | Array of all the collateral types registered |
initializeCollateralType
Register a new collateral type in the SAFEEngine
function initializeCollateralType(
bytes32 _cType,
bytes memory _collateralParams
) public virtual isAuthorized validCParams(_cType);
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Collateral type to register |
_collateralParams | bytes | Collateral parameters |
modifyParameters
Set a new value for a collateral specific parameter
function modifyParameters(
bytes32 _cType,
bytes32 _param,
bytes memory _data
) external isAuthorized validCParams(_cType);
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 |
_modifyParameters
Set a new value for a collateral specific parameter
function _modifyParameters(bytes32 _cType, bytes32 _param, bytes memory _data) internal virtual;
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 |
_initializeCollateralType
Register a new collateral type in the SAFEEngine
function _initializeCollateralType(bytes32 _cType, bytes memory _collateralParams) internal virtual;
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Collateral type to register |
_collateralParams | bytes | Collateral parameters |
_validateCParameters
Internal function to be overriden with custom logic to validate collateral parameters
function _validateCParameters(bytes32 _cType) internal view virtual;
validCParams
Triggers a routine to validate collateral parameters after a modification
modifier validCParams(bytes32 _cType);