-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(excubiae): enforce IExcubia contract interface implementation
- Loading branch information
Showing
2 changed files
with
19 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.0 <0.9.0; | ||
|
||
/// @title IExcubia | ||
/// @notice Interface for the excubia contract. | ||
/// @title IExcubia. | ||
/// @notice Excubia contract interface. | ||
interface IExcubia { | ||
/// @notice Event emitted when someone passes the `_check` method. | ||
/// @param passerby The address of those who have successfully passed the check. | ||
/// @param gate The address of the excubia-protected contract address. | ||
event GatePassed(address indexed passerby, address indexed gate); | ||
|
||
/// @notice Error thrown when the gate address is not set. | ||
error GateNotSet(); | ||
|
||
/// @notice Error thrown when the gate address has been already set. | ||
error GateAlreadySet(); | ||
|
||
/// @notice Error thrown when access is denied by the excubia. | ||
error AccessDenied(); | ||
|
||
/// @notice Sets the gate address. | ||
/// @dev Only the owner can set the destination gate address. | ||
/// @param _gate The address of the contract to be set as the gate. | ||
function setGate(address _gate) external; | ||
|
||
/// @notice Initiates the excubia's check and triggers the associated action if the check is passed. | ||
/// @param data Additional data required for the check. | ||
function open(bytes calldata data) external; | ||
/// @dev Calls `_pass` to handle the logic of checking and passing the gate. | ||
/// @param data Additional data required for the check (e.g., encoded token identifier). | ||
function pass(bytes memory data) external; | ||
} |