FacetRegistry

Git Source

Inherits: IFacetRegistry, FacetRegistryBase

Functions

addFacet

Registers a new facet.

function addFacet(address facet, bytes4[] memory selectors) external;

Parameters

NameTypeDescription

facet

address

Address of the facet to add.

selectors

bytes4[]

Function selectors of the facet.

removeFacet

Removes a facet from the registry.

function removeFacet(address facet) external;

Parameters

NameTypeDescription

facet

address

Address of the facet to remove.

deployFacet

Deploys a new facet and registers it.

function deployFacet(
    bytes32 salt,
    bytes memory creationCode,
    bytes4[] memory selectors
)
    external
    override
    returns (address facet);

Parameters

NameTypeDescription

salt

bytes32

Salt used to create the address of the new facet.

creationCode

bytes

Creation code of the new facet.

selectors

bytes4[]

Function selectors of the new facet.

Returns

NameTypeDescription

facet

address

Address of the new facet.

computeFacetAddress

Computes the address of a facet deployed with the given salt and creation code.

function computeFacetAddress(bytes32 salt, bytes memory creationCode) external view override returns (address facet);

Parameters

NameTypeDescription

salt

bytes32

Salt used to create the address of the new facet.

creationCode

bytes

Creation code of the new facet.

facetSelectors

Returns the selectors of a registered facet.

function facetSelectors(address facet) external view returns (bytes4[] memory);

Parameters

NameTypeDescription

facet

address

The address of the facet.

Returns

NameTypeDescription

<none>

bytes4[]

selectors The selectors of the facet.

facetAddresses

Returns the addresses of all registered facets.

function facetAddresses() external view returns (address[] memory);

Returns

NameTypeDescription

<none>

address[]

facets The addresses of all registered facets.