// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; // interfaces // libraries import {EnumerableSetLib} from "solady/utils/EnumerableSetLib.sol"; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STRUCTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ struct Hook { address module; uint32 entityId; bool isActive; } struct HookConfig { EnumerableSetLib.Bytes32Set preHooks; EnumerableSetLib.Bytes32Set postHooks; mapping(bytes4 selector => mapping(bytes32 entityId => bytes)) preHookData; mapping(bytes32 entityId => Hook) hookData; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BASE INTERFACE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ interface IHookBase { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ error HookAlreadyExists(); error HookDoesNotExist(); error TooManyHooks(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ event HookAdded( address indexed module, bytes4 indexed selector, uint32 indexed entityId, bool isPre, bool isPostHook ); event HookRemoved(address indexed module, bytes4 indexed selector, uint32 indexed entityId); }