Skip to main content

IDiamondLoupe

View Source: contracts/interfaces/diamond/IDiamondLoupe.sol

↘ Derived Contracts: DiamondLoupeFacet

IDiamondLoupe

Provides Diamond Facet inspection functionality.
Reference Implementation : https://github.com/mudgen/diamond-2-hardhat EIP-2535 Diamond Standard : https://eips.ethereum.org/EIPS/eip-2535 The ERC-165 identifier for this interface is: 0x48e2b093

Structs

Facet

struct Facet {
address facetAddress,
bytes4[] functionSelectors
}

Functions

facets

Gets all facets and their selectors.

function facets() 
external
view
returns(IDiamondLoupe.Facet[] memory facets_)

Returns

NameTypeDescription
facets_IDiamondLoupe.Facet[]array of Facets

facetFunctionSelectors

Gets all the function selectors supported by a specific facet.

function facetFunctionSelectors(address _facet) 
external
view
returns(bytes4[] facetFunctionSelectors_)

Arguments

NameTypeDescription
_facetaddressthe facet address

Returns

NameTypeDescription
facetFunctionSelectors_bytes4[]the selectors associated with a facet address

facetAddresses

Gets all the facet addresses used by a diamond.

function facetAddresses() 
external
view
returns(address[] facetAddresses_)

Returns

NameTypeDescription
facetAddresses_address[]array of addresses

facetAddress

Gets the facet that supports the given selector.If facet is not found return address(0).

function facetAddress(bytes4 _functionSelector) 
external
view
returns(address facetAddress_)

Arguments

NameTypeDescription
_functionSelectorbytes4the function selector.

Returns

NameTypeDescription
facetAddress_addressthe facet address.