Solidity Code Snippets

    The ERC725 interface defines the methods for an account to hold data and call contracts. The function changeOwner() allows the account to be transferred to a different address. The function getData() returns the data associated with a given key. The function setData() sets the data associated with a given key. The function execute() executes a contract with the given parameters.

    Shortcut: erc725i_draft

    // (example)
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.5.0 <0.8.0;
    The following describes standard functions for a unique identifiable proxy account to be used by humans, groups, organisations, objects and machines.
    The proxy has 2 abilities: (1) it can execute arbitrary contract calls, and (2) it can hold arbitrary data through a generic key/value store.
    One of these keys should hold the owner of the contract. The owner may be an address or a key manager contract for more complex management logic.
    Most importantly, this contract should be the reference point for a long-lasting identifiable profiles.
    interface ERC725 {
        event DataChanged(bytes32 indexed key, bytes32 indexed value);
        event OwnerChanged(address indexed ownerAddress);
        event ContractCreated(address indexed contractAddress);
        // address public owner;
        function changeOwner(address _owner) external;
        function getData(bytes32 _key) external view returns (bytes32 _value);
        function setData(bytes32 _key, bytes32 _value) external;
        function execute(uint256 _operationType, address _to, uint256 _value, bytes calldata _data) external;
    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.