erc777 interface

    0

    0

    lucycodes42

    Solidity Code Snippets

    ERC777 is a standard for tokens on the Ethereum blockchain. It defines a standard interface for tokens, as well as a number of functions for managing and governing them.

    Shortcut: erc777i

    // https://eips.ethereum.org/EIPS/eip-777
    // Example implementation https://github.com/0xjac/ERC777/blob/master/contracts/examples/ReferenceToken.sol
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.5.0 <0.8.0;
    
    interface ERC777Token {
        function name() external view returns (string memory);
        function symbol() external view returns (string memory);
        function totalSupply() external view returns (uint256);
        function balanceOf(address holder) external view returns (uint256);
        function granularity() external view returns (uint256);
    
        function defaultOperators() external view returns (address[] memory);
        function isOperatorFor(
            address operator,
            address holder
        ) external view returns (bool);
        function authorizeOperator(address operator) external;
        function revokeOperator(address operator) external;
    
        function send(address to, uint256 amount, bytes calldata data) external;
        function operatorSend(
            address from,
            address to,
            uint256 amount,
            bytes calldata data,
            bytes calldata operatorData
        ) external;
    
        function burn(uint256 amount, bytes calldata data) external;
        function operatorBurn(
            address from,
            uint256 amount,
            bytes calldata data,
            bytes calldata operatorData
        ) external;
    
        event Sent(
            address indexed operator,
            address indexed from,
            address indexed to,
            uint256 amount,
            bytes data,
            bytes operatorData
        );
        event Minted(
            address indexed operator,
            address indexed to,
            uint256 amount,
            bytes data,
            bytes operatorData
        );
        event Burned(
            address indexed operator,
            address indexed from,
            uint256 amount,
            bytes data,
            bytes operatorData
        );
        event AuthorizedOperator(
            address indexed operator,
            address indexed holder
        );
        event RevokedOperator(address indexed operator, address indexed holder);
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.