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
Name | Type | Description |
---|---|---|
_facetCuts | IDiamondCut.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 |
Events
DiamondCut
event DiamondCut(
struct IDiamondCut.FacetCut[] _diamondCut
address _init
bytes _calldata
)
Parameters
Name | Type | Description |
---|---|---|
_diamondCut | IDiamondCut.FacetCut[] | |
_init | address | |
_calldata | bytes |