# IGNSDiamondLoupe

*Based on EIP-2535: Diamonds (<https://eips.ethereum.org/EIPS/eip-2535>) Follows diamond-3 implementation (<https://github.com/mudgen/diamond-3-hardhat/>) One of the diamond standard interfaces, used to inspect the diamond like a magnifying glass.*

## Facet

These functions are expected to be called frequently by tools.

```solidity
struct Facet {
  address facetAddress;
  bytes4[] functionSelectors;
}
```

## facets

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

Gets all facet addresses and their four byte function selectors.

### Return Values

| Name     | Type                                                                                                        | Description |
| -------- | ----------------------------------------------------------------------------------------------------------- | ----------- |
| facets\_ | [IGNSDiamondLoupe.Facet\[\]](/developer/technical-reference/contracts/interfaces/ignsdiamondloupe.md#facet) | Facet       |

## facetFunctionSelectors

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

Gets all the function selectors supported by a specific facet.

### Parameters

| Name    | Type    | Description        |
| ------- | ------- | ------------------ |
| \_facet | address | The facet address. |

### Return Values

| Name                     | Type      | Description |
| ------------------------ | --------- | ----------- |
| facetFunctionSelectors\_ | bytes4\[] |             |

## facetAddresses

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

Get all the facet addresses used by a diamond.

### Return Values

| Name             | Type       | Description |
| ---------------- | ---------- | ----------- |
| facetAddresses\_ | address\[] |             |

## facetAddress

```solidity
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. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gains.trade/developer/technical-reference/contracts/interfaces/ignsdiamondloupe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
