DiamondLoupeFacet

Git Source

Inherits: IDiamondLoupe, IERC165


Author: Nick Mudge nick@perfectabstractions.com (https://twitter.com/mudgen) EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /*****************************************************************************

Functions

facets

These functions are expected to be called frequently by tools.

Gets all facets and their selectors.

function facets() external view override returns (Facet[] memory facets_);

Returns

NameTypeDescription
facets_Facet[]Facet

facetFunctionSelectors

Gets all the function selectors provided by a facet.

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

Parameters

NameTypeDescription
_facetaddressThe facet address.

Returns

NameTypeDescription
facetFunctionSelectors_bytes4[]facetFunctionSelectors_

facetAddresses

Get all the facet addresses used by a diamond.

function facetAddresses() external view override returns (address[] memory facetAddresses_);

Returns

NameTypeDescription
facetAddresses_address[]facetAddresses_

facetAddress

Gets the facet that supports the given selector.

If facet is not found return address(0).

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

Parameters

NameTypeDescription
_functionSelectorbytes4The function selector.

Returns

NameTypeDescription
facetAddress_addressThe facet address.

supportsInterface

function supportsInterface(bytes4 _interfaceId) external view override returns (bool);