diff --git a/src/Curta.sol b/src/Curta.sol index 31a678d..e91537d 100644 --- a/src/Curta.sol +++ b/src/Curta.sol @@ -116,6 +116,9 @@ contract Curta is ICurta, FlagsERC721, Owned { // Revert if the puzzle does not exist. if (address(puzzle) == address(0)) revert PuzzleDoesNotExist(_puzzleId); + // Revert if puzzle name is an empty string or not implemented. + if (bytes(puzzle.name()).length == 0) revert PuzzleNotNamed(_puzzleId); + // Revert if submissions are closed. uint40 firstSolveTimestamp = puzzleData.firstSolveTimestamp; uint40 solveTimestamp = uint40(block.timestamp); diff --git a/src/interfaces/ICurta.sol b/src/interfaces/ICurta.sol index 759ebed..6036d08 100644 --- a/src/interfaces/ICurta.sol +++ b/src/interfaces/ICurta.sol @@ -40,6 +40,10 @@ interface ICurta { /// @param _puzzleId The ID of a puzzle. error PuzzleDoesNotExist(uint32 _puzzleId); + /// @notice Emitted when a puzzle has a zero-length name. + /// @param _puzzleId The ID of a puzzle. + error PuzzleNotNamed(uint32 _puzzleId); + /// @notice Emitted when the puzzle was not the one that went longest /// unsolved. /// @param _puzzleId The ID of a puzzle.