Contract Overview |  OpenSea.io
Balance: 0 Ether
Ether Value: $0
Transactions: 7555 txns
Token Tracker: Project Wyvern Exchange
 Latest 25 txns From a total of 7555 Transactions

TxHash Age From To Value [TxFee]
0xaaf2bef422f58ff75ccfb95f2e320be0842bf83848713a82925f6eaca1914e5327 mins ago0x52bc031c769d99a60768dd4a543ec001640a4746  IN   OpenSea.io0 Ether0.000248058
0x66e10021135098f4876057b5228ed7957faddc48e288bbcc75fbdc32fe6375642 hrs 36 mins ago0x6b5bb4e60821ece7363caff836be1a4f9e3559b3  IN   OpenSea.io0.0094 Ether0.0014254398
0x79c88c0822c4476ced1d00336a64a02c3ff5bffcb3c4b8baefb3bc6bb480c66c3 hrs 22 mins ago0x18037695463f57a90971179bd6723fac4d227229  IN   OpenSea.io0 Ether0.001074918
0x3955870d7fff5baa2ce9c4a945bc75ed5fd993f281a261d312cda36f442a6b7e3 hrs 23 mins ago0x18037695463f57a90971179bd6723fac4d227229  IN   OpenSea.io0 Ether0.001074918
0x660c9bb5210006bec222ab68bb284426879c16088630e7ef407bb0104aba36c33 hrs 40 mins ago0xe6d5dde7cf1660d3dc43135fba7632dd7e1c937b  IN   OpenSea.io0 Ether0.00040767
0xbe30be11716b08f34c43aa76fe1ae5cde9e33c3f27c616e312bffeb96fa430154 hrs 39 mins ago0xc24f97bb1d7a75d9f986c99dfcfa2a558058904c  IN   OpenSea.io0 Ether0.002254005
0xcf23b13e3ecaa2f5c754207676c3c9fb8d2ce8d1af06e944faebad1a6e4540b84 hrs 47 mins ago0xa4e566c0aa45680ed257ec95931bb67add699560  IN   OpenSea.io0.008 Ether0.000930892
0x5da8d59db716344967f33f00b95d07e3efc2d62bf5a61c43e73f621ded2a952a4 hrs 47 mins ago0xa4e566c0aa45680ed257ec95931bb67add699560  IN   OpenSea.io0.008 Ether0.000930892
0x79c4c92670cb2104540d82aee5ee24b625220978f7cf4e188c2dc9ef0d8cc0984 hrs 58 mins ago0x24180b50936cf76ec7828f6a7e5b83d06ade16e6  IN   OpenSea.io0.008 Ether0.002388109
0xb98b422ad4ffc61a3247b949859fcce22136a580959a03b8aa09663bea7bb2275 hrs 23 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000516825312
0x478d2c6db8c2100de5470299c55cd70e7921c2d065daa84f407f1f2f8a2ca4d85 hrs 24 mins ago0x8033562521fedecdcc05487303522375597f9094  IN   OpenSea.io0.0035 Ether0.0013329
0x08033bdb5472aafd3d43c4f9d62e94a74b6c5f853e94516241ee4efa29e06bd95 hrs 25 mins ago0x8033562521fedecdcc05487303522375597f9094  IN   OpenSea.io0.003 Ether0.001504185593
0x2857986489f228f7012ceceee2f3cfd2939009882e8adddf8468745bd3a83b9c5 hrs 30 mins ago0x8033562521fedecdcc05487303522375597f9094  IN   OpenSea.io0.003 Ether0.002118216
0x4c27a313b68ee16909aed3f0503ee1d0eb6d9e627fe3f170a85f0262717b4ebe6 hrs 18 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000665604
0x957cf35f875299e9f79ebf2c58e588f106f56c49fad14871a4693cf231fe77fd6 hrs 19 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000665604
0x00bb6e9153c74960bb243b87361dbed1d0b6ccb4c3019d069109a4eb9fb665786 hrs 19 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000664836
0xe75f049c2bdbe1688764a14dd6d77e9acbfb4d60086e23b11c2461f4a6d366b16 hrs 19 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000665604
0xc5e905061c2e567cefb6590856f7ddecd490c4e88311d5b57b5eed1705ba54906 hrs 20 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000664836
0xcc2bf36af9b03d369def1fe11c3865be6b1665c2d3fd4c707b48696b276a94116 hrs 20 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000664836
0xdc8ff9b17a094f179c6ac392c0e281a3eafd9bf1019c6d723251855b98c4fb796 hrs 20 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.000665604
0x893f1c5803c72e89bebe4a2b82e29f25f515340778000a51ce07555eb086b3e16 hrs 22 mins ago0xb61ce2b4347bf9a028611f98dbdc8658a47457a2  IN   OpenSea.io0.015 Ether0.004424169
0x3f75c416d6ff28192513fb9159c929f3614bc112a761f7dcc441b790ff8d28276 hrs 23 mins ago0xb61ce2b4347bf9a028611f98dbdc8658a47457a2  IN   OpenSea.io0.012777544558075 Ether0.004594029
0x2c4552127a261831d6d3b40b718e8fe0223f0c90d5b7786e2483d4b71695eabf6 hrs 31 mins ago0xb61ce2b4347bf9a028611f98dbdc8658a47457a2  IN   OpenSea.io0.007 Ether0.00256140757
0x0e4cdf39309fab7f512d32bf5de4bfdac98c3ec1b2f2822c31677781b33a19d46 hrs 48 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.0007139825
0x97b6e100073bdb2718c2207febe9f62e6bace830159d385e650984b5bcdff1926 hrs 48 mins ago0xbec6b3bcf74fea0de102155970c23b1f58032245  IN   OpenSea.io0 Ether0.0007139825
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click Here To View More View All
ParentTxHash Block Age From To Value
0x66e10021135098f4876057b5228ed7957faddc48e288bbcc75fbdc32fe63756465207682 hrs 36 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x1fd67f1c83f6d08620afb5332487a83fc988de350.009165 Ether
0x66e10021135098f4876057b5228ed7957faddc48e288bbcc75fbdc32fe63756465207682 hrs 36 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.000235 Ether
0xcf23b13e3ecaa2f5c754207676c3c9fb8d2ce8d1af06e944faebad1a6e4540b865202134 hrs 47 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x07b99b5a4093be2c4465d55fcaad50a3cb61447a0.0078 Ether
0xcf23b13e3ecaa2f5c754207676c3c9fb8d2ce8d1af06e944faebad1a6e4540b865202134 hrs 47 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.0002 Ether
0x5da8d59db716344967f33f00b95d07e3efc2d62bf5a61c43e73f621ded2a952a65202134 hrs 47 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0xc7fd0a3d6d51bc1533c4d8db03ba5df8daafb70e0.0078 Ether
0x5da8d59db716344967f33f00b95d07e3efc2d62bf5a61c43e73f621ded2a952a65202134 hrs 47 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.0002 Ether
0x79c4c92670cb2104540d82aee5ee24b625220978f7cf4e188c2dc9ef0d8cc09865201714 hrs 58 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0xe6d5dde7cf1660d3dc43135fba7632dd7e1c937b0.0078 Ether
0x79c4c92670cb2104540d82aee5ee24b625220978f7cf4e188c2dc9ef0d8cc09865201714 hrs 58 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.0002 Ether
0x478d2c6db8c2100de5470299c55cd70e7921c2d065daa84f407f1f2f8a2ca4d865200445 hrs 24 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x561a81a1d18b65b4207509d0d7ec12039129ace00.0034125 Ether
0x478d2c6db8c2100de5470299c55cd70e7921c2d065daa84f407f1f2f8a2ca4d865200445 hrs 24 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.0000875 Ether
0x08033bdb5472aafd3d43c4f9d62e94a74b6c5f853e94516241ee4efa29e06bd965200405 hrs 25 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x7fc6b39009958b02c24f08435daeeb43c67f2f200.002925 Ether
0x08033bdb5472aafd3d43c4f9d62e94a74b6c5f853e94516241ee4efa29e06bd965200405 hrs 25 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.000075 Ether
0x2857986489f228f7012ceceee2f3cfd2939009882e8adddf8468745bd3a83b9c65200275 hrs 30 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x561a81a1d18b65b4207509d0d7ec12039129ace00.002925 Ether
0x2857986489f228f7012ceceee2f3cfd2939009882e8adddf8468745bd3a83b9c65200275 hrs 30 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.000075 Ether
0x893f1c5803c72e89bebe4a2b82e29f25f515340778000a51ce07555eb086b3e165198006 hrs 22 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0xa4e566c0aa45680ed257ec95931bb67add6995600.014625 Ether
0x893f1c5803c72e89bebe4a2b82e29f25f515340778000a51ce07555eb086b3e165198006 hrs 22 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.000375 Ether
0x3f75c416d6ff28192513fb9159c929f3614bc112a761f7dcc441b790ff8d282765197956 hrs 23 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0xb61ce2b4347bf9a028611f98dbdc8658a47457a20.000001398350840895 Ether
0x3f75c416d6ff28192513fb9159c929f3614bc112a761f7dcc441b790ff8d282765197956 hrs 23 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x165b440662b38c8c2d2af9fca313d3af3f4798510.012456742552054045 Ether
0x3f75c416d6ff28192513fb9159c929f3614bc112a761f7dcc441b790ff8d282765197956 hrs 23 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.000319403655180872 Ether
0x2c4552127a261831d6d3b40b718e8fe0223f0c90d5b7786e2483d4b71695eabf65197596 hrs 31 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0xa813e1506aecf2a0926b9a7b9dc012ff8c1b69830.006825 Ether
0x2c4552127a261831d6d3b40b718e8fe0223f0c90d5b7786e2483d4b71695eabf65197596 hrs 31 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.000175 Ether
0xc309809b9355059dbc37cd328464664c4ebb8dbad556d97704609050ba21234a65196467 hrs 3 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x83c99147fe32649ff33321cfe36e5568a6cb09570.55327436775 Ether
0xc309809b9355059dbc37cd328464664c4ebb8dbad556d97704609050ba21234a65196467 hrs 3 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.01418652225 Ether
0x40ad08320e12c9dfd933790c3b29a8bc66242a86edaa7a36da926aa04cb2162a65189179 hrs 59 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x1f4b10ffb832581ae5a975ed38eeac9f4e960bdf0.077025 Ether
0x40ad08320e12c9dfd933790c3b29a8bc66242a86edaa7a36da926aa04cb2162a65189179 hrs 59 mins ago0x7be8076f4ea4a4ad08075c2508e481d6c946d12b0x5b3256965e7c3cf26e11fcaf296dfc8807c010730.001975 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: WyvernExchange
Compiler Text: v0.4.23+commit.124ca40d
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.13;

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;
  }
}

contract Ownable {
  address public owner;


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


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() 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;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }
}

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);
}

contract ERC20 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
  );
}

