-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVerifierModule.sol
More file actions
39 lines (29 loc) · 1.09 KB
/
VerifierModule.sol
File metadata and controls
39 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;
import "../interfaces/modules/IVerifierModule.sol";
import "../libraries/SlotLibrary.sol";
import "./BaseModule.sol";
abstract contract VerifierModule is IVerifierModule, BaseModule {
bytes32 private immutable _verifierModuleStorageSlot;
constructor(string memory name_, uint256 version_) {
_verifierModuleStorageSlot = SlotLibrary.getSlot("VerifierModule", name_, version_);
}
// View functions
/// @inheritdoc IVerifierModule
function verifier() public view returns (IVerifier) {
return IVerifier(_verifierModuleStorage().verifier);
}
// Internal functions
function __VerifierModule_init(address verifier_) internal onlyInitializing {
if (verifier_ == address(0)) {
revert ZeroAddress();
}
_verifierModuleStorage().verifier = verifier_;
}
function _verifierModuleStorage() private view returns (VerifierModuleStorage storage $) {
bytes32 slot = _verifierModuleStorageSlot;
assembly {
$.slot := slot
}
}
}