Skip to content

Commit 8a60dbb

Browse files
committed
refactor: rename diamondStorage to _diamondStorage for consistency in DiamondLoupeFacet and ERC165Init
1 parent c98f77d commit 8a60dbb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/facets/DiamondLoupeFacet.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ contract DiamondLoupeFacet is IDiamondLoupe {
1515
/// @notice Gets all facet addresses and their function selectors.
1616
/// @return facets_ Facet
1717
function facets() external view returns (Facet[] memory facets_) {
18-
DiamondStorage storage ds = LibDiamond.diamondStorage();
18+
DiamondStorage storage ds = LibDiamond._diamondStorage();
1919
uint256 facetCount = ds.facetAddresses.length;
2020
facets_ = new Facet[](facetCount);
2121
for (uint256 i; i < facetCount;) {
@@ -37,21 +37,21 @@ contract DiamondLoupeFacet is IDiamondLoupe {
3737
override
3838
returns (bytes4[] memory facetFunctionSelectors_)
3939
{
40-
facetFunctionSelectors_ = LibDiamond.diamondStorage().facetToSelectorsAndPosition[_facet].functionSelectors;
40+
facetFunctionSelectors_ = LibDiamond._diamondStorage().facetToSelectorsAndPosition[_facet].functionSelectors;
4141
}
4242

4343
/// @notice Get all the facet addresses used by a diamond.
4444
/// @return facetAddresses_
4545
function facetAddresses() external view override returns (address[] memory facetAddresses_) {
46-
facetAddresses_ = LibDiamond.diamondStorage().facetAddresses;
46+
facetAddresses_ = LibDiamond._diamondStorage().facetAddresses;
4747
}
4848

4949
/// @notice Gets the facet that supports the given selector.
5050
/// @dev If facet is not found return address(0).
5151
/// @param _functionSelector The function selector.
5252
/// @return facetAddress_ The facet address.
5353
function facetAddress(bytes4 _functionSelector) external view override returns (address facetAddress_) {
54-
facetAddress_ = LibDiamond.diamondStorage().selectorToFacetAndPosition[_functionSelector].facetAddress;
54+
facetAddress_ = LibDiamond._diamondStorage().selectorToFacetAndPosition[_functionSelector].facetAddress;
5555
}
5656

5757
/// @notice Query if a contract implements an interface
@@ -61,6 +61,6 @@ contract DiamondLoupeFacet is IDiamondLoupe {
6161
/// @return `true` if the contract implements `interfaceID` and
6262
/// `interfaceID` is not 0xffffffff, `false` otherwise
6363
function supportsInterface(bytes4 _interfaceId) external view returns (bool) {
64-
return LibDiamond.diamondStorage().supportedInterfaces[_interfaceId];
64+
return LibDiamond._diamondStorage().supportedInterfaces[_interfaceId];
6565
}
6666
}

src/initializers/ERC165Init.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract ERC165Init {
1313
/// @dev This function is called during the diamond cut process to set up
1414
/// the initial state of the contract.
1515
function initERC165() external {
16-
DiamondStorage storage ds = LibDiamond.diamondStorage();
16+
DiamondStorage storage ds = LibDiamond._diamondStorage();
1717
/// @dev type(ERC165).interfaceId
1818
ds.supportedInterfaces[0x01ffc9a7] = true;
1919
/// @dev type(IERC173).interfaceId

0 commit comments

Comments
 (0)