diff --git a/contracts/interfaces/IGreeter.sol b/contracts/interfaces/IGreeter.sol new file mode 100644 index 0000000..11ca4be --- /dev/null +++ b/contracts/interfaces/IGreeter.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +/** + * @title IGreeter + * @dev Interface for the Greeter contract defining core interaction methods + */ +interface IGreeter { + /// @notice Emitted when a greeting is updated + event GreetingChanged(address indexed updater, string newGreeting); + + /// @notice Thrown when an unauthorized address attempts to modify the greeting + error UnauthorizedGreetingModification(address caller); + + /** + * @notice Retrieves the current stored greeting + * @return The current greeting string + */ + function getGreeting() external view returns (string memory); + + /** + * @notice Updates the greeting with optional authorization checks + * @param newGreeting The new greeting message to set + * @param nonce A unique transaction identifier to prevent replay attacks + * @param signature Optional cryptographic signature for advanced authorization + */ + function updateGreeting( + string calldata newGreeting, + uint256 nonce, + bytes calldata signature + ) external; + + /** + * @notice Checks if an address has greeting modification permissions + * @param account The address to check for authorization + * @return Boolean indicating whether the address can modify greetings + */ + function isAuthorizedGreeter(address account) external view returns (bool); + + /** + * @notice Retrieves the contract's creation timestamp + * @return The block timestamp when the contract was deployed + */ + function getDeploymentTimestamp() external view returns (uint256); +} \ No newline at end of file