ETH Price: $3,307.09 (+6.72%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Pixels235009762025-10-04 0:56:2367 days ago1759539383IN
0xBfaD2ceE...58023a844
0 ETH0.000111381.10686506
Set Pixels235007872025-10-04 0:18:2367 days ago1759537103IN
0xBfaD2ceE...58023a844
0 ETH0.003244381.12878572
Set Pixels234149992025-09-22 0:29:1179 days ago1758500951IN
0xBfaD2ceE...58023a844
0 ETH0.000356530.1240468
Set Pixels234149992025-09-22 0:29:1179 days ago1758500951IN
0xBfaD2ceE...58023a844
0 ETH0.000356460.1240468
Set Pixels234149942025-09-22 0:28:1179 days ago1758500891IN
0xBfaD2ceE...58023a844
0 ETH0.003257211.13345698
Set Pixels233376272025-09-11 5:06:3589 days ago1757567195IN
0xBfaD2ceE...58023a844
0 ETH0.003266831.13676538
Set Pixels233376252025-09-11 5:06:1189 days ago1757567171IN
0xBfaD2ceE...58023a844
0 ETH0.003263521.13545039
Set Pixels233376232025-09-11 5:05:4789 days ago1757567147IN
0xBfaD2ceE...58023a844
0 ETH0.003266841.13661919
Set Pixels233376212025-09-11 5:05:2389 days ago1757567123IN
0xBfaD2ceE...58023a844
0 ETH0.003268041.13701745
Set Pixels233376152025-09-11 5:04:1189 days ago1757567051IN
0xBfaD2ceE...58023a844
0 ETH0.003264161.13566538
Set Pixels233376102025-09-11 5:03:1189 days ago1757566991IN
0xBfaD2ceE...58023a844
0 ETH0.003258131.13357197
Set Pixels233376062025-09-11 5:02:2389 days ago1757566943IN
0xBfaD2ceE...58023a844
0 ETH0.003281641.14175215
Set Pixels233091362025-09-07 5:30:2393 days ago1757223023IN
0xBfaD2ceE...58023a844
0 ETH0.003281421.14167263
Set Pixels233091222025-09-07 5:27:3593 days ago1757222855IN
0xBfaD2ceE...58023a844
0 ETH0.003281.14118191
Set Pixels233091182025-09-07 5:26:4793 days ago1757222807IN
0xBfaD2ceE...58023a844
0 ETH0.000183831.15558196
Set Pixels233091122025-09-07 5:25:3593 days ago1757222735IN
0xBfaD2ceE...58023a844
0 ETH0.003387961.17873969
Set Pixels233091092025-09-07 5:24:5993 days ago1757222699IN
0xBfaD2ceE...58023a844
0 ETH0.003311131.14519629
Set Pixels145229192022-04-05 1:13:271345 days ago1649121207IN
0xBfaD2ceE...58023a844
0 ETH0.0090973251.63625787
Create Canvas140288522022-01-18 10:01:521421 days ago1642500112IN
0xBfaD2ceE...58023a844
0 ETH0.01148743114.13250421
Set Pixels134084392021-10-13 6:26:081518 days ago1634106368IN
0xBfaD2ceE...58023a844
0 ETH0.0058452863.95984094
Set Pixels134044752021-10-12 15:36:311519 days ago1634052991IN
0xBfaD2ceE...58023a844
0 ETH0.009732106.48873768
Set Pixels133112452021-09-28 0:55:371534 days ago1632790537IN
0xBfaD2ceE...58023a844
0 ETH0.0158460589.96641332
Set Pixels132267772021-09-14 23:18:211547 days ago1631661501IN
0xBfaD2ceE...58023a844
0 ETH0.0032698835.77942752
Set Pixels132253962021-09-14 18:20:181547 days ago1631643618IN
0xBfaD2ceE...58023a844
0 ETH0.0515358880.60063184
Set Pixels131463152021-09-02 12:35:421559 days ago1630586142IN
0xBfaD2ceE...58023a844
0 ETH0.0727293167.29024745
View all transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CryptoArt

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-07-09
*/

pragma solidity 0.4.24;

/**
* CryptoCanvas Terms of Use
*
* 1. Intro
*
* CryptoCanvas is a set of collectible artworks (“Canvas”) created by the CryptoCanvas community with proof of ownership stored on the Ethereum blockchain.
*
* This agreement does a few things. First, it passes copyright ownership of a Canvas from the Canvas Authors to the first Canvas Owner. The first Canvas Owner is then obligated to pass on the copyright ownership along with the Canvas to the next owner, and so on forever, such that each owner of a Canvas is also the copyright owner. Second, it requires each Canvas Owner to allow certain uses of their Canvas image. Third, it limits the rights of Canvas owners to sue The Mindhouse and the prior owners of the Canvas.
*
* Canvases of CryptoCanvas are not an investment. They are experimental digital art.
*
* PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE APP, THE SMART CONTRACTS, OR THE SITE. BY USING THE APP, THE SMART CONTRACTS, THE SITE, OR ANY PART OF THEM YOU ARE CONFIRMING THAT YOU UNDERSTAND AND AGREE TO BE BOUND BY ALL OF THESE TERMS. IF YOU ARE ACCEPTING THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO ACCEPT THESE TERMS ON THAT ENTITY’S BEHALF, IN WHICH CASE “YOU” WILL MEAN THAT ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT ACCEPT ALL OF THESE TERMS, THEN WE ARE UNWILLING TO MAKE THE APP, THE SMART CONTRACTS, OR THE SITE AVAILABLE TO YOU. IF YOU DO NOT AGREE TO THESE TERMS, YOU MAY NOT ACCESS OR USE THE APP, THE SMART CONTRACTS, OR THE SITE.
*
* 2. Definitions
*
* “Smart Contract” refers to this smart contract.
*
* “Canvas” means a collectible artwork created by the CryptoCanvas community with information about the color and author of each pixel of the Canvas, and proof of ownership stored in the Smart Contract. The Canvas is considered finished when all the pixels of the Canvas have their color set. Specifically, the Canvas is considered finished when its “state” field in the Smart Contract equals to STATE_INITIAL_BIDDING or STATE_OWNED constant.
*
* “Canvas Author” means the person who painted at least one final pixel of the finished Canvas by sending a transaction to the Smart Contract. Specifically, Canvas Author means the person with the private key for at least one address in the “painter” field of the “pixels” field of the applicable Canvas in the Smart Contract.
*
* “Canvas Owner” means the person that can cryptographically prove ownership of the applicable Canvas. Specifically, Canvas Owner means the person with the private key for the address in the “owner” field of the applicable Canvas in the Smart Contract. The person is the Canvas Owner only after the Initial Bidding phase is finished, that is when the field “state” of the applicable Canvas equals to the STATE_OWNED constant.
*
* “Initial Bidding” means the state of the Canvas when each of its pixels has been set by Canvas Authors but it does not have the Canvas Owner yet. In this phase any user can claim the ownership of the Canvas by sending a transaction to the Smart Contract (a “Bid”). Other users have 48 hours from the time of making the first Bid on the Canvas to submit their own Bids. After that time, the user who sent the highest Bid becomes the sole Canvas Owner of the applicable Canvas. Users who placed Bids with lower amounts are able to withdraw their Bid amount from their Account Balance.
*
* “Account Balance” means the value stored in the Smart Contract assigned to an address. The Account Balance can be withdrawn by the person with the private key for the applicable address by sending a transaction to the Smart Contract. Account Balance consists of Rewards for painting, Bids from Initial Bidding which have been overbid, cancelled offers to buy a Canvas and profits from selling a Canvas.
*
* “The Mindhouse”, “we” or “us” is the group of developers who created and published the CryptoCanvas Smart Contract.
*
* “The App” means collectively the Smart Contract and the website created by The Mindhouse to interact with the Smart Contract.
*
* 3. Intellectual Property
*
* A. First Assignment
* The Canvas Authors of the applicable Canvas hereby assign all copyright ownership in the Canvas to the Canvas Owner. In exchange for this copyright ownership, the Canvas Owner agrees to the terms below.
*
* B. Later Assignments
* When the Canvas Owner transfers the Canvas to a new owner, the Canvas Owner hereby agrees to assign all copyright ownership in the Canvas to the new owner of the Canvas. In exchange for these rights, the new owner shall agree to become the Canvas Owner, and shall agree to be subject to this Terms of Use.
*
* C. No Other Assignments.
* The Canvas Owner shall not assign or license the copyright except as set forth in the “Later Assignments” section above.
*
* D. Third Party Permissions.
* The Canvas Owner agrees to allow CryptoCanvas fans to make non-commercial Use of images of the Canvas to discuss CryptoCanvas, digital collectibles and related matters. “Use” means to reproduce, display, transmit, and distribute images of the Canvas. This permission excludes the right to print the Canvas onto physical copies (including, for example, shirts and posters).
*
* 4. Fees and Payment
*
* A. If you choose to paint, make a bid or trade any Canvas of CryptoCanvas any financial transactions that you engage in will be conducted solely through the Ethereum network via MetaMask. We will have no insight into or control over these payments or transactions, nor do we have the ability to reverse any transactions. With that in mind, we will have no liability to you or to any third party for any claims or damages that may arise as a result of any transactions that you engage in via the App, or using the Smart Contracts, or any other transactions that you conduct via the Ethereum network or MetaMask.
*
* B. Ethereum requires the payment of a transaction fee (a “Gas Fee”) for every transaction that occurs on the Ethereum network. The Gas Fee funds the network of computers that run the decentralized Ethereum network. This means that you will need to pay a Gas Fee for each transaction that occurs via the App.
*
* C. In addition to the Gas Fee, each time you sell a Canvas to another user of the App, you authorize us to collect a fee of 10% of the total value of that transaction. That fee consists of:
        1) 3.9% of the total value of that transaction (a “Commission”). You acknowledge and agree that the Commission will be transferred to us through the Ethereum network as a part of the payment.
        2) 6.1% of the total value of that transaction (a “Reward”). You acknowledge and agree that the Reward will be transferred evenly to all painters of the sold canvas through the Ethereum network as a part of the payment.

*
* D. If you are the Canvas Author you are eligible to receive a reward for painting a Canvas (a “Reward”). A Reward is distributed in these scenarios:
        1) After the Initial Bidding phase is completed. You acknowledge and agree that the Reward for the Canvas Author will be calculated by dividing the value of the winning Bid, decreased by our commission of 3.9% of the total value of the Bid, by the total number of pixels of the Canvas and multiplied by the number of pixels of the Canvas that have been painted by applicable Canvas Author.
        2) Each time the Canvas is sold. You acknowledge and agree that the Reward for the Canvas Author will be calculated by dividing 6.1% of the total transaction value by the total number of pixels of the Canvas and multiplied by the number of pixels of the Canvas that have been painted by the applicable Canvas Author.
You acknowledge and agree that in order to withdraw the Reward you first need to add the Reward to your Account Balance by sending a transaction to the Smart Contract.

*
* 5. Disclaimers
*
* A. YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR ACCESS TO AND USE OF THE APP IS AT YOUR SOLE RISK, AND THAT THE APP IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, WE, OUR SUBSIDIARIES, AFFILIATES, AND LICENSORS MAKE NO EXPRESS WARRANTIES AND HEREBY DISCLAIM ALL IMPLIED WARRANTIES REGARDING THE APP AND ANY PART OF IT (INCLUDING, WITHOUT LIMITATION, THE SITE, ANY SMART CONTRACT, OR ANY EXTERNAL WEBSITES), INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, CORRECTNESS, ACCURACY, OR RELIABILITY. WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, WE, OUR SUBSIDIARIES, AFFILIATES, AND LICENSORS DO NOT REPRESENT OR WARRANT TO YOU THAT: (I) YOUR ACCESS TO OR USE OF THE APP WILL MEET YOUR REQUIREMENTS, (II) YOUR ACCESS TO OR USE OF THE APP WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR, (III) USAGE DATA PROVIDED THROUGH THE APP WILL BE ACCURATE, (III) THE APP OR ANY CONTENT, SERVICES, OR FEATURES MADE AVAILABLE ON OR THROUGH THE APP ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR (IV) THAT ANY DATA THAT YOU DISCLOSE WHEN YOU USE THE APP WILL BE SECURE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES IN CONTRACTS WITH CONSUMERS, SO SOME OR ALL OF THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU.
*
* B. YOU ACCEPT THE INHERENT SECURITY RISKS OF PROVIDING INFORMATION AND DEALING ONLINE OVER THE INTERNET, AND AGREE THAT WE HAVE NO LIABILITY OR RESPONSIBILITY FOR ANY BREACH OF SECURITY UNLESS IT IS DUE TO OUR GROSS NEGLIGENCE.
*
* C. WE WILL NOT BE RESPONSIBLE OR LIABLE TO YOU FOR ANY LOSSES YOU INCUR AS THE RESULT OF YOUR USE OF THE ETHEREUM NETWORK OR THE METAMASK ELECTRONIC WALLET, INCLUDING BUT NOT LIMITED TO ANY LOSSES, DAMAGES OR CLAIMS ARISING FROM: (A) USER ERROR, SUCH AS FORGOTTEN PASSWORDS OR INCORRECTLY CONSTRUED SMART CONTRACTS OR OTHER TRANSACTIONS; (B) SERVER FAILURE OR DATA LOSS; (C) CORRUPTED WALLET FILES; (D) UNAUTHORIZED ACCESS OR ACTIVITIES BY THIRD PARTIES, INCLUDING BUT NOT LIMITED TO THE USE OF VIRUSES, PHISHING, BRUTEFORCING OR OTHER MEANS OF ATTACK AGAINST THE APP, ETHEREUM NETWORK, OR THE METAMASK ELECTRONIC WALLET.
*
* D. THE CANVASES OF CRYPTOCANVAS ARE INTANGIBLE DIGITAL ASSETS THAT EXIST ONLY BY VIRTUE OF THE OWNERSHIP RECORD MAINTAINED IN THE ETHEREUM NETWORK. ALL SMART CONTRACTS ARE CONDUCTED AND OCCUR ON THE DECENTRALIZED LEDGER WITHIN THE ETHEREUM PLATFORM. WE HAVE NO CONTROL OVER AND MAKE NO GUARANTEES OR PROMISES WITH RESPECT TO SMART CONTRACTS.
*
* E. THE MINDHOUSE IS NOT RESPONSIBLE FOR LOSSES DUE TO BLOCKCHAINS OR ANY OTHER FEATURES OF THE ETHEREUM NETWORK OR THE METAMASK ELECTRONIC WALLET, INCLUDING BUT NOT LIMITED TO LATE REPORT BY DEVELOPERS OR REPRESENTATIVES (OR NO REPORT AT ALL) OF ANY ISSUES WITH THE BLOCKCHAIN SUPPORTING THE ETHEREUM NETWORK, INCLUDING FORKS, TECHNICAL NODE ISSUES, OR ANY OTHER ISSUES HAVING FUND LOSSES AS A RESULT.
*
* 6. Limitation of Liability
* YOU UNDERSTAND AND AGREE THAT WE, OUR SUBSIDIARIES, AFFILIATES, AND LICENSORS WILL NOT BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY CONSEQUENTIAL, INCIDENTAL, INDIRECT, EXEMPLARY, SPECIAL, PUNITIVE, OR ENHANCED DAMAGES, OR FOR ANY LOSS OF ACTUAL OR ANTICIPATED PROFITS (REGARDLESS OF HOW THESE ARE CLASSIFIED AS DAMAGES), WHETHER ARISING OUT OF BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, REGARDLESS OF WHETHER SUCH DAMAGE WAS FORESEEABLE AND WHETHER EITHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/

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

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

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


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


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

}

/**
 * @dev Contract that is aware of time. Useful for tests - like this
 *      we can mock time.
 */
contract TimeAware is Ownable {

    /**
    * @dev Returns current time.
    */
    function getTime() public view returns (uint) {
        return now;
    }

}

/**
 * @dev Contract that holds pending withdrawals. Responsible for withdrawals.
 */
contract Withdrawable {

    mapping(address => uint) private pendingWithdrawals;

    event Withdrawal(address indexed receiver, uint amount);
    event BalanceChanged(address indexed _address, uint oldBalance, uint newBalance);

    /**
    * Returns amount of wei that given address is able to withdraw.
    */
    function getPendingWithdrawal(address _address) public view returns (uint) {
        return pendingWithdrawals[_address];
    }

    /**
    * Add pending withdrawal for an address.
    */
    function addPendingWithdrawal(address _address, uint _amount) internal {
        require(_address != 0x0);

        uint oldBalance = pendingWithdrawals[_address];
        pendingWithdrawals[_address] += _amount;

        emit BalanceChanged(_address, oldBalance, oldBalance + _amount);
    }

    /**
    * Withdraws all pending withdrawals.
    */
    function withdraw() external {
        uint amount = getPendingWithdrawal(msg.sender);
        require(amount > 0);

        pendingWithdrawals[msg.sender] = 0;
        msg.sender.transfer(amount);

        emit Withdrawal(msg.sender, amount);
        emit BalanceChanged(msg.sender, amount, 0);
    }

}

/**
* @dev This contract takes care of painting on canvases, returning artworks and creating ones.
*/
contract CanvasFactory is TimeAware, Withdrawable {

    //@dev It means canvas is not finished yet, and bidding is not possible.
    uint8 public constant STATE_NOT_FINISHED = 0;

    //@dev  there is ongoing bidding and anybody can bid. If there canvas can have
    //      assigned owner, but it can change if someone will over-bid him.
    uint8 public constant STATE_INITIAL_BIDDING = 1;

    //@dev canvas has been sold, and has the owner
    uint8 public constant STATE_OWNED = 2;

    uint8 public constant WIDTH = 48;
    uint8 public constant HEIGHT = 48;
    uint32 public constant PIXEL_COUNT = 2304; //WIDTH * HEIGHT doesn't work for some reason

    uint32 public constant MAX_CANVAS_COUNT = 1000;
    uint8 public constant MAX_ACTIVE_CANVAS = 12;
    uint8 public constant MAX_CANVAS_NAME_LENGTH = 24;

    Canvas[] canvases;
    uint32 public activeCanvasCount = 0;

    event PixelPainted(uint32 indexed canvasId, uint32 index, uint8 color, address indexed painter);
    event CanvasFinished(uint32 indexed canvasId);
    event CanvasCreated(uint indexed canvasId, address indexed bookedFor);
    event CanvasNameSet(uint indexed canvasId, string name);

    modifier notFinished(uint32 _canvasId) {
        require(!isCanvasFinished(_canvasId));
        _;
    }

    modifier finished(uint32 _canvasId) {
        require(isCanvasFinished(_canvasId));
        _;
    }

    modifier validPixelIndex(uint32 _pixelIndex) {
        require(_pixelIndex < PIXEL_COUNT);
        _;
    }

    /**
    * @notice   Creates new canvas. There can't be more canvases then MAX_CANVAS_COUNT.
    *           There can't be more unfinished canvases than MAX_ACTIVE_CANVAS.
    */
    function createCanvas() external returns (uint canvasId) {
        return _createCanvasInternal(0x0);
    }

    /**
    * @notice   Similar to createCanvas(). Books it for given address. If address is 0x0 everybody will
    *           be allowed to paint on a canvas.
    */
    function createAndBookCanvas(address _bookFor) external onlyOwner returns (uint canvasId) {
        return _createCanvasInternal(_bookFor);
    }

    /**
    * @notice   Changes canvas.bookFor variable. Only for the owner of the contract.
    */
    function bookCanvasFor(uint32 _canvasId, address _bookFor) external onlyOwner {
        Canvas storage _canvas = _getCanvas(_canvasId);
        _canvas.bookedFor = _bookFor;
    }

    /**
    * @notice   Sets pixel. Given canvas can't be yet finished.
    */
    function setPixel(uint32 _canvasId, uint32 _index, uint8 _color) external {
        Canvas storage _canvas = _getCanvas(_canvasId);
        _setPixelInternal(_canvas, _canvasId, _index, _color);
        _finishCanvasIfNeeded(_canvas, _canvasId);
    }

    /**
    * Set many pixels with one tx. Be careful though - sending a lot of pixels
    * to set may cause out of gas error.
    *
    * Throws when none of the pixels has been set.
    *
    */
    function setPixels(uint32 _canvasId, uint32[] _indexes, uint8[] _colors) external {
        require(_indexes.length == _colors.length);
        Canvas storage _canvas = _getCanvas(_canvasId);

        bool anySet = false;
        for (uint32 i = 0; i < _indexes.length; i++) {
            Pixel storage _pixel = _canvas.pixels[_indexes[i]];
            if (_pixel.painter == 0x0) {
                //only allow when pixel is not set
                _setPixelInternal(_canvas, _canvasId, _indexes[i], _colors[i]);
                anySet = true;
            }
        }

        if (!anySet) {
            //If didn't set any pixels - revert to show that transaction failed
            revert();
        }

        _finishCanvasIfNeeded(_canvas, _canvasId);
    }

    /**
    * @notice   Returns full bitmap for given canvas.
    */
    function getCanvasBitmap(uint32 _canvasId) external view returns (uint8[]) {
        Canvas storage canvas = _getCanvas(_canvasId);
        uint8[] memory result = new uint8[](PIXEL_COUNT);

        for (uint32 i = 0; i < PIXEL_COUNT; i++) {
            result[i] = canvas.pixels[i].color;
        }

        return result;
    }

    /**
    * @notice   Returns how many pixels has been already set.
    */
    function getCanvasPaintedPixelsCount(uint32 _canvasId) public view returns (uint32) {
        return _getCanvas(_canvasId).paintedPixelsCount;
    }

    function getPixelCount() external pure returns (uint) {
        return PIXEL_COUNT;
    }

    /**
    * @notice   Returns amount of created canvases.
    */
    function getCanvasCount() public view returns (uint) {
        return canvases.length;
    }

    /**
    * @notice   Returns true if the canvas has been already finished.
    */
    function isCanvasFinished(uint32 _canvasId) public view returns (bool) {
        return _isCanvasFinished(_getCanvas(_canvasId));
    }

    /**
    * @notice   Returns the author of given pixel.
    */
    function getPixelAuthor(uint32 _canvasId, uint32 _pixelIndex) public view validPixelIndex(_pixelIndex) returns (address) {
        return _getCanvas(_canvasId).pixels[_pixelIndex].painter;
    }

    /**
    * @notice   Returns number of pixels set by given address.
    */
    function getPaintedPixelsCountByAddress(address _address, uint32 _canvasId) public view returns (uint32) {
        Canvas storage canvas = _getCanvas(_canvasId);
        return canvas.addressToCount[_address];
    }

    function _isCanvasFinished(Canvas canvas) internal pure returns (bool) {
        return canvas.paintedPixelsCount == PIXEL_COUNT;
    }

    function _getCanvas(uint32 _canvasId) internal view returns (Canvas storage) {
        require(_canvasId < canvases.length);
        return canvases[_canvasId];
    }

    function _createCanvasInternal(address _bookedFor) private returns (uint canvasId) {
        require(canvases.length < MAX_CANVAS_COUNT);
        require(activeCanvasCount < MAX_ACTIVE_CANVAS);

        uint id = canvases.push(Canvas(STATE_NOT_FINISHED, 0x0, _bookedFor, "", 0, 0, false)) - 1;

        emit CanvasCreated(id, _bookedFor);
        activeCanvasCount++;

        _onCanvasCreated(id);

        return id;
    }

    function _onCanvasCreated(uint /* _canvasId */) internal {}

    /**
    * Sets the pixel.
    */
    function _setPixelInternal(Canvas storage _canvas, uint32 _canvasId, uint32 _index, uint8 _color)
    private
    notFinished(_canvasId)
    validPixelIndex(_index) {
        require(_color > 0);
        require(_canvas.bookedFor == 0x0 || _canvas.bookedFor == msg.sender);
        if (_canvas.pixels[_index].painter != 0x0) {
            //it means this pixel has been already set!
            revert();
        }

        _canvas.paintedPixelsCount++;
        _canvas.addressToCount[msg.sender]++;
        _canvas.pixels[_index] = Pixel(_color, msg.sender);

        emit PixelPainted(_canvasId, _index, _color, msg.sender);
    }

    /**
    * Marks canvas as finished if all the pixels has been already set.
    * Starts initial bidding session.
    */
    function _finishCanvasIfNeeded(Canvas storage _canvas, uint32 _canvasId) private {
        if (_isCanvasFinished(_canvas)) {
            activeCanvasCount--;
            _canvas.state = STATE_INITIAL_BIDDING;
            emit CanvasFinished(_canvasId);
        }
    }

    struct Pixel {
        uint8 color;
        address painter;
    }

    struct Canvas {
        /**
        * Map of all pixels.
        */
        mapping(uint32 => Pixel) pixels;

        uint8 state;

        /**
        * Owner of canvas. Canvas doesn't have an owner until initial bidding ends.
        */
        address owner;

        /**
        * Booked by this address. It means that only that address can draw on the canvas.
        * 0x0 if everybody can paint on the canvas.
        */
        address bookedFor;

        string name;

        /**
        * Numbers of pixels set. Canvas will be considered finished when all pixels will be set.
        * Technically it means that setPixelsCount == PIXEL_COUNT
        */
        uint32 paintedPixelsCount;

        mapping(address => uint32) addressToCount;


        /**
        * Initial bidding finish time.
        */
        uint initialBiddingFinishTime;

        /**
        * If commission from initial bidding has been paid.
        */
        bool isCommissionPaid;

        /**
        * @dev if address has been paid a reward for drawing.
        */
        mapping(address => bool) isAddressPaid;
    }
}

/**
* @notice   Useful methods to manage canvas' state.
*/
contract CanvasState is CanvasFactory {

    modifier stateBidding(uint32 _canvasId) {
        require(getCanvasState(_canvasId) == STATE_INITIAL_BIDDING);
        _;
    }

    modifier stateOwned(uint32 _canvasId) {
        require(getCanvasState(_canvasId) == STATE_OWNED);
        _;
    }

    /**
    * Ensures that canvas's saved state is STATE_OWNED.
    *
    * Because initial bidding is based on current time, we had to find a way to
    * trigger saving new canvas state. Every transaction (not a call) that
    * requires state owned should use it modifier as a last one.
    *
    * Thank's to that, we can make sure, that canvas state gets updated.
    */
    modifier forceOwned(uint32 _canvasId) {
        Canvas storage canvas = _getCanvas(_canvasId);
        if (canvas.state != STATE_OWNED) {
            canvas.state = STATE_OWNED;
        }
        _;
    }

    /**
    * @notice   Returns current canvas state.
    */
    function getCanvasState(uint32 _canvasId) public view returns (uint8) {
        Canvas storage canvas = _getCanvas(_canvasId);
        if (canvas.state != STATE_INITIAL_BIDDING) {
            //if state is set to owned, or not finished
            //it means it doesn't depend on current time -
            //we don't have to double check
            return canvas.state;
        }

        //state initial bidding - as that state depends on
        //current time, we have to double check if initial bidding
        //hasn't finish yet
        uint finishTime = canvas.initialBiddingFinishTime;
        if (finishTime == 0 || finishTime > getTime()) {
            return STATE_INITIAL_BIDDING;

        } else {
            return STATE_OWNED;
        }
    }

    /**
    * @notice   Returns all canvas' id for a given state.
    */
    function getCanvasByState(uint8 _state) external view returns (uint32[]) {
        uint size;
        if (_state == STATE_NOT_FINISHED) {
            size = activeCanvasCount;
        } else {
            size = getCanvasCount() - activeCanvasCount;
        }

        uint32[] memory result = new uint32[](size);
        uint currentIndex = 0;

        for (uint32 i = 0; i < canvases.length; i++) {
            if (getCanvasState(i) == _state) {
                result[currentIndex] = i;
                currentIndex++;
            }
        }

        return _slice(result, 0, currentIndex);
    }

    /**
    * Sets canvas name. Only for the owner of the canvas. Name can be an empty
    * string which is the same as lack of the name.
    */
    function setCanvasName(uint32 _canvasId, string _name) external
    stateOwned(_canvasId)
    forceOwned(_canvasId)
    {
        bytes memory _strBytes = bytes(_name);
        require(_strBytes.length <= MAX_CANVAS_NAME_LENGTH);

        Canvas storage _canvas = _getCanvas(_canvasId);
        require(msg.sender == _canvas.owner);

        _canvas.name = _name;
        emit CanvasNameSet(_canvasId, _name);
    }

    /**
    * @dev  Slices array from start (inclusive) to end (exclusive).
    *       Doesn't modify input array.
    */
    function _slice(uint32[] memory _array, uint _start, uint _end) internal pure returns (uint32[]) {
        require(_start <= _end);

        if (_start == 0 && _end == _array.length) {
            return _array;
        }

        uint size = _end - _start;
        uint32[] memory sliced = new uint32[](size);

        for (uint i = 0; i < size; i++) {
            sliced[i] = _array[i + _start];
        }

        return sliced;
    }

}

/**
* @notice   Keeps track of all rewards and commissions.
*           Commission - fee that we charge for using CryptoCanvas.
*           Reward - painters cut.
*/
contract RewardableCanvas is CanvasState {

    /**
    * As it's hard to operate on floating numbers, each fee will be calculated like this:
    * PRICE * COMMISSION / COMMISSION_DIVIDER. It's impossible to keep float number here.
    *
    * ufixed COMMISSION = 0.039; may seem useful, but it's not possible to multiply ufixed * uint.
    */
    uint public constant COMMISSION = 39;
    uint public constant TRADE_REWARD = 61;
    uint public constant PERCENT_DIVIDER = 1000;

    event RewardAddedToWithdrawals(uint32 indexed canvasId, address indexed toAddress, uint amount);
    event CommissionAddedToWithdrawals(uint32 indexed canvasId, uint amount);
    event FeesUpdated(uint32 indexed canvasId, uint totalCommissions, uint totalReward);

    mapping(uint => FeeHistory) private canvasToFeeHistory;

    /**
    * @notice   Adds all unpaid commission to the owner's pending withdrawals.
    *           Ethers to withdraw has to be greater that 0, otherwise transaction
    *           will be rejected.
    *           Can be called only by the owner.
    */
    function addCommissionToPendingWithdrawals(uint32 _canvasId)
    public
    onlyOwner
    stateOwned(_canvasId)
    forceOwned(_canvasId) {
        FeeHistory storage _history = _getFeeHistory(_canvasId);
        uint _toWithdraw = calculateCommissionToWithdraw(_canvasId);
        uint _lastIndex = _history.commissionCumulative.length - 1;
        require(_toWithdraw > 0);

        _history.paidCommissionIndex = _lastIndex;
        addPendingWithdrawal(owner, _toWithdraw);

        emit CommissionAddedToWithdrawals(_canvasId, _toWithdraw);
    }

    /**
    * @notice   Adds all unpaid rewards of the caller to his pending withdrawals.
    *           Ethers to withdraw has to be greater that 0, otherwise transaction
    *           will be rejected.
    */
    function addRewardToPendingWithdrawals(uint32 _canvasId)
    public
    stateOwned(_canvasId)
    forceOwned(_canvasId) {
        FeeHistory storage _history = _getFeeHistory(_canvasId);
        uint _toWithdraw;
        (_toWithdraw,) = calculateRewardToWithdraw(_canvasId, msg.sender);
        uint _lastIndex = _history.rewardsCumulative.length - 1;
        require(_toWithdraw > 0);

        _history.addressToPaidRewardIndex[msg.sender] = _lastIndex;
        addPendingWithdrawal(msg.sender, _toWithdraw);

        emit RewardAddedToWithdrawals(_canvasId, msg.sender, _toWithdraw);
    }

    /**
    * @notice   Calculates how much of commission there is to be paid.
    */
    function calculateCommissionToWithdraw(uint32 _canvasId)
    public
    view
    stateOwned(_canvasId)
    returns (uint)
    {
        FeeHistory storage _history = _getFeeHistory(_canvasId);
        uint _lastIndex = _history.commissionCumulative.length - 1;
        uint _lastPaidIndex = _history.paidCommissionIndex;

        if (_lastIndex < 0) {
            //means that FeeHistory hasn't been created yet
            return 0;
        }

        uint _commissionSum = _history.commissionCumulative[_lastIndex];
        uint _lastWithdrawn = _history.commissionCumulative[_lastPaidIndex];

        uint _toWithdraw = _commissionSum - _lastWithdrawn;
        require(_toWithdraw <= _commissionSum);

        return _toWithdraw;
    }

    /**
    * @notice   Calculates unpaid rewards of a given address. Returns amount to withdraw
    *           and amount of pixels owned.
    */
    function calculateRewardToWithdraw(uint32 _canvasId, address _address)
    public
    view
    stateOwned(_canvasId)
    returns (
        uint reward,
        uint pixelsOwned
    )
    {
        FeeHistory storage _history = _getFeeHistory(_canvasId);
        uint _lastIndex = _history.rewardsCumulative.length - 1;
        uint _lastPaidIndex = _history.addressToPaidRewardIndex[_address];
        uint _pixelsOwned = getPaintedPixelsCountByAddress(_address, _canvasId);

        if (_lastIndex < 0) {
            //means that FeeHistory hasn't been created yet
            return (0, _pixelsOwned);
        }

        uint _rewardsSum = _history.rewardsCumulative[_lastIndex];
        uint _lastWithdrawn = _history.rewardsCumulative[_lastPaidIndex];

        // Our data structure guarantees that _commissionSum is greater or equal to _lastWithdrawn
        uint _toWithdraw = ((_rewardsSum - _lastWithdrawn) / PIXEL_COUNT) * _pixelsOwned;

        return (_toWithdraw, _pixelsOwned);
    }

    /**
    * @notice   Returns total amount of commission charged for a given canvas.
    *           It is not a commission to be withdrawn!
    */
    function getTotalCommission(uint32 _canvasId) external view returns (uint) {
        require(_canvasId < canvases.length);
        FeeHistory storage _history = canvasToFeeHistory[_canvasId];
        uint _lastIndex = _history.commissionCumulative.length - 1;

        if (_lastIndex < 0) {
            //means that FeeHistory hasn't been created yet
            return 0;
        }

        return _history.commissionCumulative[_lastIndex];
    }

    /**
    * @notice   Returns total amount of commission that has been already
    *           paid (added to pending withdrawals).
    */
    function getCommissionWithdrawn(uint32 _canvasId) external view returns (uint) {
        require(_canvasId < canvases.length);
        FeeHistory storage _history = canvasToFeeHistory[_canvasId];
        uint _index = _history.paidCommissionIndex;

        return _history.commissionCumulative[_index];
    }

    /**
    * @notice   Returns all rewards charged for the given canvas.
    */
    function getTotalRewards(uint32 _canvasId) external view returns (uint) {
        require(_canvasId < canvases.length);
        FeeHistory storage _history = canvasToFeeHistory[_canvasId];
        uint _lastIndex = _history.rewardsCumulative.length - 1;

        if (_lastIndex < 0) {
            //means that FeeHistory hasn't been created yet
            return 0;
        }

        return _history.rewardsCumulative[_lastIndex];
    }

    /**
    * @notice   Returns total amount of rewards that has been already
    *           paid (added to pending withdrawals) by a given address.
    */
    function getRewardsWithdrawn(uint32 _canvasId, address _address) external view returns (uint) {
        require(_canvasId < canvases.length);
        FeeHistory storage _history = canvasToFeeHistory[_canvasId];
        uint _index = _history.addressToPaidRewardIndex[_address];
        uint _pixelsOwned = getPaintedPixelsCountByAddress(_address, _canvasId);

        if (_history.rewardsCumulative.length == 0 || _index == 0) {
            return 0;
        }

        return (_history.rewardsCumulative[_index] / PIXEL_COUNT) * _pixelsOwned;
    }

    /**
    * @notice   Calculates how the initial bidding money will be split.
    *
    * @return  Commission and sum of all painter rewards.
    */
    function splitBid(uint _amount) public pure returns (
        uint commission,
        uint paintersRewards
    ){
        uint _rewardPerPixel = ((_amount - _calculatePercent(_amount, COMMISSION))) / PIXEL_COUNT;
        // Rewards is divisible by PIXEL_COUNT
        uint _rewards = _rewardPerPixel * PIXEL_COUNT;

        return (_amount - _rewards, _rewards);
    }

    /**
    * @notice   Calculates how the money from selling canvas will be split.
    *
    * @return  Commission, sum of painters' rewards and a seller's profit.
    */
    function splitTrade(uint _amount) public pure returns (
        uint commission,
        uint paintersRewards,
        uint sellerProfit
    ){
        uint _commission = _calculatePercent(_amount, COMMISSION);

        // We make sure that painters reward is divisible by PIXEL_COUNT.
        // It is important to split reward across all the painters equally.
        uint _rewardPerPixel = _calculatePercent(_amount, TRADE_REWARD) / PIXEL_COUNT;
        uint _paintersReward = _rewardPerPixel * PIXEL_COUNT;

        uint _sellerProfit = _amount - _commission - _paintersReward;

        //check for the underflow
        require(_sellerProfit < _amount);

        return (_commission, _paintersReward, _sellerProfit);
    }

    /**
    * @notice   Adds a bid to fee history. Doesn't perform any checks if the bid is valid!
    * @return  Returns how the bid was split. Same value as _splitBid function.
    */
    function _registerBid(uint32 _canvasId, uint _amount) internal stateBidding(_canvasId) returns (
        uint commission,
        uint paintersRewards
    ){
        uint _commission;
        uint _rewards;
        (_commission, _rewards) = splitBid(_amount);

        FeeHistory storage _history = _getFeeHistory(_canvasId);
        // We have to save the difference between new bid and a previous one.
        // Because we save data as cumulative sum, it's enough to save
        // only the new value.

        _history.commissionCumulative.push(_commission);
        _history.rewardsCumulative.push(_rewards);

        return (_commission, _rewards);
    }

    /**
    * @notice   Adds a bid to fee history. Doesn't perform any checks if the bid is valid!
    * @return  Returns how the trade ethers were split. Same value as splitTrade function.
    */
    function _registerTrade(uint32 _canvasId, uint _amount)
    internal
    stateOwned(_canvasId)
    forceOwned(_canvasId)
    returns (
        uint commission,
        uint paintersRewards,
        uint sellerProfit
    ){
        uint _commission;
        uint _rewards;
        uint _sellerProfit;
        (_commission, _rewards, _sellerProfit) = splitTrade(_amount);

        FeeHistory storage _history = _getFeeHistory(_canvasId);
        _pushCumulative(_history.commissionCumulative, _commission);
        _pushCumulative(_history.rewardsCumulative, _rewards);

        return (_commission, _rewards, _sellerProfit);
    }

    function _onCanvasCreated(uint _canvasId) internal {
        //we create a fee entrance on the moment canvas is created
        canvasToFeeHistory[_canvasId] = FeeHistory(new uint[](1), new uint[](1), 0);
    }

    /**
    * @notice   Gets a fee history of a canvas.
    */
    function _getFeeHistory(uint32 _canvasId) private view returns (FeeHistory storage) {
        require(_canvasId < canvases.length);
        //fee history entry is created in onCanvasCreated() method.

        FeeHistory storage _history = canvasToFeeHistory[_canvasId];
        return _history;
    }

    function _pushCumulative(uint[] storage _array, uint _value) private returns (uint) {
        uint _lastValue = _array[_array.length - 1];
        uint _newValue = _lastValue + _value;
        //overflow protection
        require(_newValue >= _lastValue);
        return _array.push(_newValue);
    }

    /**
    * @param    _percent - percent value mapped to scale [0-1000]
    */
    function _calculatePercent(uint _amount, uint _percent) private pure returns (uint) {
        return (_amount * _percent) / PERCENT_DIVIDER;
    }

    struct FeeHistory {

        /**
        * @notice   Cumulative sum of all charged commissions.
        */
        uint[] commissionCumulative;

        /**
        * @notice   Cumulative sum of all charged rewards.
        */
        uint[] rewardsCumulative;

        /**
        * Index of last paid commission (from commissionCumulative array)
        */
        uint paidCommissionIndex;

        /**
        * Mapping showing what rewards has been already paid.
        */
        mapping(address => uint) addressToPaidRewardIndex;

    }

}

/**
* @dev This contract takes care of initial bidding.
*/
contract BiddableCanvas is RewardableCanvas {

    uint public constant BIDDING_DURATION = 48 hours;

    mapping(uint32 => Bid) bids;
    mapping(address => uint32) addressToCount;

    uint public minimumBidAmount = 0.1 ether;

    event BidPosted(uint32 indexed canvasId, address indexed bidder, uint amount, uint finishTime);

    /**
    * Places bid for canvas that is in the state STATE_INITIAL_BIDDING.
    * If somebody is outbid his pending withdrawals will be to topped up.
    */
    function makeBid(uint32 _canvasId) external payable stateBidding(_canvasId) {
        Canvas storage canvas = _getCanvas(_canvasId);
        Bid storage oldBid = bids[_canvasId];

        if (msg.value < minimumBidAmount || msg.value <= oldBid.amount) {
            revert();
        }

        if (oldBid.bidder != 0x0 && oldBid.amount > 0) {
            //return old bidder his money
            addPendingWithdrawal(oldBid.bidder, oldBid.amount);
        }

        uint finishTime = canvas.initialBiddingFinishTime;
        if (finishTime == 0) {
            canvas.initialBiddingFinishTime = getTime() + BIDDING_DURATION;
        }

        bids[_canvasId] = Bid(msg.sender, msg.value);

        if (canvas.owner != 0x0) {
            addressToCount[canvas.owner]--;
        }
        canvas.owner = msg.sender;
        addressToCount[msg.sender]++;

        _registerBid(_canvasId, msg.value);

        emit BidPosted(_canvasId, msg.sender, msg.value, canvas.initialBiddingFinishTime);
    }

    /**
    * @notice   Returns last bid for canvas. If the initial bidding has been
    *           already finished that will be winning offer.
    */
    function getLastBidForCanvas(uint32 _canvasId) external view returns (
        uint32 canvasId,
        address bidder,
        uint amount,
        uint finishTime
    ) {
        Bid storage bid = bids[_canvasId];
        Canvas storage canvas = _getCanvas(_canvasId);

        return (_canvasId, bid.bidder, bid.amount, canvas.initialBiddingFinishTime);
    }

    /**
    * @notice   Returns number of canvases owned by the given address.
    */
    function balanceOf(address _owner) external view returns (uint) {
        return addressToCount[_owner];
    }

    /**
    * @notice   Only for the owner of the contract. Sets minimum bid amount.
    */
    function setMinimumBidAmount(uint _amount) external onlyOwner {
        minimumBidAmount = _amount;
    }

    struct Bid {
        address bidder;
        uint amount;
    }

}

/**
* @dev  This contract takes trading our artworks. Trading can happen
*       if artwork has been initially bought.
*/
contract CanvasMarket is BiddableCanvas {

    mapping(uint32 => SellOffer) canvasForSale;
    mapping(uint32 => BuyOffer) buyOffers;

    event CanvasOfferedForSale(uint32 indexed canvasId, uint minPrice, address indexed from, address indexed to);
    event SellOfferCancelled(uint32 indexed canvasId, uint minPrice, address indexed from, address indexed to);
    event CanvasSold(uint32 indexed canvasId, uint amount, address indexed from, address indexed to);
    event BuyOfferMade(uint32 indexed canvasId, address indexed buyer, uint amount);
    event BuyOfferCancelled(uint32 indexed canvasId, address indexed buyer, uint amount);

    struct SellOffer {
        bool isForSale;
        address seller;
        uint minPrice;
        address onlySellTo;     // specify to sell only to a specific address
    }

    struct BuyOffer {
        bool hasOffer;
        address buyer;
        uint amount;
    }

    /**
    * @notice   Buy artwork. Artwork has to be put on sale. If buyer has bid before for
    *           that artwork, that bid will be canceled.
    */
    function acceptSellOffer(uint32 _canvasId)
    external
    payable
    stateOwned(_canvasId)
    forceOwned(_canvasId) {

        Canvas storage canvas = _getCanvas(_canvasId);
        SellOffer memory sellOffer = canvasForSale[_canvasId];

        require(msg.sender != canvas.owner);
        //don't sell for the owner
        require(sellOffer.isForSale);
        require(msg.value >= sellOffer.minPrice);
        require(sellOffer.seller == canvas.owner);
        //seller is no longer owner
        require(sellOffer.onlySellTo == 0x0 || sellOffer.onlySellTo == msg.sender);
        //protect from selling to unintended address

        uint toTransfer;
        (, ,toTransfer) = _registerTrade(_canvasId, msg.value);

        addPendingWithdrawal(sellOffer.seller, toTransfer);

        addressToCount[canvas.owner]--;
        addressToCount[msg.sender]++;

        canvas.owner = msg.sender;
        _cancelSellOfferInternal(_canvasId, false);

        emit CanvasSold(_canvasId, msg.value, sellOffer.seller, msg.sender);

        //If the buyer have placed buy offer, refund it
        BuyOffer memory offer = buyOffers[_canvasId];
        if (offer.buyer == msg.sender) {
            buyOffers[_canvasId] = BuyOffer(false, 0x0, 0);
            if (offer.amount > 0) {
                //refund offer
                addPendingWithdrawal(offer.buyer, offer.amount);
            }
        }

    }

    /**
    * @notice   Offer canvas for sale for a minimal price.
    *           Anybody can buy it for an amount grater or equal to min price.
    */
    function offerCanvasForSale(uint32 _canvasId, uint _minPrice) external {
        _offerCanvasForSaleInternal(_canvasId, _minPrice, 0x0);
    }

    /**
    * @notice   Offer canvas for sale to a given address. Only that address
    *           is allowed to buy canvas for an amount grater or equal
    *           to minimal price.
    */
    function offerCanvasForSaleToAddress(uint32 _canvasId, uint _minPrice, address _receiver) external {
        _offerCanvasForSaleInternal(_canvasId, _minPrice, _receiver);
    }

    /**
    * @notice   Cancels previously made sell offer. Caller has to be an owner
    *           of the canvas. Function will fail if there is no sell offer
    *           for the canvas.
    */
    function cancelSellOffer(uint32 _canvasId) external {
        _cancelSellOfferInternal(_canvasId, true);
    }

    /**
    * @notice   Places buy offer for the canvas. It cannot be called by the owner of the canvas.
    *           New offer has to be bigger than existing offer. Returns ethers to the previous
    *           bidder, if any.
    */
    function makeBuyOffer(uint32 _canvasId) external payable stateOwned(_canvasId) forceOwned(_canvasId) {
        Canvas storage canvas = _getCanvas(_canvasId);
        BuyOffer storage existing = buyOffers[_canvasId];

        require(canvas.owner != msg.sender);
        require(canvas.owner != 0x0);
        require(msg.value > existing.amount);

        if (existing.amount > 0) {
            //refund previous buy offer.
            addPendingWithdrawal(existing.buyer, existing.amount);
        }

        buyOffers[_canvasId] = BuyOffer(true, msg.sender, msg.value);
        emit BuyOfferMade(_canvasId, msg.sender, msg.value);
    }

    /**
    * @notice   Cancels previously made buy offer. Caller has to be an author
    *           of the offer.
    */
    function cancelBuyOffer(uint32 _canvasId) external stateOwned(_canvasId) forceOwned(_canvasId) {
        BuyOffer memory offer = buyOffers[_canvasId];
        require(offer.buyer == msg.sender);

        buyOffers[_canvasId] = BuyOffer(false, 0x0, 0);
        if (offer.amount > 0) {
            //refund offer
            addPendingWithdrawal(offer.buyer, offer.amount);
        }

        emit BuyOfferCancelled(_canvasId, offer.buyer, offer.amount);
    }

    /**
    * @notice   Accepts buy offer for the canvas. Caller has to be the owner
    *           of the canvas. You can specify minimal price, which is the
    *           protection against accidental calls.
    */
    function acceptBuyOffer(uint32 _canvasId, uint _minPrice) external stateOwned(_canvasId) forceOwned(_canvasId) {
        Canvas storage canvas = _getCanvas(_canvasId);
        require(canvas.owner == msg.sender);

        BuyOffer memory offer = buyOffers[_canvasId];
        require(offer.hasOffer);
        require(offer.amount > 0);
        require(offer.buyer != 0x0);
        require(offer.amount >= _minPrice);

        uint toTransfer;
        (, ,toTransfer) = _registerTrade(_canvasId, offer.amount);

        addressToCount[canvas.owner]--;
        addressToCount[offer.buyer]++;

        canvas.owner = offer.buyer;
        addPendingWithdrawal(msg.sender, toTransfer);

        buyOffers[_canvasId] = BuyOffer(false, 0x0, 0);
        canvasForSale[_canvasId] = SellOffer(false, 0x0, 0, 0x0);

        emit CanvasSold(_canvasId, offer.amount, msg.sender, offer.buyer);
    }

    /**
    * @notice   Returns current buy offer for the canvas.
    */
    function getCurrentBuyOffer(uint32 _canvasId)
    external
    view
    returns (bool hasOffer, address buyer, uint amount) {
        BuyOffer storage offer = buyOffers[_canvasId];
        return (offer.hasOffer, offer.buyer, offer.amount);
    }

    /**
    * @notice   Returns current sell offer for the canvas.
    */
    function getCurrentSellOffer(uint32 _canvasId)
    external
    view
    returns (bool isForSale, address seller, uint minPrice, address onlySellTo) {

        SellOffer storage offer = canvasForSale[_canvasId];
        return (offer.isForSale, offer.seller, offer.minPrice, offer.onlySellTo);
    }

    function _offerCanvasForSaleInternal(uint32 _canvasId, uint _minPrice, address _receiver)
    private
    stateOwned(_canvasId)
    forceOwned(_canvasId) {

        Canvas storage canvas = _getCanvas(_canvasId);
        require(canvas.owner == msg.sender);
        require(_receiver != canvas.owner);

        canvasForSale[_canvasId] = SellOffer(true, msg.sender, _minPrice, _receiver);
        emit CanvasOfferedForSale(_canvasId, _minPrice, msg.sender, _receiver);
    }

    function _cancelSellOfferInternal(uint32 _canvasId, bool emitEvent)
    private
    stateOwned(_canvasId)
    forceOwned(_canvasId) {

        Canvas storage canvas = _getCanvas(_canvasId);
        SellOffer memory oldOffer = canvasForSale[_canvasId];

        require(canvas.owner == msg.sender);
        require(oldOffer.isForSale);
        //don't allow to cancel if there is no offer

        canvasForSale[_canvasId] = SellOffer(false, msg.sender, 0, 0x0);

        if (emitEvent) {
            emit SellOfferCancelled(_canvasId, oldOffer.minPrice, oldOffer.seller, oldOffer.onlySellTo);
        }
    }

}

contract CryptoArt is CanvasMarket {

    function getCanvasInfo(uint32 _canvasId) external view returns (
        uint32 id,
        string name,
        uint32 paintedPixels,
        uint8 canvasState,
        uint initialBiddingFinishTime,
        address owner,
        address bookedFor
    ) {
        Canvas storage canvas = _getCanvas(_canvasId);

        return (_canvasId, canvas.name, canvas.paintedPixelsCount, getCanvasState(_canvasId),
        canvas.initialBiddingFinishTime, canvas.owner, canvas.bookedFor);
    }

    function getCanvasByOwner(address _owner) external view returns (uint32[]) {
        uint32[] memory result = new uint32[](canvases.length);
        uint currentIndex = 0;

        for (uint32 i = 0; i < canvases.length; i++) {
            if (getCanvasState(i) == STATE_OWNED) {
                Canvas storage canvas = _getCanvas(i);
                if (canvas.owner == _owner) {
                    result[currentIndex] = i;
                    currentIndex++;
                }
            }
        }

        return _slice(result, 0, currentIndex);
    }

    /**
    * @notice   Returns array of canvas's ids. Returned canvases have sell offer.
    *           If includePrivateOffers is true, includes offers that are targeted
    *           only to one specified address.
    */
    function getCanvasesWithSellOffer(bool includePrivateOffers) external view returns (uint32[]) {
        uint32[] memory result = new uint32[](canvases.length);
        uint currentIndex = 0;

        for (uint32 i = 0; i < canvases.length; i++) {
            SellOffer storage offer = canvasForSale[i];
            if (offer.isForSale && (includePrivateOffers || offer.onlySellTo == 0x0)) {
                result[currentIndex] = i;
                currentIndex++;
            }
        }

        return _slice(result, 0, currentIndex);
    }

    /**
    * @notice   Returns array of all the owners of all of pixels. If some pixel hasn't
    *           been painted yet, 0x0 address will be returned.
    */
    function getCanvasPainters(uint32 _canvasId) external view returns (address[]) {
        Canvas storage canvas = _getCanvas(_canvasId);
        address[] memory result = new address[](PIXEL_COUNT);

        for (uint32 i = 0; i < PIXEL_COUNT; i++) {
            result[i] = canvas.pixels[i].painter;
        }

        return result;
    }

}

Contract Security Audit

Contract ABI

API
[{"constant":true,"inputs":[],"name":"BIDDING_DURATION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getTotalRewards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PIXEL_COUNT","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCommissionWithdrawn","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCanvasPainters","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_minPrice","type":"uint256"}],"name":"offerCanvasForSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"},{"name":"_canvasId","type":"uint32"}],"name":"getPaintedPixelsCountByAddress","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERCENT_DIVIDER","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCanvasCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_amount","type":"uint256"}],"name":"splitBid","outputs":[{"name":"commission","type":"uint256"},{"name":"paintersRewards","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getTotalCommission","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCanvasState","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_CANVAS_NAME_LENGTH","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimumBidAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCurrentSellOffer","outputs":[{"name":"isForSale","type":"bool"},{"name":"seller","type":"address"},{"name":"minPrice","type":"uint256"},{"name":"onlySellTo","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"isCanvasFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"activeCanvasCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"setMinimumBidAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"COMMISSION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_ACTIVE_CANVAS","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"STATE_NOT_FINISHED","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_address","type":"address"}],"name":"calculateRewardToWithdraw","outputs":[{"name":"reward","type":"uint256"},{"name":"pixelsOwned","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"HEIGHT","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_bookFor","type":"address"}],"name":"createAndBookCanvas","outputs":[{"name":"canvasId","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCurrentBuyOffer","outputs":[{"name":"hasOffer","type":"bool"},{"name":"buyer","type":"address"},{"name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_CANVAS_COUNT","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPixelCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"acceptSellOffer","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"getPendingWithdrawal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_state","type":"uint8"}],"name":"getCanvasByState","outputs":[{"name":"","type":"uint32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_indexes","type":"uint32[]"},{"name":"_colors","type":"uint8[]"}],"name":"setPixels","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"getCanvasByOwner","outputs":[{"name":"","type":"uint32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"addRewardToPendingWithdrawals","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"makeBid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"cancelBuyOffer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"STATE_OWNED","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_index","type":"uint32"},{"name":"_color","type":"uint8"}],"name":"setPixel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_minPrice","type":"uint256"}],"name":"acceptBuyOffer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCanvasBitmap","outputs":[{"name":"","type":"uint8[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_amount","type":"uint256"}],"name":"splitTrade","outputs":[{"name":"commission","type":"uint256"},{"name":"paintersRewards","type":"uint256"},{"name":"sellerProfit","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getLastBidForCanvas","outputs":[{"name":"canvasId","type":"uint32"},{"name":"bidder","type":"address"},{"name":"amount","type":"uint256"},{"name":"finishTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_bookFor","type":"address"}],"name":"bookCanvasFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"calculateCommissionToWithdraw","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"makeBuyOffer","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"includePrivateOffers","type":"bool"}],"name":"getCanvasesWithSellOffer","outputs":[{"name":"","type":"uint32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"cancelSellOffer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_minPrice","type":"uint256"},{"name":"_receiver","type":"address"}],"name":"offerCanvasForSaleToAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"WIDTH","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"STATE_INITIAL_BIDDING","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_address","type":"address"}],"name":"getRewardsWithdrawn","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"addCommissionToPendingWithdrawals","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCanvasInfo","outputs":[{"name":"id","type":"uint32"},{"name":"name","type":"string"},{"name":"paintedPixels","type":"uint32"},{"name":"canvasState","type":"uint8"},{"name":"initialBiddingFinishTime","type":"uint256"},{"name":"owner","type":"address"},{"name":"bookedFor","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"}],"name":"getCanvasPaintedPixelsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"createCanvas","outputs":[{"name":"canvasId","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"TRADE_REWARD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_name","type":"string"}],"name":"setCanvasName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_canvasId","type":"uint32"},{"name":"_pixelIndex","type":"uint32"}],"name":"getPixelAuthor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":false,"name":"minPrice","type":"uint256"},{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"}],"name":"CanvasOfferedForSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":false,"name":"minPrice","type":"uint256"},{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"}],"name":"SellOfferCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"}],"name":"CanvasSold","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"BuyOfferMade","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"BuyOfferCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":true,"name":"bidder","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"finishTime","type":"uint256"}],"name":"BidPosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":true,"name":"toAddress","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RewardAddedToWithdrawals","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"CommissionAddedToWithdrawals","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":false,"name":"totalCommissions","type":"uint256"},{"indexed":false,"name":"totalReward","type":"uint256"}],"name":"FeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"},{"indexed":false,"name":"index","type":"uint32"},{"indexed":false,"name":"color","type":"uint8"},{"indexed":true,"name":"painter","type":"address"}],"name":"PixelPainted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint32"}],"name":"CanvasFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint256"},{"indexed":true,"name":"bookedFor","type":"address"}],"name":"CanvasCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"canvasId","type":"uint256"},{"indexed":false,"name":"name","type":"string"}],"name":"CanvasNameSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"receiver","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"oldBalance","type":"uint256"},{"indexed":false,"name":"newBalance","type":"uint256"}],"name":"BalanceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

