Skip to main content
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

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

NameTypeDescription
_diamondCutIDiamondStorage.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 _calldata is executed with delegatecall on _init

DiamondCut

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

NameTypeDescription
_diamondCutstruct IDiamondStorage.FacetCut[]Contains the update data (facet addresses, action, function selectors)
_initaddressThe address of the contract or facet to execute _calldata
_calldatabytesFunction call to execute after the diamond cut

InitializationFunctionReverted

error InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata)

InvalidFacetCutAction

error InvalidFacetCutAction()

NotContract

error NotContract()

NotFound

error NotFound()