// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "../../../contract-registry/IContractEntity.sol"; interface IListingConfiguratorPresetFactory is IContractEntity { /** * @dev Thrown when the implementation does not support the IListingConfiguratorPreset interface */ error InvalidListingConfiguratorInterface(); /** * @dev Thrown when the ListingConfigurator preset id is already present in the storage. */ error DuplicateListingConfiguratorPresetId(bytes32 presetId); /** * @dev Thrown when the ListingConfigurator preset has been disabled, when it was expected for it to be enabled. */ error DisabledListingConfiguratorPreset(bytes32 presetId); /** * @dev Thrown when the ListingConfigurator preset has been enabled, when it was expected for it to be disabled. */ error EnabledListingConfiguratorPreset(bytes32 presetId); /** * @dev Thrown when it was expected for the ListingConfigurator preset to be registeredr. */ error ListingConfiguratorPresetNotRegistered(bytes32 presetId); /** * @dev Thrown when the provided preset initialization data is empty. */ error EmptyPresetData(); struct ListingConfiguratorPreset { bytes32 id; address implementation; bool enabled; } /** * @dev Emitted when new ListingConfigurator preset is added. */ event ListingConfiguratorPresetAdded(bytes32 indexed presetId, address indexed implementation); /** * @dev Emitted when a ListingConfigurator preset is enabled. */ event ListingConfiguratorPresetEnabled(bytes32 indexed presetId); /** * @dev Emitted when a ListingConfigurator preset is disabled. */ event ListingConfiguratorPresetDisabled(bytes32 indexed presetId); /** * @dev Emitted when a ListingConfigurator preset is enabled. */ event ListingConfiguratorPresetRemoved(bytes32 indexed presetId); /** * @dev Emitted when a ListingConfigurator preset is deployed. */ event ListingConfiguratorPresetDeployed(bytes32 indexed presetId, address indexed listingConfigurator); /** * @dev Stores the association between `presetId` and `implementation` address. * NOTE: ListingConfigurator `implementation` must be deployed beforehand. * @param presetId ListingConfigurator preset id. * @param implementation ListingConfigurator implementation address. */ function addPreset(bytes32 presetId, address implementation) external; /** * @dev Removes the association between `presetId` and its implementation. * @param presetId ListingConfigurator preset id. */ function removePreset(bytes32 presetId) external; /** * @dev Enables ListingConfigurator preset, which makes it deployable. * @param presetId ListingConfigurator preset id. */ function enablePreset(bytes32 presetId) external; /** * @dev Disable ListingConfigurator preset, which makes non-deployable. * @param presetId ListingConfigurator preset id. */ function disablePreset(bytes32 presetId) external; /** * @dev Deploys a new ListingConfigurator from the preset identified by `presetId`. * @param presetId ListingConfigurator preset id. * @param initData ListingConfigurator initialization payload. * @return Deployed ListingConfigurator address. */ function deployPreset(bytes32 presetId, bytes calldata initData) external returns (address); /** * @dev Checks whether ListingConfigurator preset is enabled and available for deployment. * @param presetId ListingConfigurator preset id. */ function presetEnabled(bytes32 presetId) external view returns (bool); /** * @dev Returns the list of all registered ListingConfigurator presets. */ function presets() external view returns (ListingConfiguratorPreset[] memory); /** * @dev Returns the ListingConfigurator preset details. * @param presetId ListingConfigurator preset id. */ function preset(bytes32 presetId) external view returns (ListingConfiguratorPreset memory); }