ETH Price: $3,245.13 (+2.52%)
Gas: 2 Gwei

Contract

0xd94C60e2793AD587400D86E4D6fd9C874F0f79eF
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer67511392018-11-22 10:32:182073 days ago1542882738IN
0xd94C60e2...74F0f79eF
0 ETH0.000152567
Execute Orders67454842018-11-21 12:08:082074 days ago1542802088IN
0xd94C60e2...74F0f79eF
0 ETH0.0200991315
Execute Orders67454722018-11-21 12:05:402074 days ago1542801940IN
0xd94C60e2...74F0f79eF
0 ETH0.0215478615
Execute Orders66974102018-11-13 14:51:252082 days ago1542120685IN
0xd94C60e2...74F0f79eF
0 ETH0.0016202513.5
Execute Orders66952832018-11-13 6:18:132082 days ago1542089893IN
0xd94C60e2...74F0f79eF
0.15347217 ETH0.00066429.75
Execute Orders66930102018-11-12 21:23:032082 days ago1542057783IN
0xd94C60e2...74F0f79eF
0.01066592 ETH0.00057582.4
Execute Orders66929872018-11-12 21:17:192082 days ago1542057439IN
0xd94C60e2...74F0f79eF
0.042641 ETH0.000211362.4
Execute Orders66879052018-11-12 1:27:472083 days ago1541986067IN
0xd94C60e2...74F0f79eF
0.11143789 ETH0.002315415
Execute Orders66865772018-11-11 20:12:522083 days ago1541967172IN
0xd94C60e2...74F0f79eF
6.48938944 ETH0.000525573
Execute Orders66853222018-11-11 15:19:502084 days ago1541949590IN
0xd94C60e2...74F0f79eF
0 ETH0.00239135
Execute Orders66818352018-11-11 1:41:502084 days ago1541900510IN
0xd94C60e2...74F0f79eF
0 ETH0.001440723
Execute Orders66794102018-11-10 16:15:202085 days ago1541866520IN
0xd94C60e2...74F0f79eF
0 ETH0.002304385.5
Execute Orders66793752018-11-10 16:08:312085 days ago1541866111IN
0xd94C60e2...74F0f79eF
0 ETH0.002304385.5
Execute Orders66793702018-11-10 16:07:492085 days ago1541866069IN
0xd94C60e2...74F0f79eF
0 ETH0.002304385.5
Execute Orders66734432018-11-09 16:46:542086 days ago1541782014IN
0xd94C60e2...74F0f79eF
0 ETH0.003032956
Execute Orders66711532018-11-09 7:53:212086 days ago1541750001IN
0xd94C60e2...74F0f79eF
0.49392552 ETH0.0172318312
Execute Orders66674342018-11-08 17:02:302087 days ago1541696550IN
0xd94C60e2...74F0f79eF
0 ETH0.003336246.6
Execute Orders66674162018-11-08 16:59:002087 days ago1541696340IN
0xd94C60e2...74F0f79eF
0 ETH0.00436076.6
Execute Orders66659752018-11-08 11:19:042087 days ago1541675944IN
0xd94C60e2...74F0f79eF
0.27809999 ETH0.0046519910
Execute Orders66659562018-11-08 11:15:072087 days ago1541675707IN
0xd94C60e2...74F0f79eF
0.15244 ETH0.0047994310
Execute Orders66659542018-11-08 11:14:452087 days ago1541675685IN
0xd94C60e2...74F0f79eF
0.15244 ETH0.0047994310
Execute Orders66645702018-11-08 5:47:212087 days ago1541656041IN
0xd94C60e2...74F0f79eF
0.02395468 ETH0.003703648
Execute Orders66644592018-11-08 5:19:222087 days ago1541654362IN
0xd94C60e2...74F0f79eF
0 ETH0.002390789
Execute Orders66643212018-11-08 4:47:342087 days ago1541652454IN
0xd94C60e2...74F0f79eF
0 ETH0.01035046
Execute Orders66633242018-11-08 0:49:202087 days ago1541638160IN
0xd94C60e2...74F0f79eF
0 ETH0.003172126.9
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
67454842018-11-21 12:08:082074 days ago1542802088
0xd94C60e2...74F0f79eF
1.98462486 ETH
67454842018-11-21 12:08:082074 days ago1542802088
0xd94C60e2...74F0f79eF
2.0945173 ETH
67454722018-11-21 12:05:402074 days ago1542801940
0xd94C60e2...74F0f79eF
2.05170842 ETH
67454722018-11-21 12:05:402074 days ago1542801940
0xd94C60e2...74F0f79eF
2.0222005 ETH
66930102018-11-12 21:23:032082 days ago1542057783
0xd94C60e2...74F0f79eF
0.00031065 ETH
66930102018-11-12 21:23:032082 days ago1542057783
0xd94C60e2...74F0f79eF
0.01035526 ETH
66929872018-11-12 21:17:192082 days ago1542057439
0xd94C60e2...74F0f79eF
0.04139903 ETH
66879052018-11-12 1:27:472083 days ago1541986067
0xd94C60e2...74F0f79eF
0.00324576 ETH
66879052018-11-12 1:27:472083 days ago1541986067
0xd94C60e2...74F0f79eF
0.10819212 ETH
66865772018-11-11 20:12:522083 days ago1541967172
0xd94C60e2...74F0f79eF
0.18901134 ETH
66865772018-11-11 20:12:522083 days ago1541967172
0xd94C60e2...74F0f79eF
6.30037809 ETH
66853222018-11-11 15:19:502084 days ago1541949590
0xd94C60e2...74F0f79eF
0.21646577 ETH
66853222018-11-11 15:19:502084 days ago1541949590
0xd94C60e2...74F0f79eF
0.21646577 ETH
66818352018-11-11 1:41:502084 days ago1541900510
0xd94C60e2...74F0f79eF
0.04930325 ETH
66818352018-11-11 1:41:502084 days ago1541900510
0xd94C60e2...74F0f79eF
0.04930325 ETH
66794102018-11-10 16:15:202085 days ago1541866520
0xd94C60e2...74F0f79eF
0.01566 ETH
66793752018-11-10 16:08:312085 days ago1541866111
0xd94C60e2...74F0f79eF
0.01566 ETH
66793702018-11-10 16:07:492085 days ago1541866069
0xd94C60e2...74F0f79eF
0.01566 ETH
66734432018-11-09 16:46:542086 days ago1541782014
0xd94C60e2...74F0f79eF
0.11851776 ETH
66734432018-11-09 16:46:542086 days ago1541782014
0xd94C60e2...74F0f79eF
0.01973212 ETH
66711532018-11-09 7:53:212086 days ago1541750001
0xd94C60e2...74F0f79eF
0.01434673 ETH
66711532018-11-09 7:53:212086 days ago1541750001
0xd94C60e2...74F0f79eF
0.02676111 ETH
66711532018-11-09 7:53:212086 days ago1541750001
0xd94C60e2...74F0f79eF
0.04368977 ETH
66711532018-11-09 7:53:212086 days ago1541750001
0xd94C60e2...74F0f79eF
0.00014006 ETH
66711532018-11-09 7:53:212086 days ago1541750001
0xd94C60e2...74F0f79eF
0.40898777 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TotlePrimary

