2
2
pragma solidity >= 0.8.0 < 0.9.0 ;
3
3
4
4
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol " ;
5
+ import {IExcubia} from "./IExcubia.sol " ;
5
6
6
7
/// @title Excubia.
7
8
/// @notice Abstract base contract which can be extended to implement a specific excubia.
8
9
/// @dev Inherit from this contract and implement the `_check` method to define the custom gatekeeping logic.
9
- abstract contract Excubia is Ownable (msg .sender ) {
10
+ abstract contract Excubia is IExcubia , Ownable (msg .sender ) {
10
11
/// @notice The excubia-protected contract address.
11
12
/// @dev The gate can be any contract address that requires a prior `_check`.
12
13
/// For example, the gate is a semaphore group that requires the passerby
13
14
/// to meet certain criteria before joining.
14
15
address public gate;
15
16
16
- /// @notice Event emitted when someone passes the `_check` method.
17
- /// @param passerby The address of those who have successfully passed the check.
18
- /// @param gate The address of the excubia-protected contract address.
19
- event GatePassed (address indexed passerby , address indexed gate );
20
-
21
- /// @notice Error thrown when the gate address is not set.
22
- error GateNotSet ();
23
-
24
- /// @notice Error thrown when the gate address has been already set.
25
- error GateAlreadySet ();
26
-
27
- /// @notice Error thrown when access is denied by the excubia.
28
- error AccessDenied ();
29
-
30
- /// @notice Sets the gate address.
31
- /// @dev Only the owner can set the destination gate address.
32
- /// @param _gate The address of the contract to be set as the gate.
17
+ /// @dev See {IExcubia-setGate}.
33
18
function setGate (address _gate ) public virtual onlyOwner {
34
19
if (gate != address (0 )) revert GateAlreadySet ();
35
20
@@ -42,9 +27,7 @@ abstract contract Excubia is Ownable(msg.sender) {
42
27
gate = _gate;
43
28
}
44
29
45
- /// @notice Initiates the excubia's check and triggers the associated action if the check is passed.
46
- /// @dev Calls `_pass` to handle the logic of checking and passing the gate.
47
- /// @param data Additional data required for the check (e.g., encoded token identifier).
30
+ /// @dev See {IExcubia-pass}.
48
31
function pass (bytes memory data ) public virtual {
49
32
_pass (data);
50
33
}
0 commit comments