Contract 0x39755357759ce0d7f32dc8dc45414cca409ae24e

 

TxHash Block Age From To Value [TxFee]
0x92308bdd489ebc0918d5730ea951135f367da21b1992edcc2100b729912dbc6e723067623 secs ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00184939425
0xfe609ce87487a4b0fd65fe05dcc9919549c94821a49bd4727792d3e9ceb205ad723067542 secs ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00184939425
0x5f1064e1e2d71affbfc5808287bfaa432a9aee59646b88ca20daf3e5e11d499f723067353 secs ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00049191
0x97915634e35091e04ce1e61bc45acb4335e2d07535fc72694a3c6b67658ffbfa723067353 secs ago0x3dff74a0a102ef914faa32428bbdca0b0f49daf5  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.001786246
0xd20fdd3256b8607dcbe0601facf429b1cd2abec6c970347c164f3698bd625bd672306692 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00184939425
0xaf2c272ba80c2bb22620130d4bca6c45a70f8c419c097fb99f70b289ad0a166472306663 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00184939425
0x2a2004b0285a905b552a22d74e79771c58d1cc89154e88003006bb0a6c3a221072306634 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00160280835
0xbd2930ddfb3b178f08f516127eb023ff2ac8604492ac08a5e1d7f2bb0daa73e372306596 mins ago0x3dff74a0a102ef914faa32428bbdca0b0f49daf5  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0017349794
0x308b49b97ee7b750b04da904e2fe83ac3176d3133a2d9064e1b991c7de46514972306596 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00384449835
0xb45ed7bf270fd8f1af860cb748ee3c3319607ea8ee85e6a80f444525ca2d4eae72306596 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.001131214
0xcd9232ec72f79b224dda13bdb3f5eea4c27ed28f4b9f8aa7418761c61ef1e5ea72306567 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
0x94979b0be81179173ae7bf1abab2d01dbed3e9da57a3d1a25a3cc8b0c1b50cef72306529 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
0x54ac5d0b5385eae5e76386b7f985e7bfcd50787b025f3183d185879f97316abe723065010 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
0xfb132dd5245bb4ce81ff321aeecc79d43b2038647a149729c9076ee1d0f1c69f723064611 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
0x3457b025e74584971acf39f714e19d8004f653091afdc2cbc09d2f25ce2121a7723064412 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
0x24481a412c5d26971b939c70390aad46361bd28d20b680e5769124b133842ad8723064212 mins ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.001398828
0x60c9eda281e2c9b1e277577f737505b58e7e39156901ecb3e87a03364768395e723064212 mins ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00039576
0x695e8dd26118ab367c50d30ddc35654ee037a54c4f206e362538fd8be24b9ac3723064212 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
0x1d3b99b86ee6fe9f477fea177731b1edd4dc68d5863ee4a6c7d8e3a5649a379c723063914 mins ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00140256
0xe395f8f6930afbed08ad156bf30a798fc97504863d6bd59b3bb840d35675f847723063914 mins ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.00140256
0xbf7eb8816c4a6f36355f9ab1be6126395cc7815d5bc50f7d6564091db06209ae723063914 mins ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.000393528
0x82cf47c78249c538f6ff9f6116ad3fa3de29bc3f53aaaa5f22d0a9d5e3a664d6723063914 mins ago0xc6093fd9cc143f9f058938868b2df2daf9a91d28  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.000393528
0x19530c558c0eed66ba3d57d14d1f3f1f92b7f1beb9e1e5d491a19973a59c0f36723063914 mins ago0x0cd5bc171145bd0a48d63aae81ed3d3bedfd9b66  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0004328808
0x4c02c3c4f37cd62adf0ee90827f792e26117ca54dda660053cfa9a0e997ef7d1723063615 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0037212054
0x93df9cc533c794cd1e4754e84bee86a0a1638d69a2647b5d79efc802915b58b1723063417 mins ago0x65693adb7ef9d49cbc0cb5004e7dfc73b14c9297  IN   0x39755357759ce0d7f32dc8dc45414cca409ae24e0 Ether0.0014795154
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: MatchingMarket
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
/// matching_market.sol

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

pragma solidity ^0.4.18;

/// expiring_market.sol

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

pragma solidity ^0.4.18;

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.4.13;

contract DSAuthority {
    function canCall(
        address src, address dst, bytes4 sig
    ) public view returns (bool);
}

contract DSAuthEvents {
    event LogSetAuthority (address indexed authority);
    event LogSetOwner     (address indexed owner);
}

contract DSAuth is DSAuthEvents {
    DSAuthority  public  authority;
    address      public  owner;

    function DSAuth() public {
        owner = msg.sender;
        LogSetOwner(msg.sender);
    }

    function setOwner(address owner_)
        public
        auth
    {
        owner = owner_;
        LogSetOwner(owner);
    }

    function setAuthority(DSAuthority authority_)
        public
        auth
    {
        authority = authority_;
        LogSetAuthority(authority);
    }

    modifier auth {
        require(isAuthorized(msg.sender, msg.sig));
        _;
    }

    function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
        if (src == address(this)) {
            return true;
        } else if (src == owner) {
            return true;
        } else if (authority == DSAuthority(0)) {
            return false;
        } else {
            return authority.canCall(src, this, sig);
        }
    }
}

/// simple_market.sol

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

pragma solidity ^0.4.18;

/// math.sol -- mixin for inline numerical wizardry

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.4.13;

contract DSMath {
    function add(uint x, uint y) internal pure returns (uint z) {
        require((z = x + y) >= x);
    }
    function sub(uint x, uint y) internal pure returns (uint z) {
        require((z = x - y) <= x);
    }
    function mul(uint x, uint y) internal pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x);
    }

    function min(uint x, uint y) internal pure returns (uint z) {
        return x <= y ? x : y;
    }
    function max(uint x, uint y) internal pure returns (uint z) {
        return x >= y ? x : y;
    }
    function imin(int x, int y) internal pure returns (int z) {
        return x <= y ? x : y;
    }
    function imax(int x, int y) internal pure returns (int z) {
        return x >= y ? x : y;
    }

    uint constant WAD = 10 ** 18;
    uint constant RAY = 10 ** 27;

    function wmul(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, y), WAD / 2) / WAD;
    }
    function rmul(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, y), RAY / 2) / RAY;
    }
    function wdiv(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, WAD), y / 2) / y;
    }
    function rdiv(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, RAY), y / 2) / y;
    }

    // This famous algorithm is called "exponentiation by squaring"
    // and calculates x^n with x as fixed-point and n as regular unsigned.
    //
    // It's O(log n), instead of O(n) for naive repeated multiplication.
    //
    // These facts are why it works:
    //
    //  If n is even, then x^n = (x^2)^(n/2).
    //  If n is odd,  then x^n = x * x^(n-1),
    //   and applying the equation for even x gives
    //    x^n = x * (x^2)^((n-1) / 2).
    //
    //  Also, EVM division is flooring and
    //    floor[(n-1) / 2] = floor[n / 2].
    //
    function rpow(uint x, uint n) internal pure returns (uint z) {
        z = n % 2 != 0 ? x : RAY;

        for (n /= 2; n != 0; n /= 2) {
            x = rmul(x, x);

            if (n % 2 != 0) {
                z = rmul(z, x);
            }
        }
    }
}

/// erc20.sol -- API for the ERC20 token standard

// See <https://github.com/ethereum/EIPs/issues/20>.

// This file likely does not meet the threshold of originality
// required for copyright to apply.  As a result, this is free and
// unencumbered software belonging to the public domain.

pragma solidity ^0.4.8;

contract ERC20Events {
    event Approval(address indexed src, address indexed guy, uint wad);
    event Transfer(address indexed src, address indexed dst, uint wad);
}

contract ERC20 is ERC20Events {
    function totalSupply() public view returns (uint);
    function balanceOf(address guy) public view returns (uint);
    function allowance(address src, address guy) public view returns (uint);

    function approve(address guy, uint wad) public returns (bool);
    function transfer(address dst, uint wad) public returns (bool);
    function transferFrom(
        address src, address dst, uint wad
    ) public returns (bool);
}

contract EventfulMarket {
    event LogItemUpdate(uint id);
    event LogTrade(uint pay_amt, address indexed pay_gem,
                   uint buy_amt, address indexed buy_gem);

    event LogMake(
        bytes32  indexed  id,
        bytes32  indexed  pair,
        address  indexed  maker,
        ERC20             pay_gem,
        ERC20             buy_gem,
        uint128           pay_amt,
        uint128           buy_amt,
        uint64            timestamp
    );

    event LogBump(
        bytes32  indexed  id,
        bytes32  indexed  pair,
        address  indexed  maker,
        ERC20             pay_gem,
        ERC20             buy_gem,
        uint128           pay_amt,
        uint128           buy_amt,
        uint64            timestamp
    );

    event LogTake(
        bytes32           id,
        bytes32  indexed  pair,
        address  indexed  maker,
        ERC20             pay_gem,
        ERC20             buy_gem,
        address  indexed  taker,
        uint128           take_amt,
        uint128           give_amt,
        uint64            timestamp
    );

    event LogKill(
        bytes32  indexed  id,
        bytes32  indexed  pair,
        address  indexed  maker,
        ERC20             pay_gem,
        ERC20             buy_gem,
        uint128           pay_amt,
        uint128           buy_amt,
        uint64            timestamp
    );
}

