ETH Price: $3,333.69 (-3.79%)
Gas: 2 Gwei

Contract

0xA796299B72CeCA35f91107278FdeeD56d9f882A9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040155993132022-09-23 23:24:23670 days ago1663975463IN
 Create: ApproveLogic
0 ETH0.00582346.15290889

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ApproveLogic

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 12 : ApproveLogic.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import { ERC721State, ERC721Storage } from "../../../storage/ERC721Storage.sol";
import "./IApproveLogic.sol";
import "../getter/IGetterLogic.sol";

// Functional logic extracted from openZeppelin:
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol
// To follow Extension principles, maybe best to separate each function into a different Extension
contract ApproveLogic is ApproveExtension {
    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = IGetterLogic(address(this)).ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _lastExternalCaller() == owner ||
                IGetterLogic(address(this)).isApprovedForAll(owner, _lastExternalCaller()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        // must use external call for _internal to resolve correctly
        IApproveLogic(address(this))._approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_lastExternalCaller(), operator, approved);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        ERC721State storage erc721State = ERC721Storage._getState();
        erc721State._operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) public virtual override _internal {
        ERC721State storage erc721State = ERC721Storage._getState();
        erc721State._tokenApprovals[tokenId] = to;
        emit Approval(IGetterLogic(address(this)).ownerOf(tokenId), to, tokenId);
    }
}

File 2 of 12 : ERC721Storage.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

struct ERC721State {
    // Token name
    string _name;
    // Token symbol
    string _symbol;
    // Mapping from token ID to owner address
    mapping(uint256 => address) _owners;
    // Mapping owner address to token count
    mapping(address => uint256) _balances;
    // Mapping from token ID to approved address
    mapping(uint256 => address) _tokenApprovals;
    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) _operatorApprovals;
}

library ERC721Storage {
    bytes32 constant STORAGE_NAME = keccak256("extendable:erc721:base");

    function _getState() internal view returns (ERC721State storage erc721State) {
        bytes32 position = keccak256(abi.encodePacked(address(this), STORAGE_NAME));
        assembly {
            erc721State.slot := position
        }
    }
}

File 3 of 12 : IApproveLogic.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@violetprotocol/extendable/extensions/InternalExtension.sol";

interface IApproveLogic {
    /**
     * @dev See {IERC721-Approval}.
     */
    event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);

    /**
     * @dev See {IERC721-ApprovalForAll}.
     */
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev See {IERC721-approve}.
     */
    function _approve(address to, uint256 tokenId) external;
}

abstract contract ApproveExtension is IApproveLogic, InternalExtension {
    /**
     * @dev see {IExtension-getSolidityInterface}
     */
    function getSolidityInterface() public pure virtual override returns (string memory) {
        return
            "function approve(address to, uint256 tokenId) external;\n"
            "function setApprovalForAll(address operator, bool approved) external;\n"
            "function _approve(address to, uint256 tokenId) external;\n";
    }

    /**
     * @dev see {IExtension-getInterface}
     */
    function getInterface() public virtual override returns (Interface[] memory interfaces) {
        interfaces = new Interface[](1);

        bytes4[] memory functions = new bytes4[](3);
        functions[0] = IApproveLogic.approve.selector;
        functions[1] = IApproveLogic.setApprovalForAll.selector;
        functions[2] = IApproveLogic._approve.selector;

        interfaces[0] = Interface(type(IApproveLogic).interfaceId, functions);
    }
}

File 4 of 12 : IGetterLogic.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@violetprotocol/extendable/extensions/InternalExtension.sol";

interface IGetterLogic {
    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) external returns (uint256);

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) external returns (address);

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) external returns (address);

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) external returns (bool);

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     *
     * Requirements:
     *
     * - Must be modified with `public _internal`.
     */
    function _exists(uint256 tokenId) external returns (bool);

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     * - Must be modified with `public _internal`.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) external returns (bool);
}

