Appearance
Solidity API
IDiamondLoupe
This interface is part of the EIP-2535 Diamond Standard.
A loupe is a small magnifying glass used to look at diamonds. These functions look at diamonds and provide introspection capabilities.
Facet
Struct representing a facet of the diamond.
Parameters
| Name | Type | Description |
|---|
solidity
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}facets
solidity
function facets() external view returns (struct IDiamondLoupe.Facet[] facets_)Gets all facet addresses and their four byte function selectors.
This function allows for a complete view of the diamond's structure.
Return Values
| Name | Type | Description |
|---|---|---|
| facets_ | struct IDiamondLoupe.Facet[] | An array of Facet structs containing all facets and their selectors. |
facetFunctionSelectors
solidity
function facetFunctionSelectors(address _facet) external view returns (bytes4[] facetFunctionSelectors_)Gets all the function selectors supported by a specific facet.
This function allows for inspecting a single facet's capabilities.
Parameters
| Name | Type | Description |
|---|---|---|
| _facet | address | The facet address to query. |
Return Values
| Name | Type | Description |
|---|---|---|
| facetFunctionSelectors_ | bytes4[] | An array of function selectors supported by the given facet. |
facetAddresses
solidity
function facetAddresses() external view returns (address[] facetAddresses_)Get all the facet addresses used by a diamond.
This function returns a list of all active facet addresses.
Return Values
| Name | Type | Description |
|---|---|---|
| facetAddresses_ | address[] | An array of facet addresses currently used by the diamond. |
facetAddress
solidity
function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_)Gets the facet that supports the given selector.
If facet is not found, it returns address(0).
Parameters
| Name | Type | Description |
|---|---|---|
| _functionSelector | bytes4 | The function selector to query. |
Return Values
| Name | Type | Description |
|---|---|---|
| facetAddress_ | address | The address of the facet that supports the given selector. |