ETH Price: $1,609.92 (+1.08%)
Gas: 8 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040125155012021-05-27 9:03:59853 days 21 hrs ago1622106239IN
 Create: ZeroExOrdersV2InteractiveAdapter
0 ETH0.0404718530.1

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZeroExOrdersV2InteractiveAdapter

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion
File 1 of 8 : ZeroExOrdersV2InteractiveAdapter.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import { ERC20 } from "../../interfaces/ERC20.sol";
import { MixinExchangeCore } from "../../interfaces/MixinExchangeCore.sol";
import { SafeERC20 } from "../../shared/SafeERC20.sol";
import { TokenAmount } from "../../shared/Structs.sol";
import { ERC20ProtocolAdapter } from "../../adapters/ERC20ProtocolAdapter.sol";
import { InteractiveAdapter } from "../InteractiveAdapter.sol";

/**
 * @title Interactive adapter for 0x Orders (v2).
 * @dev Implementation of InteractiveAdapter abstract contract.
 * @author Igor Sobolev <[email protected]>
 */
contract ZeroExOrdersV2InteractiveAdapter is InteractiveAdapter, ERC20ProtocolAdapter {
    using SafeERC20 for ERC20;

    address internal constant ZERO_EX_EXCHANGE = 0x080bf510FCbF18b91105470639e9561022937712;
    address internal constant ZERO_EX_ERC_20_PROXY = 0x95E6F48254609A6ee006F7D493c8e5fB97094ceF;

    /**
     * @notice Exchanges tokens using ZeroEx contract.
     * @param tokenAmounts Array with one element - TokenAmount struct with
     *     "sell" token address, "sell" token amount to be deposited, and amount type.
     * @param data Bytes array with ABI-encoded Order and signature.
     * @return tokensToBeWithdrawn Array with one element -  "buy" token address.
     * @dev Implementation of InteractiveAdapter function.
     */
    function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data)
        external
        payable
        override
        returns (address[] memory tokensToBeWithdrawn)
    {
        require(tokenAmounts.length == 1, "ZEOV2IA: should be 1 tokenAmount");

        address token = tokenAmounts[0].token;
        uint256 amount = getAbsoluteAmountDeposit(tokenAmounts[0]);

        (
            MixinExchangeCore.Order memory order,
            uint256 takerAssetFillAmount,
            bytes memory signature
        ) = abi.decode(data, (MixinExchangeCore.Order, uint256, bytes));

        ERC20(token).safeApproveMax(ZERO_EX_ERC_20_PROXY, amount, "ZEOV2IA");

        tokensToBeWithdrawn = new address[](1);
        // Shift by 516 = 32 * 16 + 4 to get return token address from data
        tokensToBeWithdrawn[0] = abi.decode(data[516:], (address));

        try
            MixinExchangeCore(ZERO_EX_EXCHANGE).fillOrder(order, takerAssetFillAmount, signature)
        returns (MixinExchangeCore.FillResults memory) {} catch Error(string memory reason) {
            //solhint-disable-previous-line no-empty-blocks
            revert(reason);
        } catch {
            revert("ZEOV2IA: deposit fail");
        }
    }

    /**
     * @notice Withdraw functionality is not integrated yet.
     * @dev Implementation of InteractiveAdapter function.
     */
    function withdraw(TokenAmount[] calldata, bytes calldata)
        external
        payable
        override
        returns (address[] memory)
    {
        revert("ZEOV2IA: no withdraw");
    }
}

File 2 of 8 : ERC20ProtocolAdapter.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import { ERC20 } from "../interfaces/ERC20.sol";
import { ProtocolAdapter } from "./ProtocolAdapter.sol";

/**
 * @title Adapter for any protocol with ERC20 interface.
 * @dev Implementation of ProtocolAdapter abstract contract.
 * @author Igor Sobolev <[email protected]>
 */
contract ERC20ProtocolAdapter is ProtocolAdapter {
    /**
     * @return Amount of tokens held by the given account.
     * @dev Implementation of ProtocolAdapter abstract contract function.
     */
    function getBalance(address token, address account) public view override returns (int256) {
        return int256(ERC20(token).balanceOf(account));
    }
}

File 3 of 8 : ProtocolAdapter.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

/**
 * @title Protocol adapter abstract contract.
 * @dev adapterType(), tokenType(), and getBalance() functions MUST be implemented.
 * @author Igor Sobolev <[email protected]>
 */
