11// SPDX-License-Identifier: MIT
22pragma solidity >= 0.8.30 ;
33
4- library LibDiamondCut {
4+ library LibDiamond {
55 error NoSelectorsProvidedForFacet (address _facet );
66 error NoBytecodeAtAddress (address _contractAddress , string _message );
77 error RemoveFacetAddressMustBeZeroAddress (address _facet );
@@ -41,7 +41,7 @@ library LibDiamondCut {
4141 function addFunctions (address _facet , bytes4 [] calldata _functionSelectors ) internal {
4242 Storage storage s = getStorage ();
4343 if (_facet.code.length == 0 ) {
44- revert NoBytecodeAtAddress (_facet, "LibDiamondCut : Add facet has no code " );
44+ revert NoBytecodeAtAddress (_facet, "LibDiamond : Add facet has no code " );
4545 }
4646 // The position to store the next selector in the selectors array
4747 uint16 selectorPosition = uint16 (s.selectors.length );
@@ -60,7 +60,7 @@ library LibDiamondCut {
6060 function replaceFunctions (address _facet , bytes4 [] calldata _functionSelectors ) internal {
6161 Storage storage s = getStorage ();
6262 if (_facet.code.length == 0 ) {
63- revert NoBytecodeAtAddress (_facet, "LibDiamondCut : Replace facet has no code " );
63+ revert NoBytecodeAtAddress (_facet, "LibDiamond : Replace facet has no code " );
6464 }
6565 for (uint256 selectorIndex; selectorIndex < _functionSelectors.length ; selectorIndex++ ) {
6666 bytes4 selector = _functionSelectors[selectorIndex];
@@ -134,7 +134,7 @@ library LibDiamondCut {
134134 /// @param _init The address of the contract or facet to execute _calldata
135135 /// @param _calldata A function call, including function selector and arguments
136136 /// _calldata is executed with delegatecall on _init
137- function diamondCut (FacetCut[] calldata _diamondCut , address _init , bytes calldata _calldata ) external {
137+ function diamondCut (FacetCut[] calldata _diamondCut , address _init , bytes calldata _calldata ) internal {
138138 for (uint256 facetIndex; facetIndex < _diamondCut.length ; facetIndex++ ) {
139139 bytes4 [] calldata functionSelectors = _diamondCut[facetIndex].functionSelectors;
140140 address facetAddress = _diamondCut[facetIndex].facetAddress;
@@ -159,7 +159,7 @@ library LibDiamondCut {
159159 return ;
160160 }
161161 if (_init.code.length == 0 ) {
162- revert NoBytecodeAtAddress (_init, "LibDiamondCut : _init address no code " );
162+ revert NoBytecodeAtAddress (_init, "LibDiamond : _init address no code " );
163163 }
164164 (bool success , bytes memory error ) = _init.delegatecall (_calldata);
165165 if (! success) {
0 commit comments