IDiamondLoupe
View Source: contracts/interfaces/diamond/IDiamondLoupe.sol
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()
- facetFunctionSelectors(address _facet)
- facetAddresses()
- facetAddress(bytes4 _functionSelector)
facets
Gets all facets and their selectors.
function facets()
external
view
returns(IDiamondLoupe.Facet[] memory facets_)
Returns
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
_facet | address | the facet address |
Returns
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
_functionSelector | bytes4 | the function selector. |
Returns
Name | Type | Description |
---|---|---|
facetAddress_ | address | the facet address. |