library ArrayUtils {

    /**
     * Replace bytes in an array with bytes in another array, guarded by a bitmask
     * Efficiency of this function is a bit unpredictable because of the EVM's word-specific model (arrays under 32 bytes will be slower)
     * 
     * @dev Mask must be the size of the byte array. A nonzero byte means the byte array can be changed.
     * @param array The original array
     * @param desired The target array
     * @param mask The mask specifying which bits can be changed
     * @return The updated byte array (the parameter will be modified inplace)
     */
    function guardedArrayReplace(bytes memory array, bytes memory desired, bytes memory mask)
        internal
        pure
    {
        require(array.length == desired.length);
        require(array.length == mask.length);

        uint words = array.length / 0x20;
        uint index = words * 0x20;
        assert(index / 0x20 == words);
        uint i;

        for (i = 0; i < words; i++) {
            /* Conceptually: array[i] = (!mask[i] && array[i]) || (mask[i] && desired[i]), bitwise in word chunks. */
            assembly {
                let commonIndex := mul(0x20, add(1, i))
                let maskValue := mload(add(mask, commonIndex))
                mstore(add(array, commonIndex), or(and(not(maskValue), mload(add(array, commonIndex))), and(maskValue, mload(add(desired, commonIndex)))))
            }
        }

        /* Deal with the last section of the byte array. */
        if (words > 0) {
            /* This overlaps with bytes already set but is still more efficient than iterating through each of the remaining bytes individually. */
            i = words;
            assembly {
                let commonIndex := mul(0x20, add(1, i))
                let maskValue := mload(add(mask, commonIndex))
                mstore(add(array, commonIndex), or(and(not(maskValue), mload(add(array, commonIndex))), and(maskValue, mload(add(desired, commonIndex)))))
            }
        } else {
            /* If the byte array is shorter than a word, we must unfortunately do the whole thing bytewise.
               (bounds checks could still probably be optimized away in assembly, but this is a rare case) */
            for (i = index; i < array.length; i++) {
                array[i] = ((mask[i] ^ 0xff) & array[i]) | (mask[i] & desired[i]);
            }
        }
    }

    /**
     * Test if two arrays are equal
     * Source: https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol
     * 
     * @dev Arrays must be of equal length, otherwise will return false
     * @param a First array
     * @param b Second array
     * @return Whether or not all bytes in the arrays are equal
     */
    function arrayEq(bytes memory a, bytes memory b)
        internal
        pure
        returns (bool)
    {
        bool success = true;

        assembly {
            let length := mload(a)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(b))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(a, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(b, 0x20)
                // the next line is the loop condition:
                // while(uint(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    /**
     * Unsafe write byte array into a memory location
     *
     * @param index Memory location
     * @param source Byte array to write
     * @return End memory index
     */
    function unsafeWriteBytes(uint index, bytes source)
        internal
        pure
        returns (uint)
    {
        if (source.length > 0) {
            assembly {
                let length := mload(source)
                let end := add(source, add(0x20, length))
                let arrIndex := add(source, 0x20)
                let tempIndex := index
                for { } eq(lt(arrIndex, end), 1) {
                    arrIndex := add(arrIndex, 0x20)
                    tempIndex := add(tempIndex, 0x20)
                } {
                    mstore(tempIndex, mload(arrIndex))
                }
                index := add(index, length)
            }
        }
        return index;
    }

    /**
     * Unsafe write address into a memory location
     *
     * @param index Memory location
     * @param source Address to write
     * @return End memory index
     */
    function unsafeWriteAddress(uint index, address source)
        internal
        pure
        returns (uint)
    {
        uint conv = uint(source) << 0x60;
        assembly {
            mstore(index, conv)
            index := add(index, 0x14)
        }
        return index;
    }

    /**
     * Unsafe write uint into a memory location
     *
     * @param index Memory location
     * @param source uint to write
     * @return End memory index
     */
    function unsafeWriteUint(uint index, uint source)
        internal
        pure
        returns (uint)
    {
        assembly {
            mstore(index, source)
            index := add(index, 0x20)
        }
        return index;
    }

    /**
     * Unsafe write uint8 into a memory location
     *
     * @param index Memory location
     * @param source uint8 to write
     * @return End memory index
     */
    function unsafeWriteUint8(uint index, uint8 source)
        internal
        pure
        returns (uint)
    {
        assembly {
            mstore8(index, source)
            index := add(index, 0x1)
        }
        return index;
    }

}

contract ReentrancyGuarded {

    bool reentrancyLock = false;

    /* Prevent a contract function from being reentrant-called. */
    modifier reentrancyGuard {
        if (reentrancyLock) {
            revert();
        }
        reentrancyLock = true;
        _;
        reentrancyLock = false;
    }

}

contract TokenRecipient {
    event ReceivedEther(address indexed sender, uint amount);
    event ReceivedTokens(address indexed from, uint256 value, address indexed token, bytes extraData);

    /**
     * @dev Receive tokens and generate a log event
     * @param from Address from which to transfer tokens
     * @param value Amount of tokens to transfer
     * @param token Address of token
     * @param extraData Additional data to log
     */
    function receiveApproval(address from, uint256 value, address token, bytes extraData) public {
        ERC20 t = ERC20(token);
        require(t.transferFrom(from, this, value));
        emit ReceivedTokens(from, value, token, extraData);
    }

    /**
     * @dev Receive Ether and generate a log event
     */
    function () payable public {
        emit ReceivedEther(msg.sender, msg.value);
    }
}

contract ExchangeCore is ReentrancyGuarded, Ownable {

    /* The token used to pay exchange fees. */
    ERC20 public exchangeToken;

    /* User registry. */
    ProxyRegistry public registry;

    /* Token transfer proxy. */
    TokenTransferProxy public tokenTransferProxy;

    /* Cancelled / finalized orders, by hash. */
    mapping(bytes32 => bool) public cancelledOrFinalized;

    /* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */
    mapping(bytes32 => bool) public approvedOrders;

    /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */
    uint public minimumMakerProtocolFee = 0;

    /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */
    uint public minimumTakerProtocolFee = 0;

    /* Recipient of protocol fees. */
    address public protocolFeeRecipient;

    /* Fee method: protocol fee or split fee. */
    enum FeeMethod { ProtocolFee, SplitFee }

    /* Inverse basis point. */
    uint public constant INVERSE_BASIS_POINT = 10000;

    /* An ECDSA signature. */ 
    struct Sig {
        /* v parameter */
        uint8 v;
        /* r parameter */
        bytes32 r;
        /* s parameter */
        bytes32 s;
    }

    /* An order on the exchange. */
    struct Order {
        /* Exchange address, intended as a versioning mechanism. */
        address exchange;
        /* Order maker address. */
        address maker;
        /* Order taker address, if specified. */
        address taker;
        /* Maker relayer fee of the order, unused for taker order. */
        uint makerRelayerFee;
        /* Taker relayer fee of the order, or maximum taker fee for a taker order. */
        uint takerRelayerFee;
        /* Maker protocol fee of the order, unused for taker order. */
        uint makerProtocolFee;
        /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
        uint takerProtocolFee;
        /* Order fee recipient or zero address for taker order. */
        address feeRecipient;
        /* Fee method (protocol token or split fee). */
        FeeMethod feeMethod;
        /* Side (buy/sell). */
        SaleKindInterface.Side side;
        /* Kind of sale. */
        SaleKindInterface.SaleKind saleKind;
        /* Target. */
        address target;
        /* HowToCall. */
        AuthenticatedProxy.HowToCall howToCall;
        /* Calldata. */
        bytes calldata;
        /* Calldata replacement pattern, or an empty byte array for no replacement. */
        bytes replacementPattern;
        /* Static call target, zero-address for no static call. */
        address staticTarget;
        /* Static call extra data. */
        bytes staticExtradata;
        /* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
        address paymentToken;
        /* Base price of the order (in paymentTokens). */
        uint basePrice;
        /* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
        uint extra;
        /* Listing timestamp. */
        uint listingTime;
        /* Expiration timestamp - 0 for no expiry. */
        uint expirationTime;
        /* Order salt, used to prevent duplicate hashes. */
        uint salt;
    }
    
    event OrderApprovedPartOne    (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
    event OrderApprovedPartTwo    (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes calldata, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
    event OrderCancelled          (bytes32 indexed hash);
    event OrdersMatched           (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata);

    /**
     * @dev Change the minimum maker fee paid to the protocol (owner only)
     * @param newMinimumMakerProtocolFee New fee to set in basis points
     */
    function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee)
        public
        onlyOwner
    {
        minimumMakerProtocolFee = newMinimumMakerProtocolFee;
    }

    /**
     * @dev Change the minimum taker fee paid to the protocol (owner only)
     * @param newMinimumTakerProtocolFee New fee to set in basis points
     */
    function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee)
        public
        onlyOwner
    {
        minimumTakerProtocolFee = newMinimumTakerProtocolFee;
    }

    /**
     * @dev Change the protocol fee recipient (owner only)
     * @param newProtocolFeeRecipient New protocol fee recipient address
     */
    function changeProtocolFeeRecipient(address newProtocolFeeRecipient)
        public
        onlyOwner
    {
        protocolFeeRecipient = newProtocolFeeRecipient;
    }

    /**
     * @dev Transfer tokens
     * @param token Token to transfer
     * @param from Address to charge fees
     * @param to Address to receive fees
     * @param amount Amount of protocol tokens to charge
     */
    function transferTokens(address token, address from, address to, uint amount)
        internal
    {
        if (amount > 0) {
            require(tokenTransferProxy.transferFrom(token, from, to, amount));
        }
    }

    /**
     * @dev Charge a fee in protocol tokens
     * @param from Address to charge fees
     * @param to Address to receive fees
     * @param amount Amount of protocol tokens to charge
     */
    function chargeProtocolFee(address from, address to, uint amount)
        internal
    {
        transferTokens(exchangeToken, from, to, amount);
    }

    /**
     * @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call)
     * @param target Contract to call
     * @param calldata Calldata (appended to extradata)
     * @param extradata Base data for STATICCALL (probably function selector and argument encoding)
     * @return The result of the call (success or failure)
     */
    function staticCall(address target, bytes memory calldata, bytes memory extradata)
        public
        view
        returns (bool result)
    {
        bytes memory combined = new bytes(calldata.length + extradata.length);
        uint index;
        assembly {
            index := add(combined, 0x20)
        }
        index = ArrayUtils.unsafeWriteBytes(index, extradata);
        ArrayUtils.unsafeWriteBytes(index, calldata);
        assembly {
            result := staticcall(gas, target, add(combined, 0x20), mload(combined), mload(0x40), 0)
        }
        return result;
    }

    /**
     * Calculate size of an order struct when tightly packed
     *
     * @param order Order to calculate size of
     * @return Size in bytes
     */
    function sizeOf(Order memory order)
        internal
        pure
        returns (uint)
    {
        return ((0x14 * 7) + (0x20 * 9) + 4 + order.calldata.length + order.replacementPattern.length + order.staticExtradata.length);
    }

    /**
     * @dev Hash an order, returning the canonical order hash, without the message prefix
     * @param order Order to hash
     * @return Hash of order
     */
    function hashOrder(Order memory order)
        internal
        pure
        returns (bytes32 hash)
    {
        /* Unfortunately abi.encodePacked doesn't work here, stack size constraints. */
        uint size = sizeOf(order);
        bytes memory array = new bytes(size);
        uint index;
        assembly {
            index := add(array, 0x20)
        }
        index = ArrayUtils.unsafeWriteAddress(index, order.exchange);
        index = ArrayUtils.unsafeWriteAddress(index, order.maker);
        index = ArrayUtils.unsafeWriteAddress(index, order.taker);
        index = ArrayUtils.unsafeWriteUint(index, order.makerRelayerFee);
        index = ArrayUtils.unsafeWriteUint(index, order.takerRelayerFee);
        index = ArrayUtils.unsafeWriteUint(index, order.makerProtocolFee);
        index = ArrayUtils.unsafeWriteUint(index, order.takerProtocolFee);
        index = ArrayUtils.unsafeWriteAddress(index, order.feeRecipient);
        index = ArrayUtils.unsafeWriteUint8(index, uint8(order.feeMethod));
        index = ArrayUtils.unsafeWriteUint8(index, uint8(order.side));
        index = ArrayUtils.unsafeWriteUint8(index, uint8(order.saleKind));
        index = ArrayUtils.unsafeWriteAddress(index, order.target);
        index = ArrayUtils.unsafeWriteUint8(index, uint8(order.howToCall));
        index = ArrayUtils.unsafeWriteBytes(index, order.calldata);
        index = ArrayUtils.unsafeWriteBytes(index, order.replacementPattern);
        index = ArrayUtils.unsafeWriteAddress(index, order.staticTarget);
        index = ArrayUtils.unsafeWriteBytes(index, order.staticExtradata);
        index = ArrayUtils.unsafeWriteAddress(index, order.paymentToken);
        index = ArrayUtils.unsafeWriteUint(index, order.basePrice);
        index = ArrayUtils.unsafeWriteUint(index, order.extra);
        index = ArrayUtils.unsafeWriteUint(index, order.listingTime);
        index = ArrayUtils.unsafeWriteUint(index, order.expirationTime);
        index = ArrayUtils.unsafeWriteUint(index, order.salt);
        assembly {
            hash := keccak256(add(array, 0x20), size)
        }
        return hash;
    }

    /**
     * @dev Hash an order, returning the hash that a client must sign, including the standard message prefix
     * @param order Order to hash
     * @return Hash of message prefix and order hash per Ethereum format
     */
    function hashToSign(Order memory order)
        internal
        pure
        returns (bytes32)
    {
        return keccak256("\x19Ethereum Signed Message:\n32", hashOrder(order));
    }

    /**
     * @dev Assert an order is valid and return its hash
     * @param order Order to validate
     * @param sig ECDSA signature
     */
    function requireValidOrder(Order memory order, Sig memory sig)
        internal
        view
        returns (bytes32)
    {
        bytes32 hash = hashToSign(order);
        require(validateOrder(hash, order, sig));
        return hash;
    }

    /**
     * @dev Validate order parameters (does *not* check signature validity)
     * @param order Order to validate
     */
    function validateOrderParameters(Order memory order)
        internal
        view
        returns (bool)
    {
        /* Order must be targeted at this protocol version (this Exchange contract). */
        if (order.exchange != address(this)) {
            return false;
        }

        /* Order must possess valid sale kind parameter combination. */
        if (!SaleKindInterface.validateParameters(order.saleKind, order.expirationTime)) {
            return false;
        }

        /* If using the split fee method, order must have sufficient protocol fees. */
        if (order.feeMethod == FeeMethod.SplitFee && (order.makerProtocolFee < minimumMakerProtocolFee || order.takerProtocolFee < minimumTakerProtocolFee)) {
            return false;
        }

        return true;
    }

    /**
     * @dev Validate a provided previously approved / signed order, hash, and signature.
     * @param hash Order hash (already calculated, passed to avoid recalculation)
     * @param order Order to validate
     * @param sig ECDSA signature
     */
    function validateOrder(bytes32 hash, Order memory order, Sig memory sig) 
        internal
        view
        returns (bool)
    {
        /* Not done in an if-conditional to prevent unnecessary ecrecover evaluation, which seems to happen even though it should short-circuit. */

        /* Order must have valid parameters. */
        if (!validateOrderParameters(order)) {
            return false;
        }

        /* Order must have not been canceled or already filled. */
        if (cancelledOrFinalized[hash]) {
            return false;
        }
        
        /* Order authentication. Order must be either:
        /* (a) previously approved */
        if (approvedOrders[hash]) {
            return true;
        }

        /* or (b) ECDSA-signed by maker. */
        if (ecrecover(hash, sig.v, sig.r, sig.s) == order.maker) {
            return true;
        }

        return false;
    }

    /**
     * @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order
     * @param order Order to approve
     * @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks
     */
    function approveOrder(Order memory order, bool orderbookInclusionDesired)
        internal
    {
        /* CHECKS */

        /* Assert sender is authorized to approve order. */
        require(msg.sender == order.maker);

        /* Calculate order hash. */
        bytes32 hash = hashToSign(order);

        /* Assert order has not already been approved. */
        require(!approvedOrders[hash]);

        /* EFFECTS */
    
        /* Mark order as approved. */
        approvedOrders[hash] = true;
  
        /* Log approval event. Must be split in two due to Solidity stack size limitations. */
        {
            emit OrderApprovedPartOne(hash, order.exchange, order.maker, order.taker, order.makerRelayerFee, order.takerRelayerFee, order.makerProtocolFee, order.takerProtocolFee, order.feeRecipient, order.feeMethod, order.side, order.saleKind, order.target);
        }
        {   
            emit OrderApprovedPartTwo(hash, order.howToCall, order.calldata, order.replacementPattern, order.staticTarget, order.staticExtradata, order.paymentToken, order.basePrice, order.extra, order.listingTime, order.expirationTime, order.salt, orderbookInclusionDesired);
        }
    }

    /**
     * @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order
     * @param order Order to cancel
     * @param sig ECDSA signature
     */
    function cancelOrder(Order memory order, Sig memory sig) 
        internal
    {
        /* CHECKS */

        /* Calculate order hash. */
        bytes32 hash = requireValidOrder(order, sig);

        /* Assert sender is authorized to cancel order. */
        require(msg.sender == order.maker);
  
        /* EFFECTS */
      
        /* Mark order as cancelled, preventing it from being matched. */
        cancelledOrFinalized[hash] = true;

        /* Log cancel event. */
        emit OrderCancelled(hash);
    }

    /**
     * @dev Calculate the current price of an order (convenience function)
     * @param order Order to calculate the price of
     * @return The current price of the order
     */
    function calculateCurrentPrice (Order memory order)
        internal  
        view
        returns (uint)
    {
        return SaleKindInterface.calculateFinalPrice(order.side, order.saleKind, order.basePrice, order.extra, order.listingTime, order.expirationTime);
    }

    /**
     * @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail)
     * @param buy Buy-side order
     * @param sell Sell-side order
     * @return Match price
     */
    function calculateMatchPrice(Order memory buy, Order memory sell)
        view
        internal
        returns (uint)
    {
        /* Calculate sell price. */
        uint sellPrice = SaleKindInterface.calculateFinalPrice(sell.side, sell.saleKind, sell.basePrice, sell.extra, sell.listingTime, sell.expirationTime);

        /* Calculate buy price. */
        uint buyPrice = SaleKindInterface.calculateFinalPrice(buy.side, buy.saleKind, buy.basePrice, buy.extra, buy.listingTime, buy.expirationTime);

        /* Require price cross. */
        require(buyPrice >= sellPrice);
        
        /* Maker/taker priority. */
        return sell.feeRecipient != address(0) ? sellPrice : buyPrice;
    }

    /**
     * @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer)
     * @param buy Buy-side order
     * @param sell Sell-side order
     */
    function executeFundsTransfer(Order memory buy, Order memory sell)
        internal
        returns (uint)
    {
        /* Only payable in the special case of unwrapped Ether. */
        if (sell.paymentToken != address(0)) {
            require(msg.value == 0);
        }

        /* Calculate match price. */
        uint price = calculateMatchPrice(buy, sell);

        /* If paying using a token (not Ether), transfer tokens. This is done prior to fee payments to that a seller will have tokens before being charged fees. */
        if (price > 0 && sell.paymentToken != address(0)) {
            transferTokens(sell.paymentToken, buy.maker, sell.maker, price);
        }

        /* Amount that will be received by seller (for Ether). */
        uint receiveAmount = price;

        /* Amount that must be sent by buyer (for Ether). */
        uint requiredAmount = price;

        /* Determine maker/taker and charge fees accordingly. */
        if (sell.feeRecipient != address(0)) {
            /* Sell-side order is maker. */
      
            /* Assert taker fee is less than or equal to maximum fee specified by buyer. */
            require(sell.takerRelayerFee <= buy.takerRelayerFee);

            if (sell.feeMethod == FeeMethod.SplitFee) {
                /* Assert taker fee is less than or equal to maximum fee specified by buyer. */
                require(sell.takerProtocolFee <= buy.takerProtocolFee);

                /* Maker fees are deducted from the token amount that the maker receives. Taker fees are extra tokens that must be paid by the taker. */

                if (sell.makerRelayerFee > 0) {
                    uint makerRelayerFee = SafeMath.div(SafeMath.mul(sell.makerRelayerFee, price), INVERSE_BASIS_POINT);
                    if (sell.paymentToken == address(0)) {
                        receiveAmount = SafeMath.sub(receiveAmount, makerRelayerFee);
                        sell.feeRecipient.transfer(makerRelayerFee);
                    } else {
                        transferTokens(sell.paymentToken, sell.maker, sell.feeRecipient, makerRelayerFee);
                    }
                }

                if (sell.takerRelayerFee > 0) {
                    uint takerRelayerFee = SafeMath.div(SafeMath.mul(sell.takerRelayerFee, price), INVERSE_BASIS_POINT);
                    if (sell.paymentToken == address(0)) {
                        requiredAmount = SafeMath.add(requiredAmount, takerRelayerFee);
                        sell.feeRecipient.transfer(takerRelayerFee);
                    } else {
                        transferTokens(sell.paymentToken, buy.maker, sell.feeRecipient, takerRelayerFee);
                    }
                }

                if (sell.makerProtocolFee > 0) {
                    uint makerProtocolFee = SafeMath.div(SafeMath.mul(sell.makerProtocolFee, price), INVERSE_BASIS_POINT);
                    if (sell.paymentToken == address(0)) {
                        receiveAmount = SafeMath.sub(receiveAmount, makerProtocolFee);
                        protocolFeeRecipient.transfer(makerProtocolFee);
                    } else {
                        transferTokens(sell.paymentToken, sell.maker, protocolFeeRecipient, makerProtocolFee);
                    }
                }

                if (sell.takerProtocolFee > 0) {
                    uint takerProtocolFee = SafeMath.div(SafeMath.mul(sell.takerProtocolFee, price), INVERSE_BASIS_POINT);
                    if (sell.paymentToken == address(0)) {
                        requiredAmount = SafeMath.add(requiredAmount, takerProtocolFee);
                        protocolFeeRecipient.transfer(takerProtocolFee);
                    } else {
                        transferTokens(sell.paymentToken, buy.maker, protocolFeeRecipient, takerProtocolFee);
                    }
                }

            } else {
                /* Charge maker fee to seller. */
                chargeProtocolFee(sell.maker, sell.feeRecipient, sell.makerRelayerFee);

                /* Charge taker fee to buyer. */
                chargeProtocolFee(buy.maker, sell.feeRecipient, sell.takerRelayerFee);
            }
        } else {
            /* Buy-side order is maker. */

            /* Assert taker fee is less than or equal to maximum fee specified by seller. */
            require(buy.takerRelayerFee <= sell.takerRelayerFee);

            if (sell.feeMethod == FeeMethod.SplitFee) {
                /* The Exchange does not escrow Ether, so direct Ether can only be used to with sell-side maker / buy-side taker orders. */
                require(sell.paymentToken != address(0));

                /* Assert taker fee is less than or equal to maximum fee specified by seller. */
                require(buy.takerProtocolFee <= sell.takerProtocolFee);

                if (buy.makerRelayerFee > 0) {
                    makerRelayerFee = SafeMath.div(SafeMath.mul(buy.makerRelayerFee, price), INVERSE_BASIS_POINT);
                    transferTokens(sell.paymentToken, buy.maker, buy.feeRecipient, makerRelayerFee);
                }

                if (buy.takerRelayerFee > 0) {
                    takerRelayerFee = SafeMath.div(SafeMath.mul(buy.takerRelayerFee, price), INVERSE_BASIS_POINT);
                    transferTokens(sell.paymentToken, sell.maker, buy.feeRecipient, takerRelayerFee);
                }

                if (buy.makerProtocolFee > 0) {
                    makerProtocolFee = SafeMath.div(SafeMath.mul(buy.makerProtocolFee, price), INVERSE_BASIS_POINT);
                    transferTokens(sell.paymentToken, buy.maker, protocolFeeRecipient, makerProtocolFee);
                }

                if (buy.takerProtocolFee > 0) {
                    takerProtocolFee = SafeMath.div(SafeMath.mul(buy.takerProtocolFee, price), INVERSE_BASIS_POINT);
                    transferTokens(sell.paymentToken, sell.maker, protocolFeeRecipient, takerProtocolFee);
                }

            } else {
                /* Charge maker fee to buyer. */
                chargeProtocolFee(buy.maker, buy.feeRecipient, buy.makerRelayerFee);
      
                /* Charge taker fee to seller. */
                chargeProtocolFee(sell.maker, buy.feeRecipient, buy.takerRelayerFee);
            }
        }

        if (sell.paymentToken == address(0)) {
            /* Special-case Ether, order must be matched by buyer. */
            require(msg.value >= requiredAmount);
            sell.maker.transfer(receiveAmount);
            /* Allow overshoot for variable-price auctions, refund difference. */
            uint diff = SafeMath.sub(msg.value, requiredAmount);
            if (diff > 0) {
                buy.maker.transfer(diff);
            }
        }

        /* This contract should never hold Ether, however, we cannot assert this, since it is impossible to prevent anyone from sending Ether e.g. with selfdestruct. */

        return price;
    }

    /**
     * @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls)
     * @param buy Buy-side order
     * @param sell Sell-side order
     * @return Whether or not the two orders can be matched
     */
    function ordersCanMatch(Order memory buy, Order memory sell)
        internal
        view
        returns (bool)
    {
        return (
            /* Must be opposite-side. */
            (buy.side == SaleKindInterface.Side.Buy && sell.side == SaleKindInterface.Side.Sell) &&     
            /* Must use same fee method. */
            (buy.feeMethod == sell.feeMethod) &&
            /* Must use same payment token. */
            (buy.paymentToken == sell.paymentToken) &&
            /* Must match maker/taker addresses. */
            (sell.taker == address(0) || sell.taker == buy.maker) &&
            (buy.taker == address(0) || buy.taker == sell.maker) &&
            /* One must be maker and the other must be taker (no bool XOR in Solidity). */
            ((sell.feeRecipient == address(0) && buy.feeRecipient != address(0)) || (sell.feeRecipient != address(0) && buy.feeRecipient == address(0))) &&
            /* Must match target. */
            (buy.target == sell.target) &&
            /* Must match howToCall. */
            (buy.howToCall == sell.howToCall) &&
            /* Buy-side order must be settleable. */
            SaleKindInterface.canSettleOrder(buy.listingTime, buy.expirationTime) &&
            /* Sell-side order must be settleable. */
            SaleKindInterface.canSettleOrder(sell.listingTime, sell.expirationTime)
        );
    }

    /**
     * @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock.
     * @param buy Buy-side order
     * @param buySig Buy-side order signature
     * @param sell Sell-side order
     * @param sellSig Sell-side order signature
     */
    function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
        internal
        reentrancyGuard
    {
        /* CHECKS */
      
        /* Ensure buy order validity and calculate hash if necessary. */
        bytes32 buyHash;
        if (buy.maker == msg.sender) {
            require(validateOrderParameters(buy));
        } else {
            buyHash = requireValidOrder(buy, buySig);
        }

        /* Ensure sell order validity and calculate hash if necessary. */
        bytes32 sellHash;
        if (sell.maker == msg.sender) {
            require(validateOrderParameters(sell));
        } else {
            sellHash = requireValidOrder(sell, sellSig);
        }
        
        /* Must be matchable. */
        require(ordersCanMatch(buy, sell));

        /* Target must exist (prevent malicious selfdestructs just prior to order settlement). */
        uint size;
        address target = sell.target;
        assembly {
            size := extcodesize(target)
        }
        require(size > 0);
      
        /* Must match calldata after replacement, if specified. */ 
        if (buy.replacementPattern.length > 0) {
          ArrayUtils.guardedArrayReplace(buy.calldata, sell.calldata, buy.replacementPattern);
        }
        if (sell.replacementPattern.length > 0) {
          ArrayUtils.guardedArrayReplace(sell.calldata, buy.calldata, sell.replacementPattern);
        }
        require(ArrayUtils.arrayEq(buy.calldata, sell.calldata));

        /* Retrieve delegateProxy contract. */
        OwnableDelegateProxy delegateProxy = registry.proxies(sell.maker);

        /* Proxy must exist. */
        require(delegateProxy != address(0));

        /* Assert implementation. */
        require(delegateProxy.implementation() == registry.delegateProxyImplementation());

        /* Access the passthrough AuthenticatedProxy. */
        AuthenticatedProxy proxy = AuthenticatedProxy(delegateProxy);

        /* EFFECTS */

        /* Mark previously signed or approved orders as finalized. */
        if (msg.sender != buy.maker) {
            cancelledOrFinalized[buyHash] = true;
        }
        if (msg.sender != sell.maker) {
            cancelledOrFinalized[sellHash] = true;
        }

        /* INTERACTIONS */

        /* Execute funds transfer and pay fees. */
        uint price = executeFundsTransfer(buy, sell);

        /* Execute specified call through proxy. */
        require(proxy.proxy(sell.target, sell.howToCall, sell.calldata));

        /* Static calls are intentionally done after the effectful call so they can check resulting state. */

        /* Handle buy-side static call if specified. */
        if (buy.staticTarget != address(0)) {
            require(staticCall(buy.staticTarget, sell.calldata, buy.staticExtradata));
        }

        /* Handle sell-side static call if specified. */
        if (sell.staticTarget != address(0)) {
            require(staticCall(sell.staticTarget, sell.calldata, sell.staticExtradata));
        }

        /* Log match event. */
        emit OrdersMatched(buyHash, sellHash, sell.feeRecipient != address(0) ? sell.maker : buy.maker, sell.feeRecipient != address(0) ? buy.maker : sell.maker, price, metadata);
    }

}

contract Exchange is ExchangeCore {

    /**
     * @dev Call guardedArrayReplace - library function exposed for testing.
     */
    function guardedArrayReplace(bytes array, bytes desired, bytes mask)
        public
        pure
        returns (bytes)
    {
        ArrayUtils.guardedArrayReplace(array, desired, mask);
        return array;
    }

    /**
     * Test copy byte array
     *
     * @param arrToCopy Array to copy
     * @return byte array
     */
    function testCopy(bytes arrToCopy)
        public
        pure
        returns (bytes)
    {
        bytes memory arr = new bytes(arrToCopy.length);
        uint index;
        assembly {
            index := add(arr, 0x20)
        }
        ArrayUtils.unsafeWriteBytes(index, arrToCopy);
        return arr;
    }

    /**
     * Test write address to bytes
     *
     * @param addr Address to write
     * @return byte array
     */
    function testCopyAddress(address addr)
        public
        pure
        returns (bytes)
    {
        bytes memory arr = new bytes(0x14);
        uint index;
        assembly {
            index := add(arr, 0x20)
        }
        ArrayUtils.unsafeWriteAddress(index, addr);
        return arr;
    }

    /**
     * @dev Call calculateFinalPrice - library function exposed for testing.
     */
    function calculateFinalPrice(SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, uint basePrice, uint extra, uint listingTime, uint expirationTime)
        public
        view
        returns (uint)
    {
        return SaleKindInterface.calculateFinalPrice(side, saleKind, basePrice, extra, listingTime, expirationTime);
    }

    /**
     * @dev Call hashOrder - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function hashOrder_(
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata)
        public
        pure
        returns (bytes32)
    {
        return hashOrder(
          Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8])
        );
    }

    /**
     * @dev Call hashToSign - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function hashToSign_(
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata)
        public
        pure
        returns (bytes32)
    { 
        return hashToSign(
          Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8])
        );
    }

    /**
     * @dev Call validateOrderParameters - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function validateOrderParameters_ (
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata)
        view
        public
        returns (bool)
    {
        Order memory order = Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]);
        return validateOrderParameters(
          order
        );
    }

    /**
     * @dev Call validateOrder - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function validateOrder_ (
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata,
        uint8 v,
        bytes32 r,
        bytes32 s)
        view
        public
        returns (bool)
    {
        Order memory order = Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]);
        return validateOrder(
          hashToSign(order),
          order,
          Sig(v, r, s)
        );
    }

    /**
     * @dev Call approveOrder - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function approveOrder_ (
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata,
        bool orderbookInclusionDesired) 
        public
    {
        Order memory order = Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]);
        return approveOrder(order, orderbookInclusionDesired);
    }

    /**
     * @dev Call cancelOrder - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function cancelOrder_(
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata,
        uint8 v,
        bytes32 r,
        bytes32 s)
        public
    {

        return cancelOrder(
          Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]),
          Sig(v, r, s)
        );
    }

    /**
     * @dev Call calculateCurrentPrice - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function calculateCurrentPrice_(
        address[7] addrs,
        uint[9] uints,
        FeeMethod feeMethod,
        SaleKindInterface.Side side,
        SaleKindInterface.SaleKind saleKind,
        AuthenticatedProxy.HowToCall howToCall,
        bytes calldata,
        bytes replacementPattern,
        bytes staticExtradata)
        public
        view
        returns (uint)
    {
        return calculateCurrentPrice(
          Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], feeMethod, side, saleKind, addrs[4], howToCall, calldata, replacementPattern, addrs[5], staticExtradata, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8])
        );
    }

    /**
     * @dev Call ordersCanMatch - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function ordersCanMatch_(
        address[14] addrs,
        uint[18] uints,
        uint8[8] feeMethodsSidesKindsHowToCalls,
        bytes calldataBuy,
        bytes calldataSell,
        bytes replacementPatternBuy,
        bytes replacementPatternSell,
        bytes staticExtradataBuy,
        bytes staticExtradataSell)
        public
        view
        returns (bool)
    {
        Order memory buy = Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], FeeMethod(feeMethodsSidesKindsHowToCalls[0]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[1]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[2]), addrs[4], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[3]), calldataBuy, replacementPatternBuy, addrs[5], staticExtradataBuy, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]);
        Order memory sell = Order(addrs[7], addrs[8], addrs[9], uints[9], uints[10], uints[11], uints[12], addrs[10], FeeMethod(feeMethodsSidesKindsHowToCalls[4]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[5]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[6]), addrs[11], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[7]), calldataSell, replacementPatternSell, addrs[12], staticExtradataSell, ERC20(addrs[13]), uints[13], uints[14], uints[15], uints[16], uints[17]);
        return ordersCanMatch(
          buy,
          sell
        );
    }

    /**
     * @dev Return whether or not two orders' calldata specifications can match
     * @param buyCalldata Buy-side order calldata
     * @param buyReplacementPattern Buy-side order calldata replacement mask
     * @param sellCalldata Sell-side order calldata
     * @param sellReplacementPattern Sell-side order calldata replacement mask
     * @return Whether the orders' calldata can be matched
     */
    function orderCalldataCanMatch(bytes buyCalldata, bytes buyReplacementPattern, bytes sellCalldata, bytes sellReplacementPattern)
        public
        pure
        returns (bool)
    {
        if (buyReplacementPattern.length > 0) {
          ArrayUtils.guardedArrayReplace(buyCalldata, sellCalldata, buyReplacementPattern);
        }
        if (sellReplacementPattern.length > 0) {
          ArrayUtils.guardedArrayReplace(sellCalldata, buyCalldata, sellReplacementPattern);
        }
        return ArrayUtils.arrayEq(buyCalldata, sellCalldata);
    }

    /**
     * @dev Call calculateMatchPrice - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function calculateMatchPrice_(
        address[14] addrs,
        uint[18] uints,
        uint8[8] feeMethodsSidesKindsHowToCalls,
        bytes calldataBuy,
        bytes calldataSell,
        bytes replacementPatternBuy,
        bytes replacementPatternSell,
        bytes staticExtradataBuy,
        bytes staticExtradataSell)
        public
        view
        returns (uint)
    {
        Order memory buy = Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], FeeMethod(feeMethodsSidesKindsHowToCalls[0]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[1]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[2]), addrs[4], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[3]), calldataBuy, replacementPatternBuy, addrs[5], staticExtradataBuy, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]);
        Order memory sell = Order(addrs[7], addrs[8], addrs[9], uints[9], uints[10], uints[11], uints[12], addrs[10], FeeMethod(feeMethodsSidesKindsHowToCalls[4]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[5]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[6]), addrs[11], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[7]), calldataSell, replacementPatternSell, addrs[12], staticExtradataSell, ERC20(addrs[13]), uints[13], uints[14], uints[15], uints[16], uints[17]);
        return calculateMatchPrice(
          buy,
          sell
        );
    }

    /**
     * @dev Call atomicMatch - Solidity ABI encoding limitation workaround, hopefully temporary.
     */
    function atomicMatch_(
        address[14] addrs,
        uint[18] uints,
        uint8[8] feeMethodsSidesKindsHowToCalls,
        bytes calldataBuy,
        bytes calldataSell,
        bytes replacementPatternBuy,
        bytes replacementPatternSell,
        bytes staticExtradataBuy,
        bytes staticExtradataSell,
        uint8[2] vs,
        bytes32[5] rssMetadata)
        public
        payable
    {

        return atomicMatch(
          Order(addrs[0], addrs[1], addrs[2], uints[0], uints[1], uints[2], uints[3], addrs[3], FeeMethod(feeMethodsSidesKindsHowToCalls[0]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[1]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[2]), addrs[4], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[3]), calldataBuy, replacementPatternBuy, addrs[5], staticExtradataBuy, ERC20(addrs[6]), uints[4], uints[5], uints[6], uints[7], uints[8]),
          Sig(vs[0], rssMetadata[0], rssMetadata[1]),
          Order(addrs[7], addrs[8], addrs[9], uints[9], uints[10], uints[11], uints[12], addrs[10], FeeMethod(feeMethodsSidesKindsHowToCalls[4]), SaleKindInterface.Side(feeMethodsSidesKindsHowToCalls[5]), SaleKindInterface.SaleKind(feeMethodsSidesKindsHowToCalls[6]), addrs[11], AuthenticatedProxy.HowToCall(feeMethodsSidesKindsHowToCalls[7]), calldataSell, replacementPatternSell, addrs[12], staticExtradataSell, ERC20(addrs[13]), uints[13], uints[14], uints[15], uints[16], uints[17]),
          Sig(vs[1], rssMetadata[2], rssMetadata[3]),
          rssMetadata[4]
        );
    }

}

contract WyvernExchange is Exchange {

    string public constant name = "Project Wyvern Exchange";

    string public constant version = "2.2";

    string public constant codename = "Lambton Worm";

    /**
     * @dev Initialize a WyvernExchange instance
     * @param registryAddress Address of the registry instance which this Exchange instance will use
     * @param tokenAddress Address of the token used for protocol fees
     */
    constructor (ProxyRegistry registryAddress, TokenTransferProxy tokenTransferProxyAddress, ERC20 tokenAddress, address protocolFeeAddress) public {
        registry = registryAddress;
        tokenTransferProxy = tokenTransferProxyAddress;
        exchangeToken = tokenAddress;
        protocolFeeRecipient = protocolFeeAddress;
        owner = msg.sender;
    }

}

library SaleKindInterface {

    /**
     * Side: buy or sell.
     */
    enum Side { Buy, Sell }

    /**
     * Currently supported kinds of sale: fixed price, Dutch auction. 
     * English auctions cannot be supported without stronger escrow guarantees.
     * Future interesting options: Vickrey auction, nonlinear Dutch auctions.
     */
    enum SaleKind { FixedPrice, DutchAuction }

    /**
     * @dev Check whether the parameters of a sale are valid
     * @param saleKind Kind of sale
     * @param expirationTime Order expiration time
     * @return Whether the parameters were valid
     */
    function validateParameters(SaleKind saleKind, uint expirationTime)
        pure
        internal
        returns (bool)
    {
        /* Auctions must have a set expiration date. */
        return (saleKind == SaleKind.FixedPrice || expirationTime > 0);
    }

    /**
     * @dev Return whether or not an order can be settled
     * @dev Precondition: parameters have passed validateParameters
     * @param listingTime Order listing time
     * @param expirationTime Order expiration time
     */
    function canSettleOrder(uint listingTime, uint expirationTime)
        view
        internal
        returns (bool)
    {
        return (listingTime < now) && (expirationTime == 0 || now < expirationTime);
    }

    /**
     * @dev Calculate the settlement price of an order
     * @dev Precondition: parameters have passed validateParameters.
     * @param side Order side
     * @param saleKind Method of sale
     * @param basePrice Order base price
     * @param extra Order extra price data
     * @param listingTime Order listing time
     * @param expirationTime Order expiration time
     */
    function calculateFinalPrice(Side side, SaleKind saleKind, uint basePrice, uint extra, uint listingTime, uint expirationTime)
        view
        internal
        returns (uint finalPrice)
    {
        if (saleKind == SaleKind.FixedPrice) {
            return basePrice;
        } else if (saleKind == SaleKind.DutchAuction) {
            uint diff = SafeMath.div(SafeMath.mul(extra, SafeMath.sub(now, listingTime)), SafeMath.sub(expirationTime, listingTime));
            if (side == Side.Sell) {
                /* Sell-side - start price: basePrice. End price: basePrice - extra. */
                return SafeMath.sub(basePrice, diff);
            } else {
                /* Buy-side - start price: basePrice. End price: basePrice + extra. */
                return SafeMath.add(basePrice, diff);
            }
        }
    }

}

contract ProxyRegistry is Ownable {

    /* DelegateProxy implementation contract. Must be initialized. */
    address public delegateProxyImplementation;

    /* Authenticated proxies by user. */
    mapping(address => OwnableDelegateProxy) public proxies;

    /* Contracts pending access. */
    mapping(address => uint) public pending;

    /* Contracts allowed to call those proxies. */
    mapping(address => bool) public contracts;

    /* Delay period for adding an authenticated contract.
       This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO),
       a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have
       plenty of time to notice and transfer their assets.
    */
    uint public DELAY_PERIOD = 2 weeks;

    /**
     * Start the process to enable access for specified contract. Subject to delay period.
     *
     * @dev ProxyRegistry owner only
     * @param addr Address to which to grant permissions
     */
    function startGrantAuthentication (address addr)
        public
        onlyOwner
    {
        require(!contracts[addr] && pending[addr] == 0);
        pending[addr] = now;
    }

    /**
     * End the process to nable access for specified contract after delay period has passed.
     *
     * @dev ProxyRegistry owner only
     * @param addr Address to which to grant permissions
     */
    function endGrantAuthentication (address addr)
        public
        onlyOwner
    {
        require(!contracts[addr] && pending[addr] != 0 && ((pending[addr] + DELAY_PERIOD) < now));
        pending[addr] = 0;
        contracts[addr] = true;
    }

    /**
     * Revoke access for specified contract. Can be done instantly.
     *
     * @dev ProxyRegistry owner only
     * @param addr Address of which to revoke permissions
     */    
    function revokeAuthentication (address addr)
        public
        onlyOwner
    {
        contracts[addr] = false;
    }

    /**
     * Register a proxy contract with this registry
     *
     * @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
     * @return New AuthenticatedProxy contract
     */
    function registerProxy()
        public
        returns (OwnableDelegateProxy proxy)
    {
        require(proxies[msg.sender] == address(0));
        proxy = new OwnableDelegateProxy(msg.sender, delegateProxyImplementation, abi.encodeWithSignature("initialize(address,address)", msg.sender, address(this)));
        proxies[msg.sender] = proxy;
        return proxy;
    }

}

contract TokenTransferProxy {

    /* Authentication registry. */
    ProxyRegistry public registry;

    /**
     * Call ERC20 `transferFrom`
     *
     * @dev Authenticated contract only
     * @param token ERC20 token address
     * @param from From address
     * @param to To address
     * @param amount Transfer amount
     */
    function transferFrom(address token, address from, address to, uint amount)
        public
        returns (bool)
    {
        require(registry.contracts(msg.sender));
        return ERC20(token).transferFrom(from, to, amount);
    }

}

contract OwnedUpgradeabilityStorage {

  // Current implementation
  address internal _implementation;

  // Owner of the contract
  address private _upgradeabilityOwner;

  /**
   * @dev Tells the address of the owner
   * @return the address of the owner
   */
  function upgradeabilityOwner() public view returns (address) {
    return _upgradeabilityOwner;
  }

  /**
   * @dev Sets the address of the owner
   */
  function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
    _upgradeabilityOwner = newUpgradeabilityOwner;
  }

  /**
  * @dev Tells the address of the current implementation
  * @return address of the current implementation
  */
  function implementation() public view returns (address) {
    return _implementation;
  }

  /**
  * @dev Tells the proxy type (EIP 897)
  * @return Proxy type, 2 for forwarding proxy
  */
  function proxyType() public pure returns (uint256 proxyTypeId) {
    return 2;
  }
}

contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage {

    /* Whether initialized. */
    bool initialized = false;

    /* Address which owns this proxy. */
    address public user;

    /* Associated registry with contract authentication information. */
    ProxyRegistry public registry;

    /* Whether access has been revoked. */
    bool public revoked;

    /* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */
    enum HowToCall { Call, DelegateCall }

    /* Event fired when the proxy access is revoked or unrevoked. */
    event Revoked(bool revoked);

    /**
     * Initialize an AuthenticatedProxy
     *
     * @param addrUser Address of user on whose behalf this proxy will act
     * @param addrRegistry Address of ProxyRegistry contract which will manage this proxy
     */
    function initialize (address addrUser, ProxyRegistry addrRegistry)
        public
    {
        require(!initialized);
        initialized = true;
        user = addrUser;
        registry = addrRegistry;
    }

    /**
     * Set the revoked flag (allows a user to revoke ProxyRegistry access)
     *
     * @dev Can be called by the user only
     * @param revoke Whether or not to revoke access
     */
    function setRevoke(bool revoke)
        public
    {
        require(msg.sender == user);
        revoked = revoke;
        emit Revoked(revoke);
    }

    /**
     * Execute a message call from the proxy contract
     *
     * @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access
     * @param dest Address to which the call will be sent
     * @param howToCall Which kind of call to make
     * @param calldata Calldata to send
     * @return Result of the call (success or failure)
     */
    function proxy(address dest, HowToCall howToCall, bytes calldata)
        public
        returns (bool result)
    {
        require(msg.sender == user || (!revoked && registry.contracts(msg.sender)));
        if (howToCall == HowToCall.Call) {
            result = dest.call(calldata);
        } else if (howToCall == HowToCall.DelegateCall) {
            result = dest.delegatecall(calldata);
        }
        return result;
    }

    /**
     * Execute a message call and assert success
     * 
     * @dev Same functionality as `proxy`, just asserts the return value
     * @param dest Address to which the call will be sent
     * @param howToCall What kind of call to make
     * @param calldata Calldata to send
     */
    function proxyAssert(address dest, HowToCall howToCall, bytes calldata)
        public
    {
        require(proxy(dest, howToCall, calldata));
    }

}

