Skip to content

Commit

Permalink
Move ExpiredRoot & NonExistentRoot to IBaseWorldID (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop authored May 26, 2023
1 parent 43c77d2 commit 2e2d25f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/WorldIDIdentityManagerImplV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ contract WorldIDIdentityManagerImplV1 is WorldIDImpl, IWorldID {
/// @param latestRoot The actual latest root at the time of the transaction.
error NotLatestRoot(uint256 providedRoot, uint256 latestRoot);

/// @notice Thrown when attempting to validate a root that has expired.
error ExpiredRoot();

/// @notice Thrown when attempting to validate a root that has yet to be added to the root
/// history.
error NonExistentRoot();

/// @notice Thrown when attempting to enable the bridge when it is already enabled.
error StateBridgeAlreadyEnabled();

Expand Down
18 changes: 18 additions & 0 deletions src/interfaces/IBaseWorldID.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @title Base WorldID interface
/// @author Worldcoin
/// @notice The interface providing basic types across various WorldID contracts.
interface IBaseWorldID {
///////////////////////////////////////////////////////////////////////////////
/// ERRORS ///
///////////////////////////////////////////////////////////////////////////////

/// @notice Thrown when attempting to validate a root that has expired.
error ExpiredRoot();

/// @notice Thrown when attempting to validate a root that has yet to be added to the root
/// history.
error NonExistentRoot();
}
4 changes: 3 additions & 1 deletion src/interfaces/IWorldID.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IBaseWorldID} from "./IBaseWorldID.sol";

/// @title WorldID Interface
/// @author Worldcoin
/// @notice The interface to the proof verification for WorldID.
interface IWorldID {
interface IWorldID is IBaseWorldID {
/// @notice Verifies a WorldID zero knowledge proof.
/// @dev Note that a double-signaling check is not included here, and should be carried by the
/// caller.
Expand Down
4 changes: 3 additions & 1 deletion src/interfaces/IWorldIDGroups.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IBaseWorldID} from "./IBaseWorldID.sol";

/// @title WorldID Interface with Groups
/// @author Worldcoin
/// @notice The interface to the proof verification for WorldID.
interface IWorldIDGroups {
interface IWorldIDGroups is IBaseWorldID {
/// @notice Verifies a WorldID zero knowledge proof.
/// @dev Note that a double-signaling check is not included here, and should be carried by the
/// caller.
Expand Down

0 comments on commit 2e2d25f

Please sign in to comment.