contract SimpleMarket is EventfulMarket, DSMath {

    uint public last_offer_id;

    mapping (uint => OfferInfo) public offers;

    bool locked;

    struct OfferInfo {
        uint     pay_amt;
        ERC20    pay_gem;
        uint     buy_amt;
        ERC20    buy_gem;
        address  owner;
        uint64   timestamp;
    }

    modifier can_buy(uint id) {
        require(isActive(id));
        _;
    }

    modifier can_cancel(uint id) {
        require(isActive(id));
        require(getOwner(id) == msg.sender);
        _;
    }

    modifier can_offer {
        _;
    }

    modifier synchronized {
        require(!locked);
        locked = true;
        _;
        locked = false;
    }

    function isActive(uint id) public constant returns (bool active) {
        return offers[id].timestamp > 0;
    }

    function getOwner(uint id) public constant returns (address owner) {
        return offers[id].owner;
    }

    function getOffer(uint id) public constant returns (uint, ERC20, uint, ERC20) {
      var offer = offers[id];
      return (offer.pay_amt, offer.pay_gem,
              offer.buy_amt, offer.buy_gem);
    }

    // ---- Public entrypoints ---- //

    function bump(bytes32 id_)
        public
        can_buy(uint256(id_))
    {
        var id = uint256(id_);
        LogBump(
            id_,
            keccak256(offers[id].pay_gem, offers[id].buy_gem),
            offers[id].owner,
            offers[id].pay_gem,
            offers[id].buy_gem,
            uint128(offers[id].pay_amt),
            uint128(offers[id].buy_amt),
            offers[id].timestamp
        );
    }

    // Accept given `quantity` of an offer. Transfers funds from caller to
    // offer maker, and from market to caller.
    function buy(uint id, uint quantity)
        public
        can_buy(id)
        synchronized
        returns (bool)
    {
        OfferInfo memory offer = offers[id];
        uint spend = mul(quantity, offer.buy_amt) / offer.pay_amt;

        require(uint128(spend) == spend);
        require(uint128(quantity) == quantity);

        // For backwards semantic compatibility.
        if (quantity == 0 || spend == 0 ||
            quantity > offer.pay_amt || spend > offer.buy_amt)
        {
            return false;
        }

        offers[id].pay_amt = sub(offer.pay_amt, quantity);
        offers[id].buy_amt = sub(offer.buy_amt, spend);
        require( offer.buy_gem.transferFrom(msg.sender, offer.owner, spend) );
        require( offer.pay_gem.transfer(msg.sender, quantity) );

        LogItemUpdate(id);
        LogTake(
            bytes32(id),
            keccak256(offer.pay_gem, offer.buy_gem),
            offer.owner,
            offer.pay_gem,
            offer.buy_gem,
            msg.sender,
            uint128(quantity),
            uint128(spend),
            uint64(now)
        );
        LogTrade(quantity, offer.pay_gem, spend, offer.buy_gem);

        if (offers[id].pay_amt == 0) {
          delete offers[id];
        }

        return true;
    }

    // Cancel an offer. Refunds offer maker.
    function cancel(uint id)
        public
        can_cancel(id)
        synchronized
        returns (bool success)
    {
        // read-only offer. Modify an offer by directly accessing offers[id]
        OfferInfo memory offer = offers[id];
        delete offers[id];

        require( offer.pay_gem.transfer(offer.owner, offer.pay_amt) );

        LogItemUpdate(id);
        LogKill(
            bytes32(id),
            keccak256(offer.pay_gem, offer.buy_gem),
            offer.owner,
            offer.pay_gem,
            offer.buy_gem,
            uint128(offer.pay_amt),
            uint128(offer.buy_amt),
            uint64(now)
        );

        success = true;
    }

    function kill(bytes32 id)
        public
    {
        require(cancel(uint256(id)));
    }

    function make(
        ERC20    pay_gem,
        ERC20    buy_gem,
        uint128  pay_amt,
        uint128  buy_amt
    )
        public
        returns (bytes32 id)
    {
        return bytes32(offer(pay_amt, pay_gem, buy_amt, buy_gem));
    }

    // Make a new offer. Takes funds from the caller into market escrow.
    function offer(uint pay_amt, ERC20 pay_gem, uint buy_amt, ERC20 buy_gem)
        public
        can_offer
        synchronized
        returns (uint id)
    {
        require(uint128(pay_amt) == pay_amt);
        require(uint128(buy_amt) == buy_amt);
        require(pay_amt > 0);
        require(pay_gem != ERC20(0x0));
        require(buy_amt > 0);
        require(buy_gem != ERC20(0x0));
        require(pay_gem != buy_gem);

        OfferInfo memory info;
        info.pay_amt = pay_amt;
        info.pay_gem = pay_gem;
        info.buy_amt = buy_amt;
        info.buy_gem = buy_gem;
        info.owner = msg.sender;
        info.timestamp = uint64(now);
        id = _next_id();
        offers[id] = info;

        require( pay_gem.transferFrom(msg.sender, this, pay_amt) );

        LogItemUpdate(id);
        LogMake(
            bytes32(id),
            keccak256(pay_gem, buy_gem),
            msg.sender,
            pay_gem,
            buy_gem,
            uint128(pay_amt),
            uint128(buy_amt),
            uint64(now)
        );
    }

    function take(bytes32 id, uint128 maxTakeAmount)
        public
    {
        require(buy(uint256(id), maxTakeAmount));
    }

    function _next_id()
        internal
        returns (uint)
    {
        last_offer_id++; return last_offer_id;
    }
}

// Simple Market with a market lifetime. When the close_time has been reached,
// offers can only be cancelled (offer and buy will throw).

contract ExpiringMarket is DSAuth, SimpleMarket {
    uint64 public close_time;
    bool public stopped;

    // after close_time has been reached, no new offers are allowed
    modifier can_offer {
        require(!isClosed());
        _;
    }

    // after close, no new buys are allowed
    modifier can_buy(uint id) {
        require(isActive(id));
        require(!isClosed());
        _;
    }

    // after close, anyone can cancel an offer
    modifier can_cancel(uint id) {
        require(isActive(id));
        require((msg.sender == getOwner(id)) || isClosed());
        _;
    }

    function ExpiringMarket(uint64 _close_time)
        public
    {
        close_time = _close_time;
    }

    function isClosed() public constant returns (bool closed) {
        return stopped || getTime() > close_time;
    }

    function getTime() public constant returns (uint64) {
        return uint64(now);
    }

    function stop() public auth {
        stopped = true;
    }
}

/// note.sol -- the `note' modifier, for logging calls as events

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.4.13;

contract DSNote {
    event LogNote(
        bytes4   indexed  sig,
        address  indexed  guy,
        bytes32  indexed  foo,
        bytes32  indexed  bar,
        uint              wad,
        bytes             fax
    ) anonymous;

    modifier note {
        bytes32 foo;
        bytes32 bar;

        assembly {
            foo := calldataload(4)
            bar := calldataload(36)
        }

        LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);

        _;
    }
}

contract MatchingEvents {
    event LogBuyEnabled(bool isEnabled);
    event LogMinSell(address pay_gem, uint min_amount);
    event LogMatchingEnabled(bool isEnabled);
    event LogUnsortedOffer(uint id);
    event LogSortedOffer(uint id);
    event LogInsert(address keeper, uint id);
    event LogDelete(address keeper, uint id);
}