contract Proxy {

  /**
  * @dev Tells the address of the implementation where every call will be delegated.
  * @return address of the implementation to which it will be delegated
  */
  function implementation() public view returns (address);

  /**
  * @dev Tells the type of proxy (EIP 897)
  * @return Type of proxy, 2 for upgradeable proxy
  */
  function proxyType() public pure returns (uint256 proxyTypeId);

  /**
  * @dev Fallback function allowing to perform a delegatecall to the given implementation.
  * This function will return whatever the implementation call returns
  */
  function () payable public {
    address _impl = implementation();
    require(_impl != address(0));

    assembly {
      let ptr := mload(0x40)
      calldatacopy(ptr, 0, calldatasize)
      let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0)
      let size := returndatasize
      returndatacopy(ptr, 0, size)

      switch result
      case 0 { revert(ptr, size) }
      default { return(ptr, size) }
    }
  }
}

contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage {
  /**
  * @dev Event to show ownership has been transferred
  * @param previousOwner representing the address of the previous owner
  * @param newOwner representing the address of the new owner
  */
  event ProxyOwnershipTransferred(address previousOwner, address newOwner);

  /**
  * @dev This event will be emitted every time the implementation gets upgraded
  * @param implementation representing the address of the upgraded implementation
  */
  event Upgraded(address indexed implementation);

  /**
  * @dev Upgrades the implementation address
  * @param implementation representing the address of the new implementation to be set
  */
  function _upgradeTo(address implementation) internal {
    require(_implementation != implementation);
    _implementation = implementation;
    emit Upgraded(implementation);
  }

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

  /**
   * @dev Tells the address of the proxy owner
   * @return the address of the proxy owner
   */
  function proxyOwner() public view returns (address) {
    return upgradeabilityOwner();
  }

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

  /**
   * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy.
   * @param implementation representing the address of the new implementation to be set.
   */
  function upgradeTo(address implementation) public onlyProxyOwner {
    _upgradeTo(implementation);
  }

  /**
   * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy
   * and delegatecall the new implementation for initialization.
   * @param implementation representing the address of the new implementation to be set.
   * @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
   * signature of the implementation to be called with the needed payload
   */
  function upgradeToAndCall(address implementation, bytes data) payable public onlyProxyOwner {
    upgradeTo(implementation);
    require(address(this).delegatecall(data));
  }
}

