> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gains.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# IDiamondStorage

*Based on EIP-2535: Diamonds ([https://eips.ethereum.org/EIPS/eip-2535](https://eips.ethereum.org/EIPS/eip-2535)) Follows diamond-3 implementation ([https://github.com/mudgen/diamond-3-hardhat/](https://github.com/mudgen/diamond-3-hardhat/)) Contains the types used in the diamond management contracts.*

## DiamondStorage

```solidity theme={null}
struct DiamondStorage {
  mapping(bytes4 => struct IDiamondStorage.FacetAddressAndPosition) selectorToFacetAndPosition;
  mapping(address => struct IDiamondStorage.FacetFunctionSelectors) facetFunctionSelectors;
  address[] facetAddresses;
  address[47] __gap;
}
```

## FacetAddressAndPosition

```solidity theme={null}
struct FacetAddressAndPosition {
  address facetAddress;
  uint96 functionSelectorPosition;
}
```

## FacetFunctionSelectors

```solidity theme={null}
struct FacetFunctionSelectors {
  bytes4[] functionSelectors;
  uint256 facetAddressPosition;
}
```

## FacetCutAction

```solidity theme={null}
enum FacetCutAction {
  ADD,
  REPLACE,
  REMOVE,
  NOP
}
```

## FacetCut

```solidity theme={null}
struct FacetCut {
  address facetAddress;
  enum IDiamondStorage.FacetCutAction action;
  bytes4[] functionSelectors;
}
```