contract MatchingMarket is MatchingEvents, ExpiringMarket, DSNote {
    bool public buyEnabled = true;      //buy enabled
    bool public matchingEnabled = true; //true: enable matching,
                                         //false: revert to expiring market
    struct sortInfo {
        uint next;  //points to id of next higher offer
        uint prev;  //points to id of previous lower offer
        uint delb;  //the blocknumber where this entry was marked for delete
    }
    mapping(uint => sortInfo) public _rank;                     //doubly linked lists of sorted offer ids
    mapping(address => mapping(address => uint)) public _best;  //id of the highest offer for a token pair
    mapping(address => mapping(address => uint)) public _span;  //number of offers stored for token pair in sorted orderbook
    mapping(address => uint) public _dust;                      //minimum sell amount for a token to avoid dust offers
    mapping(uint => uint) public _near;         //next unsorted offer id
    uint _head;                                 //first unsorted offer id
    uint public dustId;                         // id of the latest offer marked as dust


    function MatchingMarket(uint64 close_time) ExpiringMarket(close_time) public {
    }

    // After close, anyone can cancel an offer
    modifier can_cancel(uint id) {
        require(isActive(id), "Offer was deleted or taken, or never existed.");
        require(
            isClosed() || msg.sender == getOwner(id) || id == dustId,
            "Offer can not be cancelled because user is not owner, and market is open, and offer sells required amount of tokens."
        );
        _;
    }

    // ---- Public entrypoints ---- //

    function make(
        ERC20    pay_gem,
        ERC20    buy_gem,
        uint128  pay_amt,
        uint128  buy_amt
    )
        public
        returns (bytes32)
    {
        return bytes32(offer(pay_amt, pay_gem, buy_amt, buy_gem));
    }

    function take(bytes32 id, uint128 maxTakeAmount) public {
        require(buy(uint256(id), maxTakeAmount));
    }

    function kill(bytes32 id) public {
        require(cancel(uint256(id)));
    }

    // Make a new offer. Takes funds from the caller into market escrow.
    //
    // If matching is enabled:
    //     * creates new offer without putting it in
    //       the sorted list.
    //     * available to authorized contracts only!
    //     * keepers should call insert(id,pos)
    //       to put offer in the sorted list.
    //
    // If matching is disabled:
    //     * calls expiring market's offer().
    //     * available to everyone without authorization.
    //     * no sorting is done.
    //
    function offer(
        uint pay_amt,    //maker (ask) sell how much
        ERC20 pay_gem,   //maker (ask) sell which token
        uint buy_amt,    //taker (ask) buy how much
        ERC20 buy_gem    //taker (ask) buy which token
    )
        public
        returns (uint)
    {
        require(!locked, "Reentrancy attempt");
        var fn = matchingEnabled ? _offeru : super.offer;
        return fn(pay_amt, pay_gem, buy_amt, buy_gem);
    }

    // Make a new offer. Takes funds from the caller into market escrow.
    function offer(
        uint pay_amt,    //maker (ask) sell how much
        ERC20 pay_gem,   //maker (ask) sell which token
        uint buy_amt,    //maker (ask) buy how much
        ERC20 buy_gem,   //maker (ask) buy which token
        uint pos         //position to insert offer, 0 should be used if unknown
    )
        public
        can_offer
        returns (uint)
    {
        return offer(pay_amt, pay_gem, buy_amt, buy_gem, pos, true);
    }

    function offer(
        uint pay_amt,    //maker (ask) sell how much
        ERC20 pay_gem,   //maker (ask) sell which token
        uint buy_amt,    //maker (ask) buy how much
        ERC20 buy_gem,   //maker (ask) buy which token
        uint pos,        //position to insert offer, 0 should be used if unknown
        bool rounding    //match "close enough" orders?
    )
        public
        can_offer
        returns (uint)
    {
        require(!locked, "Reentrancy attempt");
        require(_dust[pay_gem] <= pay_amt);

        if (matchingEnabled) {
          return _matcho(pay_amt, pay_gem, buy_amt, buy_gem, pos, rounding);
        }
        return super.offer(pay_amt, pay_gem, buy_amt, buy_gem);
    }

    //Transfers funds from caller to offer maker, and from market to caller.
    function buy(uint id, uint amount)
        public
        can_buy(id)
        returns (bool)
    {
        require(!locked, "Reentrancy attempt");
        var fn = matchingEnabled ? _buys : super.buy;
        return fn(id, amount);
    }

    // Cancel an offer. Refunds offer maker.
    function cancel(uint id)
        public
        can_cancel(id)
        returns (bool success)
    {
        require(!locked, "Reentrancy attempt");
        if (matchingEnabled) {
            if (isOfferSorted(id)) {
                require(_unsort(id));
            } else {
                require(_hide(id));
            }
        }
        return super.cancel(id);    //delete the offer.
    }

    //insert offer into the sorted list
    //keepers need to use this function
    function insert(
        uint id,   //maker (ask) id
        uint pos   //position to insert into
    )
        public
        returns (bool)
    {
        require(!locked, "Reentrancy attempt");
        require(!isOfferSorted(id));    //make sure offers[id] is not yet sorted
        require(isActive(id));          //make sure offers[id] is active

        _hide(id);                      //remove offer from unsorted offers list
        _sort(id, pos);                 //put offer into the sorted offers list
        LogInsert(msg.sender, id);
        return true;
    }

    //deletes _rank [id]
    //  Function should be called by keepers.
    function del_rank(uint id)
        public
        returns (bool)
    {
        require(!locked, "Reentrancy attempt");
        require(!isActive(id) && _rank[id].delb != 0 && _rank[id].delb < block.number - 10);
        delete _rank[id];
        LogDelete(msg.sender, id);
        return true;
    }

    //set the minimum sell amount for a token
    //    Function is used to avoid "dust offers" that have
    //    very small amount of tokens to sell, and it would
    //    cost more gas to accept the offer, than the value
    //    of tokens received.
    function setMinSell(
        ERC20 pay_gem,     //token to assign minimum sell amount to
        uint dust          //maker (ask) minimum sell amount
    )
        public
        auth
        note
        returns (bool)
    {
        _dust[pay_gem] = dust;
        LogMinSell(pay_gem, dust);
        return true;
    }

    //returns the minimum sell amount for an offer
    function getMinSell(
        ERC20 pay_gem      //token for which minimum sell amount is queried
    )
        public
        constant
        returns (uint)
    {
        return _dust[pay_gem];
    }

    //set buy functionality enabled/disabled
    function setBuyEnabled(bool buyEnabled_) public auth returns (bool) {
        buyEnabled = buyEnabled_;
        LogBuyEnabled(buyEnabled);
        return true;
    }

    //set matching enabled/disabled
    //    If matchingEnabled true(default), then inserted offers are matched.
    //    Except the ones inserted by contracts, because those end up
    //    in the unsorted list of offers, that must be later sorted by
    //    keepers using insert().
    //    If matchingEnabled is false then MatchingMarket is reverted to ExpiringMarket,
    //    and matching is not done, and sorted lists are disabled.
    function setMatchingEnabled(bool matchingEnabled_) public auth returns (bool) {
        matchingEnabled = matchingEnabled_;
        LogMatchingEnabled(matchingEnabled);
        return true;
    }

    //return the best offer for a token pair
    //      the best offer is the lowest one if it's an ask,
    //      and highest one if it's a bid offer
    function getBestOffer(ERC20 sell_gem, ERC20 buy_gem) public constant returns(uint) {
        return _best[sell_gem][buy_gem];
    }

    //return the next worse offer in the sorted list
    //      the worse offer is the higher one if its an ask,
    //      a lower one if its a bid offer,
    //      and in both cases the newer one if they're equal.
    function getWorseOffer(uint id) public constant returns(uint) {
        return _rank[id].prev;
    }

    //return the next better offer in the sorted list
    //      the better offer is in the lower priced one if its an ask,
    //      the next higher priced one if its a bid offer
    //      and in both cases the older one if they're equal.
    function getBetterOffer(uint id) public constant returns(uint) {

        return _rank[id].next;
    }

    //return the amount of better offers for a token pair
    function getOfferCount(ERC20 sell_gem, ERC20 buy_gem) public constant returns(uint) {
        return _span[sell_gem][buy_gem];
    }

    //get the first unsorted offer that was inserted by a contract
    //      Contracts can't calculate the insertion position of their offer because it is not an O(1) operation.
    //      Their offers get put in the unsorted list of offers.
    //      Keepers can calculate the insertion position offchain and pass it to the insert() function to insert
    //      the unsorted offer into the sorted list. Unsorted offers will not be matched, but can be bought with buy().
    function getFirstUnsortedOffer() public constant returns(uint) {
        return _head;
    }

    //get the next unsorted offer
    //      Can be used to cycle through all the unsorted offers.
    function getNextUnsortedOffer(uint id) public constant returns(uint) {
        return _near[id];
    }

    function isOfferSorted(uint id) public constant returns(bool) {
        return _rank[id].next != 0
               || _rank[id].prev != 0
               || _best[offers[id].pay_gem][offers[id].buy_gem] == id;
    }

    function sellAllAmount(ERC20 pay_gem, uint pay_amt, ERC20 buy_gem, uint min_fill_amount)
        public
        returns (uint fill_amt)
    {
        require(!locked, "Reentrancy attempt");
        uint offerId;
        while (pay_amt > 0) {                           //while there is amount to sell
            offerId = getBestOffer(buy_gem, pay_gem);   //Get the best offer for the token pair
            require(offerId != 0);                      //Fails if there are not more offers

            // There is a chance that pay_amt is smaller than 1 wei of the other token
            if (pay_amt * 1 ether < wdiv(offers[offerId].buy_amt, offers[offerId].pay_amt)) {
                break;                                  //We consider that all amount is sold
            }
            if (pay_amt >= offers[offerId].buy_amt) {                       //If amount to sell is higher or equal than current offer amount to buy
                fill_amt = add(fill_amt, offers[offerId].pay_amt);          //Add amount bought to acumulator
                pay_amt = sub(pay_amt, offers[offerId].buy_amt);            //Decrease amount to sell
                take(bytes32(offerId), uint128(offers[offerId].pay_amt));   //We take the whole offer
            } else { // if lower
                var baux = rmul(pay_amt * 10 ** 9, rdiv(offers[offerId].pay_amt, offers[offerId].buy_amt)) / 10 ** 9;
                fill_amt = add(fill_amt, baux);         //Add amount bought to acumulator
                take(bytes32(offerId), uint128(baux));  //We take the portion of the offer that we need
                pay_amt = 0;                            //All amount is sold
            }
        }
        require(fill_amt >= min_fill_amount);
    }

    function buyAllAmount(ERC20 buy_gem, uint buy_amt, ERC20 pay_gem, uint max_fill_amount)
        public
        returns (uint fill_amt)
    {
        require(!locked, "Reentrancy attempt");
        uint offerId;
        while (buy_amt > 0) {                           //Meanwhile there is amount to buy
            offerId = getBestOffer(buy_gem, pay_gem);   //Get the best offer for the token pair
            require(offerId != 0);

            // There is a chance that buy_amt is smaller than 1 wei of the other token
            if (buy_amt * 1 ether < wdiv(offers[offerId].pay_amt, offers[offerId].buy_amt)) {
                break;                                  //We consider that all amount is sold
            }
            if (buy_amt >= offers[offerId].pay_amt) {                       //If amount to buy is higher or equal than current offer amount to sell
                fill_amt = add(fill_amt, offers[offerId].buy_amt);          //Add amount sold to acumulator
                buy_amt = sub(buy_amt, offers[offerId].pay_amt);            //Decrease amount to buy
                take(bytes32(offerId), uint128(offers[offerId].pay_amt));   //We take the whole offer
            } else {                                                        //if lower
                fill_amt = add(fill_amt, rmul(buy_amt * 10 ** 9, rdiv(offers[offerId].buy_amt, offers[offerId].pay_amt)) / 10 ** 9); //Add amount sold to acumulator
                take(bytes32(offerId), uint128(buy_amt));                   //We take the portion of the offer that we need
                buy_amt = 0;                                                //All amount is bought
            }
        }
        require(fill_amt <= max_fill_amount);
    }

    function getBuyAmount(ERC20 buy_gem, ERC20 pay_gem, uint pay_amt) public constant returns (uint fill_amt) {
        var offerId = getBestOffer(buy_gem, pay_gem);           //Get best offer for the token pair
        while (pay_amt > offers[offerId].buy_amt) {
            fill_amt = add(fill_amt, offers[offerId].pay_amt);  //Add amount to buy accumulator
            pay_amt = sub(pay_amt, offers[offerId].buy_amt);    //Decrease amount to pay
            if (pay_amt > 0) {                                  //If we still need more offers
                offerId = getWorseOffer(offerId);               //We look for the next best offer
                require(offerId != 0);                          //Fails if there are not enough offers to complete
            }
        }
        fill_amt = add(fill_amt, rmul(pay_amt * 10 ** 9, rdiv(offers[offerId].pay_amt, offers[offerId].buy_amt)) / 10 ** 9); //Add proportional amount of last offer to buy accumulator
    }

    function getPayAmount(ERC20 pay_gem, ERC20 buy_gem, uint buy_amt) public constant returns (uint fill_amt) {
        var offerId = getBestOffer(buy_gem, pay_gem);           //Get best offer for the token pair
        while (buy_amt > offers[offerId].pay_amt) {
            fill_amt = add(fill_amt, offers[offerId].buy_amt);  //Add amount to pay accumulator
            buy_amt = sub(buy_amt, offers[offerId].pay_amt);    //Decrease amount to buy
            if (buy_amt > 0) {                                  //If we still need more offers
                offerId = getWorseOffer(offerId);               //We look for the next best offer
                require(offerId != 0);                          //Fails if there are not enough offers to complete
            }
        }
        fill_amt = add(fill_amt, rmul(buy_amt * 10 ** 9, rdiv(offers[offerId].buy_amt, offers[offerId].pay_amt)) / 10 ** 9); //Add proportional amount of last offer to pay accumulator
    }

    // ---- Internal Functions ---- //

    function _buys(uint id, uint amount)
        internal
        returns (bool)
    {
        require(buyEnabled);
        if (amount == offers[id].pay_amt) {
            if (isOfferSorted(id)) {
                //offers[id] must be removed from sorted list because all of it is bought
                _unsort(id);
            }else{
                _hide(id);
            }
        }
        require(super.buy(id, amount));
        // If offer has become dust during buy, we cancel it
        if (isActive(id) && offers[id].pay_amt < _dust[offers[id].pay_gem]) {
            dustId = id; //enable current msg.sender to call cancel(id)
            cancel(id);
        }
        return true;
    }

    //find the id of the next higher offer after offers[id]
    function _find(uint id)
        internal
        view
        returns (uint)
    {
        require( id > 0 );

        address buy_gem = address(offers[id].buy_gem);
        address pay_gem = address(offers[id].pay_gem);
        uint top = _best[pay_gem][buy_gem];
        uint old_top = 0;

        // Find the larger-than-id order whose successor is less-than-id.
        while (top != 0 && _isPricedLtOrEq(id, top)) {
            old_top = top;
            top = _rank[top].prev;
        }
        return old_top;
    }

    //find the id of the next higher offer after offers[id]
    function _findpos(uint id, uint pos)
        internal
        view
        returns (uint)
    {
        require(id > 0);

        // Look for an active order.
        while (pos != 0 && !isActive(pos)) {
            pos = _rank[pos].prev;
        }

        if (pos == 0) {
            //if we got to the end of list without a single active offer
            return _find(id);

        } else {
            // if we did find a nearby active offer
            // Walk the order book down from there...
            if(_isPricedLtOrEq(id, pos)) {
                uint old_pos;

                // Guaranteed to run at least once because of
                // the prior if statements.
                while (pos != 0 && _isPricedLtOrEq(id, pos)) {
                    old_pos = pos;
                    pos = _rank[pos].prev;
                }
                return old_pos;

            // ...or walk it up.
            } else {
                while (pos != 0 && !_isPricedLtOrEq(id, pos)) {
                    pos = _rank[pos].next;
                }
                return pos;
            }
        }
    }

    //return true if offers[low] priced less than or equal to offers[high]
    function _isPricedLtOrEq(
        uint low,   //lower priced offer's id
        uint high   //higher priced offer's id
    )
        internal
        view
        returns (bool)
    {
        return mul(offers[low].buy_amt, offers[high].pay_amt)
          >= mul(offers[high].buy_amt, offers[low].pay_amt);
    }

    //these variables are global only because of solidity local variable limit

    //match offers with taker offer, and execute token transactions
    function _matcho(
        uint t_pay_amt,    //taker sell how much
        ERC20 t_pay_gem,   //taker sell which token
        uint t_buy_amt,    //taker buy how much
        ERC20 t_buy_gem,   //taker buy which token
        uint pos,          //position id
        bool rounding      //match "close enough" orders?
    )
        internal
        returns (uint id)
    {
        uint best_maker_id;    //highest maker id
        uint t_buy_amt_old;    //taker buy how much saved
        uint m_buy_amt;        //maker offer wants to buy this much token
        uint m_pay_amt;        //maker offer wants to sell this much token

        // there is at least one offer stored for token pair
        while (_best[t_buy_gem][t_pay_gem] > 0) {
            best_maker_id = _best[t_buy_gem][t_pay_gem];
            m_buy_amt = offers[best_maker_id].buy_amt;
            m_pay_amt = offers[best_maker_id].pay_amt;

            // Ugly hack to work around rounding errors. Based on the idea that
            // the furthest the amounts can stray from their "true" values is 1.
            // Ergo the worst case has t_pay_amt and m_pay_amt at +1 away from
            // their "correct" values and m_buy_amt and t_buy_amt at -1.
            // Since (c - 1) * (d - 1) > (a + 1) * (b + 1) is equivalent to
            // c * d > a * b + a + b + c + d, we write...
            if (mul(m_buy_amt, t_buy_amt) > mul(t_pay_amt, m_pay_amt) +
                (rounding ? m_buy_amt + t_buy_amt + t_pay_amt + m_pay_amt : 0))
            {
                break;
            }
            // ^ The `rounding` parameter is a compromise borne of a couple days
            // of discussion.
            buy(best_maker_id, min(m_pay_amt, t_buy_amt));
            t_buy_amt_old = t_buy_amt;
            t_buy_amt = sub(t_buy_amt, min(m_pay_amt, t_buy_amt));
            t_pay_amt = mul(t_buy_amt, t_pay_amt) / t_buy_amt_old;

            if (t_pay_amt == 0 || t_buy_amt == 0) {
                break;
            }
        }

        if (t_buy_amt > 0 && t_pay_amt > 0 && t_pay_amt >= _dust[t_pay_gem]) {
            //new offer should be created
            id = super.offer(t_pay_amt, t_pay_gem, t_buy_amt, t_buy_gem);
            //insert offer into the sorted list
            _sort(id, pos);
        }
    }

    // Make a new offer without putting it in the sorted list.
    // Takes funds from the caller into market escrow.
    // ****Available to authorized contracts only!**********
    // Keepers should call insert(id,pos) to put offer in the sorted list.
    function _offeru(
        uint pay_amt,      //maker (ask) sell how much
        ERC20 pay_gem,     //maker (ask) sell which token
        uint buy_amt,      //maker (ask) buy how much
        ERC20 buy_gem      //maker (ask) buy which token
    )
        internal
        returns (uint id)
    {
        require(_dust[pay_gem] <= pay_amt);
        id = super.offer(pay_amt, pay_gem, buy_amt, buy_gem);
        _near[id] = _head;
        _head = id;
        LogUnsortedOffer(id);
    }

    //put offer into the sorted list
    function _sort(
        uint id,    //maker (ask) id
        uint pos    //position to insert into
    )
        internal
    {
        require(isActive(id));

        address buy_gem = address(offers[id].buy_gem);
        address pay_gem = address(offers[id].pay_gem);
        uint prev_id;                                      //maker (ask) id

        pos = pos == 0 || offers[pos].pay_gem != pay_gem || offers[pos].buy_gem != buy_gem || !isOfferSorted(pos)
        ?
            _find(id)
        :
            _findpos(id, pos);

        if (pos != 0) {                                    //offers[id] is not the highest offer
            //requirement below is satisfied by statements above
            //require(_isPricedLtOrEq(id, pos));
            prev_id = _rank[pos].prev;
            _rank[pos].prev = id;
            _rank[id].next = pos;
        } else {                                           //offers[id] is the highest offer
            prev_id = _best[pay_gem][buy_gem];
            _best[pay_gem][buy_gem] = id;
        }

        if (prev_id != 0) {                               //if lower offer does exist
            //requirement below is satisfied by statements above
            //require(!_isPricedLtOrEq(id, prev_id));
            _rank[prev_id].next = id;
            _rank[id].prev = prev_id;
        }

        _span[pay_gem][buy_gem]++;
        LogSortedOffer(id);
    }

    // Remove offer from the sorted list (does not cancel offer)
    function _unsort(
        uint id    //id of maker (ask) offer to remove from sorted list
    )
        internal
        returns (bool)
    {
        address buy_gem = address(offers[id].buy_gem);
        address pay_gem = address(offers[id].pay_gem);
        require(_span[pay_gem][buy_gem] > 0);

        require(_rank[id].delb == 0 &&                    //assert id is in the sorted list
                 isOfferSorted(id));

        if (id != _best[pay_gem][buy_gem]) {              // offers[id] is not the highest offer
            require(_rank[_rank[id].next].prev == id);
            _rank[_rank[id].next].prev = _rank[id].prev;
        } else {                                          //offers[id] is the highest offer
            _best[pay_gem][buy_gem] = _rank[id].prev;
        }

        if (_rank[id].prev != 0) {                        //offers[id] is not the lowest offer
            require(_rank[_rank[id].prev].next == id);
            _rank[_rank[id].prev].next = _rank[id].next;
        }

        _span[pay_gem][buy_gem]--;
        _rank[id].delb = block.number;                    //mark _rank[id] for deletion
        return true;
    }

    //Hide offer from the unsorted order book (does not cancel offer)
    function _hide(
        uint id     //id of maker offer to remove from unsorted list
    )
        internal
        returns (bool)
    {
        uint uid = _head;               //id of an offer in unsorted offers list
        uint pre = uid;                 //id of previous offer in unsorted offers list

        require(!isOfferSorted(id));    //make sure offer id is not in sorted offers list

        if (_head == id) {              //check if offer is first offer in unsorted offers list
            _head = _near[id];          //set head to new first unsorted offer
            _near[id] = 0;              //delete order from unsorted order list
            return true;
        }
        while (uid > 0 && uid != id) {  //find offer in unsorted order list
            pre = uid;
            uid = _near[uid];
        }
        if (uid != id) {                //did not find offer id in unsorted offers list
            return false;
        }
        _near[pre] = _near[id];         //set previous unsorted offer to point to offer after offer id
        _near[id] = 0;                  //delete order from unsorted order list
        return true;
    }
}

