Solidity Code Snippets

    Shortcut: erc173i_draft

    // (this example)
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.5.0 <0.8.0;
    /// @title ERC-173 Contract Ownership Standard
    /// @dev See
    ///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
    interface ERC173 /* is ERC165 */ {
        /// @dev This emits when ownership of a contract changes
        event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
        /// @notice Get the address of the owner
        /// @return The address of the owner.
        function owner() external view returns (address);
        /// @notice Set the address of the new owner of the contract
        /// @dev Set _newOwner to address(0) to renounce any ownership.
        /// @param _newOwner The address of the new owner of the contract
        function transferOwnership(address _newOwner) external;
    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.