// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "../../contract-registry/IContractEntity.sol"; interface ITaxStrategyRegistry is IContractEntity { /** * @dev Thrown when tax controller does not implement the required interface. */ error InvalidTaxControllerInterface(); /** * @dev Thrown when the tax cannot be processed by the specific controller due to the tax strategy ID * mismatch. * @param provided Provided tax strategy ID. * @param required Required tax strategy ID. */ error TaxStrategyMismatch(bytes4 provided, bytes4 required); /** * @dev Thrown upon attempting to register a tax strategy twice. * @param taxStrategyId Duplicate taxation strategy ID. */ error TaxStrategyIsAlreadyRegistered(bytes4 taxStrategyId); /** * @dev Thrown upon attempting to work with non-existent tax strategy. * @param taxStrategyId Taxation strategy ID. */ error UnregisteredTaxStrategy(bytes4 taxStrategyId); /** * @dev Emitted when the new tax strategy has been registered. * @param taxStrategyId Tax strategy ID. * @param controller Controller address. */ event TaxStrategyRegistered(bytes4 indexed taxStrategyId, address indexed controller); /** * @dev Emitted when the tax strategy controller has been changed. * @param taxStrategyId Tax strategy ID. * @param newController Controller address. */ event TaxStrategyControllerChanged(bytes4 indexed taxStrategyId, address indexed newController); /** * @dev Tax strategy information. * @param controller Tax controller address. */ struct TaxStrategyConfig { address controller; } /** * @dev Registers new tax strategy. * @param taxStrategyId Tax strategy ID. * @param config Taxation strategy configuration. */ function registerTaxStrategy(bytes4 taxStrategyId, TaxStrategyConfig calldata config) external; /** * @dev Sets tax strategy controller. * @param taxStrategyId Tax strategy ID. * @param controller Tax controller address. */ function setTaxController(bytes4 taxStrategyId, address controller) external; /** * @dev Returns tax strategy controller. * @param taxStrategyId Tax strategy ID. * @return Tax controller address. */ function taxController(bytes4 taxStrategyId) external view returns (address); /** * @dev Returns tax strategy configuration. * @param taxStrategyId Tax strategy ID. * @return Tax strategy information. */ function taxStrategy(bytes4 taxStrategyId) external view returns (TaxStrategyConfig memory); /** * @dev Checks tax strategy registration. * @param taxStrategyId Listing strategy ID. */ function isRegisteredTaxStrategy(bytes4 taxStrategyId) external view returns (bool); /** * @dev Reverts if tax strategy is not registered. * @param taxStrategyId Listing strategy ID. */ function checkRegisteredTaxStrategy(bytes4 taxStrategyId) external view; }