VerifierModule
Overview
VerifierModule is an abstract extension of BaseModule designed to provide standardized access to a Verifier contract. It manages internal storage using a deterministic slot derived via SlotLibrary, supporting secure modular composition across multiple vault systems.
Constructor
constructor(string memory name_, uint256 version_)Computes and stores the custom storage slot used for verifier configuration based on a unique (name_, version_) pair.
Parameters:
name_β Unique identifier used to namespace the storage slot.version_β Version number used for slot derivation.
Public & External Functions
verifier()
verifier()function verifier() public view returns (IVerifier)Returns the address of the configured Verifier contract. It is retrieved from internal storage using a fixed slot.
Returns:
IVerifierβ The verifier contract associated with the module.
Internal Functions
__VerifierModule_init(address verifier_)
__VerifierModule_init(address verifier_)Initializes the verifier module with the given verifier contract address. Validates non-zero address to prevent misconfiguration.
Parameters:
verifier_β Address of the verifier contract.
Reverts:
ZeroAddress()if verifier address is zero.
Private Functions
_verifierModuleStorage()
_verifierModuleStorage()Internal function to access the VerifierModuleStorage struct using the precomputed custom slot. Utilizes inline assembly for direct storage access.
Returns:
VerifierModuleStorageβ Storage struct holding verifier address.