Diamond
Diamond
This contract contains functions related to facets
Solidity API
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}
_become
Call _acceptImplementation to accept the diamond proxy as new implementaion
function _become(contract Unitroller unitroller) public
Parameters
unitroller
contract Unitroller
Address of the unitroller
diamondCut
To add function selectors to the facet's mapping
function diamondCut(struct IDiamondCut.FacetCut[] diamondCut_) public
Parameters
diamondCut_
struct IDiamondCut.FacetCut[]
IDiamondCut contains facets address, action and function selectors
facetFunctionSelectors
Get all function selectors mapped to the facet address
function facetFunctionSelectors(address facet) external view returns (bytes4[])
Parameters
facet
address
Address of the facet
Return Values
[0]
bytes4[]
selectors Array of function selectors
facetPosition
Get facet position in the _facetFunctionSelectors through facet address
function facetPosition(address facet) external view returns (uint256)
Parameters
facet
address
Address of the facet
Return Values
[0]
uint256
Position of the facet
facetAddresses
Get all facet addresses
function facetAddresses() external view returns (address[])
Return Values
[0]
address[]
facetAddresses Array of facet addresses
facetAddress
Get facet address and position through function selector
function facetAddress(bytes4 functionSelector) external view returns (struct ComptrollerV13Storage.FacetAddressAndPosition)
Parameters
functionSelector
bytes4
function selector
Return Values
[0]
struct ComptrollerV13Storage.FacetAddressAndPosition
FacetAddressAndPosition facet address and position
facets
Get all facets address and their function selector
function facets() external view returns (struct Diamond.Facet[])
Return Values
[0]
struct Diamond.Facet[]
facets_ Array of Facet
Last updated