// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; contract CapabilityIndex { mapping(bytes32 => bool) private _supported; event SelectorSet(address indexed agent, bytes4 indexed selector, bool supported); function setSelector(bytes4 selector, bool supported) external { bytes32 key = _key(msg.sender, selector); _supported[key] = supported; emit SelectorSet(msg.sender, selector, supported); } function isSupported(address agent, bytes4 selector) external view returns (bool) { return _supported[_key(agent, selector)]; } function _key(address agent, bytes4 selector) private pure returns (bytes32) { return bytes32((uint256(uint160(agent)) << 32) | uint32(selector)); } }