# IGNSDiamondCut

*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 for diamond management.*

## diamondCut

```solidity
function diamondCut(struct IDiamondStorage.FacetCut[] _diamondCut, address _init, bytes _calldata) external
```

Add/replace/remove any number of functions and optionally execute a function with delegatecall

### Parameters

| Name         | Type                                                                                                                  | Description                                                                                                   |
| ------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| \_diamondCut | [IDiamondStorage.FacetCut\[\]](/developer/technical-reference/contracts/interfaces/types/idiamondstorage.md#facetcut) | Contains the facet addresses and function selectors                                                           |
| \_init       | address                                                                                                               | The address of the contract or facet to execute \_calldata                                                    |
| \_calldata   | bytes                                                                                                                 | A function call, including function selector and arguments \_calldata is executed with delegatecall on \_init |

## DiamondCut

```solidity
event DiamondCut(struct IDiamondStorage.FacetCut[] _diamondCut, address _init, bytes _calldata)
```

*Emitted when function selectors of a facet of the diamond is added, replaced, or removed*

### Parameters

| Name         | Type                               | Description                                                            |
| ------------ | ---------------------------------- | ---------------------------------------------------------------------- |
| \_diamondCut | struct IDiamondStorage.FacetCut\[] | Contains the update data (facet addresses, action, function selectors) |
| \_init       | address                            | The address of the contract or facet to execute \_calldata             |
| \_calldata   | bytes                              | Function call to execute after the diamond cut                         |

## InitializationFunctionReverted

```solidity
error InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata)
```

## InvalidFacetCutAction

```solidity
error InvalidFacetCutAction()
```

## NotContract

```solidity
error NotContract()
```

## NotFound

```solidity
error NotFound()
```


---

# 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/ignsdiamondcut.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.