60806040526003805463ffffffff1916905567016345785d8a000060075560008054600160a060020a0319163317905561378b8061003e6000396000f3006080604052600436106102de5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662a0190e81146102e35780630ab85a101461030a5780630c9fe5eb146103285780631359cb2c146103565780631373083814610374578063286b583b146103e257806329ac4b591461040557806329fc7bd81461042f5780632c54e6d914610444578063304f34a0146104595780633ccfd60b1461048a5780634484d92b1461049f578063477a7042146104bd578063489e5656146104f1578063493997291461050657806349b6313c1461051b5780634bdfbb751461056c5780634d95c76c1461059e5780635130b405146105b3578063557ed1ba146105cb578063562df3d5146105e0578063604ce56c146105f5578063621a61ac1461060a578063668cf86a1461061f57806369ea80d5146106495780636d94dce11461065e57806370a082311461067f578063754d71e7146106a057806377b1b2eb146106e65780637be8352e146106fb5780637e6e65f3146107105780637ee8b2f8146107215780637fbea9551461074257806388c9a7d51461075d5780638da5cb5b146107935780639f572048146107c4578063a2b6f0ec146107e5578063a350539e14610803578063a4ab69cd14610814578063a6e7f40914610832578063aacdb27b14610847578063aaf4783514610871578063abb4339714610892578063ac4501d9146108b0578063ae7ed04c146108e6578063b3f0807814610939578063bd64635614610963578063bd9e6bfc14610981578063c9f8cf2014610992578063ca5397c7146109ac578063ce4a6f09146109ca578063d44d339414610649578063d4bffa5a146109f7578063d564835814610a0c578063d672100014610a36578063d90cdfb414610a54578063d9bc987314610b2d578063e9ceef5014610b4b578063f18166c214610b60578063f2fde38b14610b75578063fab825c614610b96578063fbebc9af14610bc0575b600080fd5b3480156102ef57600080fd5b506102f8610be4565b60408051918252519081900360200190f35b34801561031657600080fd5b506102f863ffffffff60043516610beb565b34801561033457600080fd5b5061033d610c60565b6040805163ffffffff9092168252519081900360200190f35b34801561036257600080fd5b506102f863ffffffff60043516610c66565b34801561038057600080fd5b5061039263ffffffff60043516610cab565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103ce5781810151838201526020016103b6565b505050509050019250505060405180910390f35b3480156103ee57600080fd5b5061040363ffffffff60043516602435610d52565b005b34801561041157600080fd5b5061033d600160a060020a036004351663ffffffff60243516610d62565b34801561043b57600080fd5b506102f8610d9a565b34801561045057600080fd5b506102f8610da0565b34801561046557600080fd5b50610471600435610da7565b6040805192835260208301919091528051918290030190f35b34801561049657600080fd5b50610403610dd6565b3480156104ab57600080fd5b506102f863ffffffff60043516610e9f565b3480156104c957600080fd5b506104db63ffffffff60043516610efa565b6040805160ff9092168252519081900360200190f35b3480156104fd57600080fd5b506104db610f5a565b34801561051257600080fd5b506102f8610f5f565b34801561052757600080fd5b5061053963ffffffff60043516610f65565b604080519415158552600160a060020a039384166020860152848101929092529091166060830152519081900360800190f35b34801561057857600080fd5b5061058a63ffffffff60043516610fa3565b604080519115158252519081900360200190f35b3480156105aa57600080fd5b5061033d6110b3565b3480156105bf57600080fd5b506104036004356110bf565b3480156105d757600080fd5b506102f86110db565b3480156105ec57600080fd5b506102f86110df565b34801561060157600080fd5b506104db6110e4565b34801561061657600080fd5b506104db6110e9565b34801561062b57600080fd5b5061047163ffffffff60043516600160a060020a03602435166110ee565b34801561065557600080fd5b506104db6111cb565b34801561066a57600080fd5b506102f8600160a060020a03600435166111d0565b34801561068b57600080fd5b506102f8600160a060020a03600435166111f1565b3480156106ac57600080fd5b506106be63ffffffff60043516611212565b604080519315158452600160a060020a03909216602084015282820152519081900360600190f35b3480156106f257600080fd5b5061033d610d9a565b34801561070757600080fd5b506102f8611245565b61040363ffffffff6004351661124b565b34801561072d57600080fd5b506102f8600160a060020a036004351661156f565b34801561074e57600080fd5b5061039260ff6004351661158a565b34801561076957600080fd5b506104036004803563ffffffff169060248035808201929081013591604435908101910135611664565b34801561079f57600080fd5b506107a861175c565b60408051600160a060020a039092168252519081900360200190f35b3480156107d057600080fd5b50610392600160a060020a036004351661176b565b3480156107f157600080fd5b5061040363ffffffff6004351661183c565b61040363ffffffff6004351661191c565b34801561082057600080fd5b5061040363ffffffff60043516611b23565b34801561083e57600080fd5b506104db611ca6565b34801561085357600080fd5b5061040363ffffffff6004358116906024351660ff60443516611cab565b34801561087d57600080fd5b5061040363ffffffff60043516602435611cd4565b34801561089e57600080fd5b5061039263ffffffff60043516612037565b3480156108bc57600080fd5b506108c86004356120c6565b60408051938452602084019290925282820152519081900360600190f35b3480156108f257600080fd5b5061090463ffffffff60043516612121565b6040805163ffffffff9095168552600160a060020a039093166020850152838301919091526060830152519081900360800190f35b34801561094557600080fd5b5061040363ffffffff60043516600160a060020a036024351661216f565b34801561096f57600080fd5b506102f863ffffffff600435166121c3565b61040363ffffffff6004351661226e565b34801561099e57600080fd5b5061039260043515156123f9565b3480156109b857600080fd5b5061040363ffffffff600435166124bf565b3480156109d657600080fd5b5061040363ffffffff60043516602435600160a060020a03604435166124cd565b348015610a0357600080fd5b506104db6124dd565b348015610a1857600080fd5b506102f863ffffffff60043516600160a060020a03602435166124e2565b348015610a4257600080fd5b5061040363ffffffff6004351661259d565b348015610a6057600080fd5b50610a7263ffffffff6004351661268e565b6040805163ffffffff808a16825287169181019190915260ff8516606082015260808101849052600160a060020a0380841660a0830152821660c082015260e0602080830182815289519284019290925288516101008401918a019080838360005b83811015610aec578181015183820152602001610ad4565b50505050905090810190601f168015610b195780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b348015610b3957600080fd5b5061033d63ffffffff6004351661278a565b348015610b5757600080fd5b506102f86127a5565b348015610b6c57600080fd5b506102f86127b6565b348015610b8157600080fd5b50610403600160a060020a03600435166127bb565b348015610ba257600080fd5b506104036004803563ffffffff16906024803590810191013561284f565b348015610bcc57600080fd5b506107a863ffffffff6004358116906024351661297a565b6202a30081565b6002546000908190819063ffffffff851610610c0657600080fd5b505063ffffffff821660009081526004602052604081206001810154909160001990910190811015610c3b5760009250610c59565b60018201805482908110610c4b57fe5b906000526020600020015492505b5050919050565b61090081565b6002546000908190819063ffffffff851610610c8157600080fd5b505063ffffffff8216600090815260046020526040902060028101548154829082908110610c4b57fe5b6060600060606000610cbc856129c8565b60408051610900808252620120208201909252919450602082016201200080388339019050509150600090505b61090063ffffffff82161015610d4a5763ffffffff81166000818152602085905260409020548351610100909104600160a060020a03169184918110610d2b57fe5b600160a060020a03909216602092830290910190910152600101610ce9565b509392505050565b610d5e82826000612a08565b5050565b600080610d6e836129c8565b600160a060020a038516600090815260058201602052604090205463ffffffff16925090505092915050565b6103e881565b6002545b90565b6000808080610900610dba866027612bd5565b8603811515610dc557fe5b046109000294859003959350505050565b6000610de13361156f565b905060008111610df057600080fd5b336000818152600160205260408082208290555183156108fc0291849190818181858888f19350505050158015610e2b573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a26040805182815260006020820152815133927faeeb0cb16f299136e7e5467ea84217150fe83008833064528f360cde7b7b54c3928290030190a250565b6002546000908190819063ffffffff851610610eba57600080fd5b505063ffffffff821660009081526004602052604081208054909160001990910190811015610eec5760009250610c59565b8154829082908110610c4b57fe5b6000806000610f08846129c8565b60018181015491935060ff90911614610f2a57600182015460ff169250610c59565b506006810154801580610f435750610f406110db565b81115b15610f515760019250610c59565b60029250610c59565b601881565b60075481565b63ffffffff1660009081526008602052604090208054600182015460029092015460ff821693610100909204600160a060020a039081169392911690565b60006110ad610fb1836129c8565b6040805160e08101825260018381015460ff8116835261010090819004600160a060020a03908116602080860191909152600280880154909216858701526003870180548751958116159094026000190190931691909104601f810182900482028401820190955284835292949360608601938301828280156110755780601f1061104a57610100808354040283529160200191611075565b820191906000526020600020905b81548152906001019060200180831161105857829003601f168201915b5050509183525050600482015463ffffffff1660208201526006820154604082015260079091015460ff161515606090910152612bde565b92915050565b60035463ffffffff1681565b600054600160a060020a031633146110d657600080fd5b600755565b4290565b602781565b600c81565b600081565b600080808080808080808a600261110482610efa565b60ff161461111157600080fd5b61111a8c612bef565b6001810154600160a060020a038d166000908152600383016020526040902054919950600019019750955061114f8b8d610d62565b63ffffffff169450600087101561116e576000995093975087936111bc565b6001880180548890811061117e57fe5b90600052602060002001549350876001018681548110151561119c57fe5b600091825260209091200154925084610900848603040291508185995099505b50505050505050509250929050565b603081565b60008054600160a060020a031633146111e857600080fd5b6110ad82612c21565b600160a060020a031660009081526006602052604090205463ffffffff1690565b63ffffffff166000908152600960205260409020805460019091015460ff821692610100909204600160a060020a031691565b61090090565b60006112556135d8565b600061125f6135ff565b84600261126b82610efa565b60ff161461127857600080fd5b856000611284826129c8565b600181015490915060ff166002146112a65760018101805460ff191660021790555b6112af886129c8565b63ffffffff89166000908152600860209081526040918290208251608081018452815460ff81161515825261010090819004600160a060020a0390811694830194909452600180840154958301959095526002909201548316606082015292840154939a5091985091041633141561132657600080fd5b8551151561133357600080fd5b604086015134101561134457600080fd5b60018701546020870151600160a060020a03908116610100909204161461136a57600080fd5b6060860151600160a060020a0316158061139057506060860151600160a060020a031633145b151561139b57600080fd5b6113a58834612e49565b60208901519097506113ba9250905086612edf565b6001878101805461010090819004600160a060020a0316600090815260066020526040808220805463ffffffff1980821663ffffffff928316600019018316179092553380855292842080549283169282169097011617909455825461010060a860020a03191693909102929092179055611436908990612f5a565b33600160a060020a03168660200151600160a060020a03168963ffffffff167f70fa5d525d4fdc48151e6618a1d9960a572e54b6bb139cebc47709db433d637b346040518082815260200191505060405180910390a463ffffffff88166000908152600960209081526040918290208251606081018452815460ff8116151582526101009004600160a060020a03169281018390526001909101549281019290925290945033141561156557604080516060810182526000808252602080830182815283850183815263ffffffff8e1684526009909252848320935184549151600160a060020a03166101000261010060a860020a031991151560ff19909316929092171617835551600192909201919091559085015111156115655761156584602001518560400151612edf565b5050505050505050565b600160a060020a031660009081526001602052604090205490565b6060600081818060ff861615156115ab5760035463ffffffff1693506115c0565b60035463ffffffff166115bc610da0565b0393505b836040519080825280602002602001820160405280156115ea578160200160208202803883390190505b50925060009150600090505b60025463ffffffff8216101561164e578560ff1661161382610efa565b60ff1614156116465780838381518110151561162b57fe5b63ffffffff9092166020928302909101909101526001909101905b6001016115f6565b61165a83600084613135565b9695505050505050565b600080808086851461167557600080fd5b61167e896129c8565b935060009250600091505b63ffffffff821687111561173b57836000898963ffffffff86168181106116ac57fe5b6020908102929092013563ffffffff1683525081019190915260400160002080549091506101009004600160a060020a031615156117305761172b848a8a8a63ffffffff87168181106116fb57fe5b9050602002013563ffffffff1689898763ffffffff16818110151561171c57fe5b9050602002013560ff166131f4565b600192505b600190910190611689565b82151561174757600080fd5b611751848a613371565b505050505050505050565b600054600160a060020a031681565b60608060008060006002805490506040519080825280602002602001820160405280156117a2578160200160208202803883390190505b50935060009250600091505b60025463ffffffff831610156118305760026117c983610efa565b60ff161415611825576117db826129c8565b6001810154909150600160a060020a038781166101009092041614156118255781848481518110151561180a57fe5b63ffffffff9092166020928302909101909101526001909201915b6001909101906117ae565b61165a84600085613135565b6000808083600261184c82610efa565b60ff161461185957600080fd5b846000611865826129c8565b600181015490915060ff166002146118875760018101805460ff191660021790555b61189087612bef565b955061189c87336110ee565b506001870154909550600019019350600085116118b857600080fd5b33600081815260038801602052604090208590556118d69086612edf565b604080518681529051339163ffffffff8a16917f94af59d97594c7be2f6dc00f66da665f42ee9b0bea953d993848cf8eadeed9889181900360200190a350505050505050565b6000808083600161192c82610efa565b60ff161461193957600080fd5b611942856129c8565b63ffffffff861660009081526005602052604090206007549195509350341080611970575082600101543411155b1561197a57600080fd5b8254600160a060020a031615801590611997575060008360010154115b156119b657825460018401546119b691600160a060020a031690612edf565b600684015491508115156119d7576202a3006119d06110db565b0160068501555b60408051808201825233815234602080830191825263ffffffff891660009081526005909152929092209051815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03918216178255915160019182015585015461010090041615611a7e5760018401546101009004600160a060020a03166000908152600660205260409020805463ffffffff19811663ffffffff918216600019019091161790555b6001848101805461010060a860020a031916336101008102919091179091556000908152600660205260409020805463ffffffff19811663ffffffff91821690930116919091179055611ad18534613475565b505060068401546040805134815260208101929092528051339263ffffffff8916927f3650d7c3b27153eed34d5ff83b7ec912ab40d876ba77bb57780224b7eeae689b92918290030190a35050505050565b611b2b6135ff565b816002611b3782610efa565b60ff1614611b4457600080fd5b826000611b50826129c8565b600181015490915060ff16600214611b725760018101805460ff191660021790555b63ffffffff85166000908152600960209081526040918290208251606081018452815460ff8116151582526101009004600160a060020a0316928101839052600190910154928101929092529094503314611bcc57600080fd5b604080516060810182526000808252602080830182815283850183815263ffffffff8b1684526009909252848320935184549151600160a060020a03166101000261010060a860020a031991151560ff1990931692909217161783555160019290920191909155908501511115611c4f57611c4f84602001518560400151612edf565b8360200151600160a060020a03168563ffffffff167f083061fa741b37c06e79771b36582e9da52a8b7b77333470ab3c76ab60b67d6486604001516040518082815260200191505060405180910390a35050505050565b600281565b6000611cb6846129c8565b9050611cc4818585856131f4565b611cce8185613371565b50505050565b6000611cde6135ff565b6000846002611cec82610efa565b60ff1614611cf957600080fd5b856000611d05826129c8565b600181015490915060ff16600214611d275760018101805460ff191660021790555b611d30886129c8565b60018101549096506101009004600160a060020a03163314611d5157600080fd5b63ffffffff88166000908152600960209081526040918290208251606081018452815460ff81161515808352610100909104600160a060020a03169382019390935260019091015492810192909252909550611dac57600080fd5b6040850151600010611dbd57600080fd5b6020850151600160a060020a03161515611dd657600080fd5b6040850151871115611de757600080fd5b611df5888660400151612e49565b909150905080945050600660008760010160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001908152602001600020600081819054906101000a900463ffffffff16809291906001900391906101000a81548163ffffffff021916908363ffffffff16021790555050600660008660200151600160a060020a0316600160a060020a03168152602001908152602001600020600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff1602179055505084602001518660010160016101000a815481600160a060020a030219169083600160a060020a03160217905550611f0d3385612edf565b60408051606081810183526000808352602080840182815284860183815263ffffffff8f1680855260098452878520965187549351600160a060020a0390811661010090810261010060a860020a031993151560ff19978816178416178a5593516001998a01558951608081018b52878152808701888152818c01898152998201898152858a5260088952988c9020915182549151841690960295151596169590951790911692909217835594519582019590955591516002909201805492851673ffffffffffffffffffffffffffffffffffffffff199093169290921790915588810151898501518551908152945193169333937f70fa5d525d4fdc48151e6618a1d9960a572e54b6bb139cebc47709db433d637b929181900390910190a45050505050505050565b6060600060606000612048856129c8565b60408051610900808252620120208201909252919450602082016201200080388339019050509150600090505b61090063ffffffff82161015610d4a5763ffffffff8116600081815260208590526040902054835160ff90911691849181106120ad57fe5b60ff909216602092830290910190910152600101612075565b60008060008060008060006120dc886027612bd5565b93506109006120ec89603d612bd5565b8115156120f557fe5b049250506109008202905082870381900387811061211257600080fd5b92979096509194509092505050565b63ffffffff8116600090815260056020526040812081908190819081612146876129c8565b8254600190930154600691909101549798600160a060020a039093169790965094509092505050565b60008054600160a060020a0316331461218757600080fd5b612190836129c8565b600201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0393909316929092179091555050565b60008080808080808760026121d782610efa565b60ff16146121e457600080fd5b6121ed89612bef565b80546002820154919850600019019650945060008610156122115760009750612262565b865487908790811061221f57fe5b90600052602060002001549350866000018581548110151561223d57fe5b90600052602060002001549250828403915083821115151561225e57600080fd5b8197505b50505050505050919050565b60008082600261227d82610efa565b60ff161461228a57600080fd5b836000612296826129c8565b600181015490915060ff166002146122b85760018101805460ff191660021790555b6122c1866129c8565b63ffffffff87166000908152600960205260409020600182015491965094506101009004600160a060020a03163314156122fa57600080fd5b60018501546101009004600160a060020a0316151561231857600080fd5b6001840154341161232857600080fd5b6000846001015411156123545783546001850154612354916101009004600160a060020a031690612edf565b6040805160608101825260018082523360208084018281523485870181815263ffffffff8e16600081815260098652899020975188549451600160a060020a03166101000261010060a860020a031991151560ff1990961695909517169390931787555195909401949094558451928352935190937faa04d56d11a8befe2a5c33a781e5242570c2e356412642891468181f98c6b959928290030190a3505050505050565b6060806000806000600280549050604051908082528060200260200182016040528015612430578160200160208202803883390190505b50935060009250600091505b60025463ffffffff83161015611830575063ffffffff81166000908152600860205260409020805460ff1680156124855750858061248557506002810154600160a060020a0316155b156124b45781848481518110151561249957fe5b63ffffffff9092166020928302909101909101526001909201915b60019091019061243c565b6124ca816001612f5a565b50565b6124d8838383612a08565b505050565b600181565b60025460009081908190819063ffffffff8716106124ff57600080fd5b63ffffffff86166000908152600460209081526040808320600160a060020a03891684526003810190925290912054909350915061253d8587610d62565b600184015463ffffffff9190911691501580612557575081155b156125655760009350612594565b6001830180548291610900918590811061257b57fe5b906000526020600020015481151561258f57fe5b040293505b50505092915050565b6000805481908190600160a060020a031633146125b957600080fd5b8360026125c582610efa565b60ff16146125d257600080fd5b8460006125de826129c8565b600181015490915060ff166002146126005760018101805460ff191660021790555b61260987612bef565b9550612614876121c3565b86549095506000190193506000851161262c57600080fd5b6002860184905560005461264990600160a060020a031686612edf565b60408051868152905163ffffffff8916917f07fe4955f5a29e5df9fc8015de56f3d9847da378e548baf0cdb1b78270ab9223919081900360200190a250505050505050565b600060606000806000806000806126a4896129c8565b60048101549091508990600383019063ffffffff166126c283610efa565b600685015460018087015460028089015487546040805160206101009784161588026000190190931694909404601f810183900483028501830190915280845294909304600160a060020a03908116949116928891908301828280156127695780601f1061273e57610100808354040283529160200191612769565b820191906000526020600020905b81548152906001019060200180831161274c57829003601f168201915b50505050509550975097509750975097509750975050919395979092949650565b6000612795826129c8565b6004015463ffffffff1692915050565b60006127b16000612c21565b905090565b603d81565b600054600160a060020a031633146127d257600080fd5b600160a060020a03811615156127e757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6060600084600261285f82610efa565b60ff161461286c57600080fd5b856000612878826129c8565b600181015490915060ff1660021461289a5760018101805460ff191660021790555b86868080601f01602080910402602001604051908101604052809392919081815260200183838082843750508451949950505060189092111591506128e0905057600080fd5b6128e9886129c8565b60018101549094506101009004600160a060020a0316331461290a57600080fd5b61291860038501888861361f565b508763ffffffff167f1c07bf7033f49b2cd8542f39b70e2688ce6bda1a645555f80ef3732bb47fc52288886040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a25050505050505050565b60008161090063ffffffff82161061299157600080fd5b61299a846129c8565b63ffffffff939093166000908152602093909352505060409020546101009004600160a060020a0316919050565b60025460009063ffffffff8316106129df57600080fd5b6002805463ffffffff84169081106129f357fe5b90600052602060002090600902019050919050565b6000836002612a1682610efa565b60ff1614612a2357600080fd5b846000612a2f826129c8565b600181015490915060ff16600214612a515760018101805460ff191660021790555b612a5a876129c8565b60018101549094506101009004600160a060020a03163314612a7b57600080fd5b6001840154600160a060020a03868116610100909204161415612a9d57600080fd5b60806040519081016040528060011515815260200133600160a060020a0316815260200187815260200186600160a060020a0316815250600860008963ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a815481600160a060020a030219169083600160a060020a031602179055506040820151816001015560608201518160020160006101000a815481600160a060020a030219169083600160a060020a0316021790555090505084600160a060020a031633600160a060020a03168863ffffffff167fb3db47612eb184cdf7b4e9fa8c6aee81562cf8303533e08ab7804887eb61825d896040518082815260200191505060405180910390a450505050505050565b6103e891020490565b6080015163ffffffff166109001490565b600254600090819063ffffffff841610612c0857600080fd5b505063ffffffff16600090815260046020526040902090565b60025460009081906103e811612c3657600080fd5b600354600c63ffffffff90911610612c4d57600080fd5b6040805160e08101825260008082526020808301828152600160a060020a038881168587019081528651808501909752848752606086019687526080860185905260a0860185905260c0860185905260028054600180820180845592909752875160099091027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018054965160ff1990971660ff9093169290921761010060a860020a0319166101009686169690960295909517905590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad08401805473ffffffffffffffffffffffffffffffffffffffff1916919093161790915594518051939594937f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace830193612da4937f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad10192019061369d565b50608082015160048201805463ffffffff191663ffffffff90921691909117905560a0820151600682015560c0909101516007909101805460ff19169115159190911790556040519190039150600160a060020a0384169082907ff40707cf97c453c57b4aba46aa3008b999a5dca4a68872bafc7a6202c1c2532b90600090a36003805463ffffffff8082166001011663ffffffff199091161790556110ad816134e3565b6000808080808080886002612e5d82610efa565b60ff1614612e6a57600080fd5b896000612e76826129c8565b600181015490915060ff16600214612e985760018101805460ff191660021790555b612ea18b6120c6565b91985096509450612eb18c612bef565b9350612ebd8488613583565b50612ecb8460010187613583565b50959b949a50929850929650505050505050565b6000600160a060020a0383161515612ef657600080fd5b50600160a060020a03821660008181526001602090815260409182902080548581019182905583518181529283019190915282519093927faeeb0cb16f299136e7e5467ea84217150fe83008833064528f360cde7b7b54c3928290030190a2505050565b6000612f646135d8565b836002612f7082610efa565b60ff1614612f7d57600080fd5b846000612f89826129c8565b600181015490915060ff16600214612fab5760018101805460ff191660021790555b612fb4876129c8565b63ffffffff88166000908152600860209081526040918290208251608081018452815460ff811615158252600160a060020a0361010091829004811694830194909452600180840154958301959095526002909201548316606082015292840154939850919650910416331461302957600080fd5b8351151561303657600080fd5b6040805160808101825260008082523360208084019182528385018381526060850184815263ffffffff8e16855260089092529490922092518354915160ff199092169015151761010060a860020a031916610100600160a060020a039283160217835592516001830155516002909101805473ffffffffffffffffffffffffffffffffffffffff191691909216179055851561312c578360600151600160a060020a03168460200151600160a060020a03168863ffffffff167ffcfdb4ef2ed90cfbecf61a126ff80be6b901bbb7fa189c82c3cadd60fe2545e487604001516040518082815260200191505060405180910390a45b50505050505050565b6060600081818486111561314857600080fd5b851580156131565750865185145b15613163578693506131ea565b858503925082604051908082528060200260200182016040528015613192578160200160208202803883390190505b509150600090505b828110156131e657868682018151811015156131b257fe5b9060200190602002015182828151811015156131ca57fe5b63ffffffff90921660209283029091019091015260010161319a565b8193505b5050509392505050565b826131fe81610fa3565b1561320857600080fd5b8261090063ffffffff82161061321d57600080fd5b600060ff84161161322d57600080fd5b6002860154600160a060020a0316158061325357506002860154600160a060020a031633145b151561325e57600080fd5b63ffffffff84166000908152602087905260409020546101009004600160a060020a03161561328c57600080fd5b60048601805463ffffffff8082166001908101821663ffffffff199384161790935533600081815260058b01602090815260408083208054808716909801861697909616969096179094558451808601865260ff808a168083528287018581528c87168086528f895294899020935184549151600160a060020a03166101000261010060a860020a03199190941660ff1990921691909117169190911790915585519182529381019390935283519093918916927fce19d9d797653c654874d32397bb4896303230c7f945ef72ca1ab4f9ccbaae6592908290030190a3505050505050565b6040805160e08101825260018085015460ff81168352600160a060020a03610100918290048116602080860191909152600280890154909216858701526003880180548751601f6000199783161590960296909601169290920492830181900481028401810190955281835261341194879360608601939092918301828280156110755780601f1061104a57610100808354040283529160200191611075565b15610d5e576003805463ffffffff19811663ffffffff918216600019018216179091556001838101805460ff19169091179055604051908216907fcd1846849eae8c2457039209f3e792179c7fe9947f9205476117ff897134dbf590600090a25050565b60008080808086600161348782610efa565b60ff161461349457600080fd5b61349d87610da7565b90945092506134ab88612bef565b805460018082018355600083815260208082209093018890559281018054918201815583529120018390555091969095509350505050565b6040805160016060820181815260a0830190935290918291608083016020803883395050508152604080516001808252818301909252602092830192909190808301908038833950505081526000602091820181905283815260048252604090208251805191926135599284929091019061370b565b506020828101518051613572926001850192019061370b565b506040820151816002015590505050565b8154600090819081908590600019810190811061359c57fe5b600091825260209091200154915050828101818110156135bb57600080fd5b845460018101808755600096875260209096200155509192915050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604080516060810182526000808252602082018190529181019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106136605782800160ff1982351617855561368d565b8280016001018555821561368d579182015b8281111561368d578235825591602001919060010190613672565b50613699929150613745565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106136de57805160ff191683800117855561368d565b8280016001018555821561368d579182015b8281111561368d5782518255916020019190600101906136f0565b82805482825590600052602060002090810192821561368d579160200282018281111561368d5782518255916020019190600101906136f0565b610da491905b80821115613699576000815560010161374b5600a165627a7a723058205085ef314c5f061300db61d978d5409dac88967f971c35167c4ef6e08dbe0a330029