abstract contract ProtocolAdapter {
    /**
     * @dev MUST return amount and type of the given token
     * locked on the protocol by the given account.
     */
    function getBalance(address token, address account) public virtual returns (int256);
}

File 4 of 8 : InteractiveAdapter.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import { ProtocolAdapter } from "../adapters/ProtocolAdapter.sol";
import { TokenAmount, AmountType } from "../shared/Structs.sol";
import { ERC20 } from "../interfaces/ERC20.sol";

/**
 * @title Base contract for interactive protocol adapters.
 * @dev deposit() and withdraw() functions MUST be implemented
 * as well as all the functions from ProtocolAdapter abstract contract.
 * @author Igor Sobolev <[email protected]>
 */
abstract contract InteractiveAdapter is ProtocolAdapter {
    uint256 internal constant DELIMITER = 1e18;
    address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /**
     * @dev The function must deposit assets to the protocol.
     * @return MUST return assets to be sent back to the `msg.sender`.
     */
    function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data)
        external
        payable
        virtual
        returns (address[] memory);

    /**
     * @dev The function must withdraw assets from the protocol.
     * @return MUST return assets to be sent back to the `msg.sender`.
     */
    function withdraw(TokenAmount[] calldata tokenAmounts, bytes calldata data)
        external
        payable
        virtual
        returns (address[] memory);

    function getAbsoluteAmountDeposit(TokenAmount calldata tokenAmount)
        internal
        view
        virtual
        returns (uint256)
    {
        address token = tokenAmount.token;
        uint256 amount = tokenAmount.amount;
        AmountType amountType = tokenAmount.amountType;

        require(
            amountType == AmountType.Relative || amountType == AmountType.Absolute,
            "IA: bad amount type"
        );
        if (amountType == AmountType.Relative) {
            require(amount <= DELIMITER, "IA: bad amount");

            uint256 balance;
            if (token == ETH) {
                balance = address(this).balance;
            } else {
                balance = ERC20(token).balanceOf(address(this));
            }

            if (amount == DELIMITER) {
                return balance;
            } else {
                return mul_(balance, amount) / DELIMITER;
            }
        } else {
            return amount;
        }
    }

    function getAbsoluteAmountWithdraw(TokenAmount calldata tokenAmount)
        internal
        virtual
        returns (uint256)
    {
        address token = tokenAmount.token;
        uint256 amount = tokenAmount.amount;
        AmountType amountType = tokenAmount.amountType;

        require(
            amountType == AmountType.Relative || amountType == AmountType.Absolute,
            "IA: bad amount type"
        );
        if (amountType == AmountType.Relative) {
            require(amount <= DELIMITER, "IA: bad amount");

            int256 balanceSigned = getBalance(token, address(this));
            uint256 balance = balanceSigned > 0 ? uint256(balanceSigned) : uint256(-balanceSigned);
            if (amount == DELIMITER) {
                return balance;
            } else {
                return mul_(balance, amount) / DELIMITER;
            }
        } else {
            return amount;
        }
    }

    function mul_(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "IA: mul overflow");

        return c;
    }
}

File 5 of 8 : ERC20.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

interface ERC20 {
    function approve(address, uint256) external returns (bool);

    function transfer(address, uint256) external returns (bool);

    function transferFrom(
        address,
        address,
        uint256
    ) external returns (bool);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address) external view returns (uint256);

    function allowance(address, address) external view returns (uint256);
}

File 6 of 8 : MixinExchangeCore.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

/**
 * @dev MixinExchangeCore interface.
 * The MixinExchangeCore interface is available here
 * github.com/0xProject/0x-monorepo/blob/2.1/contracts/exchange/contracts/src/MixinExchangeCore.sol.
 */
interface MixinExchangeCore {
    struct Order {
        address makerAddress;
        address takerAddress;
        address feeRecipientAddress;
        address senderAddress;
        uint256 makerAssetAmount;
        uint256 takerAssetAmount;
        uint256 makerFee;
        uint256 takerFee;
        uint256 expirationTimeSeconds;
        uint256 salt;
        bytes makerAssetData;
        bytes takerAssetData;
    }

    struct FillResults {
        uint256 makerAssetFilledAmount;
        uint256 takerAssetFilledAmount;
        uint256 makerFeePaid;
        uint256 takerFeePaid;
    }

