ETH Price: $3,130.31 (-0.20%)

Contract

0xb5aA1fB7027290d6D5cbBE3b1AEcd5317Fa582eC
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Cancel Order_57674862018-06-11 0:48:022352 days ago1528678082IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000096262
Cancel Order_57674842018-06-11 0:47:422352 days ago1528678062IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000148592
Atomic Match_57231872018-06-03 4:10:012360 days ago1527999001IN
0xb5aA1fB7...17Fa582eC
0 ETH0.002581517.5
Atomic Match_57226222018-06-03 1:45:482360 days ago1527990348IN
0xb5aA1fB7...17Fa582eC
0 ETH0.004130427
Approve Order_57225902018-06-03 1:36:482360 days ago1527989808IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000613247
Approve Order_57225872018-06-03 1:36:292360 days ago1527989789IN
0xb5aA1fB7...17Fa582eC
0 ETH0.00062227
Approve Order_57225692018-06-03 1:31:222360 days ago1527989482IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000627137
Approve Order_57225412018-06-03 1:24:182360 days ago1527989058IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000635647
Atomic Match_57225132018-06-03 1:17:452360 days ago1527988665IN
0xb5aA1fB7...17Fa582eC
0 ETH0.00357
Approve Order_57225092018-06-03 1:16:492360 days ago1527988609IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000636097
Approve Order_57224682018-06-03 1:06:342360 days ago1527987994IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000637447
Approve Order_57223292018-06-03 0:29:272360 days ago1527985767IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000637447
Approve Order_57223182018-06-03 0:26:032360 days ago1527985563IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000636097
Approve Order_57223122018-06-03 0:24:482360 days ago1527985488IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0010187111
Atomic Match_57223002018-06-03 0:21:482360 days ago1527985308IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0147
Atomic Match_57222932018-06-03 0:20:392360 days ago1527985239IN
0xb5aA1fB7...17Fa582eC
0 ETH0.01111
Atomic Match_57222862018-06-03 0:19:182360 days ago1527985158IN
0xb5aA1fB7...17Fa582eC
0 ETH0.00488
Atomic Match_57222822018-06-03 0:18:052360 days ago1527985085IN
0xb5aA1fB7...17Fa582eC
0 ETH0.003311
Atomic Match_57222752018-06-03 0:16:482360 days ago1527985008IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0007739611
Approve Order_57222602018-06-03 0:10:322360 days ago1527984632IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0011221111
Atomic Match_57109652018-06-01 0:00:292362 days ago1527811229IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0062023915
Atomic Match_56936692018-05-28 22:18:452365 days ago1527545925IN
0xb5aA1fB7...17Fa582eC
0 ETH0.003138837
Atomic Match_56922142018-05-28 16:14:042365 days ago1527524044IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0072445517
Atomic Match_56578062018-05-22 13:50:282371 days ago1526997028IN
0xb5aA1fB7...17Fa582eC
0 ETH0.0039519211
Cancel Order_56165882018-05-15 7:10:172379 days ago1526368217IN
0xb5aA1fB7...17Fa582eC
0 ETH0.000520547
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WyvernExchange

Compiler Version
v0.4.18+commit.9cf6e910

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

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

pragma solidity ^0.4.13;

library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

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

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;


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


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


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


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

}