Contract ABI
[{"constant":true,"inputs":[],"name":"matchingEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"sell_gem","type":"address"},{"name":"buy_gem","type":"address"}],"name":"getBestOffer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pay_gem","type":"address"},{"name":"pay_amt","type":"uint256"},{"name":"buy_gem","type":"address"},{"name":"min_fill_amount","type":"uint256"}],"name":"sellAllAmount","outputs":[{"name":"fill_amt","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"stop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pay_gem","type":"address"},{"name":"buy_gem","type":"address"},{"name":"pay_amt","type":"uint128"},{"name":"buy_amt","type":"uint128"}],"name":"make","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"buy_gem","type":"address"},{"name":"pay_gem","type":"address"},{"name":"pay_amt","type":"uint256"}],"name":"getBuyAmount","outputs":[{"name":"fill_amt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pay_amt","type":"uint256"},{"name":"pay_gem","type":"address"},{"name":"buy_amt","type":"uint256"},{"name":"buy_gem","type":"address"},{"name":"pos","type":"uint256"}],"name":"offer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"pos","type":"uint256"}],"name":"insert","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"last_offer_id","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"matchingEnabled_","type":"bool"}],"name":"setMatchingEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"cancel","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"getOffer","outputs":[{"name":"","type":"uint256"},{"name":"","type":"address"},{"name":"","type":"uint256"},{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"del_rank","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"bytes32"},{"name":"maxTakeAmount","type":"uint128"}],"name":"take","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"pay_gem","type":"address"}],"name":"getMinSell","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTime","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dustId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"getNextUnsortedOffer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"close_time","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"_span","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"_best","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stopped","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id_","type":"bytes32"}],"name":"bump","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"sell_gem","type":"address"},{"name":"buy_gem","type":"address"}],"name":"getOfferCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"buy_gem","type":"address"},{"name":"buy_amt","type":"uint256"},{"name":"pay_gem","type":"address"},{"name":"max_fill_amount","type":"uint256"}],"name":"buyAllAmount","outputs":[{"name":"fill_amt","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"isActive","outputs":[{"name":"active","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"offers","outputs":[{"name":"pay_amt","type":"uint256"},{"name":"pay_gem","type":"address"},{"name":"buy_amt","type":"uint256"},{"name":"buy_gem","type":"address"},{"name":"owner","type":"address"},{"name":"timestamp","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getFirstUnsortedOffer","outputs":[{"name":"","type":"uint256"}],"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":"id","type":"uint256"}],"name":"getBetterOffer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"_dust","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"getWorseOffer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"_near","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"bytes32"}],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pay_gem","type":"address"},{"name":"dust","type":"uint256"}],"name":"setMinSell","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isClosed","outputs":[{"name":"closed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"_rank","outputs":[{"name":"next","type":"uint256"},{"name":"prev","type":"uint256"},{"name":"delb","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"getOwner","outputs":[{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"isOfferSorted","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"buyEnabled_","type":"bool"}],"name":"setBuyEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"amount","type":"uint256"}],"name":"buy","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pay_amt","type":"uint256"},{"name":"pay_gem","type":"address"},{"name":"buy_amt","type":"uint256"},{"name":"buy_gem","type":"address"},{"name":"pos","type":"uint256"},{"name":"rounding","type":"bool"}],"name":"offer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pay_amt","type":"uint256"},{"name":"pay_gem","type":"address"},{"name":"buy_amt","type":"uint256"},{"name":"buy_gem","type":"address"}],"name":"offer","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"buyEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"pay_gem","type":"address"},{"name":"buy_gem","type":"address"},{"name":"buy_amt","type":"uint256"}],"name":"getPayAmount","outputs":[{"name":"fill_amt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"close_time","type":"uint64"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint256"}],"name":"LogItemUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"pay_amt","type":"uint256"},{"indexed":true,"name":"pay_gem","type":"address"},{"indexed":false,"name":"buy_amt","type":"uint256"},{"indexed":true,"name":"buy_gem","type":"address"}],"name":"LogTrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"bytes32"},{"indexed":true,"name":"pair","type":"bytes32"},{"indexed":true,"name":"maker","type":"address"},{"indexed":false,"name":"pay_gem","type":"address"},{"indexed":false,"name":"buy_gem","type":"address"},{"indexed":false,"name":"pay_amt","type":"uint128"},{"indexed":false,"name":"buy_amt","type":"uint128"},{"indexed":false,"name":"timestamp","type":"uint64"}],"name":"LogMake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"bytes32"},{"indexed":true,"name":"pair","type":"bytes32"},{"indexed":true,"name":"maker","type":"address"},{"indexed":false,"name":"pay_gem","type":"address"},{"indexed":false,"name":"buy_gem","type":"address"},{"indexed":false,"name":"pay_amt","type":"uint128"},{"indexed":false,"name":"buy_amt","type":"uint128"},{"indexed":false,"name":"timestamp","type":"uint64"}],"name":"LogBump","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"bytes32"},{"indexed":true,"name":"pair","type":"bytes32"},{"indexed":true,"name":"maker","type":"address"},{"indexed":false,"name":"pay_gem","type":"address"},{"indexed":false,"name":"buy_gem","type":"address"},{"indexed":true,"name":"taker","type":"address"},{"indexed":false,"name":"take_amt","type":"uint128"},{"indexed":false,"name":"give_amt","type":"uint128"},{"indexed":false,"name":"timestamp","type":"uint64"}],"name":"LogTake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"bytes32"},{"indexed":true,"name":"pair","type":"bytes32"},{"indexed":true,"name":"maker","type":"address"},{"indexed":false,"name":"pay_gem","type":"address"},{"indexed":false,"name":"buy_gem","type":"address"},{"indexed":false,"name":"pay_amt","type":"uint128"},{"indexed":false,"name":"buy_amt","type":"uint128"},{"indexed":false,"name":"timestamp","type":"uint64"}],"name":"LogKill","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"isEnabled","type":"bool"}],"name":"LogBuyEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"pay_gem","type":"address"},{"indexed":false,"name":"min_amount","type":"uint256"}],"name":"LogMinSell","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"isEnabled","type":"bool"}],"name":"LogMatchingEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint256"}],"name":"LogUnsortedOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint256"}],"name":"LogSortedOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"keeper","type":"address"},{"indexed":false,"name":"id","type":"uint256"}],"name":"LogInsert","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"keeper","type":"address"},{"indexed":false,"name":"id","type":"uint256"}],"name":"LogDelete","type":"event"}]