    function fillOrder(
        Order calldata order,
        uint256 takerAssetFillAmount,
        bytes calldata signature
    ) external returns (FillResults memory fillResults);
}

File 7 of 8 : SafeERC20.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;

import "../interfaces/ERC20.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token contract
 * returns false). Tokens that return no value (and instead revert or throw on failure)
 * are also supported, non-reverting calls are assumed to be successful.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    function safeTransfer(
        ERC20 token,
        address to,
        uint256 value,
        string memory location
    ) internal {
        callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transfer.selector, to, value),
            "transfer",
            location
        );
    }

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 value,
        string memory location
    ) internal {
        callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transferFrom.selector, from, to, value),
            "transferFrom",
            location
        );
    }

    function safeApprove(
        ERC20 token,
        address spender,
        uint256 value,
        string memory location
    ) internal {
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            string(abi.encodePacked("SafeERC20: bad approve call from ", location))
        );
        callOptionalReturn(
            token,
            abi.encodeWithSelector(token.approve.selector, spender, value),
            "approve",
            location
        );
    }

    function safeApproveMax(
        ERC20 token,
        address spender,
        uint256 value,
        string memory location
    ) internal {
        uint256 allowance = ERC20(token).allowance(address(this), spender);
        if (allowance < value) {
            if (allowance > 0) {
                safeApprove(token, spender, 0, location);
            }
            safeApprove(token, spender, type(uint256).max, location);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract),
     * relaxing the requirement on the return value: the return value is optional
     * (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     * @param location Location of the call (for debug).
     */
    function callOptionalReturn(
        ERC20 token,
        bytes memory data,
        string memory functionName,
        string memory location
    ) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking
        // mechanism, since we're implementing it ourselves.

        // We implement two-steps call as callee is a contract is a responsibility of a caller.
        //  1. The call itself is made, and success asserted
        //  2. The return value is decoded, which in turn checks the size of the returned data.

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(
            success,
            string(abi.encodePacked("SafeERC20: ", functionName, " failed in ", location))
        );

        if (returndata.length > 0) {
            // Return data is optional
            require(
                abi.decode(returndata, (bool)),
                string(
                    abi.encodePacked("SafeERC20: ", functionName, " returned false in ", location)
                )
            );
        }
    }
}

File 8 of 8 : Structs.sol
// Copyright (C) 2020 Zerion Inc. <https://zerion.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: LGPL-3.0-only

pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

// The struct consists of TokenBalanceMeta structs for
// (base) token and its underlying tokens (if any).
struct FullTokenBalance {
    TokenBalanceMeta base;
    TokenBalanceMeta[] underlying;
}

// The struct consists of TokenBalance struct
// with token address and absolute amount
// and ERC20Metadata struct with ERC20-style metadata.
// NOTE: 0xEeee...EEeE address is used for ETH.
struct TokenBalanceMeta {
    TokenBalance tokenBalance;
    ERC20Metadata erc20metadata;
}

// The struct consists of ERC20-style token metadata.
struct ERC20Metadata {
    string name;
    string symbol;
    uint8 decimals;
}

// The struct consists of protocol adapter's name
// and array of TokenBalance structs
// with token addresses and absolute amounts.
struct AdapterBalance {
    bytes32 protocolAdapterName;
    TokenBalance[] tokenBalances;
}

// The struct consists of token address
// and its absolute amount (may be negative).
// 0xEeee...EEeE is used for Ether
struct TokenBalance {
    address token;
    int256 amount;
}

// The struct consists of token address,
// and price per full share (1e18).
// 0xEeee...EEeE is used for Ether
struct Component {
    address token;
    int256 rate;
}

//=============================== Interactive Adapters Structs ====================================

// The struct consists of name of the protocol adapter,
// action type, array of token amounts,
// and some additional data (depends on the protocol).
struct Action {
    bytes32 protocolAdapterName;
    ActionType actionType;
    TokenAmount[] tokenAmounts;
    bytes data;
}

// The struct consists of token address,
// its amount, and amount type, as well as
// permit type and calldata.
struct Input {
    TokenAmount tokenAmount;
    Permit permit;
}

// The struct consists of
// permit type and calldata.
struct Permit {
    PermitType permitType;
    bytes permitCallData;
}

