// Source: contracts/interfaces/IOperators.sol pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT // File contracts/interfaces/IContractExecutor.sol /** * @title IContractExecutor Interface * @notice This interface defines the execute function used to interact with external contracts. */ interface IContractExecutor { /** * @notice Executes a call to an external contract. * @dev Execution logic is left up to the implementation. * @param target The address of the contract to be called * @param callData The calldata to be sent * @param nativeValue The amount of native token (e.g., Ether) to be sent along with the call * @return bytes The data returned from the executed call */ function executeContract( address target, bytes calldata callData, uint256 nativeValue ) external payable returns (bytes memory); } // File contracts/interfaces/IOwnable.sol /** * @title IOwnable Interface * @notice IOwnable is an interface that abstracts the implementation of a * contract with ownership control features. It's commonly used in upgradable * contracts and includes the functionality to get current owner, transfer * ownership, and propose and accept ownership. */ interface IOwnable { error NotOwner(); error InvalidOwner(); error InvalidOwnerAddress(); event OwnershipTransferStarted(address indexed newOwner); event OwnershipTransferred(address indexed newOwner); /** * @notice Returns the current owner of the contract. * @return address The address of the current owner */ function owner() external view returns (address); /** * @notice Returns the address of the pending owner of the contract. * @return address The address of the pending owner */ function pendingOwner() external view returns (address); /** * @notice Transfers ownership of the contract to a new address * @param newOwner The address to transfer ownership to */ function transferOwnership(address newOwner) external; /** * @notice Proposes to transfer the contract's ownership to a new address. * The new owner needs to accept the ownership explicitly. * @param newOwner The address to transfer ownership to */ function proposeOwnership(address newOwner) external; /** * @notice Transfers ownership to the pending owner. * @dev Can only be called by the pending owner */ function acceptOwnership() external; } // File contracts/interfaces/IOperators.sol /** * @title IOperators Interface * @notice Interface for an access control mechanism where operators have exclusive * permissions to execute functions. */ interface IOperators is IOwnable, IContractExecutor { error NotOperator(); error InvalidOperator(); error OperatorAlreadyAdded(); error NotAnOperator(); error ExecutionFailed(); event OperatorAdded(address indexed operator); event OperatorRemoved(address indexed operator); /** * @notice Check if an account is an operator. * @param account Address of the account to check * @return bool True if the account is an operator, false otherwise */ function isOperator(address account) external view returns (bool); /** * @notice Adds an operator. * @param operator The address to add as an operator */ function addOperator(address operator) external; /** * @notice Removes an operator. * @param operator The address of the operator to remove */ function removeOperator(address operator) external; /** * @notice Executes an external contract call. * @dev Execution logic is left up to the implementation. * @param target The contract to call * @param callData The data to call the target contract with * @param nativeValue The amount of native asset to send with the call * @return bytes The data returned from the contract call */ function executeContract( address target, bytes calldata callData, uint256 nativeValue ) external payable returns (bytes memory); }