Skip to content

Instantly share code, notes, and snippets.

@mudgen
Last active March 2, 2026 22:07
Show Gist options
  • Select an option

  • Save mudgen/d5323d7e8f6450ab7c8e4dc7f0951f59 to your computer and use it in GitHub Desktop.

Select an option

Save mudgen/d5323d7e8f6450ab7c8e4dc7f0951f59 to your computer and use it in GitHub Desktop.
pragma solidity ^0.8.0;
contract ERC721Registry {
// A loupe is a small magnifying glass used to look at diamonds.
// These functions look at diamonds
interface IDiamondLoupe {
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}
/// @notice Gets all facet addresses and their four byte function selectors.
/// @return facets_ Facet
function facets() external view returns (Facet[] memory facets_);
/// @notice Gets all the function selectors supported by a specific facet.
/// @param _facet The facet address.
/// @return facetFunctionSelectors_
function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);
/// @notice Get all the facet addresses used by a diamond.
/// @return facetAddresses_
function facetAddresses() external view returns (address[] memory facetAddresses_);
/// @notice Gets the facet that supports the given selector.
/// @dev If facet is not found return address(0).
/// @param _functionSelector The function selector.
/// @return facetAddress_ The facet address.
function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment