This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.8.0; | |
| contract ERC721Registry { | |
| // A loupe is a small magnifying glass used to look at diamonds. | |
| // These functions look at diamonds | |
| interface IDiamondLoupe { | |
| struct Facet { | |
| address facetAddress; | |
| bytes4[] functionSelectors; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.8.0; | |
| /** | |
| * @title ERC721Registry | |
| * @notice A registry contract for tracking ERC721 contracts. | |
| * Allows adding ERC721 contract addresses up to a configurable limit. | |
| * @dev EIP-8042 Diamond Storage is used to organize and manage access to storage. | |
| */ | |
| contract ERC721Registry { | |
| /// @notice Reverts when the registry reaches its configured capacity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.8.30; | |
| /* Compose | |
| * https://compose.diamonds | |
| */ | |
| /** | |
| * A loupe is a small magnifying glass used to look at diamonds. | |
| * These functions look at diamonds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "../DiamondMod.sol" as DiamondMod; | |
| contract ExampleDiamond { | |
| /** | |
| * @notice Struct to hold a facet address and its function selectors. | |
| * struct FacetFunctions { | |
| * address facet; | |
| * bytes4[] selectors; | |
| * } | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.8.31; | |
| contract DiamondInspectFacet { | |
| bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("ercXXXX.diamond"); | |
| /** | |
| * @notice Data stored for each function selector. | |
| * @dev Facet address of function selector. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0-or-later | |
| pragma solidity 0.8.17; | |
| // Static Diamond | |
| // A static implementation of EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 | |
| // This code was extraced from Pendle's deployed contracts here: | |
| // https://etherscan.io/address/0x0000000001e4ef00d069e71d6ba041b0a16f7ea0#code#F1#L1 | |
| // Blog article on the basics to implement EIP-2535 Diamonds here: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| did:3:kjzl6cwe1jw1497jm1ckqomr59zuprfmyjqqsk4mayxovtmgynx89x2ktfsvk69 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.8.17; | |
| library LibPerson { | |
| uint256 private constant INNER_STRUCT = 0; | |
| struct Car { | |
| string brand; | |
| string model; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.17; | |
| struct Data { | |
| uint a; | |
| uint b; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.11; | |
| import { LibDiamond } from "../libraries/LibDiamond.sol"; | |
| import { IDiamondCut } from "../interfaces/IDiamondCut.sol"; | |
| import { IERC165 } from "../interfaces/IERC165.sol"; | |
| import { IERC721 } from "../interfaces/IERC721.sol"; | |
| contract Diamond { |
NewerOlder