abstract contract GetterExtension is IGetterLogic, InternalExtension {
    /**
     * @dev see {IExtension-getSolidityInterface}
     */
    function getSolidityInterface() public pure virtual override returns (string memory) {
        return
            "function balanceOf(address owner) external view returns (uint256);\n"
            "function ownerOf(uint256 tokenId) external view returns (address);\n"
            "function getApproved(uint256 tokenId) external view returns (address);\n"
            "function isApprovedForAll(address owner, address operator) external view returns (bool);\n"
            "function _exists(uint256 tokenId) external view returns (bool);\n"
            "function _isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);\n";
    }

    /**
     * @dev see {IExtension-getInterface}
     */
    function getInterface() public virtual override returns (Interface[] memory interfaces) {
        interfaces = new Interface[](1);

        bytes4[] memory functions = new bytes4[](6);
        functions[0] = IGetterLogic.balanceOf.selector;
        functions[1] = IGetterLogic.ownerOf.selector;
        functions[2] = IGetterLogic.getApproved.selector;
        functions[3] = IGetterLogic.isApprovedForAll.selector;
        functions[4] = IGetterLogic._exists.selector;
        functions[5] = IGetterLogic._isApprovedOrOwner.selector;

        interfaces[0] = Interface(type(IGetterLogic).interfaceId, functions);
    }
}

File 5 of 12 : InternalExtension.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./Extension.sol";
import "../utils/Internal.sol";
import "../errors/Errors.sol";

/**
 *  ______  __  __  ______  ______  __   __  _____   ______  ______  __      ______    
 * /\  ___\/\_\_\_\/\__  _\/\  ___\/\ "-.\ \/\  __-./\  __ \/\  == \/\ \    /\  ___\
 * \ \  __\\/_/\_\/\/_/\ \/\ \  __\\ \ \-.  \ \ \/\ \ \  __ \ \  __<\ \ \___\ \  __\
 *  \ \_____\/\_\/\_\ \ \_\ \ \_____\ \_\\"\_\ \____-\ \_\ \_\ \_____\ \_____\ \_____\
 *   \/_____/\/_/\/_/  \/_/  \/_____/\/_/ \/_/\/____/ \/_/\/_/\/_____/\/_____/\/_____/
 *
 *  Base contract for Internal Extensions in the Extendable Framework
 *  
 *  Internal Extensions are used to house common functions that are used by other contract extensions.
 *  This is used to make internal functions usable across all your extensions without exposing it
 *  to the external world.
 *
 *  Define your custom Extension interface and implement it whilst inheriting this contract:
 *      contract YourExtension is IYourExtension, InternalExtension {...}
 *
 *  Then define your function and simply modify it in the following way:
 *      contract YourExtension is IYourExtension, InternalExtension {
 *          function _someFunc() public _internal {}
 *      }
 *   
 *  Notice that your internal function carries both the `public` visibility modifier and the `_internal` 
 *  modifier. This is because cross-extension calls are resolved as external calls and `public` allows
 *  your other extensions to call them whilst `_internal` restricts callers to only extensions of the
 *  same contract.
 *
 *  Note:
 *  Use underscores `_` as internal function prefixes as general naming convention.
 */
abstract contract InternalExtension is Internal, Extension {}

File 6 of 12 : Extension.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./IExtension.sol";
import "../errors/Errors.sol";
import "../utils/CallerContext.sol";
import "../erc165/IERC165Logic.sol";

