ERC165.sol 896 B

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
  3. pragma solidity ^0.8.19;
  4. import {IERC165} from "./IERC165.sol";
  5. /**
  6. * @dev Implementation of the {IERC165} interface.
  7. *
  8. * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
  9. * for the additional interface id that will be supported. For example:
  10. *
  11. * ```solidity
  12. * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
  13. * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
  14. * }
  15. * ```
  16. */
  17. abstract contract ERC165 is IERC165 {
  18. /**
  19. * @dev See {IERC165-supportsInterface}.
  20. */
  21. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
  22. return interfaceId == type(IERC165).interfaceId;
  23. }
  24. }