{"language":"Solidity","sources":{"SokoGuestbook.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.29;\n\n/**\n * @title SokoGuestbook\n * @notice Simple guestbook: anyone can write a message stored with their address and timestamp.\n * @dev Minimal and gas-conscious. Uses calldata for input and stores timestamp as uint64.\n */\ncontract SokoGuestbook {\n    /// @dev Single guestbook entry\n    struct Entry {\n        address author;\n        uint64 timestamp;\n        string message;\n    }\n\n    /// @dev All entries are stored in this dynamic array\n    Entry[] private entries;\n\n    /// @notice Emitted when a new message is written\n    event NewMessage(address indexed author, uint64 timestamp, string message);\n\n    /// @notice Write a message to the guestbook\n    /// @param message The message to store\n    function writeMessage(string calldata message) external {\n        // Store entry with compact timestamp type\n        entries.push(Entry({author: msg.sender, timestamp: uint64(block.timestamp), message: message}));\n        emit NewMessage(msg.sender, uint64(block.timestamp), message);\n    }\n\n    /// @notice Get number of messages stored\n    /// @return count Number of entries\n    function count() external view returns (uint256) {\n        return entries.length;\n    }\n\n    /// @notice Read all messages\n    /// @dev Returns three parallel arrays (authors, timestamps, messages)\n    /// @return authors Array of message authors\n    /// @return timestamps Array of timestamps (uint64)\n    /// @return messages Array of messages\n    function getAll() external view returns (address[] memory authors, uint64[] memory timestamps, string[] memory messages) {\n        uint256 len = entries.length;\n        authors = new address[](len);\n        timestamps = new uint64[](len);\n        messages = new string[](len);\n\n        for (uint256 i = 0; i < len; ++i) {\n            Entry storage e = entries[i];\n            authors[i] = e.author;\n            timestamps[i] = e.timestamp;\n            messages[i] = e.message;\n        }\n    }\n}\n"}},"settings":{"outputSelection":{"*":{"*":["*"]}},"optimizer":{"enabled":true,"runs":200}}}