Skip to main content

IDiamondCut

View Source: contracts/interfaces/diamond/IDiamondCut.sol

IDiamondCut

Manages Diamond Facets.
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: 0x1f931c1c

Enums

FacetCutAction

enum FacetCutAction {
Add,
Replace,
Remove
}

Structs

FacetCut

struct FacetCut {
address facetAddress,
IDiamondCut.FacetCutAction action,
bytes4[] functionSelectors
}

Functions

diamondCut

Cuts facets of the Diamond.
Adds/replaces/removes any number of function selectors.
If populated, _calldata is executed with delegatecall on _init
Reverts if caller does not have UPGRADER role

function diamondCut(struct IDiamondCut.FacetCut[] _facetCuts,
address _init,
bytes _calldata)
external

Arguments

NameTypeDescription
_facetCutsIDiamondCut.FacetCut[]contains the facet addresses and function selectors
_initaddressthe address of the contract or facet to execute _calldata
_calldatabytesa function call, including function selector and arguments

Events

DiamondCut

event DiamondCut(
struct IDiamondCut.FacetCut[] _diamondCut
address _init
bytes _calldata
)

Parameters

NameTypeDescription
_diamondCutIDiamondCut.FacetCut[]
_initaddress
_calldatabytes