contract OwnableDelegateProxy is OwnedUpgradeabilityProxy {

    constructor(address owner, address initialImplementation, bytes calldata)
        public
    {
        setUpgradeabilityOwner(owner);
        _upgradeTo(initialImplementation);
        require(initialImplementation.delegatecall(calldata));
    }

}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenTransferProxy","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"target","type":"address"},{"name":"calldata","type":"bytes"},{"name":"extradata","type":"bytes"}],"name":"staticCall","outputs":[{"name":"result","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newMinimumMakerProtocolFee","type":"uint256"}],"name":"changeMinimumMakerProtocolFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newMinimumTakerProtocolFee","type":"uint256"}],"name":"changeMinimumTakerProtocolFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"array","type":"bytes"},{"name":"desired","type":"bytes"},{"name":"mask","type":"bytes"}],"name":"guardedArrayReplace","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"minimumTakerProtocolFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"codename","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"testCopyAddress","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"arrToCopy","type":"bytes"}],"name":"testCopy","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"}],"name":"calculateCurrentPrice_","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newProtocolFeeRecipient","type":"address"}],"name":"changeProtocolFeeRecipient","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"buyCalldata","type":"bytes"},{"name":"buyReplacementPattern","type":"bytes"},{"name":"sellCalldata","type":"bytes"},{"name":"sellReplacementPattern","type":"bytes"}],"name":"orderCalldataCanMatch","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"validateOrder_","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"basePrice","type":"uint256"},{"name":"extra","type":"uint256"},{"name":"listingTime","type":"uint256"},{"name":"expirationTime","type":"uint256"}],"name":"calculateFinalPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"protocolFeeRecipient","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"}],"name":"hashOrder_","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[14]"},{"name":"uints","type":"uint256[18]"},{"name":"feeMethodsSidesKindsHowToCalls","type":"uint8[8]"},{"name":"calldataBuy","type":"bytes"},{"name":"calldataSell","type":"bytes"},{"name":"replacementPatternBuy","type":"bytes"},{"name":"replacementPatternSell","type":"bytes"},{"name":"staticExtradataBuy","type":"bytes"},{"name":"staticExtradataSell","type":"bytes"}],"name":"ordersCanMatch_","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"},{"name":"orderbookInclusionDesired","type":"bool"}],"name":"approveOrder_","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"registry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimumMakerProtocolFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"}],"name":"hashToSign_","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"cancelledOrFinalized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"exchangeToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"cancelOrder_","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addrs","type":"address[14]"},{"name":"uints","type":"uint256[18]"},{"name":"feeMethodsSidesKindsHowToCalls","type":"uint8[8]"},{"name":"calldataBuy","type":"bytes"},{"name":"calldataSell","type":"bytes"},{"name":"replacementPatternBuy","type":"bytes"},{"name":"replacementPatternSell","type":"bytes"},{"name":"staticExtradataBuy","type":"bytes"},{"name":"staticExtradataSell","type":"bytes"},{"name":"vs","type":"uint8[2]"},{"name":"rssMetadata","type":"bytes32[5]"}],"name":"atomicMatch_","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[7]"},{"name":"uints","type":"uint256[9]"},{"name":"feeMethod","type":"uint8"},{"name":"side","type":"uint8"},{"name":"saleKind","type":"uint8"},{"name":"howToCall","type":"uint8"},{"name":"calldata","type":"bytes"},{"name":"replacementPattern","type":"bytes"},{"name":"staticExtradata","type":"bytes"}],"name":"validateOrderParameters_","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"INVERSE_BASIS_POINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addrs","type":"address[14]"},{"name":"uints","type":"uint256[18]"},{"name":"feeMethodsSidesKindsHowToCalls","type":"uint8[8]"},{"name":"calldataBuy","type":"bytes"},{"name":"calldataSell","type":"bytes"},{"name":"replacementPatternBuy","type":"bytes"},{"name":"replacementPatternSell","type":"bytes"},{"name":"staticExtradataBuy","type":"bytes"},{"name":"staticExtradataSell","type":"bytes"}],"name":"calculateMatchPrice_","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"approvedOrders","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"registryAddress","type":"address"},{"name":"tokenTransferProxyAddress","type":"address"},{"name":"tokenAddress","type":"address"},{"name":"protocolFeeAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":false,"name":"exchange","type":"address"},{"indexed":true,"name":"maker","type":"address"},{"indexed":false,"name":"taker","type":"address"},{"indexed":false,"name":"makerRelayerFee","type":"uint256"},{"indexed":false,"name":"takerRelayerFee","type":"uint256"},{"indexed":false,"name":"makerProtocolFee","type":"uint256"},{"indexed":false,"name":"takerProtocolFee","type":"uint256"},{"indexed":true,"name":"feeRecipient","type":"address"},{"indexed":false,"name":"feeMethod","type":"uint8"},{"indexed":false,"name":"side","type":"uint8"},{"indexed":false,"name":"saleKind","type":"uint8"},{"indexed":false,"name":"target","type":"address"}],"name":"OrderApprovedPartOne","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":false,"name":"howToCall","type":"uint8"},{"indexed":false,"name":"calldata","type":"bytes"},{"indexed":false,"name":"replacementPattern","type":"bytes"},{"indexed":false,"name":"staticTarget","type":"address"},{"indexed":false,"name":"staticExtradata","type":"bytes"},{"indexed":false,"name":"paymentToken","type":"address"},{"indexed":false,"name":"basePrice","type":"uint256"},{"indexed":false,"name":"extra","type":"uint256"},{"indexed":false,"name":"listingTime","type":"uint256"},{"indexed":false,"name":"expirationTime","type":"uint256"},{"indexed":false,"name":"salt","type":"uint256"},{"indexed":false,"name":"orderbookInclusionDesired","type":"bool"}],"name":"OrderApprovedPartTwo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"buyHash","type":"bytes32"},{"indexed":false,"name":"sellHash","type":"bytes32"},{"indexed":true,"name":"maker","type":"address"},{"indexed":true,"name":"taker","type":"address"},{"indexed":false,"name":"price","type":"uint256"},{"indexed":true,"name":"metadata","type":"bytes32"}],"name":"OrdersMatched","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526000805460ff19168155600681905560075534801561002257600080fd5b50604051608080614dbf83398101604090815281516020830151918301516060909301516000805460028054600160a060020a03958616600160a060020a0319918216179091556003805496861696821696909617909555600180549685169686169690961790955560088054928416929094169190911790925533166101000261010060a860020a031992831681179092169091179055614cf6806100c96000396000f3006080604052600436106101925763ffffffff60e060020a60003504166306fdde0381146101975780630eefdbad1461022157806310796a471461025257806314350c241461030b5780631a6b13e214610325578063239e83df1461033d57806328a8ee681461041257806331e63199146104395780633464af6a1461044e5780633e1e292a1461046f5780633f67ee0d146104c8578063514f03301461060d57806354fd4d501461062e578063562b2ebc1461064357806360bef33a1461075657806363d36c0b146108aa57806364df049e146108d7578063715018a6146108ec57806371d02b381461090157806372593b4c14610a465780637966686814610c4d5780637b10399914610d965780637ccefc5214610dab5780637d76698114610dc05780638076f00514610f055780638da5cb5b14610f1d578063a25eb5d914610f32578063a8a41c7014610f47578063ab834bab1461109b578063ca595b9a146112de578063cae6047f14611423578063d537e13114611438578063e57d4adb1461163f578063f2fde38b14611657575b600080fd5b3480156101a357600080fd5b506101ac611678565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e65781810151838201526020016101ce565b50505050905090810190601f1680156102135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022d57600080fd5b506102366116af565b60408051600160a060020a039092168252519081900360200190f35b34801561025e57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102f7958335600160a060020a031695369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506116be9650505050505050565b604080519115158252519081900360200190f35b34801561031757600080fd5b5061032360043561172d565b005b34801561033157600080fd5b50610323600435611752565b34801561034957600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526101ac94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506117779650505050505050565b34801561041e57600080fd5b5061042761178e565b60408051918252519081900360200190f35b34801561044557600080fd5b506101ac611794565b34801561045a57600080fd5b506101ac600160a060020a03600435166117cb565b34801561047b57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526101ac94369492936024939284019190819084018382808284375094975061180b9650505050505050565b3480156104d457600080fd5b506040805160e081810190925261042791369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506118519650505050505050565b34801561061957600080fd5b50610323600160a060020a036004351661199f565b34801561063a57600080fd5b506101ac6119ee565b34801561064f57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102f794369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611a259650505050505050565b34801561076257600080fd5b506040805160e08181019092526102f791369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050833560ff1694505050602082013591604001359050611a63565b3480156108b657600080fd5b5061042760ff6004358116906024351660443560643560843560a435611c52565b3480156108e357600080fd5b50610236611c6d565b3480156108f857600080fd5b50610323611c7c565b34801561090d57600080fd5b506040805160e081810190925261042791369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611cf69650505050505050565b348015610a5257600080fd5b50604080516101c08181019092526102f79136916004916101c491908390600e9083908390808284375050604080516102408181019092529497969581810195945092506012915083908390808284375050604080516101008181019092529497969581810195945092506008915083908390808284375050604080516020601f88358a0180359182018390048302840183019094528083529699989781019691955091820193509150819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611e369650505050505050565b348015610c5957600080fd5b506040805160e081810190925261032391369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750505050913515159250612222915050565b348015610da257600080fd5b50610236612377565b348015610db757600080fd5b50610427612386565b348015610dcc57600080fd5b506040805160e081810190925261042791369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375094975061238c9650505050505050565b348015610f1157600080fd5b506102f76004356124cc565b348015610f2957600080fd5b506102366124e1565b348015610f3e57600080fd5b506102366124f5565b348015610f5357600080fd5b506040805160e081810190925261032391369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050833560ff1694505050602082013591604001359050612504565b604080516101c08181019092526103239136916004916101c491908390600e9083908390808284375050604080516102408181019092529497969581810195945092506012915083908390808284375050604080516101008181019092529497969581810195945092506008915083908390808284375050604080516020601f88358a0180359182018390048302840183019094528083529699989781019691955091820193509150819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750506040805180820182529598979681810196955093506002925084915083908082843750506040805160a0818101909252949796958181019594509250600591508390839080828437509396506126da95505050505050565b3480156112ea57600080fd5b506040805160e08181019092526102f791369160049160e49190839060079083908390808284375050604080516101208181019092529497969581810195945092506009915083908390808284375050604080516020601f60808901358a0180359182018390048302840183018552818452979a60ff8a3581169b848c013582169b9687013582169a6060880135909216995091975090955060a090940193820191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750612af09650505050505050565b34801561142f57600080fd5b50610427612c48565b34801561144457600080fd5b50604080516101c08181019092526104279136916004916101c491908390600e9083908390808284375050604080516102408181019092529497969581810195945092506012915083908390808284375050604080516101008181019092529497969581810195945092506008915083908390808284375050604080516020601f88358a0180359182018390048302840183019094528083529699989781019691955091820193509150819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750612c4e9650505050505050565b34801561164b57600080fd5b506102f760043561302a565b34801561166357600080fd5b50610323600160a060020a036004351661303f565b60408051808201909152601781527f50726f6a6563742057797665726e2045786368616e6765000000000000000000602082015281565b600354600160a060020a031681565b60006060600083518551016040519080825280601f01601f1916602001820160405280156116f6578160200160208202803883390190505b509150506020810161170881856130e7565b905061171481866130e7565b506000604051835160208501895afa9695505050505050565b60005433600160a060020a03908116610100909204161461174d57600080fd5b600655565b60005433600160a060020a03908116610100909204161461177257600080fd5b600755565b606061178484848461312d565b50825b9392505050565b60075481565b60408051808201909152600c81527f4c616d62746f6e20576f726d0000000000000000000000000000000000000000602082015281565b60408051601480825281830190925260609182916000916020820161028080388339019050509150506020810161180281856132b4565b50909392505050565b606080600083516040519080825280601f01601f19166020018201604052801561183f578160200160208202803883390190505b509150506020810161180281856130e7565b604080516102e0810182528a51600160a060020a0390811682526020808d01518216818401528c8401518216838501528b51606080850191909152908c01516080840152928b015160a08301528a83015160c0830152918b015190911660e08201526000906119919061010081018a60018111156118cb57fe5b81526020018960018111156118dc57fe5b81526020018860018111156118ed57fe5b815260808d0151600160a060020a0316602082015260400187600181111561191157fe5b8152602081018790526040810186905260a0808e0151600160a060020a0316606083015260808201869052018c600660209081029190910151600160a060020a031682526080808e01519183019190915260a0808e0151604084015260c08e0151606084015260e08e0151918301919091526101008d01519101526132d4565b9a9950505050505050505050565b60005433600160a060020a0390811661010090920416146119bf57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051808201909152600381527f322e320000000000000000000000000000000000000000000000000000000000602082015281565b60008084511115611a3b57611a3b85848661312d565b600082511115611a5057611a5083868461312d565b611a5a858461330a565b95945050505050565b6000611a6d614c06565b604080516102e08101909152808f600060209081029190910151600160a060020a03168252018f600160209081029190910151600160a060020a03168252018f600260209081029190910151600160a060020a03168252018e6000602090810291909101518252018e6001602090810291909101518252018e6002602090810291909101518252018e6003602090810291909101518252018f60036020020151600160a060020a031681526020018d6001811115611b2757fe5b81526020018c6001811115611b3857fe5b81526020018b6001811115611b4957fe5b81526020018f60046020020151600160a060020a031681526020018a6001811115611b7057fe5b8152602081018a9052604081018990526060018f60056020020151600160a060020a031681526020018781526020018f6006600781101515611bae57fe5b60209081029190910151600160a060020a03168252018e6004602090810291909101518252018e6005602090810291909101518252018e6006602090810291909101518252018e6007602090810291909101518252018e6008602002015190529050611c40611c1c8261336e565b6040805160608101825260ff891681526020810188905290810186905283906133b9565b9e9d5050505050505050505050505050565b6000611c628787878787876134ae565b979650505050505050565b600854600160a060020a031681565b60005433600160a060020a039081166101009092041614611c9c57600080fd5b60008054604051610100909104600160a060020a0316917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805474ffffffffffffffffffffffffffffffffffffffff0019169055565b604080516102e0810182528a51600160a060020a0390811682526020808d01518216818401528c8401518216838501528b51606080850191909152908c01516080840152928b015160a08301528a83015160c0830152918b015190911660e08201526000906119919061010081018a6001811115611d7057fe5b8152602001896001811115611d8157fe5b8152602001886001811115611d9257fe5b815260808d0151600160a060020a03166020820152604001876001811115611db657fe5b8152602081018790526040810186905260a0808e0151600160a060020a0316606083015260808201869052018c600660209081029190910151600160a060020a031682526080808e01519183019190915260a0808e0151604084015260c08e0151606084015260e08e0151918301919091526101008d0151910152613541565b6000611e40614c06565b611e48614c06565b604080516102e08101909152808d600060209081029190910151600160a060020a03168252018d600160209081029190910151600160a060020a03168252018d600260209081029190910151600160a060020a03168252018c6000602090810291909101518252018c6001602090810291909101518252018c6002602090810291909101518252018c6003602090810291909101518252018d600360209081029190910151600160a060020a03168252018b6000602002015160ff166001811115611f0f57fe5b6001811115611f1a57fe5b81526020018b6001602002015160ff166001811115611f3557fe5b6001811115611f4057fe5b81526020018b6002602002015160ff166001811115611f5b57fe5b6001811115611f6657fe5b815260808e0151600160a060020a0316602082015260608c015160409091019060ff166001811115611f9457fe5b6001811115611f9f57fe5b8152602081018b90526040810189905260a0808f0151600160a060020a0316606083015260808201889052018d600660209081029190910151600160a060020a03168252018c6004602090810291909101518252018c6005602090810291909101518252018c6006602090810291909101518252018c6007602090810291909101518252018c600860200201519052604080516102e08101909152909250808d600760209081029190910151600160a060020a03168252018d600860209081029190910151600160a060020a03168252018d600960209081029190910151600160a060020a03168252018c6009602090810291909101518252018c600a602090810291909101518252018c600b602090810291909101518252018c600c602090810291909101518252018d600a60209081029190910151600160a060020a03168252018b6004602002015160ff1660018111156120f857fe5b600181111561210357fe5b81526020018b6005602002015160ff16600181111561211e57fe5b600181111561212957fe5b81526020018b6006602002015160ff16600181111561214457fe5b600181111561214f57fe5b81526101608e0151600160a060020a0316602082015260e08c015160409091019060ff16600181111561217e57fe5b600181111561218957fe5b8152602081018a9052604081018890526101808e0151600160a060020a031660608201526080810186905260a0018d600d60209081029190910151600160a060020a031682526101a08e0151908201526101c08d015160408201526101e08d015160608201526102008d015160808201526102208d015160a09091015290506122128282613730565b9c9b505050505050505050505050565b61222a614c06565b604080516102e0810182528c51600160a060020a0390811682526020808f01518216818401528e8401518216838501528d51606080850191909152908e01516080840152928d015160a08301528c83015160c0830152918d015190911660e082015261010081018a600181111561229d57fe5b81526020018960018111156122ae57fe5b81526020018860018111156122bf57fe5b815260808d0151600160a060020a031660208201526040018760018111156122e357fe5b8152602081018790526040810186905260a0808e0151600160a060020a0316606083015260808201869052018c600660209081029190910151600160a060020a031682526080808e01519183019190915260a0808e0151604084015260c08e0151606084015260e08e0151918301919091526101008d0151910152905061236a818361390a565b5050505050505050505050565b600254600160a060020a031681565b60065481565b604080516102e0810182528a51600160a060020a0390811682526020808d01518216818401528c8401518216838501528b51606080850191909152908c01516080840152928b015160a08301528a83015160c0830152918b015190911660e08201526000906119919061010081018a600181111561240657fe5b815260200189600181111561241757fe5b815260200188600181111561242857fe5b815260808d0151600160a060020a0316602082015260400187600181111561244c57fe5b8152602081018790526040810186905260a0808e0151600160a060020a0316606083015260808201869052018c600660209081029190910151600160a060020a031682526080808e01519183019190915260a0808e0151604084015260c08e0151606084015260e08e0151918301919091526101008d015191015261336e565b60046020526000908152604090205460ff1681565b6000546101009004600160a060020a031681565b600154600160a060020a031681565b604080516102e081019091526126cc90808e600060209081029190910151600160a060020a03168252018e600160209081029190910151600160a060020a03168252018e600260209081029190910151600160a060020a03168252018d6000602090810291909101518252018d6001602090810291909101518252018d6002602090810291909101518252018d6003602090810291909101518252018e60036020020151600160a060020a031681526020018c60018111156125c257fe5b81526020018b60018111156125d357fe5b81526020018a60018111156125e457fe5b815260808f0151600160a060020a0316602082015260400189600181111561260857fe5b815260208101899052604081018890526060018e60056020020151600160a060020a031681526020018681526020018e600660078110151561264657fe5b60209081029190910151600160a060020a03168252018d6004602090810291909101518252018d6005602090810291909101518252018d6006602090810291909101518252018d6007602090810291909101518252018d6008602090810291909101519091526040805160608101825260ff881681529182018690528101849052613cd8565b505050505050505050505050565b604080516102e0810182528c51600160a060020a0390811682526020808f01518216818401528e8401518216838501528d51606080850191909152908e01516080840152928d015160a08301528c83015160c0830152918d015190911660e0820152895161236a919061010082019060ff16600181111561275757fe5b600181111561276257fe5b81526020018b6001602002015160ff16600181111561277d57fe5b600181111561278857fe5b81526020018b6002602002015160ff1660018111156127a357fe5b60018111156127ae57fe5b815260808e0151600160a060020a0316602082015260608c015160409091019060ff1660018111156127dc57fe5b60018111156127e757fe5b8152602081018b90526040810189905260a0808f0151600160a060020a0316606083015260808201889052018d600660209081029190910151600160a060020a03168252018c6004602090810291909101518252018c6005602090810291909101518252018c6006602090810291909101518252018c6007602090810291909101518252018c6008602002015190526040805160608101909152808560006020908102919091015160ff168252018460006020908102919091015182520184600160200201519052604080516102e08101909152808f600760209081029190910151600160a060020a03168252018f600860209081029190910151600160a060020a03168252018f600960209081029190910151600160a060020a03168252018e6009602090810291909101518252018e600a602090810291909101518252018e600b602090810291909101518252018e600c602090810291909101518252018f600a60209081029190910151600160a060020a03168252018d6004602002015160ff16600181111561297657fe5b600181111561298157fe5b81526020018d6005602002015160ff16600181111561299c57fe5b60018111156129a757fe5b81526020018d6006602002015160ff1660018111156129c257fe5b60018111156129cd57fe5b81526020018f600b60209081029190910151600160a060020a03168252018d6007602002015160ff166001811115612a0157fe5b6001811115612a0c57fe5b8152602081018c9052604081018a90526060018f600c6020020151600160a060020a031681526020018781526020018f600d600e81101515612a4a57fe5b60209081029190910151600160a060020a03168252018e600d602090810291909101518252018e600e602090810291909101518252018e600f602090810291909101518252018e6010602090810291909101518252018e6011602002015190526040805160608101909152808760016020908102919091015160ff1682520186600260209081029190910151825201866003602002015190528560046020020151613d4f565b6000612afa614c06565b604080516102e0810182528c51600160a060020a0390811682526020808f01518216818401528e8401518216838501528d51606080850191909152908e01516080840152928d015160a08301528c83015160c0830152918d015190911660e082015261010081018a6001811115612b6d57fe5b8152602001896001811115612b7e57fe5b8152602001886001811115612b8f57fe5b815260808d0151600160a060020a03166020820152604001876001811115612bb357fe5b8152602081018790526040810186905260a0808e0151600160a060020a0316606083015260808201869052018c600660209081029190910151600160a060020a031682526080808e01519183019190915260a0808e0151604084015260c08e0151606084015260e08e0151918301919091526101008d01519101529050612c398161432f565b9b9a5050505050505050505050565b61271081565b6000612c58614c06565b612c60614c06565b604080516102e08101909152808d600060209081029190910151600160a060020a03168252018d600160209081029190910151600160a060020a03168252018d600260209081029190910151600160a060020a03168252018c6000602090810291909101518252018c6001602090810291909101518252018c6002602090810291909101518252018c6003602090810291909101518252018d600360209081029190910151600160a060020a03168252018b6000602002015160ff166001811115612d2757fe5b6001811115612d3257fe5b81526020018b6001602002015160ff166001811115612d4d57fe5b6001811115612d5857fe5b81526020018b6002602002015160ff166001811115612d7357fe5b6001811115612d7e57fe5b815260808e0151600160a060020a0316602082015260608c015160409091019060ff166001811115612dac57fe5b6001811115612db757fe5b8152602081018b90526040810189905260a0808f0151600160a060020a0316606083015260808201889052018d600660209081029190910151600160a060020a03168252018c6004602090810291909101518252018c6005602090810291909101518252018c6006602090810291909101518252018c6007602090810291909101518252018c600860200201519052604080516102e08101909152909250808d600760209081029190910151600160a060020a03168252018d600860209081029190910151600160a060020a03168252018d600960209081029190910151600160a060020a03168252018c6009602090810291909101518252018c600a602090810291909101518252018c600b602090810291909101518252018c600c602090810291909101518252018d600a60209081029190910151600160a060020a03168252018b6004602002015160ff166001811115612f1057fe5b6001811115612f1b57fe5b81526020018b6005602002015160ff166001811115612f3657fe5b6001811115612f4157fe5b81526020018b6006602002015160ff166001811115612f5c57fe5b6001811115612f6757fe5b81526101608e0151600160a060020a0316602082015260e08c015160409091019060ff166001811115612f9657fe5b6001811115612fa157fe5b8152602081018a9052604081018890526101808e0151600160a060020a031660608201526080810186905260a0018d600d60209081029190910151600160a060020a031682526101a08e0151908201526101c08d015160408201526101e08d015160608201526102008d015160808201526102208d015160a090910152905061221282826143c3565b60056020526000908152604090205460ff1681565b60005433600160a060020a03908116610100909204161461305f57600080fd5b600160a060020a038116151561307457600080fd5b60008054604051600160a060020a038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6000808251111561312457815180602001830160208401855b6001838310141561311b578151815260209182019101613100565b50505092909201915b50815b92915050565b60008060008451865114151561314257600080fd5b835186511461315057600080fd5b855160209004925060208084029250839083041461316a57fe5b5060005b8281101561319a576001016020810284810151868201519188018051928216911990921617905261316e565b60008311156131ca57829050806001016020028085015181870151811682890151821916178289015250506132ac565b50805b85518110156132ac5784818151811015156131e457fe5b90602001015160f860020a900460f860020a02848281518110151561320557fe5b90602001015160f860020a900460f860020a0216868281518110151561322757fe5b90602001015160f860020a900460f860020a02858381518110151561324857fe5b90602001015160f860020a900460f860020a0260ff60f860020a02181617868281518110151561327457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016131cd565b505050505050565b600160a060020a03166c0100000000000000000000000002815260140190565b6000613302826101200151836101400151846102400151856102600151866102800151876102a001516134ae565b90505b919050565b8151815160009160019181148083146133265760009250613364565b600160208701838101602088015b60028483851001141561335f5780518351146133535760009650600093505b60209283019201613334565b505050505b5090949350505050565b600061337982613541565b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101929092525190819003603c0190209050919050565b60006133c48361432f565b15156133d257506000611787565b60008481526004602052604090205460ff16156133f157506000611787565b60008481526005602052604090205460ff161561341057506001611787565b602080840151835184830151604080870151815160008082528188018085528c905260ff909516818401526060810193909352608083015251600160a060020a039093169360019360a0808401949293601f19830193908390039091019190865af1158015613483573d6000803e3d6000fd5b50505060206040510351600160a060020a031614156134a457506001611787565b5060009392505050565b600080808760018111156134be57fe5b14156134cc57859150613536565b60018760018111156134da57fe5b1415613536576135056134f6866134f14288614453565b614465565b6135008587614453565b61448e565b9050600188600181111561351557fe5b141561352c576135258682614453565b9150613536565b61352586826144a3565b509695505050505050565b60008060606000613551856144b0565b9250826040519080825280601f01601f191660200182016040528015613581578160200160208202803883390190505b5091506020820190506135988186600001516132b4565b90506135a88186602001516132b4565b90506135b88186604001516132b4565b90506135c88186606001516144d0565b90506135d88186608001516144d0565b90506135e8818660a001516144d0565b90506135f8818660c001516144d0565b9050613608818660e001516132b4565b905061362481866101000151600181111561361f57fe5b6144d8565b905061363b81866101200151600181111561361f57fe5b905061365281866101400151600181111561361f57fe5b9050613663818661016001516132b4565b905061367a81866101800151600181111561361f57fe5b905061368b81866101a001516130e7565b905061369c81866101c001516130e7565b90506136ad81866101e001516132b4565b90506136be818661020001516130e7565b90506136cf818661022001516132b4565b90506136e0818661024001516144d0565b90506136f1818661026001516144d0565b9050613702818661028001516144d0565b905061371381866102a001516144d0565b905061372481866102c001516144d0565b50506020012092915050565b600080836101200151600181111561374457fe5b14801561376157506001826101200151600181111561375f57fe5b145b801561378c5750816101000151600181111561377957fe5b836101000151600181111561378a57fe5b145b80156137b35750816102200151600160a060020a0316836102200151600160a060020a0316145b80156137ed57506040820151600160a060020a031615806137ed57508260200151600160a060020a03168260400151600160a060020a0316145b801561382757506040830151600160a060020a0316158061382757508160200151600160a060020a03168360400151600160a060020a0316145b8015613882575060e0820151600160a060020a0316158015613855575060e0830151600160a060020a031615155b80613882575060e0820151600160a060020a031615801590613882575060e0830151600160a060020a0316155b80156138a95750816101600151600160a060020a0316836101600151600160a060020a0316145b80156138d4575081610180015160018111156138c157fe5b83610180015160018111156138d257fe5b145b80156138ef57506138ef836102800151846102a001516144e5565b80156117875750611787826102800151836102a001516144e5565b60008260200151600160a060020a031633600160a060020a031614151561393057600080fd5b6139398361336e565b60008181526005602052604090205490915060ff161561395857600080fd5b600160056000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055508260e00151600160a060020a03168360200151600160a060020a031682600019167f90c7f9f5b58c15f0f635bfb99f55d3d78fdbef3559e7d8abf5c81052a527662286600001518760400151886060015189608001518a60a001518b60c001518c61010001518d61012001518e61014001518f6101600151604051808b600160a060020a0316600160a060020a031681526020018a600160a060020a0316600160a060020a03168152602001898152602001888152602001878152602001868152602001856001811115613a5c57fe5b60ff168152602001846001811115613a7057fe5b60ff168152602001836001811115613a8457fe5b60ff168152600160a060020a039092166020830152506040805191829003019950975050505050505050a480600019167fe55393c778364e440d958b39ac1debd99dcfae3775a8a04d1e79124adf6a2d08846101800151856101a00151866101c00151876101e001518861020001518961022001518a61024001518b61026001518c61028001518d6102a001518e6102c001518e604051808d6001811115613b2857fe5b60ff16815260200180602001806020018c600160a060020a0316600160a060020a03168152602001806020018b600160a060020a0316600160a060020a031681526020018a81526020018981526020018881526020018781526020018681526020018515151515815260200184810384528f818151815260200191508051906020019080838360005b83811015613bc9578181015183820152602001613bb1565b50505050905090810190601f168015613bf65780820380516001836020036101000a031916815260200191505b5084810383528e818151815260200191508051906020019080838360005b83811015613c2c578181015183820152602001613c14565b50505050905090810190601f168015613c595780820380516001836020036101000a031916815260200191505b5084810382528c5181528c516020918201918e019080838360005b83811015613c8c578181015183820152602001613c74565b50505050905090810190601f168015613cb95780820380516001836020036101000a031916815260200191505b509f5050505050505050505050505050505060405180910390a2505050565b6000613ce48383614501565b90508260200151600160a060020a031633600160a060020a0316141515613d0a57600080fd5b600081815260046020526040808220805460ff191660011790555182917f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d91a2505050565b6000805481908190819081908190819060ff1615613d6c57600080fd5b6000805460ff1916600117905560208c0151600160a060020a0390811633919091161415613dad57613d9d8c61432f565b1515613da857600080fd5b613dba565b613db78c8c614501565b96505b33600160a060020a03168a60200151600160a060020a03161415613df157613de18a61432f565b1515613dec57600080fd5b613dfe565b613dfb8a8a614501565b95505b613e088c8b613730565b1515613e1357600080fd5b6101608a0151803b9550935060008511613e2c57600080fd5b60008c6101c00151511115613e5557613e558c6101a001518b6101a001518e6101c0015161312d565b60008a6101c00151511115613e7e57613e7e8a6101a001518d6101a001518c6101c0015161312d565b613e928c6101a001518b6101a0015161330a565b1515613e9d57600080fd5b6002546020808c0151604080517fc4552791000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201529051919093169263c45527919260248083019391928290030181600087803b158015613f0857600080fd5b505af1158015613f1c573d6000803e3d6000fd5b505050506040513d6020811015613f3257600080fd5b50519250600160a060020a0383161515613f4b57600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166397204d8e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613f9e57600080fd5b505af1158015613fb2573d6000803e3d6000fd5b505050506040513d6020811015613fc857600080fd5b5051604080517f5c60da1b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0392831692861691635c60da1b9160048083019260209291908290030181600087803b15801561402957600080fd5b505af115801561403d573d6000803e3d6000fd5b505050506040513d602081101561405357600080fd5b5051600160a060020a03161461406857600080fd5b8291508b60200151600160a060020a031633600160a060020a03161415156140a4576000878152600460205260409020805460ff191660011790555b8960200151600160a060020a031633600160a060020a03161415156140dd576000868152600460205260409020805460ff191660011790555b6140e78c8b614525565b905081600160a060020a0316631b0f7ba98b61016001518c61018001518d6101a001516040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600181111561414457fe5b60ff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561418557818101518382015260200161416d565b50505050905090810190601f1680156141b25780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156141d357600080fd5b505af11580156141e7573d6000803e3d6000fd5b505050506040513d60208110156141fd57600080fd5b5051151561420a57600080fd5b6101e08c0151600160a060020a031615614243576142388c6101e001518b6101a001518e61020001516116be565b151561424357600080fd5b6101e08a0151600160a060020a03161561427c576142718a6101e001518b6101a001518c61020001516116be565b151561427c57600080fd5b60e08a01518890600160a060020a0316151561429c578a602001516142a2565b8c602001515b60e08c0151600160a060020a03918216911615156142c4578d602001516142ca565b8b602001515b604080518b8152602081018b90528082018690529051600160a060020a0392909216917fc4109843e0b7d514e4c093114b863f8e7d8d9a458c372cd51bfe526b588006c99181900360600190a450506000805460ff1916905550505050505050505050565b600030600160a060020a03168260000151600160a060020a031614151561435857506000613305565b61436c826101400151836102a00151614b05565b151561437a57506000613305565b6001826101000151600181111561438d57fe5b1480156143ae57506006548260a0015110806143ae57506007548260c00151105b156143bb57506000613305565b506001919050565b60008060006143f4846101200151856101400151866102400151876102600151886102800151896102a001516134ae565b91506144228561012001518661014001518761024001518861026001518961028001518a6102a001516134ae565b90508181101561443157600080fd5b60e0840151600160a060020a0316151561444b5780611a5a565b509392505050565b60008282111561445f57fe5b50900390565b600082151561447657506000613127565b5081810281838281151561448657fe5b041461312757fe5b6000818381151561449b57fe5b049392505050565b8181018281101561312757fe5b610200810151516101c0820151516101a08301515101016101b001919050565b815260200190565b6000818353505060010190565b6000428310801561178757508115806117875750504210919050565b60008061450d8461336e565b905061451a8185856133b9565b151561178757600080fd5b600080600080600080600080600080600160a060020a03168a6102200151600160a060020a031614151561455e57341561455e57600080fd5b6145688b8b6143c3565b975060008811801561458757506102208a0151600160a060020a031615155b156145a5576145a58a61022001518c602001518c602001518b614b24565b60e08a0151889750879650600160a060020a0316156148c1576080808c0151908b015111156145d357600080fd5b60018a610100015160018111156145e657fe5b141561488e5760c0808c0151908b0151111561460157600080fd5b60008a6060015111156146a55761462761461f8b606001518a614465565b61271061448e565b6102208b0151909550600160a060020a0316151561468c576146498786614453565b60e08b0151604051919850600160a060020a03169086156108fc029087906000818181858888f19350505050158015614686573d6000803e3d6000fd5b506146a5565b6146a58a61022001518b602001518c60e0015188614b24565b60008a608001511115614741576146c361461f8b608001518a614465565b6102208b0151909450600160a060020a03161515614728576146e586856144a3565b60e08b0151604051919750600160a060020a03169085156108fc029086906000818181858888f19350505050158015614722573d6000803e3d6000fd5b50614741565b6147418a61022001518c602001518c60e0015187614b24565b60008a60a0015111156147e55761475f61461f8b60a001518a614465565b6102208b0151909350600160a060020a031615156147c2576147818784614453565b600854604051919850600160a060020a03169084156108fc029085906000818181858888f193505050501580156147bc573d6000803e3d6000fd5b506147e5565b6102208a015160208b01516008546147e5929190600160a060020a031686614b24565b60008a60c0015111156148895761480361461f8b60c001518a614465565b6102208b0151909250600160a060020a031615156148665761482586836144a3565b600854604051919750600160a060020a03169083156108fc029084906000818181858888f19350505050158015614860573d6000803e3d6000fd5b50614889565b6102208a015160208c0151600854614889929190600160a060020a031685614b24565b6148bc565b6148a58a602001518b60e001518c60600151614be9565b6148bc8b602001518b60e001518c60800151614be9565b614a42565b6080808b0151908c015111156148d657600080fd5b60018a610100015160018111156148e957fe5b1415614a14576102208a0151600160a060020a0316151561490957600080fd5b60c0808b0151908c0151111561491e57600080fd5b60008b6060015111156149575761493c61461f8c606001518a614465565b94506149578a61022001518c602001518d60e0015188614b24565b60008b6080015111156149905761497561461f8c608001518a614465565b93506149908a61022001518b602001518d60e0015187614b24565b60008b60a0015111156149d2576149ae61461f8c60a001518a614465565b6102208b015160208d01516008549295506149d292600160a060020a031686614b24565b60008b60c0015111156148bc576149f061461f8c60c001518a614465565b6102208b015160208c01516008549294506148bc92600160a060020a031685614b24565b614a2b8b602001518c60e001518d60600151614be9565b614a428a602001518c60e001518d60800151614be9565b6102208a0151600160a060020a03161515614af65734861115614a6457600080fd5b8960200151600160a060020a03166108fc889081150290604051600060405180830381858888f19350505050158015614aa1573d6000803e3d6000fd5b50614aac3487614453565b90506000811115614af6578a60200151600160a060020a03166108fc829081150290604051600060405180830381858888f19350505050158015614af4573d6000803e3d6000fd5b505b50959998505050505050505050565b600080836001811115614b1457fe5b1480611787575050600010919050565b6000811115614be357600354604080517f15dacbea000000000000000000000000000000000000000000000000000000008152600160a060020a0387811660048301528681166024830152858116604483015260648201859052915191909216916315dacbea9160848083019260209291908290030181600087803b158015614bac57600080fd5b505af1158015614bc0573d6000803e3d6000fd5b505050506040513d6020811015614bd657600080fd5b50511515614be357600080fd5b50505050565b600154614c0190600160a060020a0316848484614b24565b505050565b604080516102e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290529061010082019081526020016000815260200160008152600060208201819052604090910190815260200160608152602001606081526020016000600160a060020a03168152602001606081526020016000600160a060020a03168152602001600081526020016000815260200160008152602001600081526020016000815250905600a165627a7a72305820c55d9f4fec75a517a5c565e98d7edb55708cb4e8ffd95df42d9d014ce32a79fc0029000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1000000000000000000000000e5c783ee536cf5e63e792988335c4255169be4e1000000000000000000000000056017c55ae7ae32d12aef7c679df83a85ca75ff000000000000000000000000a839d4b5a36265795eba6894651a8af3d0ae2e68

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

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1
Arg [1] : 000000000000000000000000e5c783ee536cf5e63e792988335c4255169be4e1
Arg [2] : 000000000000000000000000056017c55ae7ae32d12aef7c679df83a85ca75ff
Arg [3] : 000000000000000000000000a839d4b5a36265795eba6894651a8af3d0ae2e68


   Swarm Source:
bzzr://c55d9f4fec75a517a5c565e98d7edb55708cb4e8ffd95df42d9d014ce32a79fc

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.