// The struct consists of token address,
// its amount, and amount type.
// 0xEeee...EEeE is used for Ether
struct TokenAmount {
    address token;
    uint256 amount;
    AmountType amountType;
}

// The struct consists of fee share
// and beneficiary address.
struct Fee {
    uint256 share;
    address beneficiary;
}

// The struct consists of token address
// and its absolute amount.
// 0xEeee...EEeE is used for Ether
struct AbsoluteTokenAmount {
    address token;
    uint256 absoluteAmount;
}

enum ActionType { None, Deposit, Withdraw }

enum AmountType { None, Relative, Absolute }

enum PermitType { None, EIP2612, DAI, Yearn }

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum AmountType","name":"amountType","type":"uint8"}],"internalType":"struct TokenAmount[]","name":"tokenAmounts","type":"tuple[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"deposit","outputs":[{"internalType":"address[]","name":"tokensToBeWithdrawn","type":"address[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getBalance","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum AmountType","name":"amountType","type":"uint8"}],"internalType":"struct TokenAmount[]","name":"","type":"tuple[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"withdraw","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"payable","type":"function"}]

608060405234801561001057600080fd5b5061177d806100206000396000f3fe6080604052600436106100345760003560e01c806328ffb83d14610039578063387b817414610062578063d4fac45d14610075575b600080fd5b61004c610047366004610fb0565b6100a2565b60405161005991906112ef565b60405180910390f35b61004c610070366004610fb0565b61036d565b34801561008157600080fd5b50610095610090366004610f78565b6103a1565b6040516100599190611349565b6060600184146100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061140a565b60405180910390fd5b6000858560008181106100f657fe5b61010c9260206060909202019081019150610f5c565b9050600061012b8787600081811061012057fe5b90506060020161044f565b90506000808061013d878901896110ea565b9250925092506101b97395e6f48254609a6ee006f7d493c8e5fb97094cef856040518060400160405280600781526020017f5a454f56324941000000000000000000000000000000000000000000000000008152508873ffffffffffffffffffffffffffffffffffffffff1661065b909392919063ffffffff16565b60408051600180825281830190925290602080830190803683370190505095506101e787610204818b6115f1565b8101906101f49190610f5c565b8660008151811061020157fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526040517fb4be83d500000000000000000000000000000000000000000000000000000000815273080bf510fcbf18b91105470639e95610229377129063b4be83d59061027a908690869086906004016114ad565b608060405180830381600087803b15801561029457600080fd5b505af19250505080156102e2575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102df9181019061108b565b60015b61035f576102ee61161f565b806102f9575061032d565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611352565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906113d3565b505050505050949350505050565b60606040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611476565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8416906370a08231906103f69085906004016112ce565b60206040518083038186803b15801561040e57600080fd5b505afa158015610422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104469190611233565b90505b92915050565b60008061045f6020840184610f5c565b905060208301356000610478606086016040870161106c565b9050600181600281111561048857fe5b148061049f5750600281600281111561049d57fe5b145b6104d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611365565b60018160028111156104e357fe5b141561064c57670de0b6b3a764000082111561052b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061139c565b600073ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561056657504761060b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906370a08231906105b89030906004016112ce565b60206040518083038186803b1580156105d057600080fd5b505afa1580156105e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106089190611233565b90505b670de0b6b3a764000083141561062657935061065692505050565b670de0b6b3a7640000610639828561074e565b8161064057fe5b04945050505050610656565b5091506106569050565b919050565b604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8581166024830152915160009287169163dd62ed3e916044808301926020929190829003018186803b1580156106d257600080fd5b505afa1580156106e6573d6000803e3d6000fd5b505050506040513d60208110156106fc57600080fd5b505190508281101561074757801561071b5761071b85856000856107a2565b61074785857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff856107a2565b5050505050565b60008261075d57506000610449565b8282028284828161076a57fe5b0414610446576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061143f565b81158061084e5750604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff858116602483015291519186169163dd62ed3e91604480820192602092909190829003018186803b15801561082057600080fd5b505afa158015610834573d6000803e3d6000fd5b505050506040513d602081101561084a57600080fd5b5051155b8160405160200180806117276021913960210182805190602001908083835b602083106108aa57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161086d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290610981576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561094657818101518382015260200161092e565b50505050905090810190601f1680156109735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506040805173ffffffffffffffffffffffffffffffffffffffff8516602482015260448082018590528251808303909101815260649091018252602081810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790528251808401909352600783527f617070726f76650000000000000000000000000000000000000000000000000090830152610a429186919084610a48565b50505050565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b60208310610ab057805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a73565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610b12576040519150601f19603f3d011682016040523d82523d6000602084013e610b17565b606091505b509150915081848460405160200180807f5361666545524332303a20000000000000000000000000000000000000000000815250600b0183805190602001908083835b60208310610b9757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b5a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527f206661696c656420696e20000000000000000000000000000000000000000000919093019081528451600b90910192850191508083835b60208310610c4457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c07565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290610cdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835190928392604490910191908501908083836000831561094657818101518382015260200161092e565b50805115610ec657808060200190516020811015610cfc57600080fd5b50516040517f5361666545524332303a20000000000000000000000000000000000000000000602082810191825287518893889392602b90910191908501908083835b60208310610d7c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610d3f565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527f2072657475726e65642066616c736520696e2000000000000000000000000000919093019081528451601390910192850191508083835b60208310610e2957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610dec565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290610ec4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835190928392604490910191908501908083836000831561094657818101518382015260200161092e565b505b505050505050565b803561065681611701565b600082601f830112610ee9578081fd5b813567ffffffffffffffff811115610efd57fe5b610f2e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016115cd565b818152846020838601011115610f42578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610f6d578081fd5b813561044681611701565b60008060408385031215610f8a578081fd5b8235610f9581611701565b91506020830135610fa581611701565b809150509250929050565b60008060008060408587031215610fc5578182fd5b843567ffffffffffffffff80821115610fdc578384fd5b818701915087601f830112610fef578384fd5b813581811115610ffd578485fd5b886020606083028501011115611011578485fd5b60209283019650945090860135908082111561102b578384fd5b818701915087601f83011261103e578384fd5b81358181111561104c578485fd5b88602082850101111561105d578485fd5b95989497505060200194505050565b60006020828403121561107d578081fd5b813560038110610446578182fd5b60006080828403121561109c578081fd5b6040516080810181811067ffffffffffffffff821117156110b957fe5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b6000806000606084860312156110fe578283fd5b833567ffffffffffffffff80821115611115578485fd5b818601915061018080838903121561112b578586fd5b611134816115cd565b905061113f83610ece565b815261114d60208401610ece565b602082015261115e60408401610ece565b604082015261116f60608401610ece565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e082015261010080840135818301525061012080840135818301525061014080840135838111156111c7578788fd5b6111d38a828701610ed9565b82840152505061016080840135838111156111ec578788fd5b6111f88a828701610ed9565b8284015250508095505060208601359350604086013591508082111561121c578283fd5b5061122986828701610ed9565b9150509250925092565b600060208284031215611244578081fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452815b8181101561128a5760208185018101518683018201520161126e565b8181111561129b5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561133d57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161130b565b50909695505050505050565b90815260200190565b6000602082526104466020830184611265565b60208082526013908201527f49413a2062616420616d6f756e74207479706500000000000000000000000000604082015260600190565b6020808252600e908201527f49413a2062616420616d6f756e74000000000000000000000000000000000000604082015260600190565b60208082526015908201527f5a454f563249413a206465706f736974206661696c0000000000000000000000604082015260600190565b6020808252818101527f5a454f563249413a2073686f756c64206265203120746f6b656e416d6f756e74604082015260600190565b60208082526010908201527f49413a206d756c206f766572666c6f7700000000000000000000000000000000604082015260600190565b60208082526014908201527f5a454f563249413a206e6f207769746864726177000000000000000000000000604082015260600190565b6000606082526114c160608301865161124b565b60208501516114d3608084018261124b565b5060408501516114e660a084018261124b565b5060608501516114f960c084018261124b565b50608085015160e083015260a0850151610100818185015260c08701519150610120828186015260e088015192506101408381870152828901519350610160925083838701528189015193506101809150838287015280890151935050806101a08601525061156c6101e0850183611265565b908701518482037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0016101c08601529091506115a88282611265565b91505084602084015282810360408401526115c38185611265565b9695505050505050565b60405181810167ffffffffffffffff811182821017156115e957fe5b604052919050565b60008085851115611600578182fd5b8386111561160c578182fd5b5050820193919092039150565b60e01c90565b600060443d101561162f576116fe565b600481823e6308c379a06116438251611619565b1461164d576116fe565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3d016004823e80513d67ffffffffffffffff816024840111818411171561169b57505050506116fe565b828401925082519150808211156116b557505050506116fe565b503d830160208284010111156116cd575050506116fe565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01681016020016040529150505b90565b73ffffffffffffffffffffffffffffffffffffffff8116811461172357600080fd5b5056fe5361666545524332303a2062616420617070726f76652063616c6c2066726f6d20a26469706673582212207e72f2ca7d70df22e551dd3411feb6d36621e7386e36a556e3215c7d781f9e6164736f6c63430007060033

