CollateralJoinFactory

Git Source

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

NameTypeDescription
_safeEngineaddressAddress of the SAFEEngine contract

deployCollateralJoin

Deploys a CollateralJoinChild contract

function deployCollateralJoin(
  bytes32 _cType,
  address _collateral
) external isAuthorized whenEnabled returns (ICollateralJoin _collateralJoin);

Parameters

NameTypeDescription
_cTypebytes32Bytes32 representation of the collateral type
_collateraladdressAddress of the ERC20 collateral token

Returns

NameTypeDescription
_collateralJoinICollateralJoinAddress 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

NameTypeDescription
_cTypebytes32Bytes32 representation of the collateral type
_collateraladdressAddress of the ERC20Votes collateral token
_delegateeaddressAddress to whom the deployed child will delegate the voting power to

Returns

NameTypeDescription
_collateralJoinICollateralJoinAddress 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

NameTypeDescription
_cTypebytes32Bytes32 representation of the collateral type

collateralTypesList

Getter for the list of collateral types

function collateralTypesList() external view returns (bytes32[] memory _collateralTypesList);

Returns

NameTypeDescription
_collateralTypesListbytes32[]List of collateral types

collateralJoinsList

Getter for the list of CollateralJoin contracts

function collateralJoinsList() external view returns (address[] memory _collateralJoinsList);

Returns

NameTypeDescription
_collateralJoinsListaddress[]List of CollateralJoin contracts