Contract Creation Code
608060405260048054605860020a60ff0219605060020a60ff02199091166a010000000000000000000017166b01000000000000000000000017905534801561004757600080fd5b50604051602080613420833981016040819052905160018054600160a060020a0319163390811790915590918291907fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9490600090a26004805467ffffffffffffffff9092166101000268ffffffffffffffff00199092169190911790555061334c806100d46000396000f3006080604052600436106102455763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301492a0b811461024a5780630374fc6f146102735780630621b4f6146102ac57806307da68f5146102da578063093f5198146102f157806313af40351461032a578063144a27521461034b5780631b33d412146103755780631d834a1b146103a6578063232cae0b146103c15780632aed1905146103d657806340e58ee5146103f05780634579268a14610408578063467f0b7b146104515780634960645514610469578063511fa4871461048d578063557ed1ba146104ae57806356ad8764146104e057806361f54a79146104f55780636377ebca1461050d578063677170e11461052257806374c1d7d31461054957806375f12b2114610570578063779997c3146105855780637a9e5e4b1461059d5780637ca9429a146105be5780638185402b146105e557806382afd23b146106135780638a72ea6a1461062b5780638af82a2e1461068d5780638da5cb5b146106a2578063911550f4146106d357806391be90c8146106eb578063943911bc1461070c578063a78d431614610724578063b4f9b6c81461073c578063bf7c734e14610754578063bf7e214f14610778578063c2b6b58c1461078d578063c2d526aa146107a2578063c41a360a146107d8578063d2b420ce146107f0578063d6f1546914610808578063d6febde814610822578063e1a6f0141461083d578063f09ea2a614610873578063f582d293146108a1578063ff1fd974146108b6575b600080fd5b34801561025657600080fd5b5061025f6108e0565b604080519115158252519081900360200190f35b34801561027f57600080fd5b5061029a600160a060020a03600435811690602435166108f8565b60408051918252519081900360200190f35b3480156102b857600080fd5b5061029a600160a060020a036004358116906024359060443516606435610925565b3480156102e657600080fd5b506102ef610ab4565b005b3480156102fd57600080fd5b5061029a600160a060020a03600435811690602435166001608060020a0360443581169060643516610af6565b34801561033657600080fd5b506102ef600160a060020a0360043516610b1f565b34801561035757600080fd5b5061029a600160a060020a0360043581169060243516604435610b9d565b34801561038157600080fd5b5061029a600435600160a060020a036024358116906044359060643516608435610c69565b3480156103b257600080fd5b5061025f600435602435610c96565b3480156103cd57600080fd5b5061029a610d61565b3480156103e257600080fd5b5061025f6004351515610d67565b3480156103fc57600080fd5b5061025f600435610dfd565b34801561041457600080fd5b50610420600435611033565b60408051948552600160a060020a039384166020860152848101929092529091166060830152519081900360800190f35b34801561045d57600080fd5b5061025f600435611069565b34801561047557600080fd5b506102ef6004356001608060020a0360243516611168565b34801561049957600080fd5b5061029a600160a060020a036004351661118a565b3480156104ba57600080fd5b506104c36111a5565b6040805167ffffffffffffffff9092168252519081900360200190f35b3480156104ec57600080fd5b5061029a6111a9565b34801561050157600080fd5b5061029a6004356111af565b34801561051957600080fd5b506104c36111c1565b34801561052e57600080fd5b5061029a600160a060020a03600435811690602435166111d6565b34801561055557600080fd5b5061029a600160a060020a03600435811690602435166111f3565b34801561057c57600080fd5b5061025f611210565b34801561059157600080fd5b506102ef600435611226565b3480156105a957600080fd5b506102ef600160a060020a0360043516611326565b3480156105ca57600080fd5b5061029a600160a060020a03600435811690602435166113a0565b3480156105f157600080fd5b5061029a600160a060020a0360043581169060243590604435166064356113cb565b34801561061f57600080fd5b5061025f60043561153f565b34801561063757600080fd5b50610643600435611566565b60408051968752600160a060020a039586166020880152868101949094529184166060860152909216608084015267ffffffffffffffff90911660a0830152519081900360c00190f35b34801561069957600080fd5b5061029a6115b8565b3480156106ae57600080fd5b506106b76115be565b60408051600160a060020a039092168252519081900360200190f35b3480156106df57600080fd5b5061029a6004356115cd565b3480156106f757600080fd5b5061029a600160a060020a03600435166115df565b34801561071857600080fd5b5061029a6004356115f1565b34801561073057600080fd5b5061029a600435611606565b34801561074857600080fd5b506102ef600435611618565b34801561076057600080fd5b5061025f600160a060020a036004351660243561162f565b34801561078457600080fd5b506106b7611703565b34801561079957600080fd5b5061025f611712565b3480156107ae57600080fd5b506107ba600435611759565b60408051938452602084019290925282820152519081900360600190f35b3480156107e457600080fd5b506106b760043561177a565b3480156107fc57600080fd5b5061025f600435611798565b34801561081457600080fd5b5061025f6004351515611809565b34801561082e57600080fd5b5061025f60043560243561189d565b34801561084957600080fd5b5061029a600435600160a060020a03602435811690604435906064351660843560a4351515611947565b34801561087f57600080fd5b5061029a600435600160a060020a036024358116906044359060643516611a0f565b3480156108ad57600080fd5b5061025f611a96565b3480156108c257600080fd5b5061029a600160a060020a0360043581169060243516604435611aad565b6004546b010000000000000000000000900460ff1681565b600160a060020a038083166000908152600660209081526040808320938516835292905220545b92915050565b6004546000908190819060ff1615610975576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b6000861115610a9d5761098885886108f8565b915081151561099657600080fd5b6000828152600360205260409020600281015490546109b59190611b66565b86670de0b6b3a76400000210156109cb57610a9d565b6000828152600360205260409020600201548610610a3f576000828152600360205260409020546109fd908490611b97565b600083815260036020526040902060020154909350610a1d908790611ba7565b600083815260036020526040902054909650610a3a908390611168565b610a98565b60008281526003602052604090208054600290910154633b9aca0091610a719189840291610a6c91611bb7565b611bd3565b811515610a7a57fe5b049050610a878382611b97565b9250610a938282611168565b600095505b610975565b83831015610aaa57600080fd5b5050949350505050565b610aca33600035600160e060020a031916611c03565b1515610ad557600080fd5b6004805469ff00000000000000000019166901000000000000000000179055565b6000610b16836001608060020a031686846001608060020a031687611a0f565b95945050505050565b610b3533600035600160e060020a031916611c03565b1515610b4057600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117918290556040519116907fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9490600090a250565b600080610baa85856108f8565b90505b600081815260036020526040902060020154831115610c2757600081815260036020526040902054610be0908390611b97565b600082815260036020526040902060020154909250610c00908490611ba7565b92506000831115610c2257610c14816115f1565b9050801515610c2257600080fd5b610bad565b60008181526003602052604090208054600290910154610b16918491633b9aca0091610c5a9188840291610a6c91611bb7565b811515610c6357fe5b04611b97565b6000610c73611712565b15610c7d57600080fd5b610c8c86868686866001611947565b9695505050505050565b60045460009060ff1615610ce2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b610ceb83611798565b15610cf557600080fd5b610cfe8361153f565b1515610d0957600080fd5b610d1283611d0a565b50610d1d8383611db2565b604080513381526020810185905281517f6d5c16212bdea16850dce4d9fa2314c446bd30ce84700d9c36c7677c6d283940929181900390910190a150600192915050565b60025481565b6000610d7f33600035600160e060020a031916611c03565b1515610d8a57600080fd5b600480548315156b0100000000000000000000009081026bff0000000000000000000000199092169190911791829055604080519190920460ff161515815290517fea11e00ec1642be9b494019b756440e2c57dbe9e59242c4f9c64ce33fb4f41d99181900360200190a1506001919050565b600081610e098161153f565b1515610e85576040805160e560020a62461bcd02815260206004820152602d60248201527f4f66666572207761732064656c65746564206f722074616b656e2c206f72206e60448201527f6576657220657869737465642e00000000000000000000000000000000000000606482015290519081900360840190fd5b610e8d611712565b80610eb15750610e9c8161177a565b600160a060020a031633600160a060020a0316145b80610ebd5750600b5481145b1515610f85576040805160e560020a62461bcd02815260206004820152607460248201527f4f666665722063616e206e6f742062652063616e63656c6c656420626563617560448201527f73652075736572206973206e6f74206f776e65722c20616e64206d61726b657460648201527f206973206f70656e2c20616e64206f666665722073656c6c732072657175697260848201527f656420616d6f756e74206f6620746f6b656e732e00000000000000000000000060a482015290519081900360c40190fd5b60045460ff1615610fce576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b6004546b010000000000000000000000900460ff161561102357610ff183611798565b1561100f57610fff83611f5c565b151561100a57600080fd5b611023565b61101883611d0a565b151561102357600080fd5b61102c8361211c565b9392505050565b600090815260036020819052604090912080546001820154600283015492909301549093600160a060020a039384169390911690565b60045460009060ff16156110b5576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b6110be8261153f565b1580156110db575060008281526005602052604090206002015415155b80156110fb57506000828152600560205260409020600201546009194301115b151561110657600080fd5b60008281526005602090815260408083208381556001810184905560020192909255815133815290810184905281517fcb9d6176c6aac6478ebb9a2754cdce22a944de29ed1f2642f8613884eba4b40c929181900390910190a1506001919050565b61117b826001608060020a03831661189d565b151561118657600080fd5b5050565b600160a060020a031660009081526008602052604090205490565b4290565b600b5481565b60009081526009602052604090205490565b600454610100900467ffffffffffffffff1681565b600760209081526000928352604080842090915290825290205481565b600660209081526000928352604080842090915290825290205481565b6004546901000000000000000000900460ff1681565b6000816112328161153f565b151561123d57600080fd5b611245611712565b1561124f57600080fd5b6000838152600360208181526040808420600481015460018201548286015484516c01000000000000000000000000600160a060020a03938416818102835292841690810260148301528651918290036028018220998d90529787528454600290950154918152958601969096526001608060020a039283168585015291909416606084015267ffffffffffffffff60a060020a850416608084015290518796509216929185917f70a14c213064359ede031fd2a1645a11ce2ec825ffe6ab5cfb5b160c3ef4d0a2919081900360a00190a4505050565b61133c33600035600160e060020a031916611c03565b151561134757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116919091178083556040519116917f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada491a250565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b600454600090819060ff1615611419576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b60008511156115295761142c86856108f8565b905080151561143a57600080fd5b6000818152600360205260409020805460029091015461145a9190611b66565b85670de0b6b3a764000002101561147057611529565b60008181526003602052604090205485106114e1576000818152600360205260409020600201546114a2908390611b97565b6000828152600360205260409020549092506114bf908690611ba7565b6000828152600360205260409020549095506114dc908290611168565b611524565b600081815260036020526040902060028101549054611513918491633b9aca0091610c5a918a840291610a6c91611bb7565b915061151f8186611168565b600094505b611419565b8282111561153657600080fd5b50949350505050565b60009081526003602052604081206004015460a060020a900467ffffffffffffffff161190565b6003602081905260009182526040909120805460018201546002830154938301546004909301549193600160a060020a039182169390929082169181169060a060020a900467ffffffffffffffff1686565b600a5490565b600154600160a060020a031681565b60009081526005602052604090205490565b60086020526000908152604090205481565b60009081526005602052604090206001015490565b60096020526000908152604090205481565b61162181610dfd565b151561162c57600080fd5b50565b600061164733600035600160e060020a031916611c03565b151561165257600080fd5b60408051348082526020820183815236938301849052600435936024359384938693339360008035600160e060020a031916949092606082018484808284376040519201829003965090945050505050a4600160a060020a0385166000818152600860209081526040918290208790558151928352820186905280517fc28d56449b0bb31e64ee7487e061f57a2e72aea8019d810832f26dda099823d09281900390910190a1506001949350505050565b600054600160a060020a031681565b6004546000906901000000000000000000900460ff16806117545750600454610100900467ffffffffffffffff166117486111a5565b67ffffffffffffffff16115b905090565b60056020526000908152604090208054600182015460029092015490919083565b600090815260036020526040902060040154600160a060020a031690565b6000818152600560205260408120541515806117c4575060008281526005602052604090206001015415155b8061091f57505060008181526003602081815260408084206001810154600160a060020a03908116865260068452828620919094015490931684529190529020541490565b600061182133600035600160e060020a031916611c03565b151561182c57600080fd5b600480548315156a01000000000000000000009081026aff00000000000000000000199092169190911791829055604080519190920460ff161515815290517f7089e4f0bcc948f9f723a361590c32d9c2284da7ab1981b1249ad2edb9f953c19181900360200190a1506001919050565b60006132c9836118ac8161153f565b15156118b757600080fd5b6118bf611712565b156118c957600080fd5b60045460ff1615611912576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b6004546b010000000000000000000000900460ff1661193357612623611937565b612ac65b9150610b1685858463ffffffff16565b6000611951611712565b1561195b57600080fd5b60045460ff16156119a4576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b600160a060020a0386166000908152600860205260409020548710156119c957600080fd5b6004546b010000000000000000000000900460ff16156119f8576119f1878787878787612b9c565b9050610c8c565b611a0487878787612d03565b979650505050505050565b6004546000906132c99060ff1615611a5f576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613301833981519152604482015290519081900360640190fd5b6004546b010000000000000000000000900460ff16611a8057612d03611a84565b61303a5b9050610c8c868686868563ffffffff16565b6004546a0100000000000000000000900460ff1681565b600080611aba84866108f8565b90505b600081815260036020526040902054831115611b3457600081815260036020526040902060020154611af0908390611b97565b600082815260036020526040902054909250611b0d908490611ba7565b92506000831115611b2f57611b21816115f1565b9050801515611b2f57600080fd5b611abd565b600081815260036020526040902060028101549054610b16918491633b9aca0091610c5a9188840291610a6c91611bb7565b600081611b86611b7e85670de0b6b3a76400006130c4565b600285610c63565b811515611b8f57fe5b049392505050565b8082018281101561091f57600080fd5b8082038281111561091f57600080fd5b600081611b86611b7e856b033b2e3c9fd0803ce80000006130c4565b60006b033b2e3c9fd0803ce8000000611b86611bef85856130c4565b60026b033b2e3c9fd0803ce8000000610c63565b6000600160a060020a038316301415611c1e5750600161091f565b600154600160a060020a0384811691161415611c3c5750600161091f565b600054600160a060020a03161515611c565750600061091f565b60008054604080517fb7009613000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152306024830152600160e060020a0319871660448301529151919092169263b700961392606480820193602093909283900390910190829087803b158015611cd757600080fd5b505af1158015611ceb573d6000803e3d6000fd5b505050506040513d6020811015611d0157600080fd5b5051905061091f565b600a5460009080611d1a84611798565b15611d2457600080fd5b83600a541415611d4b5760008481526009602052604081208054600a555560019250611dab565b5b600082118015611d5c5750838214155b15611d77575060008181526009602052604090205490611d4c565b818414611d875760009250611dab565b60008481526009602052604080822080548484529183209190915585825255600192505b5050919050565b6000806000611dc08561153f565b1515611dcb57600080fd5b600085815260036020819052604090912090810154600190910154600160a060020a039182169450169150831580611e205750600084815260036020526040902060010154600160a060020a03838116911614155b80611e49575060008481526003602081905260409091200154600160a060020a03848116911614155b80611e5a5750611e5884611798565b155b611e6d57611e6885856130ec565b611e76565b611e76856131cb565b93508315611ea457506000838152600560205260408082206001018054908790558683529120849055611ed1565b50600160a060020a0381811660009081526006602090815260408083209386168352929052208054908590555b8015611ef55760008181526005602052604080822087905586825290206001018190555b600160a060020a03808316600090815260076020908152604080832093871683529281529082902080546001019055815187815291517f20fb9bad86c18f7e22e8065258790d9416a7d2df8ff05f80f82c46d38b925acd9281900390910190a15050505050565b600081815260036020818152604080842092830154600190930154600160a060020a03908116808652600784528286209190941680865292528320549091908310611fa657600080fd5b600084815260056020526040902060020154158015611fc95750611fc984611798565b1515611fd457600080fd5b600160a060020a03808216600090815260066020908152604080832093861683529290522054841461204757600084815260056020526040808220548252902060010154841461202357600080fd5b6000848152600560205260408082206001808201549154845291909220015561207d565b600084815260056020908152604080832060010154600160a060020a038086168552600684528285209087168552909252909120555b600084815260056020526040902060010154156120d45760008481526005602052604080822060010154825290205484146120b757600080fd5b600084815260056020526040808220805460019091015483529120555b600160a060020a039081166000908152600760209081526040808320949093168252928352818120805460001901905593845260059091529091204360029091015550600190565b60006121266132cb565b826121308161153f565b15156121ac576040805160e560020a62461bcd02815260206004820152602d60248201527f4f66666572207761732064656c65746564206f722074616b656e2c206f72206e60448201527f6576657220657869737465642e00000000000000000000000000000000000000606482015290519081900360840190fd5b6121b4611712565b806121d857506121c38161177a565b600160a060020a031633600160a060020a0316145b806121e45750600b5481145b15156122ac576040805160e560020a62461bcd02815260206004820152607460248201527f4f666665722063616e206e6f742062652063616e63656c6c656420626563617560448201527f73652075736572206973206e6f74206f776e65722c20616e64206d61726b657460648201527f206973206f70656e2c20616e64206f666665722073656c6c732072657175697260848201527f656420616d6f756e74206f6620746f6b656e732e00000000000000000000000060a482015290519081900360c40190fd5b60045460ff16156122bc57600080fd5b6001600460006101000a81548160ff0219169083151502179055506003600085815260200190815260200160002060c06040519081016040529081600082015481526020016001820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001600282015481526020016003820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016004820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016004820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509150600360008581526020019081526020016000206000808201600090556001820160006101000a815490600160a060020a03021916905560028201600090556003820160006101000a815490600160a060020a0302191690556004820160006101000a815490600160a060020a0302191690556004820160146101000a81549067ffffffffffffffff021916905550508160200151600160a060020a031663a9059cbb836080015184600001516040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156124e257600080fd5b505af11580156124f6573d6000803e3d6000fd5b505050506040513d602081101561250c57600080fd5b5051151561251957600080fd5b6040805185815290517fa2c251311b1a7a475913900a2a73dc9789a21b04bc737e050bbc506dd4eb34889181900360200190a16080808301516020808501805160608088018051604080516c01000000000000000000000000600160a060020a039687168102825292861690920260148301528051918290036028018220955192518b51828d01519487168452908616978301979097526001608060020a0396871682820152959091169181019190915267ffffffffffffffff4216958101959095529151919092169287917f9577941d28fff863bfbee4694a6a4a56fb09e169619189d2eaa750b5b48199959181900360a00190a450506004805460ff19169055506001919050565b600061262d6132cb565b6000846126398161153f565b151561264457600080fd5b61264c611712565b1561265657600080fd5b60045460ff161561266657600080fd5b60048054600160ff1990911681178255600088815260036020818152604092839020835160c081018552815480825295820154600160a060020a03908116938201939093526002820154948101859052928101548216606084015290940154938416608082015260a060020a90930467ffffffffffffffff1660a0840152919450906126f39087906130c4565b8115156126fc57fe5b0491506001608060020a038216821461271457600080fd5b6001608060020a038516851461272957600080fd5b841580612734575081155b8061273f5750825185115b8061274d5750826040015182115b1561275b5760009350612ab3565b82516127679086611ba7565b60008781526003602052604090819020919091558301516127889083611ba7565b6000878152600360209081526040808320600201939093556060860151608087015184517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a0391821660248201526044810188905294519116936323b872dd9360648083019493928390030190829087803b15801561281557600080fd5b505af1158015612829573d6000803e3d6000fd5b505050506040513d602081101561283f57600080fd5b5051151561284c57600080fd5b602080840151604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a039092169263a9059cbb926044808401938290030181600087803b1580156128b657600080fd5b505af11580156128ca573d6000803e3d6000fd5b505050506040513d60208110156128e057600080fd5b505115156128ed57600080fd5b6040805187815290517fa2c251311b1a7a475913900a2a73dc9789a21b04bc737e050bbc506dd4eb34889181900360200190a16080808401516020808601805160608089018051604080516c01000000000000000000000000600160a060020a039687168102825292861690920260148301528051918290036028018220955192518f835292851696820196909652908316818601526001608060020a03808d16928201929092529088169581019590955267ffffffffffffffff421660a086015291513394939092169290917f3383e3357c77fd2e3a4b30deea81179bc70a795d053d14d5b7f2f01d0fd4596f9181900360c00190a48260600151600160a060020a03168360200151600160a060020a03167f819e390338feffe95e2de57172d6faf337853dfd15c7a09a32d76f7fd24438758785604051808381526020018281526020019250505060405180910390a36000868152600360205260409020541515612aae576000868152600360208190526040822082815560018101805473ffffffffffffffffffffffffffffffffffffffff19908116909155600282019390935590810180549092169091556004018054600160e060020a03191690555b600193505b50506004805460ff191690555092915050565b6004546000906a0100000000000000000000900460ff161515612ae857600080fd5b600083815260036020526040902054821415612b2657612b0783611798565b15612b1b57612b1583611f5c565b50612b26565b612b2483611d0a565b505b612b308383612623565b1515612b3b57600080fd5b612b448361153f565b8015612b7e575060008381526003602081815260408084206001810154600160a060020a0316855260088352908420549387905291905254105b15612b9357600b839055612b9183610dfd565b505b50600192915050565b60008060008060005b600160a060020a038089166000908152600660209081526040808320938e168352929052908120541115612ca4575050600160a060020a038087166000908152600660209081526040808320938c168352928152828220548083526003909152919020600281015490549193509085612c1f576000612c27565b808b8a840101015b612c318c836130c4565b01612c3c838b6130c4565b1115612c4757612ca4565b612c5a84612c55838c613254565b61189d565b50889250612c7189612c6c838c613254565b611ba7565b985082612c7e8a8d6130c4565b811515612c8757fe5b049a508a1580612c95575088155b15612c9f57612ca4565b612ba5565b600089118015612cb4575060008b115b8015612cd85750600160a060020a038a166000908152600860205260409020548b10155b15612cf557612ce98b8b8b8b612d03565b9450612cf58588611db2565b505050509695505050505050565b6000612d0d6132cb565b612d15611712565b15612d1f57600080fd5b60045460ff1615612d2f57600080fd5b6004805460ff191660011790556001608060020a0386168614612d5157600080fd5b6001608060020a0384168414612d6657600080fd5b60008611612d7357600080fd5b600160a060020a0385161515612d8857600080fd5b60008411612d9557600080fd5b600160a060020a0383161515612daa57600080fd5b600160a060020a038581169084161415612dc357600080fd5b858152600160a060020a038086166020830152604082018590528316606082015233608082015267ffffffffffffffff421660a0820152612e0261326b565b60008181526003602081815260408084208651815582870151600182018054600160a060020a0392831673ffffffffffffffffffffffffffffffffffffffff1991821617909155838901516002840155606089015195830180549683169682169690961790955560808801516004928301805460a08b015167ffffffffffffffff1660a060020a027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff9385169190981617919091169590951790945581517f23b872dd0000000000000000000000000000000000000000000000000000000081523391810191909152306024820152604481018c90529051949650918916936323b872dd936064808501948390030190829087803b158015612f2357600080fd5b505af1158015612f37573d6000803e3d6000fd5b505050506040513d6020811015612f4d57600080fd5b50511515612f5a57600080fd5b6040805183815290517fa2c251311b1a7a475913900a2a73dc9789a21b04bc737e050bbc506dd4eb34889181900360200190a1604080516c01000000000000000000000000600160a060020a0388811682810284529087169182026014840152835192839003602801832090835260208301919091526001608060020a03808a16838501528716606083015267ffffffffffffffff42166080830152915133929185917f773ff502687307abfa024ac9f62f9752a0d210dac2ffd9a29e38e12e2ea82c829181900360a00190a4506004805460ff19169055949350505050565b600160a060020a03831660009081526008602052604081205485101561305f57600080fd5b61306b85858585612d03565b600a80546000838152600960209081526040918290209290925591839055815183815291519293507f8173832a493e0a3989e521458e55bfe9feac9f9b675a94e100b9d5a85f81486292918290030190a1949350505050565b60008115806130e15750508082028282828115156130de57fe5b04145b151561091f57600080fd5b6000808084116130fb57600080fd5b8215801590613110575061310e8361153f565b155b1561312e5760009283526005602052604090922060010154916130fb565b8215156131455761313e846131cb565b91506131c4565b61314f8484613279565b1561318f575b821580159061316957506131698484613279565b15613187575060008281526005602052604090206001015491613155565b8091506131c4565b82158015906131a557506131a38484613279565b155b156131c057600092835260056020526040909220549161318f565b8291505b5092915050565b6000808080808086116131dd57600080fd5b505050600083815260036020818152604080842092830154600190930154600160a060020a039081168086526006845282862091909416808652925283205490935090915b811580159061323657506132368683613279565b15610b16575060008181526005602052604090206001015490613222565b600081831115613264578161102c565b5090919050565b600280546001019081905590565b600081815260036020526040808220600201548483529082205461329d91906130c4565b600084815260036020526040808220600201548583529120546132c091906130c4565b10159392505050565bfe5b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091529056005265656e7472616e637920617474656d70740000000000000000000000000000a165627a7a7230582070d9b1bb53fdc3bcb3297c97da72225e59da3f32a97ae9359d07e6a96556eddd0029000000000000000000000000000000000000000000000000000000005e3ea2c0


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

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000005e3ea2c0


   Swarm Source:
bzzr://70d9b1bb53fdc3bcb3297c97da72225e59da3f32a97ae9359d07e6a96556eddd
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.