erc165 interface




    Solidity Code Snippets

    The code defines a function supportsInterface which takes an interface ID as a parameter. The function uses less than 30,000 gas to execute. If the contract implements the interface ID, the function returns true; otherwise, it returns false.

    Shortcut: erc165i

    // SPDX-License-Identifier: MIT
    pragma solidity >=0.5.0 <0.8.0;
    interface ERC165 {
        /// @notice Query if a contract implements an interface
        /// @param interfaceID The interface identifier, as specified in ERC-165
        /// @dev Interface identification is specified in ERC-165. This function
        ///  uses less than 30,000 gas.
        /// @return `true` if the contract implements `interfaceID` and
        ///  `interfaceID` is not 0xffffffff, `false` otherwise
        function supportsInterface(bytes4 interfaceID) external view returns (bool);
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.