kopia lustrzana https://github.com/bugout-dev/dao
46 wiersze
1.5 KiB
Solidity
46 wiersze
1.5 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
// Adapted from the Diamond 3 reference implementation by Nick Mudge:
|
|
// https://github.com/mudgen/diamond-3-hardhat
|
|
|
|
// A loupe is a small magnifying glass used to look at diamonds.
|
|
// These functions look at diamonds
|
|
interface IDiamondLoupe {
|
|
/// These functions are expected to be called frequently
|
|
/// by tools.
|
|
|
|
struct Facet {
|
|
address facetAddress;
|
|
bytes4[] functionSelectors;
|
|
}
|
|
|
|
/// @notice Gets all facet addresses and their four byte function selectors.
|
|
/// @return facets_ Facet
|
|
function facets() external view returns (Facet[] memory facets_);
|
|
|
|
/// @notice Gets all the function selectors supported by a specific facet.
|
|
/// @param _facet The facet address.
|
|
/// @return facetFunctionSelectors_
|
|
function facetFunctionSelectors(address _facet)
|
|
external
|
|
view
|
|
returns (bytes4[] memory facetFunctionSelectors_);
|
|
|
|
/// @notice Get all the facet addresses used by a diamond.
|
|
/// @return facetAddresses_
|
|
function facetAddresses()
|
|
external
|
|
view
|
|
returns (address[] memory facetAddresses_);
|
|
|
|
/// @notice Gets the facet that supports the given selector.
|
|
/// @dev If facet is not found return address(0).
|
|
/// @param _functionSelector The function selector.
|
|
/// @return facetAddress_ The facet address.
|
|
function facetAddress(bytes4 _functionSelector)
|
|
external
|
|
view
|
|
returns (address facetAddress_);
|
|
}
|