Compiler Version
v0.4.21+commit.dfe3193c

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-06-03
*/

pragma solidity 0.4.21;

// File: contracts/ExchangeHandler.sol

/// @title Interface for all exchange handler contracts
interface ExchangeHandler {

    /// @dev Get the available amount left to fill for an order
    /// @param orderAddresses Array of address values needed for this DEX order
    /// @param orderValues Array of uint values needed for this DEX order
    /// @param exchangeFee Value indicating the fee for this DEX order
    /// @param v ECDSA signature parameter v
    /// @param r ECDSA signature parameter r
    /// @param s ECDSA signature parameter s
    /// @return Available amount left to fill for this order
    function getAvailableAmount(
        address[8] orderAddresses,
        uint256[6] orderValues,
        uint256 exchangeFee,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256);

    /// @dev Perform a buy order at the exchange
    /// @param orderAddresses Array of address values needed for each DEX order
    /// @param orderValues Array of uint values needed for each DEX order
    /// @param exchangeFee Value indicating the fee for this DEX order
    /// @param amountToFill Amount to fill in this order
    /// @param v ECDSA signature parameter v
    /// @param r ECDSA signature parameter r
    /// @param s ECDSA signature parameter s
    /// @return Amount filled in this order
    function performBuy(
        address[8] orderAddresses,
        uint256[6] orderValues,
        uint256 exchangeFee,
        uint256 amountToFill,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external payable returns (uint256);

    /// @dev Perform a sell order at the exchange
    /// @param orderAddresses Array of address values needed for each DEX order
    /// @param orderValues Array of uint values needed for each DEX order
    /// @param exchangeFee Value indicating the fee for this DEX order
    /// @param amountToFill Amount to fill in this order
    /// @param v ECDSA signature parameter v
    /// @param r ECDSA signature parameter r
    /// @param s ECDSA signature parameter s
    /// @return Amount filled in this order
    function performSell(
        address[8] orderAddresses,
        uint256[6] orderValues,
        uint256 exchangeFee,
        uint256 amountToFill,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256);
}

// File: openzeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract Token is ERC20Basic {
  function allowance(address owner, address spender) public view returns (uint256);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function approve(address spender, uint256 value) public returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: contracts/TokenTransferProxy.sol

/*
    Notice - This code is copyright 2017 ZeroEx Intl and licensed
    under the Apache License, Version 2.0;
*/

contract TokenTransferProxy is Ownable {

    /// @dev Only authorized addresses can invoke functions with this modifier.
    modifier onlyAuthorized {
        require(authorized[msg.sender]);
        _;
    }

    modifier targetAuthorized(address target) {
        require(authorized[target]);
        _;
    }

    modifier targetNotAuthorized(address target) {
        require(!authorized[target]);
        _;
    }

    mapping (address => bool) public authorized;
    address[] public authorities;

    event LogAuthorizedAddressAdded(address indexed target, address indexed caller);
    event LogAuthorizedAddressRemoved(address indexed target, address indexed caller);

    /*
     * Public functions
     */

    /// @dev Authorizes an address.
    /// @param target Address to authorize.
    function addAuthorizedAddress(address target)
        public
        onlyOwner
        targetNotAuthorized(target)
    {
        authorized[target] = true;
        authorities.push(target);
        emit LogAuthorizedAddressAdded(target, msg.sender);
    }

    /// @dev Removes authorizion of an address.
    /// @param target Address to remove authorization from.
    function removeAuthorizedAddress(address target)
        public
        onlyOwner
        targetAuthorized(target)
    {
        delete authorized[target];
        for (uint i = 0; i < authorities.length; i++) {
            if (authorities[i] == target) {
                authorities[i] = authorities[authorities.length - 1];
                authorities.length -= 1;
                break;
            }
        }
        emit LogAuthorizedAddressRemoved(target, msg.sender);
    }

    /// @dev Calls into ERC20 Token contract, invoking transferFrom.
    /// @param token Address of token to transfer.
    /// @param from Address to transfer token from.
    /// @param to Address to transfer token to.
    /// @param value Amount of token to transfer.
    /// @return Success of transfer.
    function transferFrom(
        address token,
        address from,
        address to,
        uint value)
        public
        onlyAuthorized
        returns (bool)
    {
        return Token(token).transferFrom(from, to, value);
    }

    /*
     * Public constant functions
     */

    /// @dev Gets all authorized addresses.
    /// @return Array of authorized addresses.
    function getAuthorizedAddresses()
        public
        constant
        returns (address[])
    {
        return authorities;
    }
}

// File: openzeppelin-solidity/contracts/math/Math.sol

/**
 * @title Math
 * @dev Assorted math operations
 */
library Math {
  function max64(uint64 a, uint64 b) internal pure returns (uint64) {
    return a >= b ? a : b;
  }

  function min64(uint64 a, uint64 b) internal pure returns (uint64) {
    return a < b ? a : b;
  }

  function max256(uint256 a, uint256 b) internal pure returns (uint256) {
    return a >= b ? a : b;
  }

  function min256(uint256 a, uint256 b) internal pure returns (uint256) {
    return a < b ? a : b;
  }
}

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    if (a == 0) {
      return 0;
    }
    c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    assert(c >= a);
    return c;
  }
}