/**
 *  ______  __  __  ______  ______  __   __  _____   ______  ______  __      ______    
 * /\  ___\/\_\_\_\/\__  _\/\  ___\/\ "-.\ \/\  __-./\  __ \/\  == \/\ \    /\  ___\
 * \ \  __\\/_/\_\/\/_/\ \/\ \  __\\ \ \-.  \ \ \/\ \ \  __ \ \  __<\ \ \___\ \  __\
 *  \ \_____\/\_\/\_\ \ \_\ \ \_____\ \_\\"\_\ \____-\ \_\ \_\ \_____\ \_____\ \_____\
 *   \/_____/\/_/\/_/  \/_/  \/_____/\/_/ \/_/\/____/ \/_/\/_/\/_____/\/_____/\/_____/
 *
 *  Base contract for Extensions in the Extendable Framework
 *  
 *  Inherit and implement this contract to create Extension contracts!
 *
 *  Implements the EIP-165 standard for interface detection of implementations during runtime.
 *  Uses the ERC165 singleton pattern where the actual implementation logic of the interface is
 *  deployed in a separate contract. See ERC165Logic. Deterministic deployment guarantees the
 *  ERC165Logic contract to always exist as static address 0x16C940672fA7820C36b2123E657029d982629070
 *
 *  Define your custom Extension interface and implement it whilst inheriting this contract:
 *      contract YourExtension is IYourExtension, Extension {...}
 *
 */
abstract contract Extension is CallerContext, IExtension, IERC165, IERC165Register {
    address constant ERC165LogicAddress = 0x16C940672fA7820C36b2123E657029d982629070;

    /**
     * @dev Constructor registers your custom Extension interface under EIP-165:
     *      https://eips.ethereum.org/EIPS/eip-165
    */
    constructor() {
        Interface[] memory interfaces = getInterface();
        for (uint256 i = 0; i < interfaces.length; i++) {
            Interface memory iface = interfaces[i];
            registerInterface(iface.interfaceId);

            for (uint256 j = 0; j < iface.functions.length; j++) {
                registerInterface(iface.functions[j]);
            }
        }

        registerInterface(type(IExtension).interfaceId);
    }

    function supportsInterface(bytes4 interfaceId) external override virtual returns(bool) {
        (bool success, bytes memory result) = ERC165LogicAddress.delegatecall(abi.encodeWithSignature("supportsInterface(bytes4)", interfaceId));

        if (!success) {
            assembly {
                revert(result, returndatasize())
            }
        }

        return abi.decode(result, (bool));
    }

    function registerInterface(bytes4 interfaceId) public override virtual {
        (bool success, ) = ERC165LogicAddress.delegatecall(abi.encodeWithSignature("registerInterface(bytes4)", interfaceId));

        if (!success) {
            assembly {
                returndatacopy(0, 0, returndatasize())
                revert(0, returndatasize())
            }
        }
    }

    /**
     * @dev Unidentified function signature calls to any Extension reverts with
     *      ExtensionNotImplemented error
    */
    function _fallback() internal virtual {
        revert ExtensionNotImplemented();
    }

    /**
     * @dev Fallback function passes to internal _fallback() logic
    */
    fallback() external payable virtual {
        _fallback();
    }
    
    /**
     * @dev Payable fallback function passes to internal _fallback() logic
    */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Virtual override declaration of getFunctionSelectors() function to silence compiler
     *
     * Must be implemented in inherited contract.
    */
    function getInterface() override public virtual returns(Interface[] memory);
}

File 7 of 12 : Internal.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/**
 * @dev Internal contract base inherited by InternalExtension to allow access
 *      to `_internal` modifier for functions that should only be callable by
 *      other Extensions of the current contract thus keeping the functions
 *      'internal' with respects to Extendable contract scope.
 *
 * Modify your functions with `_internal` to restrict callers to only originate
 * from the current Extendable contract.
 *
 * Note that due to the nature of cross-Extension calls, they are deemed as external
 * calls and thus your functions must counterintuitively be marked as both:
 *
 * `public _internal`
 *
 * function yourFunction() public _internal {}
*/

contract Internal {
    modifier _internal() {
        require(msg.sender == address(this), "external caller not allowed");
        _;
    }
}