contract ERC20Basic {
  uint256 public totalSupply;
  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 "bytemask"
     * 
     * @dev Mask must be 1/8th the size of the byte array. A 1-bit means the byte array can be changed.
     * @param array The original array
     * @param desired The target array
     * @param mask The mask specifying which bytes 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)
        pure
        internal
    {
        byte[8] memory bitmasks = [byte(2 ** 7), byte(2 ** 6), byte(2 ** 5), byte(2 ** 4), byte(2 ** 3), byte(2 ** 2), byte(2 ** 1), byte(2 ** 0)];
        require(array.length == desired.length);
        require(mask.length >= array.length / 8);
        bool masked;
        for (uint i = 0; i < array.length; i++ ) {
            /* 1-bit means value can be changed. */
            masked = (mask[i / 8] & bitmasks[i % 8]) == 0;
            if (!masked) {
                array[i] = desired[i];
            }
        }
    }

    /**
     * Test if two arrays are equal
     * 
     * @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)
        pure
        internal
        returns (bool)
    {
        if (a.length != b.length) {
            return false;
        }
        for (uint i = 0; i < a.length; i++) {
            if (a[i] != b[i]) {
                return false;
            }
        }
        return true;
    }

}

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));
        ReceivedTokens(from, value, token, extraData);
    }

    /**
     * @dev Receive Ether and generate a log event
     */
    function () payable public {
        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. */
        ERC20 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, ERC20 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(SafeMath.add(calldata.length, extradata.length));
        for (uint i = 0; i < extradata.length; i++) {
            combined[i] = extradata[i];
        }
        for (uint j = 0; j < calldata.length; j++) {
            combined[j + extradata.length] = calldata[j];
        }
        assembly {
            result := staticcall(gas, target, add(combined, 0x20), mload(combined), mload(0x40), 0)
        }
        return result;
    }

    /**
     * @dev Keccak256 order hash, part one
     * @param order Order to hash
     * @return Part one of the order hash 
     */
    function hashOrderPartOne(Order memory order)
        internal
        pure
        returns (bytes32)
    {
        return keccak256(order.exchange, order.maker, order.taker, order.makerRelayerFee, order.takerRelayerFee, order.makerProtocolFee, order.takerProtocolFee, order.feeRecipient, order.feeMethod, order.side, order.saleKind, order.target, order.howToCall);
    }

    /**
     * @dev Keccak256 order hash, part two
     * @param order Order to hash
     * @return Part two of the order hash
     */
    function hashOrderPartTwo(Order memory order)
        internal
        pure
        returns (bytes32)
    {
        return keccak256(order.calldata, order.replacementPattern, order.staticTarget, order.staticExtradata, order.paymentToken, order.basePrice, order.extra, order.listingTime, order.expirationTime, order.salt);
    }

    /**
     * @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, order hash part one, and order hash part two concatenated
     */
    function hashToSign(Order memory order)
        internal
        pure
        returns (bytes32)
    {
        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
        bytes32 hash = keccak256(prefix, hashOrderPartOne(order), hashOrderPartTwo(order));
        return hash;
    }

    /**
     * @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. */
        {
            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);
        }
        {   
            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. */
        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 proxy (the registry contract is trusted). */
        AuthenticatedProxy proxy = registry.proxies(sell.maker);

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

        /* 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. */
        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;
    }

    /**
     * @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 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";

    string public constant codename = "Bakunawa";

    /**
     * @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
     */
    function WyvernExchange (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 AuthenticatedProxy is TokenRecipient {

    /* 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);

    /**
     * Create 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 AuthenticatedProxy(address addrUser, ProxyRegistry addrRegistry) public {
        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;
        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 ProxyRegistry is Ownable {

    /* Authenticated proxies by user. */
    mapping(address => AuthenticatedProxy) 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 (AuthenticatedProxy proxy)
    {
        require(proxies[msg.sender] == address(0));
        proxy = new AuthenticatedProxy(msg.sender, 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 Security Audit

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":"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":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":"","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"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

60606040526000805460ff191681556006819055600755341561002157600080fd5b604051608080614905833981016040528080519190602001805191906020018051919060200180516000805460028054600160a060020a03998a16600160a060020a03199182161790915560038054988a16988216989098179097556001805496891696881696909617909555600880549288169290961691909117909455505033929092166101000261010060a860020a031992831681179092169091179055614834806100d16000396000f3006060604052600436106101665763ffffffff60e060020a60003504166306fdde03811461016b5780630eefdbad146101f557806310796a471461022457806314350c24146102d95780631a6b13e2146102f1578063239e83df1461030757806328a8ee68146103dc57806331e63199146104015780633f67ee0d14610414578063514f03301461056157806354fd4d5014610580578063562b2ebc1461059357806360bef33a146106aa57806363d36c0b1461080757806364df049e1461083257806371d02b381461084557806372593b4c146109925780637966686814610baa5780637b10399914610cfb5780637ccefc5214610d0e5780638076f00514610d215780638da5cb5b14610d37578063a25eb5d914610d4a578063a8a41c7014610d5d578063ab834bab14610eba578063ca595b9a1461111b578063cae6047f14611268578063d537e1311461127b578063e57d4adb14611493578063f2fde38b146114a9575b600080fd5b341561017657600080fd5b61017e6114c8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ba5780820151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020057600080fd5b6102086114ff565b604051600160a060020a03909116815260200160405180910390f35b341561022f57600080fd5b6102c560048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061150e95505050505050565b604051901515815260200160405180910390f35b34156102e457600080fd5b6102ef600435611619565b005b34156102fc57600080fd5b6102ef60043561163e565b341561031257600080fd5b61017e60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061166395505050505050565b34156103e757600080fd5b6103ef611680565b60405190815260200160405180910390f35b341561040c57600080fd5b61017e611686565b341561041f57600080fd5b6103ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506116bd95505050505050565b341561056c57600080fd5b6102ef600160a060020a0360043516611818565b341561058b57600080fd5b61017e611867565b341561059e57600080fd5b6102c560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061189e95505050505050565b34156106b557600080fd5b6102c5600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505060ff85351694602081013594506040013592506118dc915050565b341561081257600080fd5b6103ef60ff6004358116906024351660443560643560843560a435611a7d565b341561083d57600080fd5b610208611a98565b341561085057600080fd5b6103ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611aa795505050505050565b341561099d57600080fd5b6102c560046101c481600e6101c0604051908101604052919082826101c0808284378201915050505050919080610240019060128060200260405190810160405291908282610240808284378201915050505050919080610100019060088060200260405190810160405291908282610100808284375093959460208082019550903586018082019450359250829150601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611bf495505050505050565b3415610bb557600080fd5b6102ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505050913515159150611f489050565b3415610d0657600080fd5b6102086120ac565b3415610d1957600080fd5b6103ef6120bb565b3415610d2c57600080fd5b6102c56004356120c1565b3415610d4257600080fd5b6102086120d6565b3415610d5557600080fd5b6102086120ea565b3415610d6857600080fd5b6102ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505060ff85351694602081013594506040013592506120f9915050565b6102ef60046101c481600e6101c0604051908101604052919082826101c0808284378201915050505050919080610240019060128060200260405190810160405291908282610240808284378201915050505050919080610100019060088060200260405190810160405291908282610100808284375093959460208082019550903586018082019450359250829150601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437820191505050505050919080604001906002806020026040519081016040528092919082600260200280828437820191505050505091908060a001906005806020026040519081016040529190828260a08082843750939550612271945050505050565b341561112657600080fd5b6102c5600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061260295505050505050565b341561127357600080fd5b6103ef612769565b341561128657600080fd5b6103ef60046101c481600e6101c0604051908101604052919082826101c0808284378201915050505050919080610240019060128060200260405190810160405291908282610240808284378201915050505050919080610100019060088060200260405190810160405291908282610100808284375093959460208082019550903586018082019450359250829150601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061276f95505050505050565b341561149e57600080fd5b6102c5600435612ab3565b34156114b457600080fd5b6102ef600160a060020a0360043516612ac8565b60408051908101604052601781527f50726f6a6563742057797665726e2045786368616e6765000000000000000000602082015281565b600354600160a060020a031681565b60006115186146fd565b60008061152786518651612b73565b6040518059106115345750595b818152601f19601f830116810160200160405290509250600091505b84518210156115a65784828151811061156557fe5b016020015160f860020a900460f860020a0283838151811061158357fe5b906020010190600160f860020a031916908160001a905350600190910190611550565b5060005b8551811015611600578581815181106115bf57fe5b016020015160f860020a900460f860020a028386518301815181106115e057fe5b906020010190600160f860020a031916908160001a9053506001016115aa565b60006040518451602086018a5afa979650505050505050565b60005433600160a060020a03908116610100909204161461163957600080fd5b600655565b60005433600160a060020a03908116610100909204161461165e57600080fd5b600755565b61166b6146fd565b611676848484612b8d565b50825b9392505050565b60075481565b60408051908101604052600881527f42616b756e617761000000000000000000000000000000000000000000000000602082015281565b600061180a6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a600181111561174f57fe5b815260200189600181111561176057fe5b815260200188600181111561177157fe5b815260200160808d0151600160a060020a0316815260200187600181111561179557fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052612d93565b9a9950505050505050505050565b60005433600160a060020a03908116610100909204161461183857600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600181527f3200000000000000000000000000000000000000000000000000000000000000602082015281565b600080845111156118b4576118b4858486612b8d565b6000825111156118c9576118c9838684612b8d565b6118d38584612dc9565b95945050505050565b60006118e661470f565b6102e0604051908101604052808f51600160a060020a031681526020018f60016020020151600160a060020a031681526020018f60026020020151600160a060020a031681526020018e5181526020018e60016020020151815260200160408f0151815260200160608f015181526020018f60036020020151600160a060020a031681526020018d600181111561197957fe5b81526020018c600181111561198a57fe5b81526020018b600181111561199b57fe5b81526020018f60046020020151600160a060020a031681526020018a60018111156119c257fe5b8152602081018a9052604081018990526060018f60056020020151600160a060020a03168152602081018890526040018f60066020020151600160a060020a0316815260200160808f0151815260200160a08f0151815260200160c08f0151815260200160e08f015181526020016101008f015190529050611a6b611a4682612e5d565b826060604051908101604090815260ff8a168252602082018990528101879052612f20565b9e9d5050505050505050505050505050565b6000611a8d87878787878761301d565b979650505050505050565b600854600160a060020a031681565b600061180a6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a6001811115611b3957fe5b8152602001896001811115611b4a57fe5b8152602001886001811115611b5b57fe5b815260200160808d0151600160a060020a03168152602001876001811115611b7f57fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052612e5d565b6000611bfe61470f565b611c0661470f565b6102e0604051908101604052808d51600160a060020a031681526020018d60016020020151600160a060020a0316815260200160408e0151600160a060020a031681526020018c5181526020018c60016020020151815260200160408d0151815260200160608d0151815260200160608e0151600160a060020a031681526020018b5160ff166001811115611c9757fe5b6001811115611ca257fe5b81526020018b6001602002015160ff166001811115611cbd57fe5b6001811115611cc857fe5b815260200160408c015160ff166001811115611ce057fe5b6001811115611ceb57fe5b815260200160808e0151600160a060020a0316815260200160608c015160ff166001811115611d1657fe5b6001811115611d2157fe5b8152602081018b90526040810189905260600160a08e0151600160a060020a031681526020810187905260400160c08e0151600160a060020a0316815260200160808d0151815260200160a08d0151815260200160c08d0151815260200160e08d015181526020016101008d0151905291506102e06040519081016040528060e08e0151600160a060020a031681526020016101008e0151600160a060020a031681526020016101208e0151600160a060020a031681526020016101208d015181526020016101408d015181526020016101608d015181526020016101808d015181526020016101408e0151600160a060020a0316815260200160808c015160ff166001811115611e2e57fe5b6001811115611e3957fe5b815260200160a08c015160ff166001811115611e5157fe5b6001811115611e5c57fe5b815260200160c08c015160ff166001811115611e7457fe5b6001811115611e7f57fe5b81526020016101608e0151600160a060020a0316815260200160e08c015160ff166001811115611eab57fe5b6001811115611eb657fe5b8152602081018a9052604081018890526060016101808e0151600160a060020a03168152602081018690526040016101a08e0151600160a060020a031681526020016101a08d015181526020016101c08d015181526020016101e08d015181526020016102008d015181526020016102208d015190529050611f3882826130b0565b9c9b505050505050505050505050565b611f5061470f565b6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a6001811115611fdd57fe5b8152602001896001811115611fee57fe5b8152602001886001811115611fff57fe5b815260200160808d0151600160a060020a0316815260200187600181111561202357fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052905061209f8183613296565b5050505050505050505050565b600254600160a060020a031681565b60065481565b60046020526000908152604090205460ff1681565b6000546101009004600160a060020a031681565b600154600160a060020a031681565b6122636102e0604051908101604052808e51600160a060020a031681526020018e60016020020151600160a060020a0316815260200160408f0151600160a060020a031681526020018d5181526020018d60016020020151815260200160408e0151815260200160608e0151815260200160608f0151600160a060020a031681526020018c600181111561218957fe5b81526020018b600181111561219a57fe5b81526020018a60018111156121ab57fe5b815260200160808f0151600160a060020a031681526020018960018111156121cf57fe5b8152602081018990526040810188905260600160a08f0151600160a060020a031681526020810187905260400160c08f0151600160a060020a0316815260200160808e0151815260200160a08e0151815260200160c08e0151815260200160e08e015181526020016101008e015190526060604051908101604090815260ff8716825260208201869052810184905261364a565b505050505050505050505050565b61209f6102e0604051908101604052808d51600160a060020a031681526020018d60016020020151600160a060020a0316815260200160408e0151600160a060020a031681526020018c5181526020018c60016020020151815260200160408d0151815260200160608d0151815260200160608e0151600160a060020a031681526020018b5160ff16600181111561230557fe5b600181111561231057fe5b81526020018b6001602002015160ff16600181111561232b57fe5b600181111561233657fe5b815260200160408c015160ff16600181111561234e57fe5b600181111561235957fe5b815260200160808e0151600160a060020a0316815260200160608c015160ff16600181111561238457fe5b600181111561238f57fe5b8152602081018b90526040810189905260600160a08e0151600160a060020a031681526020810187905260400160c08e0151600160a060020a0316815260200160808d0151815260200160a08d0151815260200160c08d0151815260200160e08d015181526020016101008d01519052606060405190810160405280855160ff16815260200184518152602001846001602002015190526102e0604051908101604052808f60076020020151600160a060020a031681526020018f60086020020151600160a060020a031681526020018f60096020020151600160a060020a031681526020016101208f015181526020016101408f015181526020016101608f015181526020016101808f015181526020018f600a6020020151600160a060020a0316815260200160808e015160ff1660018111156124ca57fe5b60018111156124d557fe5b815260200160a08e015160ff1660018111156124ed57fe5b60018111156124f857fe5b815260200160c08e015160ff16600181111561251057fe5b600181111561251b57fe5b81526020018f600b6020020151600160a060020a0316815260200160e08e015160ff16600181111561254957fe5b600181111561255457fe5b8152602081018c9052604081018a90526060018f600c6020020151600160a060020a03168152602081018890526040018f600d6020020151600160a060020a031681526020016101a08f015181526020016101c08f015181526020016101e08f015181526020016102008f015181526020016102208f01519052606060405190810160405280602088015160ff168152602001604087015181526020016060870151905260808601516136c9565b600061260c61470f565b6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a600181111561269957fe5b81526020018960018111156126aa57fe5b81526020018860018111156126bb57fe5b815260200160808d0151600160a060020a031681526020018760018111156126df57fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052905061275a81613b6f565b9b9a5050505050505050505050565b61271081565b600061277961470f565b61278161470f565b6102e0604051908101604052808d51600160a060020a031681526020018d60016020020151600160a060020a0316815260200160408e0151600160a060020a031681526020018c5181526020018c60016020020151815260200160408d0151815260200160608d0151815260200160608e0151600160a060020a031681526020018b5160ff16600181111561281257fe5b600181111561281d57fe5b81526020018b6001602002015160ff16600181111561283857fe5b600181111561284357fe5b815260200160408c015160ff16600181111561285b57fe5b600181111561286657fe5b815260200160808e0151600160a060020a0316815260200160608c015160ff16600181111561289157fe5b600181111561289c57fe5b8152602081018b90526040810189905260600160a08e0151600160a060020a031681526020810187905260400160c08e0151600160a060020a0316815260200160808d0151815260200160a08d0151815260200160c08d0151815260200160e08d015181526020016101008d0151905291506102e06040519081016040528060e08e0151600160a060020a031681526020016101008e0151600160a060020a031681526020016101208e0151600160a060020a031681526020016101208d015181526020016101408d015181526020016101608d015181526020016101808d015181526020016101408e0151600160a060020a0316815260200160808c015160ff1660018111156129a957fe5b60018111156129b457fe5b815260200160a08c015160ff1660018111156129cc57fe5b60018111156129d757fe5b815260200160c08c015160ff1660018111156129ef57fe5b60018111156129fa57fe5b81526020016101608e0151600160a060020a0316815260200160e08c015160ff166001811115612a2657fe5b6001811115612a3157fe5b8152602081018a9052604081018890526060016101808e0151600160a060020a03168152602081018690526040016101a08e0151600160a060020a031681526020016101a08d015181526020016101c08d015181526020016101e08d015181526020016102008d015181526020016102208d015190529050611f388282613bfe565b60056020526000908152604090205460ff1681565b60005433600160a060020a039081166101009092041614612ae857600080fd5b600160a060020a0381161515612afd57600080fd5b600054600160a060020a03808316916101009004167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600082820183811015612b8257fe5b8091505b5092915050565b612b956147df565b60008061010060405190810160409081527f800000000000000000000000000000000000000000000000000000000000000082527f400000000000000000000000000000000000000000000000000000000000000060208301527f2000000000000000000000000000000000000000000000000000000000000000908201527f100000000000000000000000000000000000000000000000000000000000000060608201527f080000000000000000000000000000000000000000000000000000000000000060808201527f040000000000000000000000000000000000000000000000000000000000000060a08201527f020000000000000000000000000000000000000000000000000000000000000060c082015260f860020a60e082015292508451865114612cc657600080fd5b60088651811515612cd357fe5b0484511015612ce157600080fd5b5060005b8551811015612d8b57826008820660088110612cfd57fe5b6020020151846008830481518110612d1157fe5b016020015160f860020a900460f860020a0216600160f860020a031916600060f860020a02149150811515612d8357848181518110612d4c57fe5b016020015160f860020a900460f860020a02868281518110612d6a57fe5b906020010190600160f860020a031916908160001a9053505b600101612ce5565b505050505050565b6000612dc1826101200151836101400151846102400151856102600151866102800151876102a0015161301d565b90505b919050565b6000808251845114612dde5760009150612b86565b5060005b8351811015612e5357828181518110612df757fe5b016020015160f860020a900460f860020a02600160f860020a031916848281518110612e1f57fe5b016020015160f860020a900460f860020a02600160f860020a031916141515612e4b5760009150612b86565b600101612de2565b5060019392505050565b6000612e676146fd565b600060408051908101604052601c81527f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152915081612ea985613c90565b612eb286613e3a565b6040518084805190602001908083835b60208310612ee15780518252601f199092019160209182019101612ec2565b6001836020036101000a038019825116818451161790925250505091909101938452505060208201526040908101915051908190039020949350505050565b6000612f2b83613b6f565b1515612f3957506000611679565b60008481526004602052604090205460ff1615612f5857506000611679565b60008481526005602052604090205460ff1615612f7757506001611679565b8260200151600160a060020a03166001858451856020015186604001516040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f11515612ff357600080fd5b505060206040510351600160a060020a0316141561301357506001611679565b5060009392505050565b6000808087600181111561302d57fe5b141561303b578591506130a5565b600187600181111561304957fe5b14156130a557613074613065866130604288613fdd565b613fef565b61306f8587613fdd565b61401a565b9050600188600181111561308457fe5b141561309b576130948682613fdd565b91506130a5565b6130948682612b73565b509695505050505050565b60008083610120015160018111156130c457fe5b1480156130e15750600182610120015160018111156130df57fe5b145b801561310c575081610100015160018111156130f957fe5b836101000151600181111561310a57fe5b145b80156131335750816102200151600160a060020a0316836102200151600160a060020a0316145b801561316f575060006040830151600160a060020a0316148061316f57508260200151600160a060020a03168260400151600160a060020a0316145b80156131ab575060006040840151600160a060020a031614806131ab57508160200151600160a060020a03168360400151600160a060020a0316145b801561320e5750600060e0830151600160a060020a03161480156131dd5750600060e0840151600160a060020a031614155b8061320e5750600060e0830151600160a060020a03161415801561320e5750600060e0840151600160a060020a0316145b80156132355750816101600151600160a060020a0316836101600151600160a060020a0316145b80156132605750816101800151600181111561324d57fe5b836101800151600181111561325e57fe5b145b801561327b575061327b836102800151846102a00151614031565b80156116795750611679826102800151836102a00151614031565b60008260200151600160a060020a031633600160a060020a03161415156132bc57600080fd5b6132c583612e5d565b60008181526005602052604090205490915060ff16156132e457600080fd5b6000818152600560205260409020805460ff1916600117905560e0830151600160a060020a03168360200151600160a060020a0316827f90c7f9f5b58c15f0f635bfb99f55d3d78fdbef3559e7d8abf5c81052a527662286518760400151886060015189608001518a60a001518b60c001518c61010001518d61012001518e61014001518f6101600151604051808b600160a060020a0316600160a060020a031681526020018a600160a060020a0316600160a060020a031681526020018981526020018881526020018781526020018681526020018560018111156133c657fe5b60ff1681526020018460018111156133da57fe5b60ff1681526020018360018111156133ee57fe5b60ff16815260200182600160a060020a0316600160a060020a031681526020019a505050505050505050505060405180910390a4807fe55393c778364e440d958b39ac1debd99dcfae3775a8a04d1e79124adf6a2d08610180850151856101a00151866101c00151876101e001518861020001518961022001518a61024001518b61026001518c61028001518d6102a001518e6102c001518e604051808d600181111561349757fe5b60ff16815260200180602001806020018c600160a060020a0316600160a060020a03168152602001806020018b600160a060020a0316600160a060020a031681526020018a81526020018981526020018881526020018781526020018681526020018515151515815260200184810384528f818151815260200191508051906020019080838360005b83811015613538578082015183820152602001613520565b50505050905090810190601f1680156135655780820380516001836020036101000a031916815260200191505b5084810383528e818151815260200191508051906020019080838360005b8381101561359b578082015183820152602001613583565b50505050905090810190601f1680156135c85780820380516001836020036101000a031916815260200191505b5084810382528c818151815260200191508051906020019080838360005b838110156135fe5780820151838201526020016135e6565b50505050905090810190601f16801561362b5780820380516001836020036101000a031916815260200191505b509f5050505050505050505050505050505060405180910390a2505050565b6000613656838361404d565b90508260200151600160a060020a031633600160a060020a031614151561367c57600080fd5b60008181526004602052604090819020805460ff1916600117905581907f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d905160405180910390a2505050565b600080548190819081908190819060ff16156136e457600080fd5b6000805460ff19166001179055600160a060020a03331660208c0151600160a060020a03161415613728576137188b613b6f565b151561372357600080fd5b613735565b6137328b8b61404d565b95505b33600160a060020a03168960200151600160a060020a0316141561376c5761375c89613b6f565b151561376757600080fd5b613779565b613776898961404d565b94505b6137838b8a6130b0565b151561378e57600080fd5b886101600151803b94509250600084116137a757600080fd5b60008b6101c001515111156137d0576137d08b6101a001518a6101a001518d6101c00151612b8d565b6000896101c001515111156137f9576137f9896101a001518c6101a001518b6101c00151612b8d565b61380d8b6101a001518a6101a00151612dc9565b151561381857600080fd5b600254600160a060020a031663c455279160208b015160006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561387557600080fd5b6102c65a03f1151561388657600080fd5b5050506040518051925050600160a060020a03821615156138a657600080fd5b8a60200151600160a060020a031633600160a060020a03161415156138df576000868152600460205260409020805460ff191660011790555b8860200151600160a060020a031633600160a060020a0316141515613918576000858152600460205260409020805460ff191660011790555b6139228b8a614071565b905081600160a060020a0316631b0f7ba98a61016001518b61018001518c6101a001516000604051602001526040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600181111561398857fe5b60ff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156139c95780820151838201526020016139b1565b50505050905090810190601f1680156139f65780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1515613a1657600080fd5b6102c65a03f11515613a2757600080fd5b505050604051805190501515613a3c57600080fd5b60006101e08c0151600160a060020a031614613a7757613a6c8b6101e001518a6101a001518d610200015161150e565b1515613a7757600080fd5b60006101e08a0151600160a060020a031614613ab257613aa7896101e001518a6101a001518b610200015161150e565b1515613ab257600080fd5b86600060e08b0151600160a060020a03161415613ad3578960200151613ad9565b8b602001515b600160a060020a0316600060e08c0151600160a060020a03161415613b02578c60200151613b08565b8a602001515b600160a060020a03167fc4109843e0b7d514e4c093114b863f8e7d8d9a458c372cd51bfe526b588006c989898660405192835260208301919091526040808301919091526060909101905180910390a450506000805460ff19169055505050505050505050565b6000600160a060020a0330168251600160a060020a031614613b9357506000612dc4565b613ba7826101400151836102a00151614618565b1515613bb557506000612dc4565b60018261010001516001811115613bc857fe5b148015613be957506006548260a001511080613be957506007548260c00151105b15613bf657506000612dc4565b506001919050565b6000806000613c2f846101200151856101400151866102400151876102600151886102800151896102a0015161301d565b9150613c5d8561012001518661014001518761024001518861026001518961028001518a6102a0015161301d565b905081811015613c6c57600080fd5b600060e0850151600160a060020a03161415613c8857806118d3565b509392505050565b6000815182602001518360400151846060015185608001518660a001518760c001518860e001518961010001518a61012001518b61014001518c61016001518d6101800151604051808e600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018d600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018c600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018b81526020018a815260200189815260200188815260200187600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401866001811115613d9957fe5b60ff1660f860020a028152600101856001811115613db357fe5b60ff1660f860020a028152600101846001811115613dcd57fe5b60ff1660f860020a02815260010183600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401826001811115613e0e57fe5b60ff1660f860020a0281526001019d505050505050505050505050505060405180910390209050919050565b6000816101a00151826101c00151836101e00151846102000151856102200151866102400151876102600151886102800151896102a001518a6102c00151604051808b805190602001908083835b60208310613ea75780518252601f199092019160209182019101613e88565b6001836020036101000a03801982511681845116179092525050509190910190508a805190602001908083835b60208310613ef35780518252601f199092019160209182019101613ed4565b6001836020036101000a03801982511681845116179092525050506c01000000000000000000000000600160a060020a038d160292019182525060140188805190602001908083835b60208310613f5b5780518252601f199092019160209182019101613f3c565b6001836020036101000a03801982511681845116808217855250505050505090500187600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018681526020018581526020018481526020018381526020018281526020019a505050505050505050505060405180910390209050919050565b600082821115613fe957fe5b50900390565b6000808315156140025760009150612b86565b5082820282848281151561401257fe5b0414612b8257fe5b600080828481151561402857fe5b04949350505050565b6000428310801561167957508115806116795750504210919050565b60008061405984612e5d565b9050614066818585612f20565b1515612b8257600080fd5b60008080808080808080806102208b0151600160a060020a03161461409b57341561409b57600080fd5b6140a58b8b613bfe565b97506000881180156140c6575060006102208b0151600160a060020a031614155b156140e4576140e48a61022001518c602001518c602001518b614638565b879650869550600060e08b0151600160a060020a0316146143e6578a608001518a60800151111561411457600080fd5b60018a6101000151600181111561412757fe5b14156143b3578a60c001518a60c00151111561414257600080fd5b60008a6060015111156141e0576141686141608b606001518a613fef565b61271061401a565b945060006102208b0151600160a060020a031614156141c75761418b8786613fdd565b96508960e00151600160a060020a031685156108fc0286604051600060405180830381858888f1935050505015156141c257600080fd5b6141e0565b6141e08a61022001518b602001518c60e0015188614638565b60008a608001511115614276576141fe6141608b608001518a613fef565b935060006102208b0151600160a060020a0316141561425d576142218685612b73565b95508960e00151600160a060020a031684156108fc0285604051600060405180830381858888f19350505050151561425857600080fd5b614276565b6142768a61022001518c602001518c60e0015187614638565b60008a60a001511115614312576142946141608b60a001518a613fef565b925060006102208b0151600160a060020a031614156142f2576142b78784613fdd565b600854909750600160a060020a031683156108fc0284604051600060405180830381858888f1935050505015156142ed57600080fd5b614312565b6143128a61022001518b60200151600854600160a060020a031686614638565b60008a60c0015111156143ae576143306141608b60c001518a613fef565b915060006102208b0151600160a060020a0316141561438e576143538683612b73565b600854909650600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561438957600080fd5b6143ae565b6143ae8a61022001518c60200151600854600160a060020a031685614638565b6143e1565b6143ca8a602001518b60e001518c606001516146e0565b6143e18b602001518b60e001518c608001516146e0565b614565565b89608001518b6080015111156143fb57600080fd5b60018a6101000151600181111561440e57fe5b14156145375760006102208b0151600160a060020a0316141561443057600080fd5b8960c001518b60c00151111561444557600080fd5b60008b60600151111561447e576144636141608c606001518a613fef565b945061447e8a61022001518c602001518d60e0015188614638565b60008b6080015111156144b75761449c6141608c608001518a613fef565b93506144b78a61022001518b602001518d60e0015187614638565b60008b60a0015111156144f7576144d56141608c60a001518a613fef565b92506144f78a61022001518c60200151600854600160a060020a031686614638565b60008b60c0015111156143e1576145156141608c60c001518a613fef565b91506143e18a61022001518b60200151600854600160a060020a031685614638565b61454e8b602001518c60e001518d606001516146e0565b6145658a602001518c60e001518d608001516146e0565b60006102208b0151600160a060020a0316141561460957348690101561458a57600080fd5b8960200151600160a060020a031687156108fc0288604051600060405180830381858888f1935050505015156145bf57600080fd5b6145c93487613fdd565b90506000811115614609578a60200151600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561460957600080fd5b50959998505050505050505050565b60008083600181111561462757fe5b148061167957505060009011919050565b60008111156146da57600354600160a060020a03166315dacbea8585858560006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b15156146b457600080fd5b6102c65a03f115156146c557600080fd5b5050506040518051905015156146da57600080fd5b50505050565b6001546146f890600160a060020a0316848484614638565b505050565b60206040519081016040526000815290565b6102e06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820181905261010082018190526101208201819052610140820181905261016082018190526101808201526101a081016147856146fd565b81526020016147926146fd565b8152600060208201526040016147a66146fd565b81526020016000600160a060020a0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b6101006040519081016040526008815b6000815260001990910190602001816147ef57905050905600a165627a7a723058208b2bbe0e09e3c47383c27e7d4142dbe359fac37481acbbeb13138878470695b40029000000000000000000000000a4306692b00795f97010ec7237980141d08c6d560000000000000000000000009a33a92b408b07d3be90e9828731b21a7d794af4000000000000000000000000056017c55ae7ae32d12aef7c679df83a85ca75ff000000000000000000000000a839d4b5a36265795eba6894651a8af3d0ae2e68

Deployed Bytecode

0x6060604052600436106101665763ffffffff60e060020a60003504166306fdde03811461016b5780630eefdbad146101f557806310796a471461022457806314350c24146102d95780631a6b13e2146102f1578063239e83df1461030757806328a8ee68146103dc57806331e63199146104015780633f67ee0d14610414578063514f03301461056157806354fd4d5014610580578063562b2ebc1461059357806360bef33a146106aa57806363d36c0b1461080757806364df049e1461083257806371d02b381461084557806372593b4c146109925780637966686814610baa5780637b10399914610cfb5780637ccefc5214610d0e5780638076f00514610d215780638da5cb5b14610d37578063a25eb5d914610d4a578063a8a41c7014610d5d578063ab834bab14610eba578063ca595b9a1461111b578063cae6047f14611268578063d537e1311461127b578063e57d4adb14611493578063f2fde38b146114a9575b600080fd5b341561017657600080fd5b61017e6114c8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ba5780820151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020057600080fd5b6102086114ff565b604051600160a060020a03909116815260200160405180910390f35b341561022f57600080fd5b6102c560048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061150e95505050505050565b604051901515815260200160405180910390f35b34156102e457600080fd5b6102ef600435611619565b005b34156102fc57600080fd5b6102ef60043561163e565b341561031257600080fd5b61017e60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061166395505050505050565b34156103e757600080fd5b6103ef611680565b60405190815260200160405180910390f35b341561040c57600080fd5b61017e611686565b341561041f57600080fd5b6103ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506116bd95505050505050565b341561056c57600080fd5b6102ef600160a060020a0360043516611818565b341561058b57600080fd5b61017e611867565b341561059e57600080fd5b6102c560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061189e95505050505050565b34156106b557600080fd5b6102c5600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505060ff85351694602081013594506040013592506118dc915050565b341561081257600080fd5b6103ef60ff6004358116906024351660443560643560843560a435611a7d565b341561083d57600080fd5b610208611a98565b341561085057600080fd5b6103ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611aa795505050505050565b341561099d57600080fd5b6102c560046101c481600e6101c0604051908101604052919082826101c0808284378201915050505050919080610240019060128060200260405190810160405291908282610240808284378201915050505050919080610100019060088060200260405190810160405291908282610100808284375093959460208082019550903586018082019450359250829150601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611bf495505050505050565b3415610bb557600080fd5b6102ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650505050913515159150611f489050565b3415610d0657600080fd5b6102086120ac565b3415610d1957600080fd5b6103ef6120bb565b3415610d2c57600080fd5b6102c56004356120c1565b3415610d4257600080fd5b6102086120d6565b3415610d5557600080fd5b6102086120ea565b3415610d6857600080fd5b6102ef600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505060ff85351694602081013594506040013592506120f9915050565b6102ef60046101c481600e6101c0604051908101604052919082826101c0808284378201915050505050919080610240019060128060200260405190810160405291908282610240808284378201915050505050919080610100019060088060200260405190810160405291908282610100808284375093959460208082019550903586018082019450359250829150601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437820191505050505050919080604001906002806020026040519081016040528092919082600260200280828437820191505050505091908060a001906005806020026040519081016040529190828260a08082843750939550612271945050505050565b341561112657600080fd5b6102c5600460e481600760e06040519081016040529190828260e08082843782019150505050509190806101200190600980602002604051908101604052919082826101208082843750939560ff863581169660208082013583169750604080830135841697506060830135909316955092935060a08101926080909101358401808201929035918291601f830182900482029091019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061260295505050505050565b341561127357600080fd5b6103ef612769565b341561128657600080fd5b6103ef60046101c481600e6101c0604051908101604052919082826101c0808284378201915050505050919080610240019060128060200260405190810160405291908282610240808284378201915050505050919080610100019060088060200260405190810160405291908282610100808284375093959460208082019550903586018082019450359250829150601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061276f95505050505050565b341561149e57600080fd5b6102c5600435612ab3565b34156114b457600080fd5b6102ef600160a060020a0360043516612ac8565b60408051908101604052601781527f50726f6a6563742057797665726e2045786368616e6765000000000000000000602082015281565b600354600160a060020a031681565b60006115186146fd565b60008061152786518651612b73565b6040518059106115345750595b818152601f19601f830116810160200160405290509250600091505b84518210156115a65784828151811061156557fe5b016020015160f860020a900460f860020a0283838151811061158357fe5b906020010190600160f860020a031916908160001a905350600190910190611550565b5060005b8551811015611600578581815181106115bf57fe5b016020015160f860020a900460f860020a028386518301815181106115e057fe5b906020010190600160f860020a031916908160001a9053506001016115aa565b60006040518451602086018a5afa979650505050505050565b60005433600160a060020a03908116610100909204161461163957600080fd5b600655565b60005433600160a060020a03908116610100909204161461165e57600080fd5b600755565b61166b6146fd565b611676848484612b8d565b50825b9392505050565b60075481565b60408051908101604052600881527f42616b756e617761000000000000000000000000000000000000000000000000602082015281565b600061180a6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a600181111561174f57fe5b815260200189600181111561176057fe5b815260200188600181111561177157fe5b815260200160808d0151600160a060020a0316815260200187600181111561179557fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052612d93565b9a9950505050505050505050565b60005433600160a060020a03908116610100909204161461183857600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600181527f3200000000000000000000000000000000000000000000000000000000000000602082015281565b600080845111156118b4576118b4858486612b8d565b6000825111156118c9576118c9838684612b8d565b6118d38584612dc9565b95945050505050565b60006118e661470f565b6102e0604051908101604052808f51600160a060020a031681526020018f60016020020151600160a060020a031681526020018f60026020020151600160a060020a031681526020018e5181526020018e60016020020151815260200160408f0151815260200160608f015181526020018f60036020020151600160a060020a031681526020018d600181111561197957fe5b81526020018c600181111561198a57fe5b81526020018b600181111561199b57fe5b81526020018f60046020020151600160a060020a031681526020018a60018111156119c257fe5b8152602081018a9052604081018990526060018f60056020020151600160a060020a03168152602081018890526040018f60066020020151600160a060020a0316815260200160808f0151815260200160a08f0151815260200160c08f0151815260200160e08f015181526020016101008f015190529050611a6b611a4682612e5d565b826060604051908101604090815260ff8a168252602082018990528101879052612f20565b9e9d5050505050505050505050505050565b6000611a8d87878787878761301d565b979650505050505050565b600854600160a060020a031681565b600061180a6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a6001811115611b3957fe5b8152602001896001811115611b4a57fe5b8152602001886001811115611b5b57fe5b815260200160808d0151600160a060020a03168152602001876001811115611b7f57fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052612e5d565b6000611bfe61470f565b611c0661470f565b6102e0604051908101604052808d51600160a060020a031681526020018d60016020020151600160a060020a0316815260200160408e0151600160a060020a031681526020018c5181526020018c60016020020151815260200160408d0151815260200160608d0151815260200160608e0151600160a060020a031681526020018b5160ff166001811115611c9757fe5b6001811115611ca257fe5b81526020018b6001602002015160ff166001811115611cbd57fe5b6001811115611cc857fe5b815260200160408c015160ff166001811115611ce057fe5b6001811115611ceb57fe5b815260200160808e0151600160a060020a0316815260200160608c015160ff166001811115611d1657fe5b6001811115611d2157fe5b8152602081018b90526040810189905260600160a08e0151600160a060020a031681526020810187905260400160c08e0151600160a060020a0316815260200160808d0151815260200160a08d0151815260200160c08d0151815260200160e08d015181526020016101008d0151905291506102e06040519081016040528060e08e0151600160a060020a031681526020016101008e0151600160a060020a031681526020016101208e0151600160a060020a031681526020016101208d015181526020016101408d015181526020016101608d015181526020016101808d015181526020016101408e0151600160a060020a0316815260200160808c015160ff166001811115611e2e57fe5b6001811115611e3957fe5b815260200160a08c015160ff166001811115611e5157fe5b6001811115611e5c57fe5b815260200160c08c015160ff166001811115611e7457fe5b6001811115611e7f57fe5b81526020016101608e0151600160a060020a0316815260200160e08c015160ff166001811115611eab57fe5b6001811115611eb657fe5b8152602081018a9052604081018890526060016101808e0151600160a060020a03168152602081018690526040016101a08e0151600160a060020a031681526020016101a08d015181526020016101c08d015181526020016101e08d015181526020016102008d015181526020016102208d015190529050611f3882826130b0565b9c9b505050505050505050505050565b611f5061470f565b6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a6001811115611fdd57fe5b8152602001896001811115611fee57fe5b8152602001886001811115611fff57fe5b815260200160808d0151600160a060020a0316815260200187600181111561202357fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052905061209f8183613296565b5050505050505050505050565b600254600160a060020a031681565b60065481565b60046020526000908152604090205460ff1681565b6000546101009004600160a060020a031681565b600154600160a060020a031681565b6122636102e0604051908101604052808e51600160a060020a031681526020018e60016020020151600160a060020a0316815260200160408f0151600160a060020a031681526020018d5181526020018d60016020020151815260200160408e0151815260200160608e0151815260200160608f0151600160a060020a031681526020018c600181111561218957fe5b81526020018b600181111561219a57fe5b81526020018a60018111156121ab57fe5b815260200160808f0151600160a060020a031681526020018960018111156121cf57fe5b8152602081018990526040810188905260600160a08f0151600160a060020a031681526020810187905260400160c08f0151600160a060020a0316815260200160808e0151815260200160a08e0151815260200160c08e0151815260200160e08e015181526020016101008e015190526060604051908101604090815260ff8716825260208201869052810184905261364a565b505050505050505050505050565b61209f6102e0604051908101604052808d51600160a060020a031681526020018d60016020020151600160a060020a0316815260200160408e0151600160a060020a031681526020018c5181526020018c60016020020151815260200160408d0151815260200160608d0151815260200160608e0151600160a060020a031681526020018b5160ff16600181111561230557fe5b600181111561231057fe5b81526020018b6001602002015160ff16600181111561232b57fe5b600181111561233657fe5b815260200160408c015160ff16600181111561234e57fe5b600181111561235957fe5b815260200160808e0151600160a060020a0316815260200160608c015160ff16600181111561238457fe5b600181111561238f57fe5b8152602081018b90526040810189905260600160a08e0151600160a060020a031681526020810187905260400160c08e0151600160a060020a0316815260200160808d0151815260200160a08d0151815260200160c08d0151815260200160e08d015181526020016101008d01519052606060405190810160405280855160ff16815260200184518152602001846001602002015190526102e0604051908101604052808f60076020020151600160a060020a031681526020018f60086020020151600160a060020a031681526020018f60096020020151600160a060020a031681526020016101208f015181526020016101408f015181526020016101608f015181526020016101808f015181526020018f600a6020020151600160a060020a0316815260200160808e015160ff1660018111156124ca57fe5b60018111156124d557fe5b815260200160a08e015160ff1660018111156124ed57fe5b60018111156124f857fe5b815260200160c08e015160ff16600181111561251057fe5b600181111561251b57fe5b81526020018f600b6020020151600160a060020a0316815260200160e08e015160ff16600181111561254957fe5b600181111561255457fe5b8152602081018c9052604081018a90526060018f600c6020020151600160a060020a03168152602081018890526040018f600d6020020151600160a060020a031681526020016101a08f015181526020016101c08f015181526020016101e08f015181526020016102008f015181526020016102208f01519052606060405190810160405280602088015160ff168152602001604087015181526020016060870151905260808601516136c9565b600061260c61470f565b6102e0604051908101604052808c51600160a060020a031681526020018c60016020020151600160a060020a0316815260200160408d0151600160a060020a031681526020018b5181526020018b60016020020151815260200160408c0151815260200160608c0151815260200160608d0151600160a060020a031681526020018a600181111561269957fe5b81526020018960018111156126aa57fe5b81526020018860018111156126bb57fe5b815260200160808d0151600160a060020a031681526020018760018111156126df57fe5b8152602081018790526040810186905260600160a08d0151600160a060020a031681526020810185905260400160c08d0151600160a060020a0316815260200160808c0151815260200160a08c0151815260200160c08c0151815260200160e08c015181526020016101008c01519052905061275a81613b6f565b9b9a5050505050505050505050565b61271081565b600061277961470f565b61278161470f565b6102e0604051908101604052808d51600160a060020a031681526020018d60016020020151600160a060020a0316815260200160408e0151600160a060020a031681526020018c5181526020018c60016020020151815260200160408d0151815260200160608d0151815260200160608e0151600160a060020a031681526020018b5160ff16600181111561281257fe5b600181111561281d57fe5b81526020018b6001602002015160ff16600181111561283857fe5b600181111561284357fe5b815260200160408c015160ff16600181111561285b57fe5b600181111561286657fe5b815260200160808e0151600160a060020a0316815260200160608c015160ff16600181111561289157fe5b600181111561289c57fe5b8152602081018b90526040810189905260600160a08e0151600160a060020a031681526020810187905260400160c08e0151600160a060020a0316815260200160808d0151815260200160a08d0151815260200160c08d0151815260200160e08d015181526020016101008d0151905291506102e06040519081016040528060e08e0151600160a060020a031681526020016101008e0151600160a060020a031681526020016101208e0151600160a060020a031681526020016101208d015181526020016101408d015181526020016101608d015181526020016101808d015181526020016101408e0151600160a060020a0316815260200160808c015160ff1660018111156129a957fe5b60018111156129b457fe5b815260200160a08c015160ff1660018111156129cc57fe5b60018111156129d757fe5b815260200160c08c015160ff1660018111156129ef57fe5b60018111156129fa57fe5b81526020016101608e0151600160a060020a0316815260200160e08c015160ff166001811115612a2657fe5b6001811115612a3157fe5b8152602081018a9052604081018890526060016101808e0151600160a060020a03168152602081018690526040016101a08e0151600160a060020a031681526020016101a08d015181526020016101c08d015181526020016101e08d015181526020016102008d015181526020016102208d015190529050611f388282613bfe565b60056020526000908152604090205460ff1681565b60005433600160a060020a039081166101009092041614612ae857600080fd5b600160a060020a0381161515612afd57600080fd5b600054600160a060020a03808316916101009004167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600082820183811015612b8257fe5b8091505b5092915050565b612b956147df565b60008061010060405190810160409081527f800000000000000000000000000000000000000000000000000000000000000082527f400000000000000000000000000000000000000000000000000000000000000060208301527f2000000000000000000000000000000000000000000000000000000000000000908201527f100000000000000000000000000000000000000000000000000000000000000060608201527f080000000000000000000000000000000000000000000000000000000000000060808201527f040000000000000000000000000000000000000000000000000000000000000060a08201527f020000000000000000000000000000000000000000000000000000000000000060c082015260f860020a60e082015292508451865114612cc657600080fd5b60088651811515612cd357fe5b0484511015612ce157600080fd5b5060005b8551811015612d8b57826008820660088110612cfd57fe5b6020020151846008830481518110612d1157fe5b016020015160f860020a900460f860020a0216600160f860020a031916600060f860020a02149150811515612d8357848181518110612d4c57fe5b016020015160f860020a900460f860020a02868281518110612d6a57fe5b906020010190600160f860020a031916908160001a9053505b600101612ce5565b505050505050565b6000612dc1826101200151836101400151846102400151856102600151866102800151876102a0015161301d565b90505b919050565b6000808251845114612dde5760009150612b86565b5060005b8351811015612e5357828181518110612df757fe5b016020015160f860020a900460f860020a02600160f860020a031916848281518110612e1f57fe5b016020015160f860020a900460f860020a02600160f860020a031916141515612e4b5760009150612b86565b600101612de2565b5060019392505050565b6000612e676146fd565b600060408051908101604052601c81527f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152915081612ea985613c90565b612eb286613e3a565b6040518084805190602001908083835b60208310612ee15780518252601f199092019160209182019101612ec2565b6001836020036101000a038019825116818451161790925250505091909101938452505060208201526040908101915051908190039020949350505050565b6000612f2b83613b6f565b1515612f3957506000611679565b60008481526004602052604090205460ff1615612f5857506000611679565b60008481526005602052604090205460ff1615612f7757506001611679565b8260200151600160a060020a03166001858451856020015186604001516040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f11515612ff357600080fd5b505060206040510351600160a060020a0316141561301357506001611679565b5060009392505050565b6000808087600181111561302d57fe5b141561303b578591506130a5565b600187600181111561304957fe5b14156130a557613074613065866130604288613fdd565b613fef565b61306f8587613fdd565b61401a565b9050600188600181111561308457fe5b141561309b576130948682613fdd565b91506130a5565b6130948682612b73565b509695505050505050565b60008083610120015160018111156130c457fe5b1480156130e15750600182610120015160018111156130df57fe5b145b801561310c575081610100015160018111156130f957fe5b836101000151600181111561310a57fe5b145b80156131335750816102200151600160a060020a0316836102200151600160a060020a0316145b801561316f575060006040830151600160a060020a0316148061316f57508260200151600160a060020a03168260400151600160a060020a0316145b80156131ab575060006040840151600160a060020a031614806131ab57508160200151600160a060020a03168360400151600160a060020a0316145b801561320e5750600060e0830151600160a060020a03161480156131dd5750600060e0840151600160a060020a031614155b8061320e5750600060e0830151600160a060020a03161415801561320e5750600060e0840151600160a060020a0316145b80156132355750816101600151600160a060020a0316836101600151600160a060020a0316145b80156132605750816101800151600181111561324d57fe5b836101800151600181111561325e57fe5b145b801561327b575061327b836102800151846102a00151614031565b80156116795750611679826102800151836102a00151614031565b60008260200151600160a060020a031633600160a060020a03161415156132bc57600080fd5b6132c583612e5d565b60008181526005602052604090205490915060ff16156132e457600080fd5b6000818152600560205260409020805460ff1916600117905560e0830151600160a060020a03168360200151600160a060020a0316827f90c7f9f5b58c15f0f635bfb99f55d3d78fdbef3559e7d8abf5c81052a527662286518760400151886060015189608001518a60a001518b60c001518c61010001518d61012001518e61014001518f6101600151604051808b600160a060020a0316600160a060020a031681526020018a600160a060020a0316600160a060020a031681526020018981526020018881526020018781526020018681526020018560018111156133c657fe5b60ff1681526020018460018111156133da57fe5b60ff1681526020018360018111156133ee57fe5b60ff16815260200182600160a060020a0316600160a060020a031681526020019a505050505050505050505060405180910390a4807fe55393c778364e440d958b39ac1debd99dcfae3775a8a04d1e79124adf6a2d08610180850151856101a00151866101c00151876101e001518861020001518961022001518a61024001518b61026001518c61028001518d6102a001518e6102c001518e604051808d600181111561349757fe5b60ff16815260200180602001806020018c600160a060020a0316600160a060020a03168152602001806020018b600160a060020a0316600160a060020a031681526020018a81526020018981526020018881526020018781526020018681526020018515151515815260200184810384528f818151815260200191508051906020019080838360005b83811015613538578082015183820152602001613520565b50505050905090810190601f1680156135655780820380516001836020036101000a031916815260200191505b5084810383528e818151815260200191508051906020019080838360005b8381101561359b578082015183820152602001613583565b50505050905090810190601f1680156135c85780820380516001836020036101000a031916815260200191505b5084810382528c818151815260200191508051906020019080838360005b838110156135fe5780820151838201526020016135e6565b50505050905090810190601f16801561362b5780820380516001836020036101000a031916815260200191505b509f5050505050505050505050505050505060405180910390a2505050565b6000613656838361404d565b90508260200151600160a060020a031633600160a060020a031614151561367c57600080fd5b60008181526004602052604090819020805460ff1916600117905581907f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d905160405180910390a2505050565b600080548190819081908190819060ff16156136e457600080fd5b6000805460ff19166001179055600160a060020a03331660208c0151600160a060020a03161415613728576137188b613b6f565b151561372357600080fd5b613735565b6137328b8b61404d565b95505b33600160a060020a03168960200151600160a060020a0316141561376c5761375c89613b6f565b151561376757600080fd5b613779565b613776898961404d565b94505b6137838b8a6130b0565b151561378e57600080fd5b886101600151803b94509250600084116137a757600080fd5b60008b6101c001515111156137d0576137d08b6101a001518a6101a001518d6101c00151612b8d565b6000896101c001515111156137f9576137f9896101a001518c6101a001518b6101c00151612b8d565b61380d8b6101a001518a6101a00151612dc9565b151561381857600080fd5b600254600160a060020a031663c455279160208b015160006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561387557600080fd5b6102c65a03f1151561388657600080fd5b5050506040518051925050600160a060020a03821615156138a657600080fd5b8a60200151600160a060020a031633600160a060020a03161415156138df576000868152600460205260409020805460ff191660011790555b8860200151600160a060020a031633600160a060020a0316141515613918576000858152600460205260409020805460ff191660011790555b6139228b8a614071565b905081600160a060020a0316631b0f7ba98a61016001518b61018001518c6101a001516000604051602001526040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600181111561398857fe5b60ff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156139c95780820151838201526020016139b1565b50505050905090810190601f1680156139f65780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1515613a1657600080fd5b6102c65a03f11515613a2757600080fd5b505050604051805190501515613a3c57600080fd5b60006101e08c0151600160a060020a031614613a7757613a6c8b6101e001518a6101a001518d610200015161150e565b1515613a7757600080fd5b60006101e08a0151600160a060020a031614613ab257613aa7896101e001518a6101a001518b610200015161150e565b1515613ab257600080fd5b86600060e08b0151600160a060020a03161415613ad3578960200151613ad9565b8b602001515b600160a060020a0316600060e08c0151600160a060020a03161415613b02578c60200151613b08565b8a602001515b600160a060020a03167fc4109843e0b7d514e4c093114b863f8e7d8d9a458c372cd51bfe526b588006c989898660405192835260208301919091526040808301919091526060909101905180910390a450506000805460ff19169055505050505050505050565b6000600160a060020a0330168251600160a060020a031614613b9357506000612dc4565b613ba7826101400151836102a00151614618565b1515613bb557506000612dc4565b60018261010001516001811115613bc857fe5b148015613be957506006548260a001511080613be957506007548260c00151105b15613bf657506000612dc4565b506001919050565b6000806000613c2f846101200151856101400151866102400151876102600151886102800151896102a0015161301d565b9150613c5d8561012001518661014001518761024001518861026001518961028001518a6102a0015161301d565b905081811015613c6c57600080fd5b600060e0850151600160a060020a03161415613c8857806118d3565b509392505050565b6000815182602001518360400151846060015185608001518660a001518760c001518860e001518961010001518a61012001518b61014001518c61016001518d6101800151604051808e600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018d600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018c600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018b81526020018a815260200189815260200188815260200187600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401866001811115613d9957fe5b60ff1660f860020a028152600101856001811115613db357fe5b60ff1660f860020a028152600101846001811115613dcd57fe5b60ff1660f860020a02815260010183600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401826001811115613e0e57fe5b60ff1660f860020a0281526001019d505050505050505050505050505060405180910390209050919050565b6000816101a00151826101c00151836101e00151846102000151856102200151866102400151876102600151886102800151896102a001518a6102c00151604051808b805190602001908083835b60208310613ea75780518252601f199092019160209182019101613e88565b6001836020036101000a03801982511681845116179092525050509190910190508a805190602001908083835b60208310613ef35780518252601f199092019160209182019101613ed4565b6001836020036101000a03801982511681845116179092525050506c01000000000000000000000000600160a060020a038d160292019182525060140188805190602001908083835b60208310613f5b5780518252601f199092019160209182019101613f3c565b6001836020036101000a03801982511681845116808217855250505050505090500187600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018681526020018581526020018481526020018381526020018281526020019a505050505050505050505060405180910390209050919050565b600082821115613fe957fe5b50900390565b6000808315156140025760009150612b86565b5082820282848281151561401257fe5b0414612b8257fe5b600080828481151561402857fe5b04949350505050565b6000428310801561167957508115806116795750504210919050565b60008061405984612e5d565b9050614066818585612f20565b1515612b8257600080fd5b60008080808080808080806102208b0151600160a060020a03161461409b57341561409b57600080fd5b6140a58b8b613bfe565b97506000881180156140c6575060006102208b0151600160a060020a031614155b156140e4576140e48a61022001518c602001518c602001518b614638565b879650869550600060e08b0151600160a060020a0316146143e6578a608001518a60800151111561411457600080fd5b60018a6101000151600181111561412757fe5b14156143b3578a60c001518a60c00151111561414257600080fd5b60008a6060015111156141e0576141686141608b606001518a613fef565b61271061401a565b945060006102208b0151600160a060020a031614156141c75761418b8786613fdd565b96508960e00151600160a060020a031685156108fc0286604051600060405180830381858888f1935050505015156141c257600080fd5b6141e0565b6141e08a61022001518b602001518c60e0015188614638565b60008a608001511115614276576141fe6141608b608001518a613fef565b935060006102208b0151600160a060020a0316141561425d576142218685612b73565b95508960e00151600160a060020a031684156108fc0285604051600060405180830381858888f19350505050151561425857600080fd5b614276565b6142768a61022001518c602001518c60e0015187614638565b60008a60a001511115614312576142946141608b60a001518a613fef565b925060006102208b0151600160a060020a031614156142f2576142b78784613fdd565b600854909750600160a060020a031683156108fc0284604051600060405180830381858888f1935050505015156142ed57600080fd5b614312565b6143128a61022001518b60200151600854600160a060020a031686614638565b60008a60c0015111156143ae576143306141608b60c001518a613fef565b915060006102208b0151600160a060020a0316141561438e576143538683612b73565b600854909650600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561438957600080fd5b6143ae565b6143ae8a61022001518c60200151600854600160a060020a031685614638565b6143e1565b6143ca8a602001518b60e001518c606001516146e0565b6143e18b602001518b60e001518c608001516146e0565b614565565b89608001518b6080015111156143fb57600080fd5b60018a6101000151600181111561440e57fe5b14156145375760006102208b0151600160a060020a0316141561443057600080fd5b8960c001518b60c00151111561444557600080fd5b60008b60600151111561447e576144636141608c606001518a613fef565b945061447e8a61022001518c602001518d60e0015188614638565b60008b6080015111156144b75761449c6141608c608001518a613fef565b93506144b78a61022001518b602001518d60e0015187614638565b60008b60a0015111156144f7576144d56141608c60a001518a613fef565b92506144f78a61022001518c60200151600854600160a060020a031686614638565b60008b60c0015111156143e1576145156141608c60c001518a613fef565b91506143e18a61022001518b60200151600854600160a060020a031685614638565b61454e8b602001518c60e001518d606001516146e0565b6145658a602001518c60e001518d608001516146e0565b60006102208b0151600160a060020a0316141561460957348690101561458a57600080fd5b8960200151600160a060020a031687156108fc0288604051600060405180830381858888f1935050505015156145bf57600080fd5b6145c93487613fdd565b90506000811115614609578a60200151600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561460957600080fd5b50959998505050505050505050565b60008083600181111561462757fe5b148061167957505060009011919050565b60008111156146da57600354600160a060020a03166315dacbea8585858560006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b15156146b457600080fd5b6102c65a03f115156146c557600080fd5b5050506040518051905015156146da57600080fd5b50505050565b6001546146f890600160a060020a0316848484614638565b505050565b60206040519081016040526000815290565b6102e06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820181905261010082018190526101208201819052610140820181905261016082018190526101808201526101a081016147856146fd565b81526020016147926146fd565b8152600060208201526040016147a66146fd565b81526020016000600160a060020a0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b6101006040519081016040526008815b6000815260001990910190602001816147ef57905050905600a165627a7a723058208b2bbe0e09e3c47383c27e7d4142dbe359fac37481acbbeb13138878470695b40029

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

000000000000000000000000a4306692b00795f97010ec7237980141d08c6d560000000000000000000000009a33a92b408b07d3be90e9828731b21a7d794af4000000000000000000000000056017c55ae7ae32d12aef7c679df83a85ca75ff000000000000000000000000a839d4b5a36265795eba6894651a8af3d0ae2e68

-----Decoded View---------------
Arg [0] : registryAddress (address): 0xa4306692b00795f97010ec7237980141d08c6D56
Arg [1] : tokenTransferProxyAddress (address): 0x9A33A92b408b07d3be90E9828731b21A7d794Af4
Arg [2] : tokenAddress (address): 0x056017c55aE7AE32d12AeF7C679dF83A85ca75Ff
Arg [3] : protocolFeeAddress (address): 0xa839D4b5A36265795EbA6894651a8aF3d0aE2e68

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a4306692b00795f97010ec7237980141d08c6d56
Arg [1] : 0000000000000000000000009a33a92b408b07d3be90e9828731b21a7d794af4
Arg [2] : 000000000000000000000000056017c55ae7ae32d12aef7c679df83a85ca75ff
Arg [3] : 000000000000000000000000a839d4b5a36265795eba6894651a8af3d0ae2e68


Swarm Source

bzzr://8b2bbe0e09e3c47383c27e7d4142dbe359fac37481acbbeb13138878470695b4

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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