// File: contracts/TotlePrimary.sol

/// @title The primary contract for Totle Inc
contract TotlePrimary is Ownable {
    // Constants
    uint256 public constant MAX_EXCHANGE_FEE_PERCENTAGE = 0.01 * 10**18; // 1%
    bool constant BUY = false;
    bool constant SELL = true;

    // State variables
    mapping(address => bool) public handlerWhitelist;
    address tokenTransferProxy;

    // Structs
    struct Tokens {
        address[] tokenAddresses;
        bool[]    buyOrSell;
        uint256[] amountToObtain;
        uint256[] amountToGive;
    }

    struct DEXOrders {
        address[] tokenForOrder;
        address[] exchanges;
        address[8][] orderAddresses;
        uint256[6][] orderValues;
        uint256[] exchangeFees;
        uint8[] v;
        bytes32[] r;
        bytes32[] s;
    }

    /// @dev Constructor
    /// @param proxy Address of the TokenTransferProxy
    function TotlePrimary(address proxy) public {
        tokenTransferProxy = proxy;
    }

    /*
    *   Public functions
    */

    /// @dev Set an exchange handler address to true/false
    /// @notice - onlyOwner modifier only allows the contract owner to run the code
    /// @param handler Address of the exchange handler which permission needs changing
    /// @param allowed Boolean value to set whether an exchange handler is allowed/denied
    function setHandler(address handler, bool allowed) public onlyOwner {
        handlerWhitelist[handler] = allowed;
    }

    /// @dev Synchronously executes an array of orders
    /// @notice The first four parameters relate to Token orders, the last eight relate to DEX orders
    /// @param tokenAddresses Array of addresses of ERC20 Token contracts for each Token order
    /// @param buyOrSell Array indicating whether each Token order is a buy or sell
    /// @param amountToObtain Array indicating the amount (in ether or tokens) to obtain in the order
    /// @param amountToGive Array indicating the amount (in ether or tokens) to give in the order
    /// @param tokenForOrder Array of addresses of ERC20 Token contracts for each DEX order
    /// @param exchanges Array of addresses of exchange handler contracts
    /// @param orderAddresses Array of address values needed for each DEX order
    /// @param orderValues Array of uint values needed for each DEX order
    /// @param exchangeFees Array indicating the fee for each DEX order (percentage of fill amount as decimal * 10**18)
    /// @param v ECDSA signature parameter v
    /// @param r ECDSA signature parameter r
    /// @param s ECDSA signature parameter s
    function executeOrders(
        // Tokens
        address[] tokenAddresses,
        bool[]    buyOrSell,
        uint256[] amountToObtain,
        uint256[] amountToGive,
        // DEX Orders
        address[] tokenForOrder,
        address[] exchanges,
        address[8][] orderAddresses,
        uint256[6][] orderValues,
        uint256[] exchangeFees,
        uint8[] v,
        bytes32[] r,
        bytes32[] s
    ) public payable {

        require(
            tokenAddresses.length == buyOrSell.length &&
            buyOrSell.length      == amountToObtain.length &&
            amountToObtain.length == amountToGive.length
        );

        require(
            tokenForOrder.length  == exchanges.length &&
            exchanges.length      == orderAddresses.length &&
            orderAddresses.length == orderValues.length &&
            orderValues.length    == exchangeFees.length &&
            exchangeFees.length   == v.length &&
            v.length              == r.length &&
            r.length              == s.length
        );

        // Wrapping order in structs to reduce local variable count
        internalOrderExecution(
            Tokens(
                tokenAddresses,
                buyOrSell,
                amountToObtain,
                amountToGive
            ),
            DEXOrders(
                tokenForOrder,
                exchanges,
                orderAddresses,
                orderValues,
                exchangeFees,
                v,
                r,
                s
            )
        );
    }

    /*
    *   Internal functions
    */

    /// @dev Synchronously executes an array of orders
    /// @notice The orders in this function have been wrapped in structs to reduce the local variable count
    /// @param tokens Struct containing the arrays of token orders
    /// @param orders Struct containing the arrays of DEX orders
    function internalOrderExecution(Tokens tokens, DEXOrders orders) internal {
        transferTokens(tokens);

        uint256 tokensLength = tokens.tokenAddresses.length;
        uint256 ordersLength = orders.tokenForOrder.length;
        uint256 etherBalance = msg.value;
        uint256 orderIndex = 0;

        for(uint256 tokenIndex = 0; tokenIndex < tokensLength; tokenIndex++) {
            // NOTE - check for repetitions in the token list?

            uint256 amountRemaining = tokens.amountToGive[tokenIndex];
            uint256 amountObtained = 0;

            while(orderIndex < ordersLength) {
                require(tokens.tokenAddresses[tokenIndex] == orders.tokenForOrder[orderIndex]);
                require(handlerWhitelist[orders.exchanges[orderIndex]]);

                if(amountRemaining > 0) {
                    if(tokens.buyOrSell[tokenIndex] == BUY) {
                        require(etherBalance >= amountRemaining);
                    }
                    (amountRemaining, amountObtained) = performTrade(
                        tokens.buyOrSell[tokenIndex],
                        amountRemaining,
                        amountObtained,
                        orders, // NOTE - unable to send pointer to order values individually, as run out of stack space!
                        orderIndex
                        );
                }

                orderIndex = SafeMath.add(orderIndex, 1);
                // If this is the last order for this token
                if(orderIndex == ordersLength || orders.tokenForOrder[SafeMath.sub(orderIndex, 1)] != orders.tokenForOrder[orderIndex]){
                    break;
                }
            }

            uint256 amountGiven = SafeMath.sub(tokens.amountToGive[tokenIndex], amountRemaining);

            require(orderWasValid(amountObtained, amountGiven, tokens.amountToObtain[tokenIndex], tokens.amountToGive[tokenIndex]));

            if(tokens.buyOrSell[tokenIndex] == BUY) {
                // Take away spent ether from refund balance
                etherBalance = SafeMath.sub(etherBalance, amountGiven);
                // Transfer back tokens acquired
                if(amountObtained > 0) {
                    require(Token(tokens.tokenAddresses[tokenIndex]).transfer(msg.sender, amountObtained));
                }
            } else {
                // Add ether to refund balance
                etherBalance = SafeMath.add(etherBalance, amountObtained);
                // Transfer back un-sold tokens
                if(amountRemaining > 0) {
                    require(Token(tokens.tokenAddresses[tokenIndex]).transfer(msg.sender, amountRemaining));
                }
            }
        }

        // Send back acquired/unspent ether - throw on failure
        if(etherBalance > 0) {
            msg.sender.transfer(etherBalance);
        }
    }

    /// @dev Iterates through a list of token orders, transfer the SELL orders to this contract & calculates if we have the ether needed
    /// @param tokens Struct containing the arrays of token orders
    function transferTokens(Tokens tokens) internal {
        uint256 expectedEtherAvailable = msg.value;
        uint256 totalEtherNeeded = 0;

        for(uint256 i = 0; i < tokens.tokenAddresses.length; i++) {
            if(tokens.buyOrSell[i] == BUY) {
                totalEtherNeeded = SafeMath.add(totalEtherNeeded, tokens.amountToGive[i]);
            } else {
                expectedEtherAvailable = SafeMath.add(expectedEtherAvailable, tokens.amountToObtain[i]);
                require(TokenTransferProxy(tokenTransferProxy).transferFrom(
                    tokens.tokenAddresses[i],
                    msg.sender,
                    this,
                    tokens.amountToGive[i]
                ));
            }
        }

        // Make sure we have will have enough ETH after SELLs to cover our BUYs
        require(expectedEtherAvailable >= totalEtherNeeded);
    }

    /// @dev Performs a single trade via the requested exchange handler
    /// @param buyOrSell Boolean value stating whether this is a buy or sell order
    /// @param initialRemaining The remaining value we have left to trade
    /// @param totalObtained The total amount we have obtained so far
    /// @param orders Struct containing all DEX orders
    /// @param index Value indicating the index of the specific DEX order we wish to execute
    /// @return Remaining value left after trade
    /// @return Total value obtained after trade
    function performTrade(bool buyOrSell, uint256 initialRemaining, uint256 totalObtained, DEXOrders orders, uint256 index)
        internal returns (uint256, uint256) {
        uint256 obtained = 0;
        uint256 remaining = initialRemaining;

        require(orders.exchangeFees[index] < MAX_EXCHANGE_FEE_PERCENTAGE);

        uint256 amountToFill = getAmountToFill(remaining, orders, index);

        if(amountToFill > 0) {
            remaining = SafeMath.sub(remaining, amountToFill);

            if(buyOrSell == BUY) {
                obtained = ExchangeHandler(orders.exchanges[index]).performBuy.value(amountToFill)(
                    orders.orderAddresses[index],
                    orders.orderValues[index],
                    orders.exchangeFees[index],
                    amountToFill,
                    orders.v[index],
                    orders.r[index],
                    orders.s[index]
                );
            } else {
                require(Token(orders.tokenForOrder[index]).transfer(
                    orders.exchanges[index],
                    amountToFill
                ));
                obtained = ExchangeHandler(orders.exchanges[index]).performSell(
                    orders.orderAddresses[index],
                    orders.orderValues[index],
                    orders.exchangeFees[index],
                    amountToFill,
                    orders.v[index],
                    orders.r[index],
                    orders.s[index]
                );
            }
        }

        return (obtained == 0 ? initialRemaining: remaining, SafeMath.add(totalObtained, obtained));
    }

    /// @dev Get the amount of this order we are able to fill
    /// @param remaining Amount we have left to spend
    /// @param orders Struct containing all DEX orders
    /// @param index Value indicating the index of the specific DEX order we wish to execute
    /// @return Minimum of the amount we have left to spend and the available amount at the exchange
    function getAmountToFill(uint256 remaining, DEXOrders orders, uint256 index) internal returns (uint256) {

        uint256 availableAmount = ExchangeHandler(orders.exchanges[index]).getAvailableAmount(
            orders.orderAddresses[index],
            orders.orderValues[index],
            orders.exchangeFees[index],
            orders.v[index],
            orders.r[index],
            orders.s[index]
        );

        return Math.min256(remaining, availableAmount);
    }

    /// @dev Checks whether a given order was valid
    /// @param amountObtained Amount of the order which was obtained
    /// @param amountGiven Amount given in return for amountObtained
    /// @param amountToObtain Amount we intended to obtain
    /// @param amountToGive Amount we intended to give in return for amountToObtain
    /// @return Boolean value indicating whether this order was valid
    function orderWasValid(uint256 amountObtained, uint256 amountGiven, uint256 amountToObtain, uint256 amountToGive) internal pure returns (bool) {

        if(amountObtained > 0 && amountGiven > 0) {
            // NOTE - Check the edge cases here
            if(amountObtained > amountGiven) {
                return SafeMath.div(amountToObtain, amountToGive) <= SafeMath.div(amountObtained, amountGiven);
            } else {
                return SafeMath.div(amountToGive, amountToObtain) >= SafeMath.div(amountGiven, amountObtained);
            }
        }
        return false;
    }

    function() public payable {
        // Check in here that the sender is a contract! (to stop accidents)
        uint256 size;
        address sender = msg.sender;
        assembly {
            size := extcodesize(sender)
        }
        require(size > 0);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"handler","type":"address"},{"name":"allowed","type":"bool"}],"name":"setHandler","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"tokenAddresses","type":"address[]"},{"name":"buyOrSell","type":"bool[]"},{"name":"amountToObtain","type":"uint256[]"},{"name":"amountToGive","type":"uint256[]"},{"name":"tokenForOrder","type":"address[]"},{"name":"exchanges","type":"address[]"},{"name":"orderAddresses","type":"address[8][]"},{"name":"orderValues","type":"uint256[6][]"},{"name":"exchangeFees","type":"uint256[]"},{"name":"v","type":"uint8[]"},{"name":"r","type":"bytes32[]"},{"name":"s","type":"bytes32[]"}],"name":"executeOrders","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"handlerWhitelist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_EXCHANGE_FEE_PERCENTAGE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"proxy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

