BaseModule is an abstract contract that acts as a foundational layer for modules within the system. It integrates shared logic such as initializer protection, reentrancy guard, IERC721Receiver compliance and low level storage access.
This module is intended to be inherited and extended by other functional modules.
constructor() {
_disableInitializers();
}
Prevents the contract from being initialized outside of proxy context. Ensures secure upgradeable deployments.
getStorageAt(bytes32 slot)function getStorageAt(bytes32 slot) external pure returns (StorageSlot.Bytes32Slot memory)
Returns a reference to a custom storage slot. Enables advanced access to shared storage across upgradeable modules using the StorageSlot pattern.
Parameters:
slot — The bytes32 identifier of the storage slot.Returns:
StorageSlot.Bytes32Slot struct pointing to the slot.onERC721Received(...)function onERC721Received(address, address, uint256, bytes calldata) external pure returns (bytes4)
ERC721 receiver hook implementation to support safe transfers of NFTs to the module. Returns the selector as required by IERC721Receiver.
Returns:
IERC721Receiver.onERC721Received.selector — confirms compliance.receive()