CollateralJoinFactory
Inherits: Authorizable, Disableable, ICollateralJoinFactory
This contract is used to deploy CollateralJoin contracts
The deployed contracts are CollateralJoinChild or CollateralJoinDelegatableChild instances
State Variables
safeEngine
Address of the SAFEEngine contract
address public safeEngine;
_collateralTypes
The enumerable set of deployed CollateralJoin contracts
EnumerableSet.Bytes32Set internal _collateralTypes;
collateralJoins
Getter for the address of the CollateralJoin contract associated with a collateral type
mapping(bytes32 _cType => address _collateralJoin) public collateralJoins;
Functions
constructor
constructor(address _safeEngine) Authorizable(msg.sender);
Parameters
Name | Type | Description |
---|---|---|
_safeEngine | address | Address of the SAFEEngine contract |
deployCollateralJoin
Deploys a CollateralJoinChild contract
function deployCollateralJoin(
bytes32 _cType,
address _collateral
) external isAuthorized whenEnabled returns (ICollateralJoin _collateralJoin);
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Bytes32 representation of the collateral type |
_collateral | address | Address of the ERC20 collateral token |
Returns
Name | Type | Description |
---|---|---|
_collateralJoin | ICollateralJoin | Address of the deployed CollateralJoinChild contract |
deployDelegatableCollateralJoin
Deploys a CollateralJoinDelegatableChild contract
function deployDelegatableCollateralJoin(
bytes32 _cType,
address _collateral,
address _delegatee
) external isAuthorized whenEnabled returns (ICollateralJoin _collateralJoin);
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Bytes32 representation of the collateral type |
_collateral | address | Address of the ERC20Votes collateral token |
_delegatee | address | Address to whom the deployed child will delegate the voting power to |
Returns
Name | Type | Description |
---|---|---|
_collateralJoin | ICollateralJoin | Address of the deployed CollateralJoinDelegatableChild contract |
disableCollateralJoin
Disables a CollateralJoin contract and removes it from the collateral types list
Allows the deployment of other CollateralJoin contract for the same collateral type
function disableCollateralJoin(bytes32 _cType) external isAuthorized;
Parameters
Name | Type | Description |
---|---|---|
_cType | bytes32 | Bytes32 representation of the collateral type |
collateralTypesList
Getter for the list of collateral types
function collateralTypesList() external view returns (bytes32[] memory _collateralTypesList);
Returns
Name | Type | Description |
---|---|---|
_collateralTypesList | bytes32[] | List of collateral types |
collateralJoinsList
Getter for the list of CollateralJoin contracts
function collateralJoinsList() external view returns (address[] memory _collateralJoinsList);
Returns
Name | Type | Description |
---|---|---|
_collateralJoinsList | address[] | List of CollateralJoin contracts |