6060604052341561000f57600080fd5b60405160208061192583398101604052808051906020019091905050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050611869806100bc6000396000f300606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680638da5cb5b146100955780639cb7de4b146100ea578063abaed9241461012e578063c792433f146104b6578063cb96b0d614610507578063f2fde38b14610530575b600080339050803b915060008211151561009157600080fd5b5050005b34156100a057600080fd5b6100a8610569565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100f557600080fd5b61012c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190505061058e565b005b6104b460048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b8282101561032a578484839050610100020160088060200260405190810160405280929190826008602002808284378201915050505050815260200190600101906102e4565b5050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156103a657848483905060c002016006806020026040519081016040528092919082600660200280828437820191505050505081526020019060010190610361565b50505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610644565b005b34156104c157600080fd5b6104ed600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061073f565b604051808215151515815260200191505060405180910390f35b341561051257600080fd5b61051a61075f565b6040518082815260200191505060405180910390f35b341561053b57600080fd5b610567600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061076a565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105e957600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b8a518c51148015610656575089518b51145b8015610663575088518a51145b151561066e57600080fd5b86518851148015610680575085518751145b801561068d575084518651145b801561069a575083518551145b80156106a7575082518451145b80156106b4575081518351145b80156106c1575080518251145b15156106cc57600080fd5b6107316080604051908101604052808e81526020018d81526020018c81526020018b815250610100604051908101604052808b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001848152506108bf565b505050505050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b662386f26fc1000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561080157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000806000806000806108d48a610dfd565b8960000151519750886000015151965034955060009450600093505b87841015610da75789606001518481518110151561090a57fe5b906020019060200201519250600091505b86851015610b0e5788600001518581518110151561093557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff168a600001518581518110151561096757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151561099357600080fd5b600160008a60200151878151811015156109a957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a0657600080fd5b6000831115610a7857600015158a6020015185815181101515610a2557fe5b9060200190602002015115151415610a4757828610151515610a4657600080fd5b5b610a6f8a6020015185815181101515610a5c57fe5b9060200190602002015184848c8961103d565b80935081945050505b610a8385600161158b565b945086851480610aff5750886000015185815181101515610aa057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff168960000151610ad08760016115a7565b815181101515610adc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b15610b0957610b0e565b61091b565b610b338a6060015185815181101515610b2357fe5b90602001906020020151846115a7565b9050610b7782828c6040015187815181101515610b4c57fe5b906020019060200201518d6060015188815181101515610b6857fe5b906020019060200201516115c0565b1515610b8257600080fd5b600015158a6020015185815181101515610b9857fe5b9060200190602002015115151415610ca457610bb486826115a7565b95506000821115610c9f57896000015184815181101515610bd157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610c7c57600080fd5b5af11515610c8957600080fd5b505050604051805190501515610c9e57600080fd5b5b610d9a565b610cae868361158b565b95506000831115610d9957896000015184815181101515610ccb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610d7657600080fd5b5af11515610d8357600080fd5b505050604051805190501515610d9857600080fd5b5b5b83806001019450506108f0565b6000861115610df1573373ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f193505050501515610df057600080fd5b5b50505050505050505050565b600080600034925060009150600090505b8360000151518110156110285760001515846020015182815181101515610e3157fe5b9060200190602002015115151415610e6f57610e6882856060015183815181101515610e5957fe5b9060200190602002015161158b565b915061101b565b610e9483856040015183815181101515610e8557fe5b9060200190602002015161158b565b9250600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166315dacbea856000015183815181101515610ee657fe5b906020019060200201513330886060015186815181101515610f0457fe5b906020019060200201516040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050602060405180830381600087803b1515610ff857600080fd5b5af1151561100557600080fd5b50505060405180519050151561101a57600080fd5b5b8080600101915050610e0e565b81831015151561103757600080fd5b50505050565b6000806000806000809250889150662386f26fc1000087608001518781518110151561106557fe5b9060200190602002015110151561107b57600080fd5b611086828888611625565b905060008111156115605761109b82826115a7565b9150600015158a1515141561128a578660200151868151811015156110bc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663bdd5be2f828960400151898151811015156110f457fe5b906020019060200201518a606001518a81518110151561111057fe5b906020019060200201518b608001518b81518110151561112c57fe5b90602001906020020151868d60a001518d81518110151561114957fe5b906020019060200201518e60c001518e81518110151561116557fe5b906020019060200201518f60e001518f81518110151561118157fe5b906020019060200201516040518963ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018088600860200280838360005b838110156111e15780820151818401526020810190506111c6565b5050505090500187600660200280838360005b8381101561120f5780820151818401526020810190506111f4565b505050509050018681526020018581526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019750505050505050506020604051808303818588803b151561126b57600080fd5b5af1151561127857600080fd5b5050505060405180519050925061155f565b86600001518681518110151561129c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8860200151888151811015156112d357fe5b90602001906020020151836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561136257600080fd5b5af1151561136f57600080fd5b50505060405180519050151561138457600080fd5b86602001518681518110151561139657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16634981b3ca8860400151888151811015156113cd57fe5b906020019060200201518960600151898151811015156113e957fe5b906020019060200201518a608001518a81518110151561140557fe5b90602001906020020151858c60a001518c81518110151561142257fe5b906020019060200201518d60c001518d81518110151561143e57fe5b906020019060200201518e60e001518e81518110151561145a57fe5b906020019060200201516040518863ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018088600860200280838360005b838110156114ba57808201518184015260208101905061149f565b5050505090500187600660200280838360005b838110156114e85780820151818401526020810190506114cd565b505050509050018681526020018581526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001975050505050505050602060405180830381600087803b151561154557600080fd5b5af1151561155257600080fd5b5050506040518051905092505b5b6000831461156e5781611570565b885b61157a898561158b565b945094505050509550959350505050565b6000818301905082811015151561159e57fe5b80905092915050565b60008282111515156115b557fe5b818303905092915050565b600080851180156115d15750600084115b1561161857838511156115fb576115e8858561180e565b6115f2848461180e565b1115905061161d565b611605848661180e565b61160f838561180e565b1015905061161d565b600090505b949350505050565b60008083602001518381518110151561163a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16634102bf5c85604001518581518110151561167157fe5b9060200190602002015186606001518681518110151561168d57fe5b906020019060200201518760800151878151811015156116a957fe5b906020019060200201518860a00151888151811015156116c557fe5b906020019060200201518960c00151898151811015156116e157fe5b906020019060200201518a60e001518a8151811015156116fd57fe5b906020019060200201516040518763ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018087600860200280838360005b8381101561175d578082015181840152602081019050611742565b5050505090500186600660200280838360005b8381101561178b578082015181840152602081019050611770565b505050509050018581526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019650505050505050602060405180830381600087803b15156117e157600080fd5b5af115156117ee57600080fd5b5050506040518051905090506118048582611824565b9150509392505050565b6000818381151561181b57fe5b04905092915050565b60008183106118335781611835565b825b9050929150505600a165627a7a72305820d6369909bc3d02d7e0379b81ae4b266625b0a845f183639b20ae79ced15ea1ba0029000000000000000000000000ad5aa494bcd729b8ea728f581aade049c4ec4e9d