Deployed Bytecode

0x6080604052600436106102de5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662a0190e81146102e35780630ab85a101461030a5780630c9fe5eb146103285780631359cb2c146103565780631373083814610374578063286b583b146103e257806329ac4b591461040557806329fc7bd81461042f5780632c54e6d914610444578063304f34a0146104595780633ccfd60b1461048a5780634484d92b1461049f578063477a7042146104bd578063489e5656146104f1578063493997291461050657806349b6313c1461051b5780634bdfbb751461056c5780634d95c76c1461059e5780635130b405146105b3578063557ed1ba146105cb578063562df3d5146105e0578063604ce56c146105f5578063621a61ac1461060a578063668cf86a1461061f57806369ea80d5146106495780636d94dce11461065e57806370a082311461067f578063754d71e7146106a057806377b1b2eb146106e65780637be8352e146106fb5780637e6e65f3146107105780637ee8b2f8146107215780637fbea9551461074257806388c9a7d51461075d5780638da5cb5b146107935780639f572048146107c4578063a2b6f0ec146107e5578063a350539e14610803578063a4ab69cd14610814578063a6e7f40914610832578063aacdb27b14610847578063aaf4783514610871578063abb4339714610892578063ac4501d9146108b0578063ae7ed04c146108e6578063b3f0807814610939578063bd64635614610963578063bd9e6bfc14610981578063c9f8cf2014610992578063ca5397c7146109ac578063ce4a6f09146109ca578063d44d339414610649578063d4bffa5a146109f7578063d564835814610a0c578063d672100014610a36578063d90cdfb414610a54578063d9bc987314610b2d578063e9ceef5014610b4b578063f18166c214610b60578063f2fde38b14610b75578063fab825c614610b96578063fbebc9af14610bc0575b600080fd5b3480156102ef57600080fd5b506102f8610be4565b60408051918252519081900360200190f35b34801561031657600080fd5b506102f863ffffffff60043516610beb565b34801561033457600080fd5b5061033d610c60565b6040805163ffffffff9092168252519081900360200190f35b34801561036257600080fd5b506102f863ffffffff60043516610c66565b34801561038057600080fd5b5061039263ffffffff60043516610cab565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103ce5781810151838201526020016103b6565b505050509050019250505060405180910390f35b3480156103ee57600080fd5b5061040363ffffffff60043516602435610d52565b005b34801561041157600080fd5b5061033d600160a060020a036004351663ffffffff60243516610d62565b34801561043b57600080fd5b506102f8610d9a565b34801561045057600080fd5b506102f8610da0565b34801561046557600080fd5b50610471600435610da7565b6040805192835260208301919091528051918290030190f35b34801561049657600080fd5b50610403610dd6565b3480156104ab57600080fd5b506102f863ffffffff60043516610e9f565b3480156104c957600080fd5b506104db63ffffffff60043516610efa565b6040805160ff9092168252519081900360200190f35b3480156104fd57600080fd5b506104db610f5a565b34801561051257600080fd5b506102f8610f5f565b34801561052757600080fd5b5061053963ffffffff60043516610f65565b604080519415158552600160a060020a039384166020860152848101929092529091166060830152519081900360800190f35b34801561057857600080fd5b5061058a63ffffffff60043516610fa3565b604080519115158252519081900360200190f35b3480156105aa57600080fd5b5061033d6110b3565b3480156105bf57600080fd5b506104036004356110bf565b3480156105d757600080fd5b506102f86110db565b3480156105ec57600080fd5b506102f86110df565b34801561060157600080fd5b506104db6110e4565b34801561061657600080fd5b506104db6110e9565b34801561062b57600080fd5b5061047163ffffffff60043516600160a060020a03602435166110ee565b34801561065557600080fd5b506104db6111cb565b34801561066a57600080fd5b506102f8600160a060020a03600435166111d0565b34801561068b57600080fd5b506102f8600160a060020a03600435166111f1565b3480156106ac57600080fd5b506106be63ffffffff60043516611212565b604080519315158452600160a060020a03909216602084015282820152519081900360600190f35b3480156106f257600080fd5b5061033d610d9a565b34801561070757600080fd5b506102f8611245565b61040363ffffffff6004351661124b565b34801561072d57600080fd5b506102f8600160a060020a036004351661156f565b34801561074e57600080fd5b5061039260ff6004351661158a565b34801561076957600080fd5b506104036004803563ffffffff169060248035808201929081013591604435908101910135611664565b34801561079f57600080fd5b506107a861175c565b60408051600160a060020a039092168252519081900360200190f35b3480156107d057600080fd5b50610392600160a060020a036004351661176b565b3480156107f157600080fd5b5061040363ffffffff6004351661183c565b61040363ffffffff6004351661191c565b34801561082057600080fd5b5061040363ffffffff60043516611b23565b34801561083e57600080fd5b506104db611ca6565b34801561085357600080fd5b5061040363ffffffff6004358116906024351660ff60443516611cab565b34801561087d57600080fd5b5061040363ffffffff60043516602435611cd4565b34801561089e57600080fd5b5061039263ffffffff60043516612037565b3480156108bc57600080fd5b506108c86004356120c6565b60408051938452602084019290925282820152519081900360600190f35b3480156108f257600080fd5b5061090463ffffffff60043516612121565b6040805163ffffffff9095168552600160a060020a039093166020850152838301919091526060830152519081900360800190f35b34801561094557600080fd5b5061040363ffffffff60043516600160a060020a036024351661216f565b34801561096f57600080fd5b506102f863ffffffff600435166121c3565b61040363ffffffff6004351661226e565b34801561099e57600080fd5b5061039260043515156123f9565b3480156109b857600080fd5b5061040363ffffffff600435166124bf565b3480156109d657600080fd5b5061040363ffffffff60043516602435600160a060020a03604435166124cd565b348015610a0357600080fd5b506104db6124dd565b348015610a1857600080fd5b506102f863ffffffff60043516600160a060020a03602435166124e2565b348015610a4257600080fd5b5061040363ffffffff6004351661259d565b348015610a6057600080fd5b50610a7263ffffffff6004351661268e565b6040805163ffffffff808a16825287169181019190915260ff8516606082015260808101849052600160a060020a0380841660a0830152821660c082015260e0602080830182815289519284019290925288516101008401918a019080838360005b83811015610aec578181015183820152602001610ad4565b50505050905090810190601f168015610b195780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b348015610b3957600080fd5b5061033d63ffffffff6004351661278a565b348015610b5757600080fd5b506102f86127a5565b348015610b6c57600080fd5b506102f86127b6565b348015610b8157600080fd5b50610403600160a060020a03600435166127bb565b348015610ba257600080fd5b506104036004803563ffffffff16906024803590810191013561284f565b348015610bcc57600080fd5b506107a863ffffffff6004358116906024351661297a565b6202a30081565b6002546000908190819063ffffffff851610610c0657600080fd5b505063ffffffff821660009081526004602052604081206001810154909160001990910190811015610c3b5760009250610c59565b60018201805482908110610c4b57fe5b906000526020600020015492505b5050919050565b61090081565b6002546000908190819063ffffffff851610610c8157600080fd5b505063ffffffff8216600090815260046020526040902060028101548154829082908110610c4b57fe5b6060600060606000610cbc856129c8565b60408051610900808252620120208201909252919450602082016201200080388339019050509150600090505b61090063ffffffff82161015610d4a5763ffffffff81166000818152602085905260409020548351610100909104600160a060020a03169184918110610d2b57fe5b600160a060020a03909216602092830290910190910152600101610ce9565b509392505050565b610d5e82826000612a08565b5050565b600080610d6e836129c8565b600160a060020a038516600090815260058201602052604090205463ffffffff16925090505092915050565b6103e881565b6002545b90565b6000808080610900610dba866027612bd5565b8603811515610dc557fe5b046109000294859003959350505050565b6000610de13361156f565b905060008111610df057600080fd5b336000818152600160205260408082208290555183156108fc0291849190818181858888f19350505050158015610e2b573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a26040805182815260006020820152815133927faeeb0cb16f299136e7e5467ea84217150fe83008833064528f360cde7b7b54c3928290030190a250565b6002546000908190819063ffffffff851610610eba57600080fd5b505063ffffffff821660009081526004602052604081208054909160001990910190811015610eec5760009250610c59565b8154829082908110610c4b57fe5b6000806000610f08846129c8565b60018181015491935060ff90911614610f2a57600182015460ff169250610c59565b506006810154801580610f435750610f406110db565b81115b15610f515760019250610c59565b60029250610c59565b601881565b60075481565b63ffffffff1660009081526008602052604090208054600182015460029092015460ff821693610100909204600160a060020a039081169392911690565b60006110ad610fb1836129c8565b6040805160e08101825260018381015460ff8116835261010090819004600160a060020a03908116602080860191909152600280880154909216858701526003870180548751958116159094026000190190931691909104601f810182900482028401820190955284835292949360608601938301828280156110755780601f1061104a57610100808354040283529160200191611075565b820191906000526020600020905b81548152906001019060200180831161105857829003601f168201915b5050509183525050600482015463ffffffff1660208201526006820154604082015260079091015460ff161515606090910152612bde565b92915050565b60035463ffffffff1681565b600054600160a060020a031633146110d657600080fd5b600755565b4290565b602781565b600c81565b600081565b600080808080808080808a600261110482610efa565b60ff161461111157600080fd5b61111a8c612bef565b6001810154600160a060020a038d166000908152600383016020526040902054919950600019019750955061114f8b8d610d62565b63ffffffff169450600087101561116e576000995093975087936111bc565b6001880180548890811061117e57fe5b90600052602060002001549350876001018681548110151561119c57fe5b600091825260209091200154925084610900848603040291508185995099505b50505050505050509250929050565b603081565b60008054600160a060020a031633146111e857600080fd5b6110ad82612c21565b600160a060020a031660009081526006602052604090205463ffffffff1690565b63ffffffff166000908152600960205260409020805460019091015460ff821692610100909204600160a060020a031691565b61090090565b60006112556135d8565b600061125f6135ff565b84600261126b82610efa565b60ff161461127857600080fd5b856000611284826129c8565b600181015490915060ff166002146112a65760018101805460ff191660021790555b6112af886129c8565b63ffffffff89166000908152600860209081526040918290208251608081018452815460ff81161515825261010090819004600160a060020a0390811694830194909452600180840154958301959095526002909201548316606082015292840154939a5091985091041633141561132657600080fd5b8551151561133357600080fd5b604086015134101561134457600080fd5b60018701546020870151600160a060020a03908116610100909204161461136a57600080fd5b6060860151600160a060020a0316158061139057506060860151600160a060020a031633145b151561139b57600080fd5b6113a58834612e49565b60208901519097506113ba9250905086612edf565b6001878101805461010090819004600160a060020a0316600090815260066020526040808220805463ffffffff1980821663ffffffff928316600019018316179092553380855292842080549283169282169097011617909455825461010060a860020a03191693909102929092179055611436908990612f5a565b33600160a060020a03168660200151600160a060020a03168963ffffffff167f70fa5d525d4fdc48151e6618a1d9960a572e54b6bb139cebc47709db433d637b346040518082815260200191505060405180910390a463ffffffff88166000908152600960209081526040918290208251606081018452815460ff8116151582526101009004600160a060020a03169281018390526001909101549281019290925290945033141561156557604080516060810182526000808252602080830182815283850183815263ffffffff8e1684526009909252848320935184549151600160a060020a03166101000261010060a860020a031991151560ff19909316929092171617835551600192909201919091559085015111156115655761156584602001518560400151612edf565b5050505050505050565b600160a060020a031660009081526001602052604090205490565b6060600081818060ff861615156115ab5760035463ffffffff1693506115c0565b60035463ffffffff166115bc610da0565b0393505b836040519080825280602002602001820160405280156115ea578160200160208202803883390190505b50925060009150600090505b60025463ffffffff8216101561164e578560ff1661161382610efa565b60ff1614156116465780838381518110151561162b57fe5b63ffffffff9092166020928302909101909101526001909101905b6001016115f6565b61165a83600084613135565b9695505050505050565b600080808086851461167557600080fd5b61167e896129c8565b935060009250600091505b63ffffffff821687111561173b57836000898963ffffffff86168181106116ac57fe5b6020908102929092013563ffffffff1683525081019190915260400160002080549091506101009004600160a060020a031615156117305761172b848a8a8a63ffffffff87168181106116fb57fe5b9050602002013563ffffffff1689898763ffffffff16818110151561171c57fe5b9050602002013560ff166131f4565b600192505b600190910190611689565b82151561174757600080fd5b611751848a613371565b505050505050505050565b600054600160a060020a031681565b60608060008060006002805490506040519080825280602002602001820160405280156117a2578160200160208202803883390190505b50935060009250600091505b60025463ffffffff831610156118305760026117c983610efa565b60ff161415611825576117db826129c8565b6001810154909150600160a060020a038781166101009092041614156118255781848481518110151561180a57fe5b63ffffffff9092166020928302909101909101526001909201915b6001909101906117ae565b61165a84600085613135565b6000808083600261184c82610efa565b60ff161461185957600080fd5b846000611865826129c8565b600181015490915060ff166002146118875760018101805460ff191660021790555b61189087612bef565b955061189c87336110ee565b506001870154909550600019019350600085116118b857600080fd5b33600081815260038801602052604090208590556118d69086612edf565b604080518681529051339163ffffffff8a16917f94af59d97594c7be2f6dc00f66da665f42ee9b0bea953d993848cf8eadeed9889181900360200190a350505050505050565b6000808083600161192c82610efa565b60ff161461193957600080fd5b611942856129c8565b63ffffffff861660009081526005602052604090206007549195509350341080611970575082600101543411155b1561197a57600080fd5b8254600160a060020a031615801590611997575060008360010154115b156119b657825460018401546119b691600160a060020a031690612edf565b600684015491508115156119d7576202a3006119d06110db565b0160068501555b60408051808201825233815234602080830191825263ffffffff891660009081526005909152929092209051815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03918216178255915160019182015585015461010090041615611a7e5760018401546101009004600160a060020a03166000908152600660205260409020805463ffffffff19811663ffffffff918216600019019091161790555b6001848101805461010060a860020a031916336101008102919091179091556000908152600660205260409020805463ffffffff19811663ffffffff91821690930116919091179055611ad18534613475565b505060068401546040805134815260208101929092528051339263ffffffff8916927f3650d7c3b27153eed34d5ff83b7ec912ab40d876ba77bb57780224b7eeae689b92918290030190a35050505050565b611b2b6135ff565b816002611b3782610efa565b60ff1614611b4457600080fd5b826000611b50826129c8565b600181015490915060ff16600214611b725760018101805460ff191660021790555b63ffffffff85166000908152600960209081526040918290208251606081018452815460ff8116151582526101009004600160a060020a0316928101839052600190910154928101929092529094503314611bcc57600080fd5b604080516060810182526000808252602080830182815283850183815263ffffffff8b1684526009909252848320935184549151600160a060020a03166101000261010060a860020a031991151560ff1990931692909217161783555160019290920191909155908501511115611c4f57611c4f84602001518560400151612edf565b8360200151600160a060020a03168563ffffffff167f083061fa741b37c06e79771b36582e9da52a8b7b77333470ab3c76ab60b67d6486604001516040518082815260200191505060405180910390a35050505050565b600281565b6000611cb6846129c8565b9050611cc4818585856131f4565b611cce8185613371565b50505050565b6000611cde6135ff565b6000846002611cec82610efa565b60ff1614611cf957600080fd5b856000611d05826129c8565b600181015490915060ff16600214611d275760018101805460ff191660021790555b611d30886129c8565b60018101549096506101009004600160a060020a03163314611d5157600080fd5b63ffffffff88166000908152600960209081526040918290208251606081018452815460ff81161515808352610100909104600160a060020a03169382019390935260019091015492810192909252909550611dac57600080fd5b6040850151600010611dbd57600080fd5b6020850151600160a060020a03161515611dd657600080fd5b6040850151871115611de757600080fd5b611df5888660400151612e49565b909150905080945050600660008760010160019054906101000a9004600160a060020a0316600160a060020a0316600160a060020a03168152602001908152602001600020600081819054906101000a900463ffffffff16809291906001900391906101000a81548163ffffffff021916908363ffffffff16021790555050600660008660200151600160a060020a0316600160a060020a03168152602001908152602001600020600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff1602179055505084602001518660010160016101000a815481600160a060020a030219169083600160a060020a03160217905550611f0d3385612edf565b60408051606081810183526000808352602080840182815284860183815263ffffffff8f1680855260098452878520965187549351600160a060020a0390811661010090810261010060a860020a031993151560ff19978816178416178a5593516001998a01558951608081018b52878152808701888152818c01898152998201898152858a5260088952988c9020915182549151841690960295151596169590951790911692909217835594519582019590955591516002909201805492851673ffffffffffffffffffffffffffffffffffffffff199093169290921790915588810151898501518551908152945193169333937f70fa5d525d4fdc48151e6618a1d9960a572e54b6bb139cebc47709db433d637b929181900390910190a45050505050505050565b6060600060606000612048856129c8565b60408051610900808252620120208201909252919450602082016201200080388339019050509150600090505b61090063ffffffff82161015610d4a5763ffffffff8116600081815260208590526040902054835160ff90911691849181106120ad57fe5b60ff909216602092830290910190910152600101612075565b60008060008060008060006120dc886027612bd5565b93506109006120ec89603d612bd5565b8115156120f557fe5b049250506109008202905082870381900387811061211257600080fd5b92979096509194509092505050565b63ffffffff8116600090815260056020526040812081908190819081612146876129c8565b8254600190930154600691909101549798600160a060020a039093169790965094509092505050565b60008054600160a060020a0316331461218757600080fd5b612190836129c8565b600201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0393909316929092179091555050565b60008080808080808760026121d782610efa565b60ff16146121e457600080fd5b6121ed89612bef565b80546002820154919850600019019650945060008610156122115760009750612262565b865487908790811061221f57fe5b90600052602060002001549350866000018581548110151561223d57fe5b90600052602060002001549250828403915083821115151561225e57600080fd5b8197505b50505050505050919050565b60008082600261227d82610efa565b60ff161461228a57600080fd5b836000612296826129c8565b600181015490915060ff166002146122b85760018101805460ff191660021790555b6122c1866129c8565b63ffffffff87166000908152600960205260409020600182015491965094506101009004600160a060020a03163314156122fa57600080fd5b60018501546101009004600160a060020a0316151561231857600080fd5b6001840154341161232857600080fd5b6000846001015411156123545783546001850154612354916101009004600160a060020a031690612edf565b6040805160608101825260018082523360208084018281523485870181815263ffffffff8e16600081815260098652899020975188549451600160a060020a03166101000261010060a860020a031991151560ff1990961695909517169390931787555195909401949094558451928352935190937faa04d56d11a8befe2a5c33a781e5242570c2e356412642891468181f98c6b959928290030190a3505050505050565b6060806000806000600280549050604051908082528060200260200182016040528015612430578160200160208202803883390190505b50935060009250600091505b60025463ffffffff83161015611830575063ffffffff81166000908152600860205260409020805460ff1680156124855750858061248557506002810154600160a060020a0316155b156124b45781848481518110151561249957fe5b63ffffffff9092166020928302909101909101526001909201915b60019091019061243c565b6124ca816001612f5a565b50565b6124d8838383612a08565b505050565b600181565b60025460009081908190819063ffffffff8716106124ff57600080fd5b63ffffffff86166000908152600460209081526040808320600160a060020a03891684526003810190925290912054909350915061253d8587610d62565b600184015463ffffffff9190911691501580612557575081155b156125655760009350612594565b6001830180548291610900918590811061257b57fe5b906000526020600020015481151561258f57fe5b040293505b50505092915050565b6000805481908190600160a060020a031633146125b957600080fd5b8360026125c582610efa565b60ff16146125d257600080fd5b8460006125de826129c8565b600181015490915060ff166002146126005760018101805460ff191660021790555b61260987612bef565b9550612614876121c3565b86549095506000190193506000851161262c57600080fd5b6002860184905560005461264990600160a060020a031686612edf565b60408051868152905163ffffffff8916917f07fe4955f5a29e5df9fc8015de56f3d9847da378e548baf0cdb1b78270ab9223919081900360200190a250505050505050565b600060606000806000806000806126a4896129c8565b60048101549091508990600383019063ffffffff166126c283610efa565b600685015460018087015460028089015487546040805160206101009784161588026000190190931694909404601f810183900483028501830190915280845294909304600160a060020a03908116949116928891908301828280156127695780601f1061273e57610100808354040283529160200191612769565b820191906000526020600020905b81548152906001019060200180831161274c57829003601f168201915b50505050509550975097509750975097509750975050919395979092949650565b6000612795826129c8565b6004015463ffffffff1692915050565b60006127b16000612c21565b905090565b603d81565b600054600160a060020a031633146127d257600080fd5b600160a060020a03811615156127e757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6060600084600261285f82610efa565b60ff161461286c57600080fd5b856000612878826129c8565b600181015490915060ff1660021461289a5760018101805460ff191660021790555b86868080601f01602080910402602001604051908101604052809392919081815260200183838082843750508451949950505060189092111591506128e0905057600080fd5b6128e9886129c8565b60018101549094506101009004600160a060020a0316331461290a57600080fd5b61291860038501888861361f565b508763ffffffff167f1c07bf7033f49b2cd8542f39b70e2688ce6bda1a645555f80ef3732bb47fc52288886040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a25050505050505050565b60008161090063ffffffff82161061299157600080fd5b61299a846129c8565b63ffffffff939093166000908152602093909352505060409020546101009004600160a060020a0316919050565b60025460009063ffffffff8316106129df57600080fd5b6002805463ffffffff84169081106129f357fe5b90600052602060002090600902019050919050565b6000836002612a1682610efa565b60ff1614612a2357600080fd5b846000612a2f826129c8565b600181015490915060ff16600214612a515760018101805460ff191660021790555b612a5a876129c8565b60018101549094506101009004600160a060020a03163314612a7b57600080fd5b6001840154600160a060020a03868116610100909204161415612a9d57600080fd5b60806040519081016040528060011515815260200133600160a060020a0316815260200187815260200186600160a060020a0316815250600860008963ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a815481600160a060020a030219169083600160a060020a031602179055506040820151816001015560608201518160020160006101000a815481600160a060020a030219169083600160a060020a0316021790555090505084600160a060020a031633600160a060020a03168863ffffffff167fb3db47612eb184cdf7b4e9fa8c6aee81562cf8303533e08ab7804887eb61825d896040518082815260200191505060405180910390a450505050505050565b6103e891020490565b6080015163ffffffff166109001490565b600254600090819063ffffffff841610612c0857600080fd5b505063ffffffff16600090815260046020526040902090565b60025460009081906103e811612c3657600080fd5b600354600c63ffffffff90911610612c4d57600080fd5b6040805160e08101825260008082526020808301828152600160a060020a038881168587019081528651808501909752848752606086019687526080860185905260a0860185905260c0860185905260028054600180820180845592909752875160099091027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018054965160ff1990971660ff9093169290921761010060a860020a0319166101009686169690960295909517905590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad08401805473ffffffffffffffffffffffffffffffffffffffff1916919093161790915594518051939594937f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace830193612da4937f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad10192019061369d565b50608082015160048201805463ffffffff191663ffffffff90921691909117905560a0820151600682015560c0909101516007909101805460ff19169115159190911790556040519190039150600160a060020a0384169082907ff40707cf97c453c57b4aba46aa3008b999a5dca4a68872bafc7a6202c1c2532b90600090a36003805463ffffffff8082166001011663ffffffff199091161790556110ad816134e3565b6000808080808080886002612e5d82610efa565b60ff1614612e6a57600080fd5b896000612e76826129c8565b600181015490915060ff16600214612e985760018101805460ff191660021790555b612ea18b6120c6565b91985096509450612eb18c612bef565b9350612ebd8488613583565b50612ecb8460010187613583565b50959b949a50929850929650505050505050565b6000600160a060020a0383161515612ef657600080fd5b50600160a060020a03821660008181526001602090815260409182902080548581019182905583518181529283019190915282519093927faeeb0cb16f299136e7e5467ea84217150fe83008833064528f360cde7b7b54c3928290030190a2505050565b6000612f646135d8565b836002612f7082610efa565b60ff1614612f7d57600080fd5b846000612f89826129c8565b600181015490915060ff16600214612fab5760018101805460ff191660021790555b612fb4876129c8565b63ffffffff88166000908152600860209081526040918290208251608081018452815460ff811615158252600160a060020a0361010091829004811694830194909452600180840154958301959095526002909201548316606082015292840154939850919650910416331461302957600080fd5b8351151561303657600080fd5b6040805160808101825260008082523360208084019182528385018381526060850184815263ffffffff8e16855260089092529490922092518354915160ff199092169015151761010060a860020a031916610100600160a060020a039283160217835592516001830155516002909101805473ffffffffffffffffffffffffffffffffffffffff191691909216179055851561312c578360600151600160a060020a03168460200151600160a060020a03168863ffffffff167ffcfdb4ef2ed90cfbecf61a126ff80be6b901bbb7fa189c82c3cadd60fe2545e487604001516040518082815260200191505060405180910390a45b50505050505050565b6060600081818486111561314857600080fd5b851580156131565750865185145b15613163578693506131ea565b858503925082604051908082528060200260200182016040528015613192578160200160208202803883390190505b509150600090505b828110156131e657868682018151811015156131b257fe5b9060200190602002015182828151811015156131ca57fe5b63ffffffff90921660209283029091019091015260010161319a565b8193505b5050509392505050565b826131fe81610fa3565b1561320857600080fd5b8261090063ffffffff82161061321d57600080fd5b600060ff84161161322d57600080fd5b6002860154600160a060020a0316158061325357506002860154600160a060020a031633145b151561325e57600080fd5b63ffffffff84166000908152602087905260409020546101009004600160a060020a03161561328c57600080fd5b60048601805463ffffffff8082166001908101821663ffffffff199384161790935533600081815260058b01602090815260408083208054808716909801861697909616969096179094558451808601865260ff808a168083528287018581528c87168086528f895294899020935184549151600160a060020a03166101000261010060a860020a03199190941660ff1990921691909117169190911790915585519182529381019390935283519093918916927fce19d9d797653c654874d32397bb4896303230c7f945ef72ca1ab4f9ccbaae6592908290030190a3505050505050565b6040805160e08101825260018085015460ff81168352600160a060020a03610100918290048116602080860191909152600280890154909216858701526003880180548751601f6000199783161590960296909601169290920492830181900481028401810190955281835261341194879360608601939092918301828280156110755780601f1061104a57610100808354040283529160200191611075565b15610d5e576003805463ffffffff19811663ffffffff918216600019018216179091556001838101805460ff19169091179055604051908216907fcd1846849eae8c2457039209f3e792179c7fe9947f9205476117ff897134dbf590600090a25050565b60008080808086600161348782610efa565b60ff161461349457600080fd5b61349d87610da7565b90945092506134ab88612bef565b805460018082018355600083815260208082209093018890559281018054918201815583529120018390555091969095509350505050565b6040805160016060820181815260a0830190935290918291608083016020803883395050508152604080516001808252818301909252602092830192909190808301908038833950505081526000602091820181905283815260048252604090208251805191926135599284929091019061370b565b506020828101518051613572926001850192019061370b565b506040820151816002015590505050565b8154600090819081908590600019810190811061359c57fe5b600091825260209091200154915050828101818110156135bb57600080fd5b845460018101808755600096875260209096200155509192915050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604080516060810182526000808252602082018190529181019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106136605782800160ff1982351617855561368d565b8280016001018555821561368d579182015b8281111561368d578235825591602001919060010190613672565b50613699929150613745565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106136de57805160ff191683800117855561368d565b8280016001018555821561368d579182015b8281111561368d5782518255916020019190600101906136f0565b82805482825590600052602060002090810192821561368d579160200282018281111561368d5782518255916020019190600101906136f0565b610da491905b80821115613699576000815560010161374b5600a165627a7a723058205085ef314c5f061300db61d978d5409dac88967f971c35167c4ef6e08dbe0a330029

Swarm Source

bzzr://5085ef314c5f061300db61d978d5409dac88967f971c35167c4ef6e08dbe0a33

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.