Skip to content

Solidity API

DiamondCutFacet

Implements diamond cut functionality for upgrading diamond contracts

Inherits from IDiamondCut and ERC2771Context

constructor

solidity
constructor() public

Initializes the contract with a trusted forwarder address

Sets the trusted forwarder to address(0)

diamondCut

solidity
function diamondCut(struct IDiamondCut.FacetCut[] _diamondCut, struct IPropsInitCall.InitCall[] _initCalls) external

Performs a diamond cut operation

Only the contract owner can call this function

Parameters

NameTypeDescription
_diamondCutstruct IDiamondCut.FacetCut[]An array of FacetCut structs containing the facet addresses and function selectors
_initCallsstruct IPropsInitCall.InitCall[]An array of initialization calls to be executed after the cut

_msgSender

solidity
function _msgSender() internal view virtual returns (address sender)

Returns the sender of the current message

Overrides the ERC2771Context implementation

Return Values

NameTypeDescription
senderaddressThe address of the message sender

_msgData

solidity
function _msgData() internal view virtual returns (bytes)

Returns the calldata of the current message

Overrides the ERC2771Context implementation

Return Values

NameTypeDescription
[0]bytesThe calldata of the message