File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ contract DiamondCutFacet {
6464 revert NoBytecodeAtAddress (_facet, "DiamondCutFacet: Add facet has no code " );
6565 }
6666 // The position to store the next selector in the selectors array
67- uint16 selectorPosition = uint16 (s.selectors.length );
67+ uint32 selectorPosition = uint32 (s.selectors.length );
6868 for (uint256 selectorIndex; selectorIndex < _functionSelectors.length ; selectorIndex++ ) {
6969 bytes4 selector = _functionSelectors[selectorIndex];
7070 address oldFacet = s.facetAndPosition[selector].facet;
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ import {IERC721Metadata} from "../../interfaces/IERC721Metadata.sol";
1010
1111contract ExampleDiamond is ComposeDiamond {
1212 /// @notice Struct to hold facet address and its function selectors.
13- // struct Facet {
14- // address facet ;
15- // bytes4[] functionSelectors;
16- // }
17-
13+ /// struct FacetCut {
14+ /// address facetAddress ;
15+ /// FacetCutAction action; // Add=0, Replace=1, Remove=2
16+ /// bytes4[] functionSelectors;
17+ /// }
1818 /// @notice Initializes the diamond contract with facets, owner and other data.
1919 /// @dev Adds all provided facets to the diamond's function selector mapping and sets the contract owner.
2020 /// Each facet in the array will have its function selectors registered to enable delegatecall routing.
@@ -29,7 +29,7 @@ contract ExampleDiamond is ComposeDiamond {
2929 // Setting the contract owner
3030 LibOwner.setContractOwner (_diamondOwner);
3131 // Setting ERC721 token details
32- LibERC721.setMetadata ("ExampleDiamondNFT " , "EDN " , "https://example.com/metadata/ " );
32+ LibERC721.setMetadata ({_name: "ExampleDiamondNFT " , _symbol: "EDN " , _baseURI: "https://example.com/metadata/ " } );
3333 // Registering ERC165 interfaces
3434 LibERC165.registerInterface (type (IERC721 ).interfaceId);
3535 LibERC165.registerInterface (type (IERC721Metadata ).interfaceId);
You can’t perform that action at this time.
0 commit comments