DeployManager

Git Source

Inherits: IDeployManager, Ownable, ERC165

Author: Solidity University

Allows users to deploy utility contracts by cloning registered templates.

Uses OpenZeppelin's Clones and Ownable; assumes templates implement IUtilityContract.

State Variables

deployedContracts

mapping(address => address[]) public deployedContracts;

contractsData

mapping(address => ContractInfo) public contractsData;

Functions

constructor

constructor() payable Ownable(msg.sender);

deploy

Deploys a new utility contract

Emits NewDeployment event

function deploy(address _utilityContract, bytes calldata _initData) external payable override 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 override onlyOwner;

updateFee

function updateFee(address _contractAddress, uint256 _newFee) external override onlyOwner;

deactivateContract

function deactivateContract(address _address) external override onlyOwner;

activateContract

function activateContract(address _address) external override onlyOwner;

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool);

Structs

ContractInfo

struct ContractInfo {
    uint256 fee;
    bool isActive;
    uint256 registredAt;
}