Appearance
Solidity API
PropsDiamond
This contract implements the Diamond pattern for upgradeable contracts with additional Props-specific functionality
Inherits from Diamond and PropsReceiver
constructor
solidity
constructor() publicinitialize
solidity
function initialize(address _newOwner, address _diamondCutFacet, struct IPropsInitCall.InitCall[] _initCalls) externalInitializes the PropsDiamond contract with a new owner and initial facets
Can only be called once when the contract owner is not set
Parameters
| Name | Type | Description |
|---|---|---|
| _newOwner | address | The address to be set as the new owner |
| _diamondCutFacet | address | The address of the DiamondCutFacet contract |
| _initCalls | struct IPropsInitCall.InitCall[] | An array of initialization calls to be executed |
initialize
solidity
function initialize(address _newOwner, address _diamondCutFacet, struct IDiamondCut.FacetCut[] _initialDiamondCuts, struct IPropsInitCall.InitCall[] _initCalls) externalInitializes the PropsDiamond contract with a new owner, initial facets, and additional diamond cuts
Can only be called once when the contract owner is not set
Parameters
| Name | Type | Description |
|---|---|---|
| _newOwner | address | The address to be set as the new owner |
| _diamondCutFacet | address | The address of the DiamondCutFacet contract |
| _initialDiamondCuts | struct IDiamondCut.FacetCut[] | An array of initial diamond cuts to be applied |
| _initCalls | struct IPropsInitCall.InitCall[] | An array of initialization calls to be executed |
diamondCut
solidity
function diamondCut(struct IDiamondCut.FacetCut[] _diamondCuts, struct IPropsInitCall.InitCall[] _initCalls) internalInternal function to perform a diamond cut
This function is called by both initialize functions to apply facet changes and execute initialization calls
Parameters
| Name | Type | Description |
|---|---|---|
| _diamondCuts | struct IDiamondCut.FacetCut[] | An array of FacetCut structs defining the facet changes to be made |
| _initCalls | struct IPropsInitCall.InitCall[] | An array of initialization calls to be executed after the diamond cut |
getHookPermissions
solidity
function getHookPermissions() public pure returns (struct Hooks.Permissions)Returns the permissions for Uniswap hooks as true, PropsUniswapHook will run/skip based on the hook permissions set in storage This is a default implementation that allows all hooks to be called, individual hooks will run/skip based on the hook permissions set in storage
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | struct Hooks.Permissions | Permissions The permissions for diamond uniswap hooks |