File 8 of 12 : Errors.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/**
 * @dev  ExtensionNotImplemented error is emitted by Extendable and Extensions
 *       where no implementation for a specified function signature exists
 *       in the contract
*/
error ExtensionNotImplemented();


/**
 * @dev  Utility library for contracts to catch custom errors
 *       Pass in a return `result` from a call, and the selector for your error message
 *       and the `catchCustomError` function will return `true` if the error was found
 *       or `false` otherwise
*/
library Errors {
    function catchCustomError(bytes memory result, bytes4 errorSelector) internal pure returns(bool) {
        bytes4 caught;
        assembly {
            caught := mload(add(result, 0x20))
        }

        return caught == errorSelector;
    }
}

File 9 of 12 : IExtension.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

struct Interface {
    bytes4 interfaceId;
    bytes4[] functions;
}

/**
 * @dev Interface for Extension
*/
interface IExtension {
    /**
     * @dev Returns a full view of the functional interface of the extension
     *
     * Must return a list of the functions in the interface of your custom Extension
     * in the same format and syntax as in the interface itself as a string, 
     * escaped-newline separated.
     *
     * OPEN TO SUGGESTIONS FOR IMPROVEMENT ON THIS METHODOLOGY FOR 
     * DEEP DESCRIPTIVE RUNTIME INTROSPECTION
     *
     * Intent is to allow developers that want to integrate with an Extendable contract
     * that will have a constantly evolving interface, due to the nature of Extendables,
     * to be able to easily inspect and query for the current state of the interface and
     * integrate with it.
     *
     * See {ExtendLogic-getSolidityInterface} for an example.
    */
    function getSolidityInterface() external pure returns(string memory);

    /**
     * @dev Returns the interface IDs that are implemented by the Extension
     *
     * These are full interface IDs and ARE NOT function selectors. Full interface IDs are
     * XOR'd function selectors of an interface. For example the interface ID of the ERC721
     * interface is 0x80ac58cd determined by the XOR or all function selectors of the interface.
     * 
     * If an interface only consists of a single function, then the interface ID is identical
     * to that function selector.
     * 
     * Provides a simple abstraction from the developer for any custom Extension to 
     * be EIP-165 compliant out-of-the-box simply by implementing this function. 
     *
     * Excludes any functions either already described by other interface definitions
     * that are not developed on top of this backbone i.e. EIP-165, IExtension
    */
    function getInterface() external returns(Interface[] memory interfaces);
}

File 10 of 12 : CallerContext.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {CallerState, CallerContextStorage} from "../storage/CallerContextStorage.sol";

/**
 * @dev CallerContext contract provides Extensions with proper caller-scoped contexts.
 *      Inherit this contract with your Extension to make use of caller references.
 *
 * `msg.sender` may not behave as developer intends when using within Extensions as many
 * calls may be exchanged between intra-contract extensions which result in a `msg.sender` as self.
 * Instead of using `msg.sender`, replace it with 
 *      - `_lastExternalCaller()` for the most recent caller in the call chain that is external to this contract
 *      - `_lastCaller()` for the most recent caller
 *
 * CallerContext provides a deep callstack to track the caller of the Extension/Extendable contract
 * at any point in the execution cycle.
 *
*/
contract CallerContext {
    /**
     * @dev Returns the most recent caller of this contract that came from outside this contract.
     *
     * Used by extensions that require fetching msg.sender that aren't cross-extension calls.
     * Cross-extension calls resolve msg.sender as the current contract and so the actual
     * caller context is obfuscated.
     * 
     * This function should be used in place of `msg.sender` where external callers are read.
     */
    function _lastExternalCaller() internal view returns(address) {
        CallerState storage state = CallerContextStorage._getState();

        for (uint i = state.callerStack.length - 1; i >= 0; i--) {
            address lastSubsequentCaller = state.callerStack[i];
            if (lastSubsequentCaller != address(this)) {
                return lastSubsequentCaller;
            }
        }

        revert("_lastExternalCaller: end of stack");
    }

    /**
     * @dev Returns the most recent caller of this contract.
     *
     * Last caller may also be the current contract.
     *
     * If the call is directly to the contract, without passing an Extendable, return `msg.sender` instead
     */
    function _lastCaller() internal view returns(address) {
        CallerState storage state = CallerContextStorage._getState();
        if (state.callerStack.length > 0)
            return state.callerStack[state.callerStack.length - 1];
        else
            return msg.sender;
    }
}

