GNSDiamondLoupe

Based on EIP-2535: Diamonds (https://eips.ethereum.org/EIPS/eip-2535) Follows diamond-3 implementation (https://github.com/mudgen/diamond-3-hardhat/) Returns useful information about the diamond and its facets.

facets

function facets() external view returns (struct IGNSDiamondLoupe.Facet[] facets_)

Gets all facets and their selectors.

Return Values

Name
Type
Description

facets_

Facet

facetFunctionSelectors

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

Gets all the function selectors provided by a facet.

Parameters

Name
Type
Description

_facet

address

The facet address.

Return Values

Name
Type
Description

facetFunctionSelectors_

bytes4[]

the function selectors.

facetAddresses

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

Get all the facet addresses used by a diamond.

Return Values

Name
Type
Description

facetAddresses_

address[]

the facet addresses

facetAddress

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

Gets the facet that supports the given selector.

If facet is not found return address(0).

Parameters

Name
Type
Description

_functionSelector

bytes4

The function selector.

Return Values

Name
Type
Description

facetAddress_

address

The facet address.

Last updated