Deployed Bytecode

0x606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680638da5cb5b146100955780639cb7de4b146100ea578063abaed9241461012e578063c792433f146104b6578063cb96b0d614610507578063f2fde38b14610530575b600080339050803b915060008211151561009157600080fd5b5050005b34156100a057600080fd5b6100a8610569565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100f557600080fd5b61012c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190505061058e565b005b6104b460048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b8282101561032a578484839050610100020160088060200260405190810160405280929190826008602002808284378201915050505050815260200190600101906102e4565b5050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020016000905b828210156103a657848483905060c002016006806020026040519081016040528092919082600660200280828437820191505050505081526020019060010190610361565b50505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610644565b005b34156104c157600080fd5b6104ed600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061073f565b604051808215151515815260200191505060405180910390f35b341561051257600080fd5b61051a61075f565b6040518082815260200191505060405180910390f35b341561053b57600080fd5b610567600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061076a565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105e957600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b8a518c51148015610656575089518b51145b8015610663575088518a51145b151561066e57600080fd5b86518851148015610680575085518751145b801561068d575084518651145b801561069a575083518551145b80156106a7575082518451145b80156106b4575081518351145b80156106c1575080518251145b15156106cc57600080fd5b6107316080604051908101604052808e81526020018d81526020018c81526020018b815250610100604051908101604052808b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001848152506108bf565b505050505050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b662386f26fc1000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561080157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000806000806000806108d48a610dfd565b8960000151519750886000015151965034955060009450600093505b87841015610da75789606001518481518110151561090a57fe5b906020019060200201519250600091505b86851015610b0e5788600001518581518110151561093557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff168a600001518581518110151561096757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151561099357600080fd5b600160008a60200151878151811015156109a957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a0657600080fd5b6000831115610a7857600015158a6020015185815181101515610a2557fe5b9060200190602002015115151415610a4757828610151515610a4657600080fd5b5b610a6f8a6020015185815181101515610a5c57fe5b9060200190602002015184848c8961103d565b80935081945050505b610a8385600161158b565b945086851480610aff5750886000015185815181101515610aa057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff168960000151610ad08760016115a7565b815181101515610adc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b15610b0957610b0e565b61091b565b610b338a6060015185815181101515610b2357fe5b90602001906020020151846115a7565b9050610b7782828c6040015187815181101515610b4c57fe5b906020019060200201518d6060015188815181101515610b6857fe5b906020019060200201516115c0565b1515610b8257600080fd5b600015158a6020015185815181101515610b9857fe5b9060200190602002015115151415610ca457610bb486826115a7565b95506000821115610c9f57896000015184815181101515610bd157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610c7c57600080fd5b5af11515610c8957600080fd5b505050604051805190501515610c9e57600080fd5b5b610d9a565b610cae868361158b565b95506000831115610d9957896000015184815181101515610ccb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610d7657600080fd5b5af11515610d8357600080fd5b505050604051805190501515610d9857600080fd5b5b5b83806001019450506108f0565b6000861115610df1573373ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f193505050501515610df057600080fd5b5b50505050505050505050565b600080600034925060009150600090505b8360000151518110156110285760001515846020015182815181101515610e3157fe5b9060200190602002015115151415610e6f57610e6882856060015183815181101515610e5957fe5b9060200190602002015161158b565b915061101b565b610e9483856040015183815181101515610e8557fe5b9060200190602002015161158b565b9250600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166315dacbea856000015183815181101515610ee657fe5b906020019060200201513330886060015186815181101515610f0457fe5b906020019060200201516040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050602060405180830381600087803b1515610ff857600080fd5b5af1151561100557600080fd5b50505060405180519050151561101a57600080fd5b5b8080600101915050610e0e565b81831015151561103757600080fd5b50505050565b6000806000806000809250889150662386f26fc1000087608001518781518110151561106557fe5b9060200190602002015110151561107b57600080fd5b611086828888611625565b905060008111156115605761109b82826115a7565b9150600015158a1515141561128a578660200151868151811015156110bc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663bdd5be2f828960400151898151811015156110f457fe5b906020019060200201518a606001518a81518110151561111057fe5b906020019060200201518b608001518b81518110151561112c57fe5b90602001906020020151868d60a001518d81518110151561114957fe5b906020019060200201518e60c001518e81518110151561116557fe5b906020019060200201518f60e001518f81518110151561118157fe5b906020019060200201516040518963ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018088600860200280838360005b838110156111e15780820151818401526020810190506111c6565b5050505090500187600660200280838360005b8381101561120f5780820151818401526020810190506111f4565b505050509050018681526020018581526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019750505050505050506020604051808303818588803b151561126b57600080fd5b5af1151561127857600080fd5b5050505060405180519050925061155f565b86600001518681518110151561129c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8860200151888151811015156112d357fe5b90602001906020020151836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561136257600080fd5b5af1151561136f57600080fd5b50505060405180519050151561138457600080fd5b86602001518681518110151561139657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16634981b3ca8860400151888151811015156113cd57fe5b906020019060200201518960600151898151811015156113e957fe5b906020019060200201518a608001518a81518110151561140557fe5b90602001906020020151858c60a001518c81518110151561142257fe5b906020019060200201518d60c001518d81518110151561143e57fe5b906020019060200201518e60e001518e81518110151561145a57fe5b906020019060200201516040518863ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018088600860200280838360005b838110156114ba57808201518184015260208101905061149f565b5050505090500187600660200280838360005b838110156114e85780820151818401526020810190506114cd565b505050509050018681526020018581526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001975050505050505050602060405180830381600087803b151561154557600080fd5b5af1151561155257600080fd5b5050506040518051905092505b5b6000831461156e5781611570565b885b61157a898561158b565b945094505050509550959350505050565b6000818301905082811015151561159e57fe5b80905092915050565b60008282111515156115b557fe5b818303905092915050565b600080851180156115d15750600084115b1561161857838511156115fb576115e8858561180e565b6115f2848461180e565b1115905061161d565b611605848661180e565b61160f838561180e565b1015905061161d565b600090505b949350505050565b60008083602001518381518110151561163a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16634102bf5c85604001518581518110151561167157fe5b9060200190602002015186606001518681518110151561168d57fe5b906020019060200201518760800151878151811015156116a957fe5b906020019060200201518860a00151888151811015156116c557fe5b906020019060200201518960c00151898151811015156116e157fe5b906020019060200201518a60e001518a8151811015156116fd57fe5b906020019060200201516040518763ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018087600860200280838360005b8381101561175d578082015181840152602081019050611742565b5050505090500186600660200280838360005b8381101561178b578082015181840152602081019050611770565b505050509050018581526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019650505050505050602060405180830381600087803b15156117e157600080fd5b5af115156117ee57600080fd5b5050506040518051905090506118048582611824565b9150509392505050565b6000818381151561181b57fe5b04905092915050565b60008183106118335781611835565b825b9050929150505600a165627a7a72305820d6369909bc3d02d7e0379b81ae4b266625b0a845f183639b20ae79ced15ea1ba0029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ad5aa494bcd729b8ea728f581aade049c4ec4e9d

-----Decoded View---------------
Arg [0] : proxy (address): 0xAd5aa494bcd729b8EA728f581AAdE049c4EC4E9D

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ad5aa494bcd729b8ea728f581aade049c4ec4e9d


Swarm Source

bzzr://d6369909bc3d02d7e0379b81ae4b266625b0a845f183639b20ae79ced15ea1ba

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  ]
[ 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.