File 11 of 12 : IERC165Logic.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external returns (bool);
}


/**
 * @dev Storage based implementation of the {IERC165} interface.
 *
 * Uses Extendable storage pattern to populate the registered interfaces storage variable.
 */
interface IERC165Register {
    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function registerInterface(bytes4 interfaceId) external;
}

File 12 of 12 : CallerContextStorage.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

struct CallerState {
    // Stores a list of callers in the order they are received
    // The current caller context is always the last-most address
    address[] callerStack;
}

library CallerContextStorage {
    bytes32 constant private STORAGE_NAME = keccak256("extendable.framework.v1:caller-state");

    function _getState()
        internal 
        view
        returns (CallerState storage callerState) 
    {
        bytes32 position = keccak256(abi.encodePacked(address(this), STORAGE_NAME));
        assembly {
            callerState.slot := position
        }
    }
}

Settings
{
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"ExtensionNotImplemented","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"_approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getInterface","outputs":[{"components":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"},{"internalType":"bytes4[]","name":"functions","type":"bytes4[]"}],"internalType":"struct Interface[]","name":"interfaces","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getSolidityInterface","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"registerInterface","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060006200001e620000ec565b905060005b8151811015620000d2576000828281518110620000445762000044620002fa565b602002602001015190506200006381600001516200023b60201b60201c565b60005b816020015151811015620000ba57620000a582602001518281518110620000915762000091620002fa565b60200260200101516200023b60201b60201c565b80620000b18162000310565b91505062000066565b50508080620000c99062000310565b91505062000023565b50620000e56377841c7160e11b6200023b565b5062000376565b604080516001808252818301909252606091816020015b6040805180820190915260008152606060208201528152602001906001900390816200010357505060408051600380825260808201909252919250600091906020820160608036833701905050905063095ea7b360e01b81600081518110620001705762000170620002fa565b6001600160e01b031990921660209283029190910190910152805163a22cb46560e01b9082906001908110620001aa57620001aa620002fa565b6001600160e01b0319909216602092830291909101909101528051637b7d722560e01b9082906002908110620001e457620001e4620002fa565b6001600160e01b03199092166020928302919091018201526040805180820190915263d00f61f360e01b8152908101829052825183906000906200022c576200022c620002fa565b60200260200101819052505090565b6040516001600160e01b0319821660248201526000907316c940672fa7820c36b2123e657029d9826290709060440160408051601f198184030181529181526020820180516001600160e01b0316624299b760e71b17905251620002a0919062000338565b600060405180830381855af49150503d8060008114620002dd576040519150601f19603f3d011682016040523d82523d6000602084013e620002e2565b606091505b5050905080620002f6573d6000803e3d6000fd5b5050565b634e487b7160e01b600052603260045260246000fd5b6000600182016200033157634e487b7160e01b600052601160045260246000fd5b5060010190565b6000825160005b818110156200035b57602081860181015185830152016200033f565b818111156200036b576000828501525b509190910192915050565b610da280620003866000396000f3fe6080604052600436106100745760003560e01c806330101f3d1161004e57806330101f3d146101005780637b7d722514610122578063a22cb46514610142578063df1827df1461016257610083565b806301ffc9a71461008b578063095ea7b3146100c0578063214cdb80146100e057610083565b3661008357610081610184565b005b610081610184565b34801561009757600080fd5b506100ab6100a6366004610a5f565b61019d565b60405190151581526020015b60405180910390f35b3480156100cc57600080fd5b506100816100db366004610aa8565b610284565b3480156100ec57600080fd5b506100816100fb366004610a5f565b6104d4565b34801561010c57600080fd5b506101156105a3565b6040516100b79190610b04565b34801561012e57600080fd5b5061008161013d366004610aa8565b6105c3565b34801561014e57600080fd5b5061008161015d366004610b45565b610702565b34801561016e57600080fd5b50610177610714565b6040516100b79190610b7e565b60405163deba8f3160e01b815260040160405180910390fd5b6040516001600160e01b031982166024820152600090819081907316c940672fa7820c36b2123e657029d9826290709060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b1790525161021a9190610c2e565b600060405180830381855af49150503d8060008114610255576040519150601f19603f3d011682016040523d82523d6000602084013e61025a565b606091505b509150915081610268573d81fd5b8080602001905181019061027c9190610c4a565b949350505050565b6040516331a9108f60e11b8152600481018290526000903090636352211e906024016020604051808303816000875af11580156102c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e99190610c67565b9050806001600160a01b0316836001600160a01b03160361035b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b031661036d610856565b6001600160a01b031614806103fd57503063e985e9c58261038c610856565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156103d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fd9190610c4a565b61046f5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610352565b604051637b7d722560e01b81526001600160a01b0384166004820152602481018390523090637b7d722590604401600060405180830381600087803b1580156104b757600080fd5b505af11580156104cb573d6000803e3d6000fd5b50505050505050565b6040516001600160e01b0319821660248201526000907316c940672fa7820c36b2123e657029d9826290709060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16624299b760e71b1790525161054c9190610c2e565b600060405180830381855af49150503d8060008114610587576040519150601f19603f3d011682016040523d82523d6000602084013e61058c565b606091505b505090508061059f573d6000803e3d6000fd5b5050565b60606040518060e0016040528060b78152602001610cdf60b79139905090565b3330146106125760405162461bcd60e51b815260206004820152601b60248201527f65787465726e616c2063616c6c6572206e6f7420616c6c6f77656400000000006044820152606401610352565b600061061c6108c7565b6000838152600482810160205260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03881690811790915591516331a9108f60e11b815290810185905291925083913090636352211e906024016020604051808303816000875af11580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c89190610c67565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b61059f61070d610856565b838361092f565b604080516001808252818301909252606091816020015b60408051808201909152600081526060602082015281526020019060019003908161072b57505060408051600380825260808201909252919250600091906020820160608036833701905050905063095ea7b360e01b8160008151811061079457610794610c84565b6001600160e01b031990921660209283029190910190910152805163a22cb46560e01b90829060019081106107cb576107cb610c84565b6001600160e01b0319909216602092830291909101909101528051637b7d722560e01b908290600290811061080257610802610c84565b6001600160e01b03199092166020928302919091018201526040805180820190915263d00f61f360e01b81529081018290528251839060009061084757610847610c84565b60200260200101819052505090565b600080610861610a11565b805490915060009061087590600190610cb0565b90505b600082600001828154811061088f5761088f610c84565b6000918252602090912001546001600160a01b031690503081146108b4579392505050565b50806108bf81610cc7565b915050610878565b6040516bffffffffffffffffffffffff193060601b1660208201527f9e4673de1ccd04f1c4802d719ca4663f19655a024fdf4ebb6d488d3e26150fb5603482015260009081906054015b60408051601f19818403018152919052805160209091012092915050565b816001600160a01b0316836001600160a01b0316036109905760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610352565b600061099a6108c7565b6001600160a01b038581166000818152600584016020908152604080832094891680845294825291829020805460ff19168815159081179091559151918252939450919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b6040516bffffffffffffffffffffffff193060601b1660208201527f37daa740f89c6d2d45c8cff54bcd79cd943b0b83a0445f091d1f2980355bda4260348201526000908190605401610911565b600060208284031215610a7157600080fd5b81356001600160e01b031981168114610a8957600080fd5b9392505050565b6001600160a01b0381168114610aa557600080fd5b50565b60008060408385031215610abb57600080fd5b8235610ac681610a90565b946020939093013593505050565b60005b83811015610aef578181015183820152602001610ad7565b83811115610afe576000848401525b50505050565b6020815260008251806020840152610b23816040850160208701610ad4565b601f01601f19169190910160400192915050565b8015158114610aa557600080fd5b60008060408385031215610b5857600080fd5b8235610b6381610a90565b91506020830135610b7381610b37565b809150509250929050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015610c1f57898403603f19018652825180516001600160e01b03199081168652908901518986018990528051898701819052908a0191849160608801905b80841015610c0957845183168252938c019360019390930192908c0190610be7565b50988b0198965050509288019250600101610ba6565b50919998505050505050505050565b60008251610c40818460208701610ad4565b9190910192915050565b600060208284031215610c5c57600080fd5b8151610a8981610b37565b600060208284031215610c7957600080fd5b8151610a8981610a90565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610cc257610cc2610c9a565b500390565b600081610cd657610cd6610c9a565b50600019019056fe66756e6374696f6e20617070726f7665286164647265737320746f2c2075696e7432353620746f6b656e4964292065787465726e616c3b0a66756e6374696f6e20736574417070726f76616c466f72416c6c2861646472657373206f70657261746f722c20626f6f6c20617070726f766564292065787465726e616c3b0a66756e6374696f6e205f617070726f7665286164647265737320746f2c2075696e7432353620746f6b656e4964292065787465726e616c3b0aa164736f6c634300080d000a

