ModifiablePerCollateral

Git Source

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

NameTypeDescription
__collateralListbytes32[]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

NameTypeDescription
_cTypebytes32Collateral type to register
_collateralParamsbytesCollateral 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

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

NameTypeDescription
_cTypebytes32String identifier of the collateral to modify
_parambytes32String identifier of the parameter to modify
_databytesEncoded data to modify the parameter

_initializeCollateralType

Register a new collateral type in the SAFEEngine

function _initializeCollateralType(bytes32 _cType, bytes memory _collateralParams) internal virtual;

Parameters

NameTypeDescription
_cTypebytes32Collateral type to register
_collateralParamsbytesCollateral 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);