Deployed Bytecode

0x6080604052600436106100345760003560e01c806328ffb83d14610039578063387b817414610062578063d4fac45d14610075575b600080fd5b61004c610047366004610fb0565b6100a2565b60405161005991906112ef565b60405180910390f35b61004c610070366004610fb0565b61036d565b34801561008157600080fd5b50610095610090366004610f78565b6103a1565b6040516100599190611349565b6060600184146100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061140a565b60405180910390fd5b6000858560008181106100f657fe5b61010c9260206060909202019081019150610f5c565b9050600061012b8787600081811061012057fe5b90506060020161044f565b90506000808061013d878901896110ea565b9250925092506101b97395e6f48254609a6ee006f7d493c8e5fb97094cef856040518060400160405280600781526020017f5a454f56324941000000000000000000000000000000000000000000000000008152508873ffffffffffffffffffffffffffffffffffffffff1661065b909392919063ffffffff16565b60408051600180825281830190925290602080830190803683370190505095506101e787610204818b6115f1565b8101906101f49190610f5c565b8660008151811061020157fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101526040517fb4be83d500000000000000000000000000000000000000000000000000000000815273080bf510fcbf18b91105470639e95610229377129063b4be83d59061027a908690869086906004016114ad565b608060405180830381600087803b15801561029457600080fd5b505af19250505080156102e2575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102df9181019061108b565b60015b61035f576102ee61161f565b806102f9575061032d565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611352565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906113d3565b505050505050949350505050565b60606040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611476565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8416906370a08231906103f69085906004016112ce565b60206040518083038186803b15801561040e57600080fd5b505afa158015610422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104469190611233565b90505b92915050565b60008061045f6020840184610f5c565b905060208301356000610478606086016040870161106c565b9050600181600281111561048857fe5b148061049f5750600281600281111561049d57fe5b145b6104d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611365565b60018160028111156104e357fe5b141561064c57670de0b6b3a764000082111561052b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061139c565b600073ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561056657504761060b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906370a08231906105b89030906004016112ce565b60206040518083038186803b1580156105d057600080fd5b505afa1580156105e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106089190611233565b90505b670de0b6b3a764000083141561062657935061065692505050565b670de0b6b3a7640000610639828561074e565b8161064057fe5b04945050505050610656565b5091506106569050565b919050565b604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8581166024830152915160009287169163dd62ed3e916044808301926020929190829003018186803b1580156106d257600080fd5b505afa1580156106e6573d6000803e3d6000fd5b505050506040513d60208110156106fc57600080fd5b505190508281101561074757801561071b5761071b85856000856107a2565b61074785857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff856107a2565b5050505050565b60008261075d57506000610449565b8282028284828161076a57fe5b0414610446576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061143f565b81158061084e5750604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff858116602483015291519186169163dd62ed3e91604480820192602092909190829003018186803b15801561082057600080fd5b505afa158015610834573d6000803e3d6000fd5b505050506040513d602081101561084a57600080fd5b5051155b8160405160200180806117276021913960210182805190602001908083835b602083106108aa57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161086d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290610981576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561094657818101518382015260200161092e565b50505050905090810190601f1680156109735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506040805173ffffffffffffffffffffffffffffffffffffffff8516602482015260448082018590528251808303909101815260649091018252602081810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790528251808401909352600783527f617070726f76650000000000000000000000000000000000000000000000000090830152610a429186919084610a48565b50505050565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b60208310610ab057805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a73565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610b12576040519150601f19603f3d011682016040523d82523d6000602084013e610b17565b606091505b509150915081848460405160200180807f5361666545524332303a20000000000000000000000000000000000000000000815250600b0183805190602001908083835b60208310610b9757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b5a565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527f206661696c656420696e20000000000000000000000000000000000000000000919093019081528451600b90910192850191508083835b60208310610c4457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c07565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290610cdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835190928392604490910191908501908083836000831561094657818101518382015260200161092e565b50805115610ec657808060200190516020811015610cfc57600080fd5b50516040517f5361666545524332303a20000000000000000000000000000000000000000000602082810191825287518893889392602b90910191908501908083835b60208310610d7c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610d3f565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527f2072657475726e65642066616c736520696e2000000000000000000000000000919093019081528451601390910192850191508083835b60208310610e2957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610dec565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290610ec4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835190928392604490910191908501908083836000831561094657818101518382015260200161092e565b505b505050505050565b803561065681611701565b600082601f830112610ee9578081fd5b813567ffffffffffffffff811115610efd57fe5b610f2e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016115cd565b818152846020838601011115610f42578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610f6d578081fd5b813561044681611701565b60008060408385031215610f8a578081fd5b8235610f9581611701565b91506020830135610fa581611701565b809150509250929050565b60008060008060408587031215610fc5578182fd5b843567ffffffffffffffff80821115610fdc578384fd5b818701915087601f830112610fef578384fd5b813581811115610ffd578485fd5b886020606083028501011115611011578485fd5b60209283019650945090860135908082111561102b578384fd5b818701915087601f83011261103e578384fd5b81358181111561104c578485fd5b88602082850101111561105d578485fd5b95989497505060200194505050565b60006020828403121561107d578081fd5b813560038110610446578182fd5b60006080828403121561109c578081fd5b6040516080810181811067ffffffffffffffff821117156110b957fe5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b6000806000606084860312156110fe578283fd5b833567ffffffffffffffff80821115611115578485fd5b818601915061018080838903121561112b578586fd5b611134816115cd565b905061113f83610ece565b815261114d60208401610ece565b602082015261115e60408401610ece565b604082015261116f60608401610ece565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e082015261010080840135818301525061012080840135818301525061014080840135838111156111c7578788fd5b6111d38a828701610ed9565b82840152505061016080840135838111156111ec578788fd5b6111f88a828701610ed9565b8284015250508095505060208601359350604086013591508082111561121c578283fd5b5061122986828701610ed9565b9150509250925092565b600060208284031215611244578081fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452815b8181101561128a5760208185018101518683018201520161126e565b8181111561129b5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561133d57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161130b565b50909695505050505050565b90815260200190565b6000602082526104466020830184611265565b60208082526013908201527f49413a2062616420616d6f756e74207479706500000000000000000000000000604082015260600190565b6020808252600e908201527f49413a2062616420616d6f756e74000000000000000000000000000000000000604082015260600190565b60208082526015908201527f5a454f563249413a206465706f736974206661696c0000000000000000000000604082015260600190565b6020808252818101527f5a454f563249413a2073686f756c64206265203120746f6b656e416d6f756e74604082015260600190565b60208082526010908201527f49413a206d756c206f766572666c6f7700000000000000000000000000000000604082015260600190565b60208082526014908201527f5a454f563249413a206e6f207769746864726177000000000000000000000000604082015260600190565b6000606082526114c160608301865161124b565b60208501516114d3608084018261124b565b5060408501516114e660a084018261124b565b5060608501516114f960c084018261124b565b50608085015160e083015260a0850151610100818185015260c08701519150610120828186015260e088015192506101408381870152828901519350610160925083838701528189015193506101809150838287015280890151935050806101a08601525061156c6101e0850183611265565b908701518482037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0016101c08601529091506115a88282611265565b91505084602084015282810360408401526115c38185611265565b9695505050505050565b60405181810167ffffffffffffffff811182821017156115e957fe5b604052919050565b60008085851115611600578182fd5b8386111561160c578182fd5b5050820193919092039150565b60e01c90565b600060443d101561162f576116fe565b600481823e6308c379a06116438251611619565b1461164d576116fe565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3d016004823e80513d67ffffffffffffffff816024840111818411171561169b57505050506116fe565b828401925082519150808211156116b557505050506116fe565b503d830160208284010111156116cd575050506116fe565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01681016020016040529150505b90565b73ffffffffffffffffffffffffffffffffffffffff8116811461172357600080fd5b5056fe5361666545524332303a2062616420617070726f76652063616c6c2066726f6d20a26469706673582212207e72f2ca7d70df22e551dd3411feb6d36621e7386e36a556e3215c7d781f9e6164736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.