Deployed Bytecode

0x6080604052600436106100745760003560e01c806330101f3d1161004e57806330101f3d146101005780637b7d722514610122578063a22cb46514610142578063df1827df1461016257610083565b806301ffc9a71461008b578063095ea7b3146100c0578063214cdb80146100e057610083565b3661008357610081610184565b005b610081610184565b34801561009757600080fd5b506100ab6100a6366004610a5f565b61019d565b60405190151581526020015b60405180910390f35b3480156100cc57600080fd5b506100816100db366004610aa8565b610284565b3480156100ec57600080fd5b506100816100fb366004610a5f565b6104d4565b34801561010c57600080fd5b506101156105a3565b6040516100b79190610b04565b34801561012e57600080fd5b5061008161013d366004610aa8565b6105c3565b34801561014e57600080fd5b5061008161015d366004610b45565b610702565b34801561016e57600080fd5b50610177610714565b6040516100b79190610b7e565b60405163deba8f3160e01b815260040160405180910390fd5b6040516001600160e01b031982166024820152600090819081907316c940672fa7820c36b2123e657029d9826290709060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b1790525161021a9190610c2e565b600060405180830381855af49150503d8060008114610255576040519150601f19603f3d011682016040523d82523d6000602084013e61025a565b606091505b509150915081610268573d81fd5b8080602001905181019061027c9190610c4a565b949350505050565b6040516331a9108f60e11b8152600481018290526000903090636352211e906024016020604051808303816000875af11580156102c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e99190610c67565b9050806001600160a01b0316836001600160a01b03160361035b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b031661036d610856565b6001600160a01b031614806103fd57503063e985e9c58261038c610856565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156103d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fd9190610c4a565b61046f5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610352565b604051637b7d722560e01b81526001600160a01b0384166004820152602481018390523090637b7d722590604401600060405180830381600087803b1580156104b757600080fd5b505af11580156104cb573d6000803e3d6000fd5b50505050505050565b6040516001600160e01b0319821660248201526000907316c940672fa7820c36b2123e657029d9826290709060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16624299b760e71b1790525161054c9190610c2e565b600060405180830381855af49150503d8060008114610587576040519150601f19603f3d011682016040523d82523d6000602084013e61058c565b606091505b505090508061059f573d6000803e3d6000fd5b5050565b60606040518060e0016040528060b78152602001610cdf60b79139905090565b3330146106125760405162461bcd60e51b815260206004820152601b60248201527f65787465726e616c2063616c6c6572206e6f7420616c6c6f77656400000000006044820152606401610352565b600061061c6108c7565b6000838152600482810160205260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03881690811790915591516331a9108f60e11b815290810185905291925083913090636352211e906024016020604051808303816000875af11580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c89190610c67565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b61059f61070d610856565b838361092f565b604080516001808252818301909252606091816020015b60408051808201909152600081526060602082015281526020019060019003908161072b57505060408051600380825260808201909252919250600091906020820160608036833701905050905063095ea7b360e01b8160008151811061079457610794610c84565b6001600160e01b031990921660209283029190910190910152805163a22cb46560e01b90829060019081106107cb576107cb610c84565b6001600160e01b0319909216602092830291909101909101528051637b7d722560e01b908290600290811061080257610802610c84565b6001600160e01b03199092166020928302919091018201526040805180820190915263d00f61f360e01b81529081018290528251839060009061084757610847610c84565b60200260200101819052505090565b600080610861610a11565b805490915060009061087590600190610cb0565b90505b600082600001828154811061088f5761088f610c84565b6000918252602090912001546001600160a01b031690503081146108b4579392505050565b50806108bf81610cc7565b915050610878565b6040516bffffffffffffffffffffffff193060601b1660208201527f9e4673de1ccd04f1c4802d719ca4663f19655a024fdf4ebb6d488d3e26150fb5603482015260009081906054015b60408051601f19818403018152919052805160209091012092915050565b816001600160a01b0316836001600160a01b0316036109905760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610352565b600061099a6108c7565b6001600160a01b038581166000818152600584016020908152604080832094891680845294825291829020805460ff19168815159081179091559151918252939450919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b6040516bffffffffffffffffffffffff193060601b1660208201527f37daa740f89c6d2d45c8cff54bcd79cd943b0b83a0445f091d1f2980355bda4260348201526000908190605401610911565b600060208284031215610a7157600080fd5b81356001600160e01b031981168114610a8957600080fd5b9392505050565b6001600160a01b0381168114610aa557600080fd5b50565b60008060408385031215610abb57600080fd5b8235610ac681610a90565b946020939093013593505050565b60005b83811015610aef578181015183820152602001610ad7565b83811115610afe576000848401525b50505050565b6020815260008251806020840152610b23816040850160208701610ad4565b601f01601f19169190910160400192915050565b8015158114610aa557600080fd5b60008060408385031215610b5857600080fd5b8235610b6381610a90565b91506020830135610b7381610b37565b809150509250929050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015610c1f57898403603f19018652825180516001600160e01b03199081168652908901518986018990528051898701819052908a0191849160608801905b80841015610c0957845183168252938c019360019390930192908c0190610be7565b50988b0198965050509288019250600101610ba6565b50919998505050505050505050565b60008251610c40818460208701610ad4565b9190910192915050565b600060208284031215610c5c57600080fd5b8151610a8981610b37565b600060208284031215610c7957600080fd5b8151610a8981610a90565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610cc257610cc2610c9a565b500390565b600081610cd657610cd6610c9a565b50600019019056fe66756e6374696f6e20617070726f7665286164647265737320746f2c2075696e7432353620746f6b656e4964292065787465726e616c3b0a66756e6374696f6e20736574417070726f76616c466f72416c6c2861646472657373206f70657261746f722c20626f6f6c20617070726f766564292065787465726e616c3b0a66756e6374696f6e205f617070726f7665286164647265737320746f2c2075696e7432353620746f6b656e4964292065787465726e616c3b0aa164736f6c634300080d000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.