IDeployManager

Git Source

Inherits: IERC165

Author: Solidity Univesity

This interface defines the functions, errors and events for the DeployManager contract.

Functions

deploy

Deploys a new utility contract

Emits NewDeployment event

function deploy(address _utilityContract, bytes calldata _initData) external payable returns (address);

Parameters

NameTypeDescription
_utilityContractaddressThe address of the utility contract template
_initDatabytesThe initialization data for the utility contract

Returns

NameTypeDescription
<none>addressThe address of the deployed utility contract

addNewContract

function addNewContract(address _contractAddress, uint256 _fee, bool _isActive) external;

updateFee

function updateFee(address _contractAddress, uint256 _newFee) external;

deactivateContract

function deactivateContract(address _contractAddress) external;

activateContract

function activateContract(address _contractAddress) external;

Events

NewContractAdded

Emitted when a new utility contract template is registered.

event NewContractAdded(address indexed _contractAddress, uint256 _fee, bool _isActive, uint256 _timestamp);

Parameters

NameTypeDescription
_contractAddressaddressAddress of the registered utility contract template.
_feeuint256Fee (in wei) required to deploy a clone of this contract.
_isActiveboolWhether the contract is active and deployable.
_timestampuint256Timestamp when the contract was added.

ContractFeeUpdated

event ContractFeeUpdated(address indexed _contractAddress, uint256 _oldFee, uint256 _newFee, uint256 _timestamp);

ContractStatusUpdated

event ContractStatusUpdated(address indexed _contractAddress, bool _isActive, uint256 _timestamp);

NewDeployment

event NewDeployment(address indexed _deployer, address indexed _contractAddress, uint256 _fee, uint256 _timestamp);

Errors

ContractNotActive

Reverts if the contract is not active

error ContractNotActive();

NotEnoughtFunds

Not enough funds to deploy the contract

error NotEnoughtFunds();

ContractDoesNotRegistered

Reverts if the contract is not registered

error ContractDoesNotRegistered();

InitializationFailed

Reverts if the .initialize() function fails

error InitializationFailed();

ContractIsNotUtilityContract

Reverts if the contract is not a utility contract

error ContractIsNotUtilityContract();