ETH Price: $3,103.06 (+1.16%)
Gas: 16 Gwei

Contract

0xEbcf3bcA271B26ae4B162Ba560e243055Af0E679
 

Overview

ETH Balance

1.930000000000000007 ETH

Eth Value

$5,988.90 (@ $3,103.06/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Request Status C...186957822023-12-02 2:37:47221 days ago1701484667IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0159513428.84375417
Request Status C...186775032023-11-29 13:14:59224 days ago1701263699IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0173238831.31141257
Request Status C...185927242023-11-17 16:15:35235 days ago1700237735IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0255245446.15600332
Request Status C...183500172023-10-14 17:09:35269 days ago1697303375IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.004005737.24222326
Execute Request183095272023-10-09 1:06:47275 days ago1696813607IN
0xEbcf3bcA...55Af0E679
0 ETH0.000537076.2509499
Request Status C...182719102023-10-03 18:52:59280 days ago1696359179IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0092771816.77506356
Request Status C...179278902023-08-16 14:08:59329 days ago1692194939IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0200267236.21691612
Request Status C...178554722023-08-06 10:58:59339 days ago1691319539IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0065727111.88457201
Request Status C...175720962023-06-27 17:13:23378 days ago1687886003IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0132257323.91434736
Request Status C...175358462023-06-22 14:48:11384 days ago1687445291IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0124367222.47829558
Submit Evidence174264752023-06-07 5:37:23399 days ago1686116243IN
0xEbcf3bcA...55Af0E679
0 ETH0.000737721.34634131
Request Status C...174264412023-06-07 5:30:11399 days ago1686115811IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0063522820.50706361
Execute Request173823722023-06-01 0:21:23405 days ago1685578883IN
0xEbcf3bcA...55Af0E679
0 ETH0.0021038724.48667495
Request Status C...173449722023-05-26 18:13:35410 days ago1685124815IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.028148750.90862453
Request Status C...172866532023-05-18 13:12:23419 days ago1684415543IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0287798552.04821135
Request Status C...172713952023-05-16 9:30:59421 days ago1684229459IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0267868648.41719607
Request Status C...170335662023-04-12 18:02:11454 days ago1681322531IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.020666637.36714055
Request Status C...169199282023-03-27 16:32:23470 days ago1679934743IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0295858853.50205917
Request Status C...168964952023-03-24 9:33:35474 days ago1679650415IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0099617218.00365725
Submit Evidence168806942023-03-22 4:15:35476 days ago1679458535IN
0xEbcf3bcA...55Af0E679
0 ETH0.0004200212.15377461
Request Status C...168806742023-03-22 4:11:35476 days ago1679458295IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0039950412.89605377
Submit Evidence168741742023-03-21 6:16:11477 days ago1679379371IN
0xEbcf3bcA...55Af0E679
0 ETH0.0004171112.06963191
Request Status C...168741622023-03-21 6:13:47477 days ago1679379227IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0036193711.6218291
Request Status C...168311702023-03-15 5:16:35483 days ago1678857395IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0100471918.1649523
Request Status C...167976902023-03-10 12:20:23488 days ago1678450823IN
0xEbcf3bcA...55Af0E679
0.1595 ETH0.0126543722.87003411
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
187333742023-12-07 8:58:23216 days ago1701939503
0xEbcf3bcA...55Af0E679
0.1595 ETH
187152322023-12-04 19:57:35218 days ago1701719855
0xEbcf3bcA...55Af0E679
0.1595 ETH
186303162023-11-22 22:39:47230 days ago1700692787
0xEbcf3bcA...55Af0E679
0.1595 ETH
183876812023-10-19 23:32:11264 days ago1697758331
0xEbcf3bcA...55Af0E679
0.1595 ETH
183095272023-10-09 1:06:47275 days ago1696813607
0xEbcf3bcA...55Af0E679
0.1595 ETH
179655322023-08-21 20:37:47323 days ago1692650267
0xEbcf3bcA...55Af0E679
0.1595 ETH
178931312023-08-11 17:27:23333 days ago1691774843
0xEbcf3bcA...55Af0E679
0.1595 ETH
176097792023-07-03 0:05:59373 days ago1688342759
0xEbcf3bcA...55Af0E679
0.1595 ETH
175732452023-06-27 21:05:35378 days ago1687899935
0xEbcf3bcA...55Af0E679
0.1595 ETH
174638952023-06-12 12:11:23394 days ago1686571883
0xEbcf3bcA...55Af0E679
0.1595 ETH
173823722023-06-01 0:21:23405 days ago1685578883
0xEbcf3bcA...55Af0E679
0.1595 ETH
173241762023-05-23 20:03:23413 days ago1684872203
0xEbcf3bcA...55Af0E679
0.1595 ETH
173087972023-05-21 16:02:11415 days ago1684684931
0xEbcf3bcA...55Af0E679
0.1595 ETH
170702072023-04-18 1:02:59449 days ago1681779779
0xEbcf3bcA...55Af0E679
0.1595 ETH
169574192023-04-01 22:59:59465 days ago1680389999
0xEbcf3bcA...55Af0E679
0.1595 ETH
169340492023-03-29 16:10:59468 days ago1680106259
0xEbcf3bcA...55Af0E679
0.1595 ETH
169182772023-03-27 10:59:35471 days ago1679914775
0xEbcf3bcA...55Af0E679
0.1595 ETH
169117562023-03-26 12:59:23472 days ago1679835563
0xEbcf3bcA...55Af0E679
0.1595 ETH
168687402023-03-20 11:59:11478 days ago1679313551
0xEbcf3bcA...55Af0E679
0.1595 ETH
168352262023-03-15 18:58:47482 days ago1678906727
0xEbcf3bcA...55Af0E679
0.1595 ETH
167993602023-03-10 17:58:47487 days ago1678471127
0xEbcf3bcA...55Af0E679
0.1595 ETH
167807242023-03-08 2:58:23490 days ago1678244303
0xEbcf3bcA...55Af0E679
0.1595 ETH
167256172023-02-28 8:57:59498 days ago1677574679
0xEbcf3bcA...55Af0E679
0.1595 ETH
166811752023-02-22 2:57:59504 days ago1677034679
0xEbcf3bcA...55Af0E679
0.1595 ETH
165970072023-02-10 7:57:11516 days ago1676015831
0xEbcf3bcA...55Af0E679
0.1595 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ArbitrableTokenList

Compiler Version
v0.4.25+commit.59dbf8f1

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-03-05
*/

/**
 *  @authors: [@mtsalenc, @clesaege]
 *  @reviewers: [@clesaege]
 *  @auditors: []
 *  @bounties: []
 *  @deployments: []
 */
/* solium-disable max-len*/
pragma solidity 0.4.25;
/**
 *  @title ArbitrableTokenList
 *  This contract is an arbitrable token curated registry for tokens, sometimes referred to as a Token² Curated Registry. Users can send requests to register or remove tokens from the registry, which can in turn, be challenged by parties that disagree with them.
 *  A crowdsourced insurance system allows parties to contribute to arbitration fees and win rewards if the side they backed ultimately wins a dispute.
 *  NOTE: This contract trusts that the Arbitrator is honest and will not reenter or modify its costs during a call. This contract is only to be used with an arbitrator returning appealPeriod and having non-zero fees. The governor contract (which will be a DAO) is also to be trusted.
 */

/**
 * @title CappedMath
 * @dev Math operations with caps for under and overflow.
 */
library CappedMath {
    uint constant private UINT_MAX = 2**256 - 1;

    /**
     * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.
     */
    function addCap(uint _a, uint _b) internal pure returns (uint) {
        uint c = _a + _b;
        return c >= _a ? c : UINT_MAX;
    }

    /**
     * @dev Subtracts two integers, returns 0 on underflow.
     */
    function subCap(uint _a, uint _b) internal pure returns (uint) {
        if (_b > _a)
            return 0;
        else
            return _a - _b;
    }

    /**
     * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.
     */
    function mulCap(uint _a, uint _b) internal pure returns (uint) {
        // Gas optimization: this is cheaper than requiring '_a' not being zero, but the
        // benefit is lost if '_b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (_a == 0)
            return 0;

        uint c = _a * _b;
        return c / _a == _b ? c : UINT_MAX;
    }
}

/** @title Arbitrator
 *  Arbitrator abstract contract.
 *  When developing arbitrator contracts we need to:
 *  -Define the functions for dispute creation (createDispute) and appeal (appeal). Don't forget to store the arbitrated contract and the disputeID (which should be unique, use nbDisputes).
 *  -Define the functions for cost display (arbitrationCost and appealCost).
 *  -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).
 */
contract Arbitrator {

    enum DisputeStatus {Waiting, Appealable, Solved}

    modifier requireArbitrationFee(bytes _extraData) {
        require(msg.value >= arbitrationCost(_extraData), "Not enough ETH to cover arbitration costs.");
        _;
    }
    modifier requireAppealFee(uint _disputeID, bytes _extraData) {
        require(msg.value >= appealCost(_disputeID, _extraData), "Not enough ETH to cover appeal costs.");
        _;
    }

    /** @dev To be raised when a dispute is created.
     *  @param _disputeID ID of the dispute.
     *  @param _arbitrable The contract which created the dispute.
     */
    event DisputeCreation(uint indexed _disputeID, Arbitrable indexed _arbitrable);

    /** @dev To be raised when a dispute can be appealed.
     *  @param _disputeID ID of the dispute.
     */
    event AppealPossible(uint indexed _disputeID, Arbitrable indexed _arbitrable);

    /** @dev To be raised when the current ruling is appealed.
     *  @param _disputeID ID of the dispute.
     *  @param _arbitrable The contract which created the dispute.
     */
    event AppealDecision(uint indexed _disputeID, Arbitrable indexed _arbitrable);

    /** @dev Create a dispute. Must be called by the arbitrable contract.
     *  Must be paid at least arbitrationCost(_extraData).
     *  @param _choices Amount of choices the arbitrator can make in this dispute.
     *  @param _extraData Can be used to give additional info on the dispute to be created.
     *  @return disputeID ID of the dispute created.
     */
    function createDispute(uint _choices, bytes _extraData) public requireArbitrationFee(_extraData) payable returns(uint disputeID) {}

    /** @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
     *  @param _extraData Can be used to give additional info on the dispute to be created.
     *  @return fee Amount to be paid.
     */
    function arbitrationCost(bytes _extraData) public view returns(uint fee);

    /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.
     *  @param _disputeID ID of the dispute to be appealed.
     *  @param _extraData Can be used to give extra info on the appeal.
     */
    function appeal(uint _disputeID, bytes _extraData) public requireAppealFee(_disputeID,_extraData) payable {
        emit AppealDecision(_disputeID, Arbitrable(msg.sender));
    }

    /** @dev Compute the cost of appeal. It is recommended not to increase it often, as it can be higly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
     *  @param _disputeID ID of the dispute to be appealed.
     *  @param _extraData Can be used to give additional info on the dispute to be created.
     *  @return fee Amount to be paid.
     */
    function appealCost(uint _disputeID, bytes _extraData) public view returns(uint fee);

    /** @dev Compute the start and end of the dispute's current or next appeal period, if possible.
     *  @param _disputeID ID of the dispute.
     *  @return The start and end of the period.
     */
    function appealPeriod(uint _disputeID) public view returns(uint start, uint end) {}

    /** @dev Return the status of a dispute.
     *  @param _disputeID ID of the dispute to rule.
     *  @return status The status of the dispute.
     */
    function disputeStatus(uint _disputeID) public view returns(DisputeStatus status);

    /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.
     *  @param _disputeID ID of the dispute.
     *  @return ruling The ruling which has been given or the one which will be given if there is no appeal.
     */
    function currentRuling(uint _disputeID) public view returns(uint ruling);
}

/** @title IArbitrable
 *  Arbitrable interface.
 *  When developing arbitrable contracts, we need to:
 *  -Define the action taken when a ruling is received by the contract. We should do so in executeRuling.
 *  -Allow dispute creation. For this a function must:
 *      -Call arbitrator.createDispute.value(_fee)(_choices,_extraData);
 *      -Create the event Dispute(_arbitrator,_disputeID,_rulingOptions);
 */
interface IArbitrable {
    /** @dev To be emmited when meta-evidence is submitted.
     *  @param _metaEvidenceID Unique identifier of meta-evidence.
     *  @param _evidence A link to the meta-evidence JSON.
     */
    event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);

    /** @dev To be emmited when a dispute is created to link the correct meta-evidence to the disputeID
     *  @param _arbitrator The arbitrator of the contract.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _metaEvidenceID Unique identifier of meta-evidence.
     *  @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.
     */
    event Dispute(Arbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);

    /** @dev To be raised when evidence are submitted. Should point to the ressource (evidences are not to be stored on chain due to gas considerations).
     *  @param _arbitrator The arbitrator of the contract.
     *  @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.
     *  @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.
     *  @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.
     */
    event Evidence(Arbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);

    /** @dev To be raised when a ruling is given.
     *  @param _arbitrator The arbitrator giving the ruling.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _ruling The ruling which was given.
     */
    event Ruling(Arbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);

    /** @dev Give a ruling for a dispute. Must be called by the arbitrator.
     *  The purpose of this function is to ensure that the address calling it has the right to rule on the contract.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function rule(uint _disputeID, uint _ruling) public;
}

/** @title Arbitrable
 *  Arbitrable abstract contract.
 *  When developing arbitrable contracts, we need to:
 *  -Define the action taken when a ruling is received by the contract. We should do so in executeRuling.
 *  -Allow dispute creation. For this a function must:
 *      -Call arbitrator.createDispute.value(_fee)(_choices,_extraData);
 *      -Create the event Dispute(_arbitrator,_disputeID,_rulingOptions);
 */
contract Arbitrable is IArbitrable {
    Arbitrator public arbitrator;
    bytes public arbitratorExtraData; // Extra data to require particular dispute and appeal behaviour.

    modifier onlyArbitrator {require(msg.sender == address(arbitrator), "Can only be called by the arbitrator."); _;}

    /** @dev Constructor. Choose the arbitrator.
     *  @param _arbitrator The arbitrator of the contract.
     *  @param _arbitratorExtraData Extra data for the arbitrator.
     */
    constructor(Arbitrator _arbitrator, bytes _arbitratorExtraData) public {
        arbitrator = _arbitrator;
        arbitratorExtraData = _arbitratorExtraData;
    }

    /** @dev Give a ruling for a dispute. Must be called by the arbitrator.
     *  The purpose of this function is to ensure that the address calling it has the right to rule on the contract.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function rule(uint _disputeID, uint _ruling) public onlyArbitrator {
        emit Ruling(Arbitrator(msg.sender),_disputeID,_ruling);

        executeRuling(_disputeID,_ruling);
    }


    /** @dev Execute a ruling of a dispute.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function executeRuling(uint _disputeID, uint _ruling) internal;
}

/**
 *  @title Permission Interface
 *  This is a permission interface for arbitrary values. The values can be cast to the required types.
 */
interface PermissionInterface{
    /* External */

    /**
     *  @dev Return true if the value is allowed.
     *  @param _value The value we want to check.
     *  @return allowed True if the value is allowed, false otherwise.
     */
    function isPermitted(bytes32 _value) external view returns (bool allowed);
}

/**
 *  @title ArbitrableAddressList
 *  This contract is an arbitrable token curated registry for addresses, sometimes referred to as a Address Curated Registry. Users can send requests to register or remove addresses from the registry, which can in turn, be challenged by parties that disagree with them.
 *  A crowdsourced insurance system allows parties to contribute to arbitration fees and win rewards if the side they backed ultimately wins a dispute.
 *  NOTE: This contract trusts that the Arbitrator is honest and will not reenter or modify its costs during a call. This contract is only to be used with an arbitrator returning appealPeriod and having non-zero fees. The governor contract (which will be a DAO) is also to be trusted.
 */
contract ArbitrableAddressList is PermissionInterface, Arbitrable {
    using CappedMath for uint; // Operations bounded between 0 and 2**256 - 1.

    /* Enums */

    enum AddressStatus {
        Absent, // The address is not in the registry.
        Registered, // The address is in the registry.
        RegistrationRequested, // The address has a request to be added to the registry.
        ClearingRequested // The address has a request to be removed from the registry.
    }

    enum Party {
        None,      // Party per default when there is no challenger or requester. Also used for unconclusive ruling.
        Requester, // Party that made the request to change an address status.
        Challenger // Party that challenges the request to change an address status.
    }

    // ************************ //
    // *  Request Life Cycle  * //
    // ************************ //
    // Changes to the address status are made via requests for either listing or removing an address from the Address Curated Registry.
    // To make or challenge a request, a party must pay a deposit. This value will be rewarded to the party that ultimately wins a dispute. If no one challenges the request, the value will be reimbursed to the requester.
    // Additionally to the challenge reward, in the case a party challenges a request, both sides must fully pay the amount of arbitration fees required to raise a dispute. The party that ultimately wins the case will be reimbursed.
    // Finally, arbitration fees can be crowdsourced. To incentivise insurers, an additional fee stake must be deposited. Contributors that fund the side that ultimately wins a dispute will be reimbursed and rewarded with the other side's fee stake proportionally to their contribution.
    // In summary, costs for placing or challenging a request are the following:
    // - A challenge reward given to the party that wins a potential dispute.
    // - Arbitration fees used to pay jurors.
    // - A fee stake that is distributed among insurers of the side that ultimately wins a dispute.

    /* Structs */

    struct Address {
        AddressStatus status; // The status of the address.
        Request[] requests; // List of status change requests made for the address.
    }

    // Some arrays below have 3 elements to map with the Party enums for better readability:
    // - 0: is unused, matches `Party.None`.
    // - 1: for `Party.Requester`.
    // - 2: for `Party.Challenger`.
    struct Request {
        bool disputed; // True if a dispute was raised.
        uint disputeID; // ID of the dispute, if any.
        uint submissionTime; // Time when the request was made. Used to track when the challenge period ends.
        bool resolved; // True if the request was executed and/or any disputes raised were resolved.
        address[3] parties; // Address of requester and challenger, if any.
        Round[] rounds; // Tracks each round of a dispute.
        Party ruling; // The final ruling given, if any.
        Arbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.
        bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.
    }

    struct Round {
        uint[3] paidFees; // Tracks the fees paid by each side on this round.
        bool[3] hasPaid; // True when the side has fully paid its fee. False otherwise.
        uint feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.
        mapping(address => uint[3]) contributions; // Maps contributors to their contributions for each side.
    }

    /* Storage */

    // Constants

    uint RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.

    // Settings
    address public governor; // The address that can make governance changes to the parameters of the Address Curated Registry.
    uint public requesterBaseDeposit; // The base deposit to make a request.
    uint public challengerBaseDeposit; // The base deposit to challenge a request.
    uint public challengePeriodDuration; // The time before a request becomes executable if not challenged.
    uint public metaEvidenceUpdates; // The number of times the meta evidence has been updated. Used to track the latest meta evidence ID.

    // The required fee stake that a party must pay depends on who won the previous round and is proportional to the arbitration cost such that the fee stake for a round is stake multiplier * arbitration cost for that round.
    // Multipliers are in basis points.
    uint public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.
    uint public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.
    uint public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where there isn't a winner and loser (e.g. when it's the first round or the arbitrator ruled "refused to rule"/"could not rule").
    uint public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.

    // Registry data.
    mapping(address => Address) public addresses; // Maps the address to the address data.
    mapping(address => mapping(uint => address)) public arbitratorDisputeIDToAddress; // Maps a dispute ID to the address with the disputed request. On the form arbitratorDisputeIDToAddress[arbitrator][disputeID].
    address[] public addressList; // List of submitted addresses.

    /* Modifiers */

    modifier onlyGovernor {require(msg.sender == governor, "The caller must be the governor."); _;}

    /* Events */

    /**
     *  @dev Emitted when a party submits a new address.
     *  @param _address The address.
     *  @param _requester The address of the party that made the request.
     */
    event AddressSubmitted(address indexed _address, address indexed _requester);

    /** @dev Emitted when a party makes a request to change an address status.
     *  @param _address The affected address.
     *  @param _registrationRequest Whether the request is a registration request. False means it is a clearing request.
     */
    event RequestSubmitted(address indexed _address, bool _registrationRequest);

    /**
     *  @dev Emitted when a party makes a request, dispute or appeals are raised, or when a request is resolved.
     *  @param _requester Address of the party that submitted the request.
     *  @param _challenger Address of the party that has challenged the request, if any.
     *  @param _address The address.
     *  @param _status The status of the address.
     *  @param _disputed Whether the address is disputed.
     *  @param _appealed Whether the current round was appealed.
     */
    event AddressStatusChange(
        address indexed _requester,
        address indexed _challenger,
        address indexed _address,
        AddressStatus _status,
        bool _disputed,
        bool _appealed
    );

    /** @dev Emitted when a reimbursements and/or contribution rewards are withdrawn.
     *  @param _address The address from which the withdrawal was made.
     *  @param _contributor The address that sent the contribution.
     *  @param _request The request from which the withdrawal was made.
     *  @param _round The round from which the reward was taken.
     *  @param _value The value of the reward.
     */
    event RewardWithdrawal(address indexed _address, address indexed _contributor, uint indexed _request, uint _round, uint _value);


    /* Constructor */

    /**
     *  @dev Constructs the arbitrable token curated registry.
     *  @param _arbitrator The trusted arbitrator to resolve potential disputes.
     *  @param _arbitratorExtraData Extra data for the trusted arbitrator contract.
     *  @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.
     *  @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.
     *  @param _governor The trusted governor of this contract.
     *  @param _requesterBaseDeposit The base deposit to make a request.
     *  @param _challengerBaseDeposit The base deposit to challenge a request.
     *  @param _challengePeriodDuration The time in seconds, parties have to challenge a request.
     *  @param _sharedStakeMultiplier Multiplier of the arbitration cost that each party must pay as fee stake for a round when there isn't a winner/loser in the previous round (e.g. when it's the first round or the arbitrator refused to or did not rule). In basis points.
     *  @param _winnerStakeMultiplier Multiplier of the arbitration cost that the winner has to pay as fee stake for a round in basis points.
     *  @param _loserStakeMultiplier Multiplier of the arbitration cost that the loser has to pay as fee stake for a round in basis points.
     */
    constructor(
        Arbitrator _arbitrator,
        bytes _arbitratorExtraData,
        string _registrationMetaEvidence,
        string _clearingMetaEvidence,
        address _governor,
        uint _requesterBaseDeposit,
        uint _challengerBaseDeposit,
        uint _challengePeriodDuration,
        uint _sharedStakeMultiplier,
        uint _winnerStakeMultiplier,
        uint _loserStakeMultiplier
    ) Arbitrable(_arbitrator, _arbitratorExtraData) public {
        emit MetaEvidence(0, _registrationMetaEvidence);
        emit MetaEvidence(1, _clearingMetaEvidence);

        governor = _governor;
        requesterBaseDeposit = _requesterBaseDeposit;
        challengerBaseDeposit = _challengerBaseDeposit;
        challengePeriodDuration = _challengePeriodDuration;
        sharedStakeMultiplier = _sharedStakeMultiplier;
        winnerStakeMultiplier = _winnerStakeMultiplier;
        loserStakeMultiplier = _loserStakeMultiplier;
    }


    /* External and Public */

    // ************************ //
    // *       Requests       * //
    // ************************ //

    /** @dev Submits a request to change an address status. Accepts enough ETH to fund a potential dispute considering the current required amount and reimburses the rest. TRUSTED.
     *  @param _address The address.
     */
    function requestStatusChange(address _address)
        external
        payable
    {
        Address storage addr = addresses[_address];
        if (addr.requests.length == 0) {
            // Initial address registration.
            addressList.push(_address);
            emit AddressSubmitted(_address, msg.sender);
        }

        // Update address status.
        if (addr.status == AddressStatus.Absent)
            addr.status = AddressStatus.RegistrationRequested;
        else if (addr.status == AddressStatus.Registered)
            addr.status = AddressStatus.ClearingRequested;
        else
            revert("Address already has a pending request.");

        // Setup request.
        Request storage request = addr.requests[addr.requests.length++];
        request.parties[uint(Party.Requester)] = msg.sender;
        request.submissionTime = now;
        request.arbitrator = arbitrator;
        request.arbitratorExtraData = arbitratorExtraData;
        Round storage round = request.rounds[request.rounds.length++];

        emit RequestSubmitted(_address, addr.status == AddressStatus.RegistrationRequested);

        // Amount required to fully the requester: requesterBaseDeposit + arbitration cost + (arbitration cost * multiplier).
        uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);
        uint totalCost = arbitrationCost.addCap((arbitrationCost.mulCap(sharedStakeMultiplier)) / MULTIPLIER_DIVISOR).addCap(requesterBaseDeposit);
        contribute(round, Party.Requester, msg.sender, msg.value, totalCost);
        require(round.paidFees[uint(Party.Requester)] >= totalCost, "You must fully fund your side.");
        round.hasPaid[uint(Party.Requester)] = true;

        emit AddressStatusChange(
            request.parties[uint(Party.Requester)],
            address(0x0),
            _address,
            addr.status,
            false,
            false
        );
    }

    /** @dev Challenges the latest request of an address. Accepts enough ETH to fund a potential dispute considering the current required amount. Reimburses unused ETH. TRUSTED.
     *  @param _address The address with the request to challenge.
     *  @param _evidence A link to an evidence using its URI. Ignored if not provided or if not enough funds were provided to create a dispute.
     */
    function challengeRequest(address _address, string _evidence) external payable {
        Address storage addr = addresses[_address];
        require(
            addr.status == AddressStatus.RegistrationRequested || addr.status == AddressStatus.ClearingRequested,
            "The address must have a pending request."
        );
        Request storage request = addr.requests[addr.requests.length - 1];
        require(now - request.submissionTime <= challengePeriodDuration, "Challenges must occur during the challenge period.");
        require(!request.disputed, "The request should not have already been disputed.");

        // Take the deposit and save the challenger's address.
        request.parties[uint(Party.Challenger)] = msg.sender;

        Round storage round = request.rounds[request.rounds.length - 1];
        uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);
        uint totalCost = arbitrationCost.addCap((arbitrationCost.mulCap(sharedStakeMultiplier)) / MULTIPLIER_DIVISOR).addCap(challengerBaseDeposit);
        contribute(round, Party.Challenger, msg.sender, msg.value, totalCost);
        require(round.paidFees[uint(Party.Challenger)] >= totalCost, "You must fully fund your side.");
        round.hasPaid[uint(Party.Challenger)] = true;

        // Raise a dispute.
        request.disputeID = request.arbitrator.createDispute.value(arbitrationCost)(RULING_OPTIONS, request.arbitratorExtraData);
        arbitratorDisputeIDToAddress[request.arbitrator][request.disputeID] = _address;
        request.disputed = true;
        request.rounds.length++;
        round.feeRewards = round.feeRewards.subCap(arbitrationCost);

        emit Dispute(
            request.arbitrator,
            request.disputeID,
            addr.status == AddressStatus.RegistrationRequested
                ? 2 * metaEvidenceUpdates
                : 2 * metaEvidenceUpdates + 1,
            uint(keccak256(abi.encodePacked(_address,addr.requests.length - 1)))
        );
        emit AddressStatusChange(
            request.parties[uint(Party.Requester)],
            request.parties[uint(Party.Challenger)],
            _address,
            addr.status,
            true,
            false
        );
        if (bytes(_evidence).length > 0)
            emit Evidence(request.arbitrator, uint(keccak256(abi.encodePacked(_address,addr.requests.length - 1))), msg.sender, _evidence);
    }

    /** @dev Takes up to the total amount required to fund a side of an appeal. Reimburses the rest. Creates an appeal if both sides are fully funded. TRUSTED.
     *  @param _address The address with the request to fund.
     *  @param _side The recipient of the contribution.
     */
    function fundAppeal(address _address, Party _side) external payable {
        // Recipient must be either the requester or challenger.
        require(_side == Party.Requester || _side == Party.Challenger); // solium-disable-line error-reason
        Address storage addr = addresses[_address];
        require(
            addr.status == AddressStatus.RegistrationRequested || addr.status == AddressStatus.ClearingRequested,
            "The address must have a pending request."
        );
        Request storage request = addr.requests[addr.requests.length - 1];
        require(request.disputed, "A dispute must have been raised to fund an appeal.");
        (uint appealPeriodStart, uint appealPeriodEnd) = request.arbitrator.appealPeriod(request.disputeID);
        require(
            now >= appealPeriodStart && now < appealPeriodEnd,
            "Contributions must be made within the appeal period."
        );


        // Amount required to fully fund each side: arbitration cost + (arbitration cost * multiplier)
        Round storage round = request.rounds[request.rounds.length - 1];
        Party winner = Party(request.arbitrator.currentRuling(request.disputeID));
        Party loser;
        if (winner == Party.Requester)
            loser = Party.Challenger;
        else if (winner == Party.Challenger)
            loser = Party.Requester;
        require(!(_side==loser) || (now-appealPeriodStart < (appealPeriodEnd-appealPeriodStart)/2), "The loser must contribute during the first half of the appeal period.");

        uint multiplier;
        if (_side == winner)
            multiplier = winnerStakeMultiplier;
        else if (_side == loser)
            multiplier = loserStakeMultiplier;
        else
            multiplier = sharedStakeMultiplier;
        uint appealCost = request.arbitrator.appealCost(request.disputeID, request.arbitratorExtraData);
        uint totalCost = appealCost.addCap((appealCost.mulCap(multiplier)) / MULTIPLIER_DIVISOR);
        contribute(round, _side, msg.sender, msg.value, totalCost);
        if (round.paidFees[uint(_side)] >= totalCost)
            round.hasPaid[uint(_side)] = true;

        // Raise appeal if both sides are fully funded.
        if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) {
            request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData);
            request.rounds.length++;
            round.feeRewards = round.feeRewards.subCap(appealCost);
            emit AddressStatusChange(
                request.parties[uint(Party.Requester)],
                request.parties[uint(Party.Challenger)],
                _address,
                addr.status,
                true,
                true
            );
        }
    }

    /** @dev Reimburses contributions if no disputes were raised. If a dispute was raised, sends the fee stake rewards and reimbursements proportional to the contributions made to the winner of a dispute.
     *  @param _beneficiary The address that made contributions to a request.
     *  @param _address The address submission with the request from which to withdraw.
     *  @param _request The request from which to withdraw.
     *  @param _round The round from which to withdraw.
     */
    function withdrawFeesAndRewards(address _beneficiary, address _address, uint _request, uint _round) public {
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[_request];
        Round storage round = request.rounds[_round];
        // The request must be executed and there can be no disputes pending resolution.
        require(request.resolved); // solium-disable-line error-reason

        uint reward;
        if (!request.disputed || request.ruling == Party.None) {
            // No disputes were raised, or there isn't a winner and loser. Reimburse unspent fees proportionally.
            uint rewardRequester = round.paidFees[uint(Party.Requester)] > 0
                ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.paidFees[uint(Party.Challenger)] + round.paidFees[uint(Party.Requester)])
                : 0;
            uint rewardChallenger = round.paidFees[uint(Party.Challenger)] > 0
                ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.paidFees[uint(Party.Challenger)] + round.paidFees[uint(Party.Requester)])
                : 0;

            reward = rewardRequester + rewardChallenger;
            round.contributions[_beneficiary][uint(Party.Requester)] = 0;
            round.contributions[_beneficiary][uint(Party.Challenger)] = 0;
        } else {
            // Reward the winner.
            reward = round.paidFees[uint(request.ruling)] > 0
                ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.paidFees[uint(request.ruling)]
                : 0;

            round.contributions[_beneficiary][uint(request.ruling)] = 0;
        }

        emit RewardWithdrawal(_address, _beneficiary, _request, _round,  reward);
        _beneficiary.send(reward); // It is the user responsibility to accept ETH.
    }

    /** @dev Withdraws rewards and reimbursements of multiple rounds at once. This function is O(n) where n is the number of rounds. This could exceed gas limits, therefore this function should be used only as a utility and not be relied upon by other contracts.
     *  @param _beneficiary The address that made contributions to the request.
     *  @param _address The address with funds to be withdrawn.
     *  @param _request The request from which to withdraw contributions.
     *  @param _cursor The round from where to start withdrawing.
     *  @param _count The number of rounds to iterate. If set to 0 or a value larger than the number of rounds, iterates until the last round.
     */
    function batchRoundWithdraw(address _beneficiary, address _address, uint _request, uint _cursor, uint _count) public {
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[_request];
        for (uint i = _cursor; i<request.rounds.length && (_count==0 || i<_count); i++)
            withdrawFeesAndRewards(_beneficiary, _address, _request, i);
    }

    /** @dev Withdraws rewards and reimbursements of multiple requests at once. This function is O(n*m) where n is the number of requests and m is the number of rounds. This could exceed gas limits, therefore this function should be used only as a utility and not be relied upon by other contracts.
     *  @param _beneficiary The address that made contributions to the request.
     *  @param _address The address with funds to be withdrawn.
     *  @param _cursor The request from which to start withdrawing.
     *  @param _count The number of requests to iterate. If set to 0 or a value larger than the number of request, iterates until the last request.
     *  @param _roundCursor The round of each request from where to start withdrawing.
     *  @param _roundCount The number of rounds to iterate on each request. If set to 0 or a value larger than the number of rounds a request has, iteration for that request will stop at the last round.
     */
    function batchRequestWithdraw(
        address _beneficiary,
        address _address,
        uint _cursor,
        uint _count,
        uint _roundCursor,
        uint _roundCount
    ) external {
        Address storage addr = addresses[_address];
        for (uint i = _cursor; i<addr.requests.length && (_count==0 || i<_count); i++)
            batchRoundWithdraw(_beneficiary, _address, i, _roundCursor, _roundCount);
    }

    /** @dev Executes a request if the challenge period passed and no one challenged the request.
     *  @param _address The address with the request to execute.
     */
    function executeRequest(address _address) external {
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[addr.requests.length - 1];
        require(
            now - request.submissionTime > challengePeriodDuration,
            "Time to challenge the request must have passed."
        );
        require(!request.disputed, "The request should not be disputed.");

        if (addr.status == AddressStatus.RegistrationRequested)
            addr.status = AddressStatus.Registered;
        else if (addr.status == AddressStatus.ClearingRequested)
            addr.status = AddressStatus.Absent;
        else
            revert("There must be a request.");

        request.resolved = true;
        withdrawFeesAndRewards(request.parties[uint(Party.Requester)], _address, addr.requests.length - 1, 0); // Automatically withdraw for the requester.

        emit AddressStatusChange(
            request.parties[uint(Party.Requester)],
            address(0x0),
            _address,
            addr.status,
            false,
            false
        );
    }

    /** @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.
     *  Overrides parent function to account for the situation where the winner loses a case due to paying less appeal fees than expected.
     *  @param _disputeID ID of the dispute in the arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function rule(uint _disputeID, uint _ruling) public {
        Party resultRuling = Party(_ruling);
        address _address = arbitratorDisputeIDToAddress[msg.sender][_disputeID];
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[addr.requests.length - 1];
        Round storage round = request.rounds[request.rounds.length - 1];
        require(_ruling <= RULING_OPTIONS); // solium-disable-line error-reason
        require(request.arbitrator == msg.sender); // solium-disable-line error-reason
        require(!request.resolved); // solium-disable-line error-reason

        // The ruling is inverted if the loser paid its fees.
        if (round.hasPaid[uint(Party.Requester)] == true) // If one side paid its fees, the ruling is in its favor. Note that if the other side had also paid, an appeal would have been created.
            resultRuling = Party.Requester;
        else if (round.hasPaid[uint(Party.Challenger)] == true)
            resultRuling = Party.Challenger;

        emit Ruling(Arbitrator(msg.sender), _disputeID, uint(resultRuling));
        executeRuling(_disputeID, uint(resultRuling));
    }

    /** @dev Submit a reference to evidence. EVENT.
     *  @param _evidence A link to an evidence using its URI.
     */
    function submitEvidence(address _address, string _evidence) external {
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[addr.requests.length - 1];
        require(!request.resolved, "The dispute must not already be resolved.");

        emit Evidence(request.arbitrator, uint(keccak256(abi.encodePacked(_address,addr.requests.length - 1))), msg.sender, _evidence);
    }

    // ************************ //
    // *      Governance      * //
    // ************************ //

    /** @dev Change the duration of the challenge period.
     *  @param _challengePeriodDuration The new duration of the challenge period.
     */
    function changeTimeToChallenge(uint _challengePeriodDuration) external onlyGovernor {
        challengePeriodDuration = _challengePeriodDuration;
    }

    /** @dev Change the base amount required as a deposit to make a request.
     *  @param _requesterBaseDeposit The new base amount of wei required to make a request.
     */
    function changeRequesterBaseDeposit(uint _requesterBaseDeposit) external onlyGovernor {
        requesterBaseDeposit = _requesterBaseDeposit;
    }

    /** @dev Change the base amount required as a deposit to challenge a request.
     *  @param _challengerBaseDeposit The new base amount of wei required to challenge a request.
     */
    function changeChallengerBaseDeposit(uint _challengerBaseDeposit) external onlyGovernor {
        challengerBaseDeposit = _challengerBaseDeposit;
    }

    /** @dev Change the governor of the token curated registry.
     *  @param _governor The address of the new governor.
     */
    function changeGovernor(address _governor) external onlyGovernor {
        governor = _governor;
    }

    /** @dev Change the percentage of arbitration fees that must be paid as fee stake by parties when there isn't a winner or loser.
     *  @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.
     */
    function changeSharedStakeMultiplier(uint _sharedStakeMultiplier) external onlyGovernor {
        sharedStakeMultiplier = _sharedStakeMultiplier;
    }

    /** @dev Change the percentage of arbitration fees that must be paid as fee stake by the winner of the previous round.
     *  @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.
     */
    function changeWinnerStakeMultiplier(uint _winnerStakeMultiplier) external onlyGovernor {
        winnerStakeMultiplier = _winnerStakeMultiplier;
    }

    /** @dev Change the percentage of arbitration fees that must be paid as fee stake by the party that lost the previous round.
     *  @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.
     */
    function changeLoserStakeMultiplier(uint _loserStakeMultiplier) external onlyGovernor {
        loserStakeMultiplier = _loserStakeMultiplier;
    }

    /** @dev Change the arbitrator to be used for disputes that may be raised in the next requests. The arbitrator is trusted to support appeal periods and not reenter.
     *  @param _arbitrator The new trusted arbitrator to be used in the next requests.
     *  @param _arbitratorExtraData The extra data used by the new arbitrator.
     */
    function changeArbitrator(Arbitrator _arbitrator, bytes _arbitratorExtraData) external onlyGovernor {
        arbitrator = _arbitrator;
        arbitratorExtraData = _arbitratorExtraData;
    }

    /** @dev Update the meta evidence used for disputes.
     *  @param _registrationMetaEvidence The meta evidence to be used for future registration request disputes.
     *  @param _clearingMetaEvidence The meta evidence to be used for future clearing request disputes.
     */
    function changeMetaEvidence(string _registrationMetaEvidence, string _clearingMetaEvidence) external onlyGovernor {
        metaEvidenceUpdates++;
        emit MetaEvidence(2 * metaEvidenceUpdates, _registrationMetaEvidence);
        emit MetaEvidence(2 * metaEvidenceUpdates + 1, _clearingMetaEvidence);
    }


    /* Internal */

    /** @dev Returns the contribution value and remainder from available ETH and required amount.
     *  @param _available The amount of ETH available for the contribution.
     *  @param _requiredAmount The amount of ETH required for the contribution.
     *  @return taken The amount of ETH taken.
     *  @return remainder The amount of ETH left from the contribution.
     */
    function calculateContribution(uint _available, uint _requiredAmount)
        internal
        pure
        returns(uint taken, uint remainder)
    {
        if (_requiredAmount > _available)
            return (_available, 0); // Take whatever is available, return 0 as leftover ETH.

        remainder = _available - _requiredAmount;
        return (_requiredAmount, remainder);
    }

    /** @dev Make a fee contribution.
     *  @param _round The round to contribute.
     *  @param _side The side for which to contribute.
     *  @param _contributor The contributor.
     *  @param _amount The amount contributed.
     *  @param _totalRequired The total amount required for this side.
     */
    function contribute(Round storage _round, Party _side, address _contributor, uint _amount, uint _totalRequired) internal {
        // Take up to the amount necessary to fund the current round at the current costs.
        uint contribution; // Amount contributed.
        uint remainingETH; // Remaining ETH to send back.
        (contribution, remainingETH) = calculateContribution(_amount, _totalRequired.subCap(_round.paidFees[uint(_side)]));
        _round.contributions[_contributor][uint(_side)] += contribution;
        _round.paidFees[uint(_side)] += contribution;
        _round.feeRewards += contribution;

        // Reimburse leftover ETH.
        _contributor.send(remainingETH); // Deliberate use of send in order to not block the contract in case of reverting fallback.
    }

    /** @dev Execute the ruling of a dispute.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function executeRuling(uint _disputeID, uint _ruling) internal {
        address _address = arbitratorDisputeIDToAddress[msg.sender][_disputeID];
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[addr.requests.length - 1];

        Party winner = Party(_ruling);

        // Update address state
        if (winner == Party.Requester) { // Execute Request
            if (addr.status == AddressStatus.RegistrationRequested)
                addr.status = AddressStatus.Registered;
            else
                addr.status = AddressStatus.Absent;
        } else { // Revert to previous state.
            if (addr.status == AddressStatus.RegistrationRequested)
                addr.status = AddressStatus.Absent;
            else if (addr.status == AddressStatus.ClearingRequested)
                addr.status = AddressStatus.Registered;
        }

        request.resolved = true;
        request.ruling = Party(_ruling);
        // Automatically withdraw.
        if (winner == Party.None) {
            withdrawFeesAndRewards(request.parties[uint(Party.Requester)], _address, addr.requests.length-1, 0);
            withdrawFeesAndRewards(request.parties[uint(Party.Challenger)], _address, addr.requests.length-1, 0);
        } else {
            withdrawFeesAndRewards(request.parties[uint(winner)], _address, addr.requests.length-1, 0);
        }

        emit AddressStatusChange(
            request.parties[uint(Party.Requester)],
            request.parties[uint(Party.Challenger)],
            _address,
            addr.status,
            request.disputed,
            false
        );
    }


    /* Views */

    /** @dev Return true if the address is on the list.
     *  @param _address The address to be queried.
     *  @return allowed True if the address is allowed, false otherwise.
     */
    function isPermitted(bytes32 _address) external view returns (bool allowed) {
        Address storage addr = addresses[address(_address)];
        return addr.status == AddressStatus.Registered || addr.status == AddressStatus.ClearingRequested;
    }


    /* Interface Views */

    /** @dev Return the sum of withdrawable wei of a request an account is entitled to. This function is O(n), where n is the number of rounds of the request. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
     *  @param _address The address to query.
     *  @param _beneficiary The contributor for which to query.
     *  @param _request The request from which to query for.
     *  @return The total amount of wei available to withdraw.
     */
    function amountWithdrawable(address _address, address _beneficiary, uint _request) external view returns (uint total){
        Request storage request = addresses[_address].requests[_request];
        if (!request.resolved) return total;

        for (uint i = 0; i < request.rounds.length; i++) {
            Round storage round = request.rounds[i];
            if (!request.disputed || request.ruling == Party.None) {
                uint rewardRequester = round.paidFees[uint(Party.Requester)] > 0
                    ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.paidFees[uint(Party.Requester)] + round.paidFees[uint(Party.Challenger)])
                    : 0;
                uint rewardChallenger = round.paidFees[uint(Party.Challenger)] > 0
                    ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.paidFees[uint(Party.Requester)] + round.paidFees[uint(Party.Challenger)])
                    : 0;

                total += rewardRequester + rewardChallenger;
            } else {
                total += round.paidFees[uint(request.ruling)] > 0
                    ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.paidFees[uint(request.ruling)]
                    : 0;
            }
        }

        return total;
    }

    /** @dev Return the numbers of addresses that were submitted. Includes addresses that never made it to the list or were later removed.
     *  @return count The numbers of addresses in the list.
     */
    function addressCount() external view returns (uint count) {
        return addressList.length;
    }

    /** @dev Return the numbers of addresses with each status. This function is O(n), where n is the number of addresses. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
     *  @return The numbers of addresses in the list per status.
     */
    function countByStatus()
        external
        view
        returns (
            uint absent,
            uint registered,
            uint registrationRequest,
            uint clearingRequest,
            uint challengedRegistrationRequest,
            uint challengedClearingRequest
        )
    {
        for (uint i = 0; i < addressList.length; i++) {
            Address storage addr = addresses[addressList[i]];
            Request storage request = addr.requests[addr.requests.length - 1];

            if (addr.status == AddressStatus.Absent) absent++;
            else if (addr.status == AddressStatus.Registered) registered++;
            else if (addr.status == AddressStatus.RegistrationRequested && !request.disputed) registrationRequest++;
            else if (addr.status == AddressStatus.ClearingRequested && !request.disputed) clearingRequest++;
            else if (addr.status == AddressStatus.RegistrationRequested && request.disputed) challengedRegistrationRequest++;
            else if (addr.status == AddressStatus.ClearingRequested && request.disputed) challengedClearingRequest++;
        }
    }

    /** @dev Return the values of the addresses the query finds. This function is O(n), where n is the number of addresses. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
     *  @param _cursor The address from which to start iterating. To start from either the oldest or newest item.
     *  @param _count The number of addresses to return.
     *  @param _filter The filter to use. Each element of the array in sequence means:
     *  - Include absent addresses in result.
     *  - Include registered addresses in result.
     *  - Include addresses with registration requests that are not disputed in result.
     *  - Include addresses with clearing requests that are not disputed in result.
     *  - Include disputed addresses with registration requests in result.
     *  - Include disputed addresses with clearing requests in result.
     *  - Include addresses submitted by the caller.
     *  - Include addresses challenged by the caller.
     *  @param _oldestFirst Whether to sort from oldest to the newest item.
     *  @return The values of the addresses found and whether there are more addresses for the current filter and sort.
     */
    function queryAddresses(address _cursor, uint _count, bool[8] _filter, bool _oldestFirst)
        external
        view
        returns (address[] values, bool hasMore)
    {
        uint cursorIndex;
        values = new address[](_count);
        uint index = 0;

        if (_cursor == 0)
            cursorIndex = 0;
        else {
            for (uint j = 0; j < addressList.length; j++) {
                if (addressList[j] == _cursor) {
                    cursorIndex = j;
                    break;
                }
            }
            require(cursorIndex != 0, "The cursor is invalid.");
        }

        for (
                uint i = cursorIndex == 0 ? (_oldestFirst ? 0 : 1) : (_oldestFirst ? cursorIndex + 1 : addressList.length - cursorIndex + 1);
                _oldestFirst ? i < addressList.length : i <= addressList.length;
                i++
            ) { // Oldest or newest first.
            Address storage addr = addresses[addressList[_oldestFirst ? i : addressList.length - i]];
            Request storage request = addr.requests[addr.requests.length - 1];
            if (
                /* solium-disable operator-whitespace */
                (_filter[0] && addr.status == AddressStatus.Absent) ||
                (_filter[1] && addr.status == AddressStatus.Registered) ||
                (_filter[2] && addr.status == AddressStatus.RegistrationRequested && !request.disputed) ||
                (_filter[3] && addr.status == AddressStatus.ClearingRequested && !request.disputed) ||
                (_filter[4] && addr.status == AddressStatus.RegistrationRequested && request.disputed) ||
                (_filter[5] && addr.status == AddressStatus.ClearingRequested && request.disputed) ||
                (_filter[6] && request.parties[uint(Party.Requester)] == msg.sender) || // My Submissions.
                (_filter[7] && request.parties[uint(Party.Challenger)] == msg.sender) // My Challenges.
                /* solium-enable operator-whitespace */
            ) {
                if (index < _count) {
                    values[index] = addressList[_oldestFirst ? i : addressList.length - i];
                    index++;
                } else {
                    hasMore = true;
                    break;
                }
            }
        }
    }

    /** @dev Gets the contributions made by a party for a given round of a request.
     *  @param _address The address.
     *  @param _request The position of the request.
     *  @param _round The position of the round.
     *  @param _contributor The address of the contributor.
     *  @return The contributions.
     */
    function getContributions(
        address _address,
        uint _request,
        uint _round,
        address _contributor
    ) external view returns(uint[3] contributions) {
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[_request];
        Round storage round = request.rounds[_round];
        contributions = round.contributions[_contributor];
    }

    /** @dev Returns address information. Includes length of requests array.
     *  @param _address The queried address.
     *  @return The address information.
     */
    function getAddressInfo(address _address)
        external
        view
        returns (
            AddressStatus status,
            uint numberOfRequests
        )
    {
        Address storage addr = addresses[_address];
        return (
            addr.status,
            addr.requests.length
        );
    }

    /** @dev Gets information on a request made for an address.
     *  @param _address The queried address.
     *  @param _request The request to be queried.
     *  @return The request information.
     */
    function getRequestInfo(address _address, uint _request)
        external
        view
        returns (
            bool disputed,
            uint disputeID,
            uint submissionTime,
            bool resolved,
            address[3] parties,
            uint numberOfRounds,
            Party ruling,
            Arbitrator arbitrator,
            bytes arbitratorExtraData
        )
    {
        Request storage request = addresses[_address].requests[_request];
        return (
            request.disputed,
            request.disputeID,
            request.submissionTime,
            request.resolved,
            request.parties,
            request.rounds.length,
            request.ruling,
            request.arbitrator,
            request.arbitratorExtraData
        );
    }

    /** @dev Gets the information on a round of a request.
     *  @param _address The queried address.
     *  @param _request The request to be queried.
     *  @param _round The round to be queried.
     *  @return The round information.
     */
    function getRoundInfo(address _address, uint _request, uint _round)
        external
        view
        returns (
            bool appealed,
            uint[3] paidFees,
            bool[3] hasPaid,
            uint feeRewards
        )
    {
        Address storage addr = addresses[_address];
        Request storage request = addr.requests[_request];
        Round storage round = request.rounds[_round];
        return (
            _round != (request.rounds.length-1),
            round.paidFees,
            round.hasPaid,
            round.feeRewards
        );
    }
}

/**
 *  @title ArbitrableTokenList
 *  This contract is an arbitrable token curated registry for tokens, sometimes referred to as a Token² Curated Registry. Users can send requests to register or remove tokens from the registry, which can in turn, be challenged by parties that disagree with them.
 *  A crowdsourced insurance system allows parties to contribute to arbitration fees and win rewards if the side they backed ultimately wins a dispute.
 *  NOTE: This contract trusts that the Arbitrator is honest and will not reenter or modify its costs during a call. This contract is only to be used with an arbitrator returning appealPeriod and having non-zero fees. The governor contract (which will be a DAO) is also to be trusted.
 */
contract ArbitrableTokenList is PermissionInterface, Arbitrable {
    using CappedMath for uint; // Operations bounded between 0 and 2**256 - 1.

    /* Enums */

    enum TokenStatus {
        Absent, // The token is not in the registry.
        Registered, // The token is in the registry.
        RegistrationRequested, // The token has a request to be added to the registry.
        ClearingRequested // The token has a request to be removed from the registry.
    }

    enum Party {
        None,      // Party per default when there is no challenger or requester. Also used for unconclusive ruling.
        Requester, // Party that made the request to change a token status.
        Challenger // Party that challenges the request to change a token status.
    }

    // ************************ //
    // *  Request Life Cycle  * //
    // ************************ //
    // Changes to the token status are made via requests for either listing or removing a token from the Token² Curated Registry.
    // To make or challenge a request, a party must pay a deposit. This value will be rewarded to the party that ultimately wins a dispute. If no one challenges the request, the value will be reimbursed to the requester.
    // Additionally to the challenge reward, in the case a party challenges a request, both sides must fully pay the amount of arbitration fees required to raise a dispute. The party that ultimately wins the case will be reimbursed.
    // Finally, arbitration fees can be crowdsourced. To incentivise insurers, an additional fee stake must be deposited. Contributors that fund the side that ultimately wins a dispute will be reimbursed and rewarded with the other side's fee stake proportionally to their contribution.
    // In summary, costs for placing or challenging a request are the following:
    // - A challenge reward given to the party that wins a potential dispute.
    // - Arbitration fees used to pay jurors.
    // - A fee stake that is distributed among insurers of the side that ultimately wins a dispute.

    /* Structs */

    struct Token {
        string name; // The token name (e.g. Pinakion).
        string ticker; // The token ticker (e.g. PNK).
        address addr; // The Ethereum address of the token.
        string symbolMultihash; // The multihash of the token symbol.
        TokenStatus status; // The status of the token.
        Request[] requests; // List of status change requests made for the token.
    }

    // Some arrays below have 3 elements to map with the Party enums for better readability:
    // - 0: is unused, matches `Party.None`.
    // - 1: for `Party.Requester`.
    // - 2: for `Party.Challenger`.
    struct Request {
        bool disputed; // True if a dispute was raised.
        uint disputeID; // ID of the dispute, if any.
        uint submissionTime; // Time when the request was made. Used to track when the challenge period ends.
        bool resolved; // True if the request was executed and/or any disputes raised were resolved.
        address[3] parties; // Address of requester and challenger, if any.
        Round[] rounds; // Tracks each round of a dispute.
        Party ruling; // The final ruling given, if any.
        Arbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.
        bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.
    }

    struct Round {
        uint[3] paidFees; // Tracks the fees paid by each side on this round.
        bool[3] hasPaid; // True when the side has fully paid its fee. False otherwise.
        uint feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.
        mapping(address => uint[3]) contributions; // Maps contributors to their contributions for each side.
    }

    /* Storage */
    
    // Constants
    
    uint RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.

    // Settings
    address public governor; // The address that can make governance changes to the parameters of the Token² Curated Registry.
    uint public requesterBaseDeposit; // The base deposit to make a request.
    uint public challengerBaseDeposit; // The base deposit to challenge a request.
    uint public challengePeriodDuration; // The time before a request becomes executable if not challenged.
    uint public metaEvidenceUpdates; // The number of times the meta evidence has been updated. Used to track the latest meta evidence ID.

    // The required fee stake that a party must pay depends on who won the previous round and is proportional to the arbitration cost such that the fee stake for a round is stake multiplier * arbitration cost for that round.
    // Multipliers are in basis points.
    uint public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.
    uint public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.
    uint public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where there isn't a winner and loser (e.g. when it's the first round or the arbitrator ruled "refused to rule"/"could not rule").
    uint public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.

    // Registry data.
    mapping(bytes32 => Token) public tokens; // Maps the token ID to the token data.
    mapping(address => mapping(uint => bytes32)) public arbitratorDisputeIDToTokenID; // Maps a dispute ID to the ID of the token with the disputed request. On the form arbitratorDisputeIDToTokenID[arbitrator][disputeID].
    bytes32[] public tokensList; // List of IDs of submitted tokens.

    // Token list
    mapping(address => bytes32[]) public addressToSubmissions; // Maps addresses to submitted token IDs.

    /* Modifiers */

    modifier onlyGovernor {require(msg.sender == governor, "The caller must be the governor."); _;}

    /* Events */

    /**
     *  @dev Emitted when a party submits a new token.
     *  @param _name The token name (e.g. Pinakion).
     *  @param _ticker The token ticker (e.g. PNK).
     *  @param _symbolMultihash The keccak256 multihash of the token symbol image.
     *  @param _address The token address.
     */
    event TokenSubmitted(string _name, string _ticker, string _symbolMultihash, address indexed _address);

    /** @dev Emitted when a party makes a request to change a token status.
     *  @param _tokenID The ID of the affected token.
     *  @param _registrationRequest Whether the request is a registration request. False means it is a clearing request.
     */
    event RequestSubmitted(bytes32 indexed _tokenID, bool _registrationRequest);

    /**
     *  @dev Emitted when a party makes a request, dispute or appeals are raised, or when a request is resolved.
     *  @param _requester Address of the party that submitted the request.
     *  @param _challenger Address of the party that has challenged the request, if any.
     *  @param _tokenID The token ID. It is the keccak256 hash of it's data.
     *  @param _status The status of the token.
     *  @param _disputed Whether the token is disputed.
     *  @param _appealed Whether the current round was appealed.
     */
    event TokenStatusChange(
        address indexed _requester,
        address indexed _challenger,
        bytes32 indexed _tokenID,
        TokenStatus _status,
        bool _disputed,
        bool _appealed
    );

    /** @dev Emitted when a reimbursements and/or contribution rewards are withdrawn.
     *  @param _tokenID The ID of the token from which the withdrawal was made.
     *  @param _contributor The address that sent the contribution.
     *  @param _request The request from which the withdrawal was made.
     *  @param _round The round from which the reward was taken.
     *  @param _value The value of the reward.
     */
    event RewardWithdrawal(bytes32 indexed _tokenID, address indexed _contributor, uint indexed _request, uint _round, uint _value);

    
    /* Constructor */

    /**
     *  @dev Constructs the arbitrable token curated registry.
     *  @param _arbitrator The trusted arbitrator to resolve potential disputes.
     *  @param _arbitratorExtraData Extra data for the trusted arbitrator contract.
     *  @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.
     *  @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.
     *  @param _governor The trusted governor of this contract.
     *  @param _requesterBaseDeposit The base deposit to make a request.
     *  @param _challengerBaseDeposit The base deposit to challenge a request.
     *  @param _challengePeriodDuration The time in seconds, parties have to challenge a request.
     *  @param _sharedStakeMultiplier Multiplier of the arbitration cost that each party must pay as fee stake for a round when there isn't a winner/loser in the previous round (e.g. when it's the first round or the arbitrator refused to or did not rule). In basis points.
     *  @param _winnerStakeMultiplier Multiplier of the arbitration cost that the winner has to pay as fee stake for a round in basis points.
     *  @param _loserStakeMultiplier Multiplier of the arbitration cost that the loser has to pay as fee stake for a round in basis points.
     */
    constructor(
        Arbitrator _arbitrator,
        bytes _arbitratorExtraData,
        string _registrationMetaEvidence,
        string _clearingMetaEvidence,
        address _governor,
        uint _requesterBaseDeposit,
        uint _challengerBaseDeposit,
        uint _challengePeriodDuration,
        uint _sharedStakeMultiplier,
        uint _winnerStakeMultiplier,
        uint _loserStakeMultiplier
    ) Arbitrable(_arbitrator, _arbitratorExtraData) public {
        emit MetaEvidence(0, _registrationMetaEvidence);
        emit MetaEvidence(1, _clearingMetaEvidence);

        governor = _governor;
        requesterBaseDeposit = _requesterBaseDeposit;
        challengerBaseDeposit = _challengerBaseDeposit;
        challengePeriodDuration = _challengePeriodDuration;
        sharedStakeMultiplier = _sharedStakeMultiplier;
        winnerStakeMultiplier = _winnerStakeMultiplier;
        loserStakeMultiplier = _loserStakeMultiplier;
    }

    
    /* External and Public */
    
    // ************************ //
    // *       Requests       * //
    // ************************ //

    /** @dev Submits a request to change a token status. Accepts enough ETH to fund a potential dispute considering the current required amount and reimburses the rest. TRUSTED.
     *  @param _name The token name (e.g. Pinakion).
     *  @param _ticker The token ticker (e.g. PNK).
     *  @param _addr The Ethereum address of the token.
     *  @param _symbolMultihash The multihash of the token symbol.
     */
    function requestStatusChange(
        string _name,
        string _ticker,
        address _addr,
        string _symbolMultihash
    )
        external
        payable
    {
        bytes32 tokenID = keccak256(
            abi.encodePacked(
                _name,
                _ticker,
                _addr,
                _symbolMultihash
            )
        );

        Token storage token = tokens[tokenID];
        if (token.requests.length == 0) {
            // Initial token registration.
            token.name = _name;
            token.ticker = _ticker;
            token.addr = _addr;
            token.symbolMultihash = _symbolMultihash;
            tokensList.push(tokenID);
            addressToSubmissions[_addr].push(tokenID);
            emit TokenSubmitted(_name, _ticker, _symbolMultihash, _addr);
        }

        // Update token status.
        if (token.status == TokenStatus.Absent)
            token.status = TokenStatus.RegistrationRequested;
        else if (token.status == TokenStatus.Registered)
            token.status = TokenStatus.ClearingRequested;
        else
            revert("Token already has a pending request.");

        // Setup request.
        Request storage request = token.requests[token.requests.length++];
        request.parties[uint(Party.Requester)] = msg.sender;
        request.submissionTime = now;
        request.arbitrator = arbitrator;
        request.arbitratorExtraData = arbitratorExtraData;
        Round storage round = request.rounds[request.rounds.length++];

        emit RequestSubmitted(tokenID, token.status == TokenStatus.RegistrationRequested);

        // Amount required to fully fund each side: requesterBaseDeposit + arbitration cost + (arbitration cost * multiplier).
        uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);
        uint totalCost = arbitrationCost.addCap((arbitrationCost.mulCap(sharedStakeMultiplier)) / MULTIPLIER_DIVISOR).addCap(requesterBaseDeposit);
        contribute(round, Party.Requester, msg.sender, msg.value, totalCost);
        require(round.paidFees[uint(Party.Requester)] >= totalCost, "You must fully fund your side.");
        round.hasPaid[uint(Party.Requester)] = true;
        
        emit TokenStatusChange(
            request.parties[uint(Party.Requester)],
            address(0x0),
            tokenID,
            token.status,
            false,
            false
        );
    }

    /** @dev Challenges the latest request of a token. Accepts enough ETH to fund a potential dispute considering the current required amount. Reimburses unused ETH. TRUSTED.
     *  @param _tokenID The ID of the token with the request to challenge.
     *  @param _evidence A link to an evidence using its URI. Ignored if not provided or if not enough funds were provided to create a dispute.
     */
    function challengeRequest(bytes32 _tokenID, string _evidence) external payable {
        Token storage token = tokens[_tokenID];
        require(
            token.status == TokenStatus.RegistrationRequested || token.status == TokenStatus.ClearingRequested,
            "The token must have a pending request."
        );
        Request storage request = token.requests[token.requests.length - 1];
        require(now - request.submissionTime <= challengePeriodDuration, "Challenges must occur during the challenge period.");
        require(!request.disputed, "The request should not have already been disputed.");

        // Take the deposit and save the challenger's address.
        request.parties[uint(Party.Challenger)] = msg.sender;

        Round storage round = request.rounds[request.rounds.length - 1];
        uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);
        uint totalCost = arbitrationCost.addCap((arbitrationCost.mulCap(sharedStakeMultiplier)) / MULTIPLIER_DIVISOR).addCap(challengerBaseDeposit);
        contribute(round, Party.Challenger, msg.sender, msg.value, totalCost);
        require(round.paidFees[uint(Party.Challenger)] >= totalCost, "You must fully fund your side.");
        round.hasPaid[uint(Party.Challenger)] = true;
        
        // Raise a dispute.
        request.disputeID = request.arbitrator.createDispute.value(arbitrationCost)(RULING_OPTIONS, request.arbitratorExtraData);
        arbitratorDisputeIDToTokenID[request.arbitrator][request.disputeID] = _tokenID;
        request.disputed = true;
        request.rounds.length++;
        round.feeRewards = round.feeRewards.subCap(arbitrationCost);
        
        emit Dispute(
            request.arbitrator,
            request.disputeID,
            token.status == TokenStatus.RegistrationRequested
                ? 2 * metaEvidenceUpdates
                : 2 * metaEvidenceUpdates + 1,
            uint(keccak256(abi.encodePacked(_tokenID,token.requests.length - 1)))
        );
        emit TokenStatusChange(
            request.parties[uint(Party.Requester)],
            request.parties[uint(Party.Challenger)],
            _tokenID,
            token.status,
            true,
            false
        );
        if (bytes(_evidence).length > 0)
            emit Evidence(request.arbitrator, uint(keccak256(abi.encodePacked(_tokenID,token.requests.length - 1))), msg.sender, _evidence);
    }

    /** @dev Takes up to the total amount required to fund a side of an appeal. Reimburses the rest. Creates an appeal if both sides are fully funded. TRUSTED.
     *  @param _tokenID The ID of the token with the request to fund.
     *  @param _side The recipient of the contribution.
     */
    function fundAppeal(bytes32 _tokenID, Party _side) external payable {
        // Recipient must be either the requester or challenger.
        require(_side == Party.Requester || _side == Party.Challenger); // solium-disable-line error-reason
        Token storage token = tokens[_tokenID];
        require(
            token.status == TokenStatus.RegistrationRequested || token.status == TokenStatus.ClearingRequested,
            "The token must have a pending request."
        );
        Request storage request = token.requests[token.requests.length - 1];
        require(request.disputed, "A dispute must have been raised to fund an appeal.");
        (uint appealPeriodStart, uint appealPeriodEnd) = request.arbitrator.appealPeriod(request.disputeID);
        require(
            now >= appealPeriodStart && now < appealPeriodEnd,
            "Contributions must be made within the appeal period."
        );
        

        // Amount required to fully fund each side: arbitration cost + (arbitration cost * multiplier)
        Round storage round = request.rounds[request.rounds.length - 1];
        Party winner = Party(request.arbitrator.currentRuling(request.disputeID));
        Party loser;
        if (winner == Party.Requester)
            loser = Party.Challenger;
        else if (winner == Party.Challenger)
            loser = Party.Requester;
        require(!(_side==loser) || (now-appealPeriodStart < (appealPeriodEnd-appealPeriodStart)/2), "The loser must contribute during the first half of the appeal period.");
        
        uint multiplier;
        if (_side == winner)
            multiplier = winnerStakeMultiplier;
        else if (_side == loser)
            multiplier = loserStakeMultiplier;
        else
            multiplier = sharedStakeMultiplier;
        uint appealCost = request.arbitrator.appealCost(request.disputeID, request.arbitratorExtraData);
        uint totalCost = appealCost.addCap((appealCost.mulCap(multiplier)) / MULTIPLIER_DIVISOR);
        contribute(round, _side, msg.sender, msg.value, totalCost);
        if (round.paidFees[uint(_side)] >= totalCost)
            round.hasPaid[uint(_side)] = true;

        // Raise appeal if both sides are fully funded.
        if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) {
            request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData);
            request.rounds.length++;
            round.feeRewards = round.feeRewards.subCap(appealCost);
            emit TokenStatusChange(
                request.parties[uint(Party.Requester)],
                request.parties[uint(Party.Challenger)],
                _tokenID,
                token.status,
                true,
                true
            );
        }
    }

    /** @dev Reimburses contributions if no disputes were raised. If a dispute was raised, sends the fee stake rewards and reimbursements proportional to the contributions made to the winner of a dispute.
     *  @param _beneficiary The address that made contributions to a request.
     *  @param _tokenID The ID of the token submission with the request from which to withdraw.
     *  @param _request The request from which to withdraw.
     *  @param _round The round from which to withdraw.
     */
    function withdrawFeesAndRewards(address _beneficiary, bytes32 _tokenID, uint _request, uint _round) public {
        Token storage token = tokens[_tokenID];
        Request storage request = token.requests[_request];
        Round storage round = request.rounds[_round];
        // The request must be resolved and there can be no disputes pending resolution.
        require(request.resolved); // solium-disable-line error-reason

        uint reward;
        if (!request.disputed || request.ruling == Party.None) {
            // No disputes were raised, or there isn't a winner and loser. Reimburse unspent fees proportionally.
            uint rewardRequester = round.paidFees[uint(Party.Requester)] > 0
                ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.paidFees[uint(Party.Challenger)] + round.paidFees[uint(Party.Requester)])
                : 0;
            uint rewardChallenger = round.paidFees[uint(Party.Challenger)] > 0
                ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.paidFees[uint(Party.Challenger)] + round.paidFees[uint(Party.Requester)])
                : 0;

            reward = rewardRequester + rewardChallenger;
            round.contributions[_beneficiary][uint(Party.Requester)] = 0;
            round.contributions[_beneficiary][uint(Party.Challenger)] = 0;
        } else {
            // Reward the winner.
            reward = round.paidFees[uint(request.ruling)] > 0
                ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.paidFees[uint(request.ruling)]
                : 0;

            round.contributions[_beneficiary][uint(request.ruling)] = 0;
        }

        emit RewardWithdrawal(_tokenID, _beneficiary, _request, _round,  reward);
        _beneficiary.send(reward); // It is the user responsibility to accept ETH.
    }

    /** @dev Withdraws rewards and reimbursements of multiple rounds at once. This function is O(n) where n is the number of rounds. This could exceed gas limits, therefore this function should be used only as a utility and not be relied upon by other contracts.
     *  @param _beneficiary The address that made contributions to the request.
     *  @param _tokenID The token ID with funds to be withdrawn.
     *  @param _request The request from which to withdraw contributions.
     *  @param _cursor The round from where to start withdrawing.
     *  @param _count The number of rounds to iterate. If set to 0 or a value larger than the number of rounds, iterates until the last round.
     */
    function batchRoundWithdraw(address _beneficiary, bytes32 _tokenID, uint _request, uint _cursor, uint _count) public {
        Token storage token = tokens[_tokenID];
        Request storage request = token.requests[_request];
        for (uint i = _cursor; i<request.rounds.length && (_count==0 || i<_count); i++)
            withdrawFeesAndRewards(_beneficiary, _tokenID, _request, i);
    }

    /** @dev Withdraws rewards and reimbursements of multiple requests at once. This function is O(n*m) where n is the number of requests and m is the number of rounds to withdraw per request. This could exceed gas limits, therefore this function should be used only as a utility and not be relied upon by other contracts.
     *  @param _beneficiary The address that made contributions to the request.
     *  @param _tokenID The token ID with funds to be withdrawn.
     *  @param _cursor The request from which to start withdrawing.
     *  @param _count The number of requests to iterate. If set to 0 or a value larger than the number of request, iterates until the last request.
     *  @param _roundCursor The round of each request from where to start withdrawing.
     *  @param _roundCount The number of rounds to iterate on each request. If set to 0 or a value larger than the number of rounds a request has, iteration for that request will stop at the last round.
     */
    function batchRequestWithdraw(
        address _beneficiary,
        bytes32 _tokenID,
        uint _cursor,
        uint _count,
        uint _roundCursor,
        uint _roundCount
    ) external {
        Token storage token = tokens[_tokenID];
        for (uint i = _cursor; i<token.requests.length && (_count==0 || i<_count); i++)
            batchRoundWithdraw(_beneficiary, _tokenID, i, _roundCursor, _roundCount);
    }

    /** @dev Executes a request if the challenge period passed and no one challenged the request.
     *  @param _tokenID The ID of the token with the request to execute.
     */
    function executeRequest(bytes32 _tokenID) external {
        Token storage token = tokens[_tokenID];
        Request storage request = token.requests[token.requests.length - 1];
        require(
            now - request.submissionTime > challengePeriodDuration,
            "Time to challenge the request must have passed."
        );
        require(!request.disputed, "The request should not be disputed.");

        if (token.status == TokenStatus.RegistrationRequested)
            token.status = TokenStatus.Registered;
        else if (token.status == TokenStatus.ClearingRequested)
            token.status = TokenStatus.Absent;
        else
            revert("There must be a request.");

        request.resolved = true;
        withdrawFeesAndRewards(request.parties[uint(Party.Requester)], _tokenID, token.requests.length - 1, 0); // Automatically withdraw for the requester.

        emit TokenStatusChange(
            request.parties[uint(Party.Requester)],
            address(0x0),
            _tokenID,
            token.status,
            false,
            false
        );
    }

    /** @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.
     *  Overrides parent function to account for the situation where the winner loses a case due to paying less appeal fees than expected.
     *  @param _disputeID ID of the dispute in the arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function rule(uint _disputeID, uint _ruling) public {
        Party resultRuling = Party(_ruling);
        bytes32 tokenID = arbitratorDisputeIDToTokenID[msg.sender][_disputeID];
        Token storage token = tokens[tokenID];
        Request storage request = token.requests[token.requests.length - 1];
        Round storage round = request.rounds[request.rounds.length - 1];
        require(_ruling <= RULING_OPTIONS); // solium-disable-line error-reason
        require(request.arbitrator == msg.sender); // solium-disable-line error-reason
        require(!request.resolved); // solium-disable-line error-reason

        // The ruling is inverted if the loser paid its fees.
        if (round.hasPaid[uint(Party.Requester)] == true) // If one side paid its fees, the ruling is in its favor. Note that if the other side had also paid, an appeal would have been created.
            resultRuling = Party.Requester;
        else if (round.hasPaid[uint(Party.Challenger)] == true)
            resultRuling = Party.Challenger;
        
        emit Ruling(Arbitrator(msg.sender), _disputeID, uint(resultRuling));
        executeRuling(_disputeID, uint(resultRuling));
    }

    /** @dev Submit a reference to evidence. EVENT.
     *  @param _evidence A link to an evidence using its URI.
     */
    function submitEvidence(bytes32 _tokenID, string _evidence) external {
        Token storage token = tokens[_tokenID];
        Request storage request = token.requests[token.requests.length - 1];
        require(!request.resolved, "The dispute must not already be resolved.");

        emit Evidence(request.arbitrator, uint(keccak256(abi.encodePacked(_tokenID,token.requests.length - 1))), msg.sender, _evidence);
    }

    // ************************ //
    // *      Governance      * //
    // ************************ //

    /** @dev Change the duration of the challenge period.
     *  @param _challengePeriodDuration The new duration of the challenge period.
     */
    function changeTimeToChallenge(uint _challengePeriodDuration) external onlyGovernor {
        challengePeriodDuration = _challengePeriodDuration;
    }

    /** @dev Change the base amount required as a deposit to make a request.
     *  @param _requesterBaseDeposit The new base amount of wei required to make a request.
     */
    function changeRequesterBaseDeposit(uint _requesterBaseDeposit) external onlyGovernor {
        requesterBaseDeposit = _requesterBaseDeposit;
    }
    
    /** @dev Change the base amount required as a deposit to challenge a request.
     *  @param _challengerBaseDeposit The new base amount of wei required to challenge a request.
     */
    function changeChallengerBaseDeposit(uint _challengerBaseDeposit) external onlyGovernor {
        challengerBaseDeposit = _challengerBaseDeposit;
    }

    /** @dev Change the governor of the token curated registry.
     *  @param _governor The address of the new governor.
     */
    function changeGovernor(address _governor) external onlyGovernor {
        governor = _governor;
    }

    /** @dev Change the percentage of arbitration fees that must be paid as fee stake by parties when there isn't a winner or loser.
     *  @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.
     */
    function changeSharedStakeMultiplier(uint _sharedStakeMultiplier) external onlyGovernor {
        sharedStakeMultiplier = _sharedStakeMultiplier;
    }

    /** @dev Change the percentage of arbitration fees that must be paid as fee stake by the winner of the previous round.
     *  @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.
     */
    function changeWinnerStakeMultiplier(uint _winnerStakeMultiplier) external onlyGovernor {
        winnerStakeMultiplier = _winnerStakeMultiplier;
    }

    /** @dev Change the percentage of arbitration fees that must be paid as fee stake by the party that lost the previous round.
     *  @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.
     */
    function changeLoserStakeMultiplier(uint _loserStakeMultiplier) external onlyGovernor {
        loserStakeMultiplier = _loserStakeMultiplier;
    }

    /** @dev Change the arbitrator to be used for disputes that may be raised in the next requests. The arbitrator is trusted to support appeal periods and not reenter.
     *  @param _arbitrator The new trusted arbitrator to be used in the next requests.
     *  @param _arbitratorExtraData The extra data used by the new arbitrator.
     */
    function changeArbitrator(Arbitrator _arbitrator, bytes _arbitratorExtraData) external onlyGovernor {
        arbitrator = _arbitrator;
        arbitratorExtraData = _arbitratorExtraData;
    }

    /** @dev Update the meta evidence used for disputes.
     *  @param _registrationMetaEvidence The meta evidence to be used for future registration request disputes.
     *  @param _clearingMetaEvidence The meta evidence to be used for future clearing request disputes.
     */
    function changeMetaEvidence(string _registrationMetaEvidence, string _clearingMetaEvidence) external onlyGovernor {
        metaEvidenceUpdates++;
        emit MetaEvidence(2 * metaEvidenceUpdates, _registrationMetaEvidence);
        emit MetaEvidence(2 * metaEvidenceUpdates + 1, _clearingMetaEvidence);
    }

    
    /* Internal */

    /** @dev Returns the contribution value and remainder from available ETH and required amount.
     *  @param _available The amount of ETH available for the contribution.
     *  @param _requiredAmount The amount of ETH required for the contribution.
     *  @return taken The amount of ETH taken.
     *  @return remainder The amount of ETH left from the contribution.
     */
    function calculateContribution(uint _available, uint _requiredAmount)
        internal
        pure
        returns(uint taken, uint remainder)
    {
        if (_requiredAmount > _available)
            return (_available, 0); // Take whatever is available, return 0 as leftover ETH.

        remainder = _available - _requiredAmount;
        return (_requiredAmount, remainder);
    }
    
    /** @dev Make a fee contribution.
     *  @param _round The round to contribute.
     *  @param _side The side for which to contribute.
     *  @param _contributor The contributor.
     *  @param _amount The amount contributed.
     *  @param _totalRequired The total amount required for this side.
     */
    function contribute(Round storage _round, Party _side, address _contributor, uint _amount, uint _totalRequired) internal {
        // Take up to the amount necessary to fund the current round at the current costs.
        uint contribution; // Amount contributed.
        uint remainingETH; // Remaining ETH to send back.
        (contribution, remainingETH) = calculateContribution(_amount, _totalRequired.subCap(_round.paidFees[uint(_side)]));
        _round.contributions[_contributor][uint(_side)] += contribution;
        _round.paidFees[uint(_side)] += contribution;
        _round.feeRewards += contribution;

        // Reimburse leftover ETH.
        _contributor.send(remainingETH); // Deliberate use of send in order to not block the contract in case of reverting fallback.
    }
    
    /** @dev Execute the ruling of a dispute.
     *  @param _disputeID ID of the dispute in the Arbitrator contract.
     *  @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".
     */
    function executeRuling(uint _disputeID, uint _ruling) internal {
        bytes32 tokenID = arbitratorDisputeIDToTokenID[msg.sender][_disputeID];
        Token storage token = tokens[tokenID];
        Request storage request = token.requests[token.requests.length - 1];

        Party winner = Party(_ruling);

        // Update token state
        if (winner == Party.Requester) { // Execute Request
            if (token.status == TokenStatus.RegistrationRequested)
                token.status = TokenStatus.Registered;
            else
                token.status = TokenStatus.Absent;
        } else { // Revert to previous state.
            if (token.status == TokenStatus.RegistrationRequested)
                token.status = TokenStatus.Absent;
            else if (token.status == TokenStatus.ClearingRequested)
                token.status = TokenStatus.Registered;
        }

        request.resolved = true;
        request.ruling = Party(_ruling);
        // Automatically withdraw.
        if (winner == Party.None) {
            withdrawFeesAndRewards(request.parties[uint(Party.Requester)], tokenID, token.requests.length-1, 0);
            withdrawFeesAndRewards(request.parties[uint(Party.Challenger)], tokenID, token.requests.length-1, 0);
        } else {
            withdrawFeesAndRewards(request.parties[uint(winner)], tokenID, token.requests.length-1, 0); 
        }

        emit TokenStatusChange(
            request.parties[uint(Party.Requester)],
            request.parties[uint(Party.Challenger)],
            tokenID,
            token.status,
            request.disputed,
            false
        );
    }
    
    
    /* Views */

    /** @dev Return true if the token is on the list.
     *  @param _tokenID The ID of the token to be queried.
     *  @return allowed True if the token is allowed, false otherwise.
     */
    function isPermitted(bytes32 _tokenID) external view returns (bool allowed) {
        Token storage token = tokens[_tokenID];
        return token.status == TokenStatus.Registered || token.status == TokenStatus.ClearingRequested;
    }

    
    /* Interface Views */

    /** @dev Return the sum of withdrawable wei of a request an account is entitled to. This function is O(n), where n is the number of rounds of the request. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
     *  @param _tokenID The ID of the token to query.
     *  @param _beneficiary The contributor for which to query.
     *  @param _request The request from which to query for.
     *  @return The total amount of wei available to withdraw.
     */
    function amountWithdrawable(bytes32 _tokenID, address _beneficiary, uint _request) external view returns (uint total){
        Request storage request = tokens[_tokenID].requests[_request];
        if (!request.resolved) return total;

        for (uint i = 0; i < request.rounds.length; i++) {
            Round storage round = request.rounds[i];
            if (!request.disputed || request.ruling == Party.None) {
                uint rewardRequester = round.paidFees[uint(Party.Requester)] > 0
                    ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.paidFees[uint(Party.Requester)] + round.paidFees[uint(Party.Challenger)])
                    : 0;
                uint rewardChallenger = round.paidFees[uint(Party.Challenger)] > 0
                    ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.paidFees[uint(Party.Requester)] + round.paidFees[uint(Party.Challenger)])
                    : 0;

                total += rewardRequester + rewardChallenger;
            } else {
                total += round.paidFees[uint(request.ruling)] > 0
                    ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.paidFees[uint(request.ruling)]
                    : 0;
            }
        }

        return total;
    }
    
    /** @dev Return the numbers of tokens that were submitted. Includes tokens that never made it to the list or were later removed.
     *  @return count The numbers of tokens in the list.
     */
    function tokenCount() external view returns (uint count) {
        return tokensList.length;
    }
    
    /** @dev Return the numbers of tokens with each status. This function is O(n), where n is the number of tokens. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
     *  @return The numbers of tokens in the list per status.
     */
    function countByStatus()
        external
        view
        returns (
            uint absent,
            uint registered,
            uint registrationRequest,
            uint clearingRequest,
            uint challengedRegistrationRequest,
            uint challengedClearingRequest
        )
    {
        for (uint i = 0; i < tokensList.length; i++) {
            Token storage token = tokens[tokensList[i]];
            Request storage request = token.requests[token.requests.length - 1];

            if (token.status == TokenStatus.Absent) absent++;
            else if (token.status == TokenStatus.Registered) registered++;
            else if (token.status == TokenStatus.RegistrationRequested && !request.disputed) registrationRequest++;
            else if (token.status == TokenStatus.ClearingRequested && !request.disputed) clearingRequest++;
            else if (token.status == TokenStatus.RegistrationRequested && request.disputed) challengedRegistrationRequest++;
            else if (token.status == TokenStatus.ClearingRequested && request.disputed) challengedClearingRequest++;
        }
    }

    /** @dev Return the values of the tokens the query finds. This function is O(n), where n is the number of tokens. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.
     *  @param _cursor The ID of the token from which to start iterating. To start from either the oldest or newest item.
     *  @param _count The number of tokens to return.
     *  @param _filter The filter to use. Each element of the array in sequence means:
     *  - Include absent tokens in result.
     *  - Include registered tokens in result.
     *  - Include tokens with registration requests that are not disputed in result.
     *  - Include tokens with clearing requests that are not disputed in result.
     *  - Include disputed tokens with registration requests in result.
     *  - Include disputed tokens with clearing requests in result.
     *  - Include tokens submitted by the caller.
     *  - Include tokens challenged by the caller.
     *  @param _oldestFirst Whether to sort from oldest to the newest item.
     *  @param _tokenAddr A token address to filter submissions by address (optional).
     *  @return The values of the tokens found and whether there are more tokens for the current filter and sort.
     */
    function queryTokens(bytes32 _cursor, uint _count, bool[8] _filter, bool _oldestFirst, address _tokenAddr)
        external
        view
        returns (bytes32[] values, bool hasMore)
    {
        uint cursorIndex;
        values = new bytes32[](_count);
        uint index = 0;

        bytes32[] storage list = _tokenAddr == address(0x0)
            ? tokensList
            : addressToSubmissions[_tokenAddr];

        if (_cursor == 0)
            cursorIndex = 0;
        else {
            for (uint j = 0; j < list.length; j++) {
                if (list[j] == _cursor) {
                    cursorIndex = j;
                    break;
                }
            }
            require(cursorIndex  != 0, "The cursor is invalid.");
        }

        for (
                uint i = cursorIndex == 0 ? (_oldestFirst ? 0 : 1) : (_oldestFirst ? cursorIndex + 1 : list.length - cursorIndex + 1);
                _oldestFirst ? i < list.length : i <= list.length;
                i++
            ) { // Oldest or newest first.
            bytes32 tokenID = list[_oldestFirst ? i : list.length - i];
            Token storage token = tokens[tokenID];
            Request storage request = token.requests[token.requests.length - 1];
            if (
                /* solium-disable operator-whitespace */
                (_filter[0] && token.status == TokenStatus.Absent) ||
                (_filter[1] && token.status == TokenStatus.Registered) ||
                (_filter[2] && token.status == TokenStatus.RegistrationRequested && !request.disputed) ||
                (_filter[3] && token.status == TokenStatus.ClearingRequested && !request.disputed) ||
                (_filter[4] && token.status == TokenStatus.RegistrationRequested && request.disputed) ||
                (_filter[5] && token.status == TokenStatus.ClearingRequested && request.disputed) ||
                (_filter[6] && request.parties[uint(Party.Requester)] == msg.sender) || // My Submissions.
                (_filter[7] && request.parties[uint(Party.Challenger)] == msg.sender) // My Challenges.
                /* solium-enable operator-whitespace */
            ) {
                if (index < _count) {
                    values[index] = list[_oldestFirst ? i : list.length - i];
                    index++;
                } else {
                    hasMore = true;
                    break;
                }
            }
        }
    }
    
    /** @dev Gets the contributions made by a party for a given round of a request.
     *  @param _tokenID The ID of the token.
     *  @param _request The position of the request.
     *  @param _round The position of the round.
     *  @param _contributor The address of the contributor.
     *  @return The contributions.
     */
    function getContributions(
        bytes32 _tokenID,
        uint _request,
        uint _round,
        address _contributor
    ) external view returns(uint[3] contributions) {
        Token storage token = tokens[_tokenID];
        Request storage request = token.requests[_request];
        Round storage round = request.rounds[_round];
        contributions = round.contributions[_contributor];
    }
    
    /** @dev Returns token information. Includes length of requests array.
     *  @param _tokenID The ID of the queried token.
     *  @return The token information.
     */
    function getTokenInfo(bytes32 _tokenID)
        external
        view
        returns (
            string name,
            string ticker,
            address addr,
            string symbolMultihash,
            TokenStatus status,
            uint numberOfRequests
        )
    {
        Token storage token = tokens[_tokenID];
        return (
            token.name,
            token.ticker,
            token.addr,
            token.symbolMultihash,
            token.status,
            token.requests.length
        );
    }

    /** @dev Gets information on a request made for a token.
     *  @param _tokenID The ID of the queried token.
     *  @param _request The request to be queried.
     *  @return The request information.
     */
    function getRequestInfo(bytes32 _tokenID, uint _request)
        external
        view
        returns (
            bool disputed,
            uint disputeID,
            uint submissionTime,
            bool resolved,
            address[3] parties,
            uint numberOfRounds,
            Party ruling,
            Arbitrator arbitrator,
            bytes arbitratorExtraData
        )
    {
        Request storage request = tokens[_tokenID].requests[_request];
        return (
            request.disputed,
            request.disputeID,
            request.submissionTime,
            request.resolved,
            request.parties,
            request.rounds.length,
            request.ruling,
            request.arbitrator,
            request.arbitratorExtraData
        );
    }

    /** @dev Gets the information on a round of a request.
     *  @param _tokenID The ID of the queried token.
     *  @param _request The request to be queried.
     *  @param _round The round to be queried.
     *  @return The round information.
     */
    function getRoundInfo(bytes32 _tokenID, uint _request, uint _round)
        external
        view
        returns (
            bool appealed,
            uint[3] paidFees,
            bool[3] hasPaid,
            uint feeRewards
        )
    {
        Token storage token = tokens[_tokenID];
        Request storage request = token.requests[_request];
        Round storage round = request.rounds[_round];
        return (
            _round != (request.rounds.length-1),
            round.paidFees,
            round.hasPaid,
            round.feeRewards
        );
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"challengePeriodDuration","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"governor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"arbitratorExtraData","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_beneficiary","type":"address"},{"name":"_request","type":"uint256"}],"name":"amountWithdrawable","outputs":[{"name":"total","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_sharedStakeMultiplier","type":"uint256"}],"name":"changeSharedStakeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_tokenID","type":"bytes32"},{"name":"_cursor","type":"uint256"},{"name":"_count","type":"uint256"},{"name":"_roundCursor","type":"uint256"},{"name":"_roundCount","type":"uint256"}],"name":"batchRequestWithdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"loserStakeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"countByStatus","outputs":[{"name":"absent","type":"uint256"},{"name":"registered","type":"uint256"},{"name":"registrationRequest","type":"uint256"},{"name":"clearingRequest","type":"uint256"},{"name":"challengedRegistrationRequest","type":"uint256"},{"name":"challengedClearingRequest","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_side","type":"uint8"}],"name":"fundAppeal","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenID","type":"bytes32"}],"name":"getTokenInfo","outputs":[{"name":"name","type":"string"},{"name":"ticker","type":"string"},{"name":"addr","type":"address"},{"name":"symbolMultihash","type":"string"},{"name":"status","type":"uint8"},{"name":"numberOfRequests","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_disputeID","type":"uint256"},{"name":"_ruling","type":"uint256"}],"name":"rule","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"challengerBaseDeposit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_requesterBaseDeposit","type":"uint256"}],"name":"changeRequesterBaseDeposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_cursor","type":"bytes32"},{"name":"_count","type":"uint256"},{"name":"_filter","type":"bool[8]"},{"name":"_oldestFirst","type":"bool"},{"name":"_tokenAddr","type":"address"}],"name":"queryTokens","outputs":[{"name":"values","type":"bytes32[]"},{"name":"hasMore","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sharedStakeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"arbitratorDisputeIDToTokenID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"tokensList","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_request","type":"uint256"},{"name":"_round","type":"uint256"},{"name":"_contributor","type":"address"}],"name":"getContributions","outputs":[{"name":"contributions","type":"uint256[3]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"arbitrator","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"metaEvidenceUpdates","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"addressToSubmissions","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_tokenID","type":"bytes32"},{"name":"_request","type":"uint256"},{"name":"_cursor","type":"uint256"},{"name":"_count","type":"uint256"}],"name":"batchRoundWithdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"winnerStakeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_evidence","type":"string"}],"name":"challengeRequest","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"requesterBaseDeposit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"tokens","outputs":[{"name":"name","type":"string"},{"name":"ticker","type":"string"},{"name":"addr","type":"address"},{"name":"symbolMultihash","type":"string"},{"name":"status","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_loserStakeMultiplier","type":"uint256"}],"name":"changeLoserStakeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_request","type":"uint256"},{"name":"_round","type":"uint256"}],"name":"getRoundInfo","outputs":[{"name":"appealed","type":"bool"},{"name":"paidFees","type":"uint256[3]"},{"name":"hasPaid","type":"bool[3]"},{"name":"feeRewards","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenCount","outputs":[{"name":"count","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_ticker","type":"string"},{"name":"_addr","type":"address"},{"name":"_symbolMultihash","type":"string"}],"name":"requestStatusChange","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_tokenID","type":"bytes32"},{"name":"_request","type":"uint256"},{"name":"_round","type":"uint256"}],"name":"withdrawFeesAndRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_winnerStakeMultiplier","type":"uint256"}],"name":"changeWinnerStakeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_arbitrator","type":"address"},{"name":"_arbitratorExtraData","type":"bytes"}],"name":"changeArbitrator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenID","type":"bytes32"}],"name":"isPermitted","outputs":[{"name":"allowed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_request","type":"uint256"}],"name":"getRequestInfo","outputs":[{"name":"disputed","type":"bool"},{"name":"disputeID","type":"uint256"},{"name":"submissionTime","type":"uint256"},{"name":"resolved","type":"bool"},{"name":"parties","type":"address[3]"},{"name":"numberOfRounds","type":"uint256"},{"name":"ruling","type":"uint8"},{"name":"arbitrator","type":"address"},{"name":"arbitratorExtraData","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_challengePeriodDuration","type":"uint256"}],"name":"changeTimeToChallenge","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MULTIPLIER_DIVISOR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_registrationMetaEvidence","type":"string"},{"name":"_clearingMetaEvidence","type":"string"}],"name":"changeMetaEvidence","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_challengerBaseDeposit","type":"uint256"}],"name":"changeChallengerBaseDeposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_governor","type":"address"}],"name":"changeGovernor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenID","type":"bytes32"}],"name":"executeRequest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenID","type":"bytes32"},{"name":"_evidence","type":"string"}],"name":"submitEvidence","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_arbitrator","type":"address"},{"name":"_arbitratorExtraData","type":"bytes"},{"name":"_registrationMetaEvidence","type":"string"},{"name":"_clearingMetaEvidence","type":"string"},{"name":"_governor","type":"address"},{"name":"_requesterBaseDeposit","type":"uint256"},{"name":"_challengerBaseDeposit","type":"uint256"},{"name":"_challengePeriodDuration","type":"uint256"},{"name":"_sharedStakeMultiplier","type":"uint256"},{"name":"_winnerStakeMultiplier","type":"uint256"},{"name":"_loserStakeMultiplier","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_name","type":"string"},{"indexed":false,"name":"_ticker","type":"string"},{"indexed":false,"name":"_symbolMultihash","type":"string"},{"indexed":true,"name":"_address","type":"address"}],"name":"TokenSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_tokenID","type":"bytes32"},{"indexed":false,"name":"_registrationRequest","type":"bool"}],"name":"RequestSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_requester","type":"address"},{"indexed":true,"name":"_challenger","type":"address"},{"indexed":true,"name":"_tokenID","type":"bytes32"},{"indexed":false,"name":"_status","type":"uint8"},{"indexed":false,"name":"_disputed","type":"bool"},{"indexed":false,"name":"_appealed","type":"bool"}],"name":"TokenStatusChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_tokenID","type":"bytes32"},{"indexed":true,"name":"_contributor","type":"address"},{"indexed":true,"name":"_request","type":"uint256"},{"indexed":false,"name":"_round","type":"uint256"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"RewardWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_metaEvidenceID","type":"uint256"},{"indexed":false,"name":"_evidence","type":"string"}],"name":"MetaEvidence","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_arbitrator","type":"address"},{"indexed":true,"name":"_disputeID","type":"uint256"},{"indexed":false,"name":"_metaEvidenceID","type":"uint256"},{"indexed":false,"name":"_evidenceGroupID","type":"uint256"}],"name":"Dispute","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_arbitrator","type":"address"},{"indexed":true,"name":"_evidenceGroupID","type":"uint256"},{"indexed":true,"name":"_party","type":"address"},{"indexed":false,"name":"_evidence","type":"string"}],"name":"Evidence","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_arbitrator","type":"address"},{"indexed":true,"name":"_disputeID","type":"uint256"},{"indexed":false,"name":"_ruling","type":"uint256"}],"name":"Ruling","type":"event"}]

6080604052600280553480156200001557600080fd5b5060405162004ad338038062004ad38339810160409081528151602080840151928401516060850151608086015160a087015160c088015160e08901516101008a01516101208b01516101408c015160008054600160a060020a031916600160a060020a038d161790559a8c0180519a9c909b9881019a9701989597949693959294919390928c918c91620000b09160019184019062000211565b505050600060008051602062004ab38339815191528a6040518080602001828103825283818151815260200191508051906020019080838360005b8381101562000105578181015183820152602001620000eb565b50505050905090810190601f168015620001335780820380516001836020036101000a031916815260200191505b509250505060405180910390a2600160008051602062004ab3833981519152896040518080602001828103825283818151815260200191508051906020019080838360005b838110156200019257818101518382015260200162000178565b50505050905090810190601f168015620001c05780820380516001836020036101000a031916815260200191505b509250505060405180910390a260038054600160a060020a031916600160a060020a039890981697909717909655600494909455600592909255600655600a5560085560095550620002b692505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200025457805160ff191683800117855562000284565b8280016001018555821562000284579182015b828111156200028457825182559160200191906001019062000267565b506200029292915062000296565b5090565b620002b391905b808211156200029257600081556001016200029d565b90565b6147ed80620002c66000396000f3006080604052600436106101e95763ffffffff60e060020a60003504166282a36d81146101ee5780630c340a24146102155780630c7ac7b6146102465780631126ca5e146102d057806312ce3525146102f7578063171dff6e146103115780631d5120851461034157806329ccf8ea146103565780632baf80ee1461039e5780632d8b70a1146103af578063311a6c5614610540578063329cedb41461055b57806334f06fb9146105705780633b77d60614610588578063416583411461061757806346106fea1461062c5780634d12e34e1461065057806352bc0e60146106685780636cc6cde1146106ca5780636cdc090f146106df57806373a7800b146106f45780637a086f96146107185780637b94338314610745578063873db1a71461075a5780638c10fef314610771578063904194a31461078657806392239dff14610910578063974121b2146109285780639f181b5e146109ba578063a05359ff146109cf578063a1c2bf4d14610a07578063adc7faba14610a31578063ba7079ca14610a49578063beabdb7b14610a76578063bfbcff1a14610aa2578063d36fdb1814610bba578063d661dd3114610bd2578063d706be3114610be7578063dd0f026514610c13578063e4c0aaf414610c2b578063e9c2416614610c4c578063f48a0b3114610c64575b600080fd5b3480156101fa57600080fd5b50610203610c88565b60408051918252519081900360200190f35b34801561022157600080fd5b5061022a610c8e565b60408051600160a060020a039092168252519081900360200190f35b34801561025257600080fd5b5061025b610c9d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029557818101518382015260200161027d565b50505050905090810190601f1680156102c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102dc57600080fd5b50610203600435600160a060020a0360243516604435610d2a565b34801561030357600080fd5b5061030f600435610f3c565b005b34801561031d57600080fd5b5061030f600160a060020a036004351660243560443560643560843560a435610f91565b34801561034d57600080fd5b50610203610fdf565b34801561036257600080fd5b5061036b610fe5565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b61030f60043560ff6024351661117b565b3480156103bb57600080fd5b506103c76004356119eb565b60405180806020018060200187600160a060020a0316600160a060020a03168152602001806020018660038111156103fb57fe5b60ff16815260200185815260200184810384528a818151815260200191508051906020019080838360005b8381101561043e578181015183820152602001610426565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b5084810383528951815289516020918201918b019080838360005b8381101561049e578181015183820152602001610486565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b838110156104fe5781810151838201526020016104e6565b50505050905090810190601f16801561052b5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b34801561054c57600080fd5b5061030f600435602435611bf2565b34801561056757600080fd5b50610203611d5e565b34801561057c57600080fd5b5061030f600435611d64565b34801561059457600080fd5b506105b86004356024356044610144351515600160a060020a036101643516611db9565b604051808060200183151515158152602001828103825284818151815260200191508051906020019060200280838360005b838110156106025781810151838201526020016105ea565b50505050905001935050505060405180910390f35b34801561062357600080fd5b50610203612180565b34801561063857600080fd5b50610203600160a060020a0360043516602435612186565b34801561065c57600080fd5b506102036004356121a3565b34801561067457600080fd5b50610692600435602435604435600160a060020a03606435166121c2565b6040518082606080838360005b838110156106b757818101518382015260200161069f565b5050505090500191505060405180910390f35b3480156106d657600080fd5b5061022a612275565b3480156106eb57600080fd5b50610203612284565b34801561070057600080fd5b50610203600160a060020a036004351660243561228a565b34801561072457600080fd5b5061030f600160a060020a03600435166024356044356064356084356122ba565b34801561075157600080fd5b50610203612325565b61030f60048035906024803590810191013561232b565b34801561077d57600080fd5b50610203612b3e565b34801561079257600080fd5b5061079e600435612b44565b60405180806020018060200186600160a060020a0316600160a060020a03168152602001806020018560038111156107d257fe5b60ff168152602001848103845289818151815260200191508051906020019080838360005b8381101561080f5781810151838201526020016107f7565b50505050905090810190601f16801561083c5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b8381101561086f578181015183820152602001610857565b50505050905090810190601f16801561089c5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b838110156108cf5781810151838201526020016108b7565b50505050905090810190601f1680156108fc5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b34801561091c57600080fd5b5061030f600435612d2e565b34801561093457600080fd5b50610946600435602435604435612d83565b60405184151581526020810184606080838360005b8381101561097357818101518382015260200161095b565b5050505090500183600360200280838360005b8381101561099e578181015183820152602001610986565b5050505090500182815260200194505050505060405180910390f35b3480156109c657600080fd5b50610203612ea5565b61030f6024600480358281019290820135918135808301929082013591600160a060020a036044351691606435908101910135612eac565b348015610a1357600080fd5b5061030f600160a060020a0360043516602435604435606435613540565b348015610a3d57600080fd5b5061030f600435613801565b348015610a5557600080fd5b5061030f60048035600160a060020a03169060248035908101910135613856565b348015610a8257600080fd5b50610a8e6004356138e0565b604080519115158252519081900360200190f35b348015610aae57600080fd5b50610abd600435602435613928565b604051808a1515151581526020018981526020018881526020018715151515815260200186600360200280838360005b83811015610b05578181015183820152602001610aed565b50505050905001858152602001846002811115610b1e57fe5b60ff16815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b77578181015183820152602001610b5f565b50505050905090810190601f168015610ba45780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b348015610bc657600080fd5b5061030f600435613a9d565b348015610bde57600080fd5b50610203613af2565b348015610bf357600080fd5b5061030f6024600480358281019290820135918135918201910135613af8565b348015610c1f57600080fd5b5061030f600435613c07565b348015610c3757600080fd5b5061030f600160a060020a0360043516613c5c565b348015610c5857600080fd5b5061030f600435613cdb565b348015610c7057600080fd5b5061030f600480359060248035908101910135613f70565b60065481565b600354600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610d225780601f10610cf757610100808354040283529160200191610d22565b820191906000526020600020905b815481529060010190602001808311610d0557829003601f168201915b505050505081565b6000838152600b602052604081206005018054829182918291829182919088908110610d5257fe5b60009182526020909120600a90910201600381015490955060ff161515610d7857610f30565b600093505b6007850154841015610f305760078501805485908110610d9957fe5b600091825260209091208654600690920201935060ff161580610dce57506000600886015460ff166002811115610dcc57fe5b145b15610e85576000836001015411610de6576000610e24565b826002015483600101546004850154600160a060020a038b166000908152600587016020526040902092909101916001015402811515610e2257fe5b045b91506000836002015411610e39576000610e77565b826002015483600101546004850154600160a060020a038b166000908152600587016020526040902092909101916002015402811515610e7557fe5b045b905080820186019550610f25565b6008850154600090849060ff166002811115610e9d57fe5b60038110610ea757fe5b015411610eb5576000610f20565b6008850154839060ff166002811115610eca57fe5b60038110610ed457fe5b01546004840154600160a060020a038a1660009081526005860160205260409020600888015460ff166002811115610f0857fe5b60038110610f1257fe5b015402811515610f1e57fe5b045b860195505b600190930192610d7d565b50505050509392505050565b600354600160a060020a03163314610f8c576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600a55565b6000858152600b60205260409020845b600582015481108015610fbb5750841580610fbb57508481105b15610fd557610fcd88888387876122ba565b600101610fa1565b5050505050505050565b60095481565b600080808080808080805b600d5483101561117057600b6000600d8581548110151561100d57fe5b60009182526020808320909101548352820192909252604001902060058101805491935090600019810190811061104057fe5b600091825260208220600a909102019150600483015460ff16600381111561106457fe5b141561107557600190980197611165565b6001600483015460ff16600381111561108a57fe5b141561109b57600190970196611165565b6002600483015460ff1660038111156110b057fe5b1480156110bf5750805460ff16155b156110cf57600190960195611165565b6003600483015460ff1660038111156110e457fe5b1480156110f35750805460ff16155b1561110357600190950194611165565b6002600483015460ff16600381111561111857fe5b1480156111265750805460ff165b1561113657600190940193611165565b6003600483015460ff16600381111561114b57fe5b1480156111595750805460ff165b15611165576001909301925b600190920191610ff0565b505050909192939495565b600080808080808080808060018b600281111561119457fe5b14806111ab575060028b60028111156111a957fe5b145b15156111b657600080fd5b60008c8152600b602052604090209950600260048b015460ff1660038111156111db57fe5b14806111f95750600360048b015460ff1660038111156111f757fe5b145b1515611275576040805160e560020a62461bcd02815260206004820152602660248201527f54686520746f6b656e206d757374206861766520612070656e64696e6720726560448201527f71756573742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60058a018054600019810190811061128957fe5b60009182526020909120600a90910201805490995060ff16151561131d576040805160e560020a62461bcd02815260206004820152603260248201527f412064697370757465206d7573742068617665206265656e207261697365642060448201527f746f2066756e6420616e2061707065616c2e0000000000000000000000000000606482015290519081900360840190fd5b8860080160019054906101000a9004600160a060020a0316600160a060020a031663afe15cfb8a600101546040518263ffffffff1660e060020a028152600401808281526020019150506040805180830381600087803b15801561138057600080fd5b505af1158015611394573d6000803e3d6000fd5b505050506040513d60408110156113aa57600080fd5b50805160209091015190985096504288118015906113c757508642105b1515611443576040805160e560020a62461bcd02815260206004820152603460248201527f436f6e747269627574696f6e73206d757374206265206d61646520776974686960448201527f6e207468652061707065616c20706572696f642e000000000000000000000000606482015290519081900360840190fd5b600789018054600019810190811061145757fe5b906000526020600020906006020195508860080160019054906101000a9004600160a060020a0316600160a060020a0316631c3db16d8a600101546040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b1580156114cb57600080fd5b505af11580156114df573d6000803e3d6000fd5b505050506040513d60208110156114f557600080fd5b5051600281111561150257fe5b9450600185600281111561151257fe5b1415611521576002935061153a565b600285600281111561152f57fe5b141561153a57600193505b83600281111561154657fe5b8b600281111561155257fe5b1415806115655750600288880304884203105b1515611607576040805160e560020a62461bcd02815260206004820152604560248201527f546865206c6f736572206d75737420636f6e7472696275746520647572696e6760448201527f207468652066697273742068616c66206f66207468652061707065616c20706560648201527f72696f642e000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b84600281111561161357fe5b8b600281111561161f57fe5b141561162f57600854925061165d565b83600281111561163b57fe5b8b600281111561164757fe5b141561165757600954925061165d565b600a5492505b60088901546001808b0154604080517ff23f16e6000000000000000000000000000000000000000000000000000000008152600481018381526024820192835260098f018054600261010097821615880260001901909116046044840181905295909604600160a060020a03169563f23f16e6959093919260640190849080156117285780601f106116fd57610100808354040283529160200191611728565b820191906000526020600020905b81548152906001019060200180831161170b57829003601f168201915b50509350505050602060405180830381600087803b15801561174957600080fd5b505af115801561175d573d6000803e3d6000fd5b505050506040513d602081101561177357600080fd5b505191506117a561271061178d848663ffffffff61411d16565b81151561179657fe5b8491900463ffffffff61415a16565b90506117b4868c33348561416f565b80868c60028111156117c257fe5b600381106117cc57fe5b01541061180f576001866003018c60028111156117e557fe5b600381106117ef57fe5b602091828204019190066101000a81548160ff0219169083151502179055505b600386015462010000900460ff16801561183257506003860154610100900460ff165b156119dd5760088901546001808b0154604080517f49912f88000000000000000000000000000000000000000000000000000000008152600481018381526024820192835260098f018054600261010097821615880260001901909116046044840181905295909604600160a060020a0316956349912f8895899594919360640190849080156119035780601f106118d857610100808354040283529160200191611903565b820191906000526020600020905b8154815290600101906020018083116118e657829003601f168201915b505093505050506000604051808303818588803b15801561192357600080fd5b505af1158015611937573d6000803e3d6000fd5b50505060078b01805492506119509150600183016144b6565b506004860154611966908363ffffffff61423b16565b60048781019190915560068a015460058b0154918c01546040518f93600160a060020a039384169316916000805160206147a28339815191529160ff909116906001908190808460038111156119b857fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a45b505050505050505050505050565b6000818152600b602090815260408083206002808201546004830154600584015484548651601f600183811615610100026000190190931696909604958601899004890281018901909752848752606098899890978997899788979196879695870195600160a060020a0390931694600388019460ff90921693928891830182828015611ab95780601f10611a8e57610100808354040283529160200191611ab9565b820191906000526020600020905b815481529060010190602001808311611a9c57829003601f168201915b5050885460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959b508a945092508401905082828015611b475780601f10611b1c57610100808354040283529160200191611b47565b820191906000526020600020905b815481529060010190602001808311611b2a57829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a5088945092508401905082828015611bd55780601f10611baa57610100808354040283529160200191611bd5565b820191906000526020600020905b815481529060010190602001808311611bb857829003601f168201915b505050505092509650965096509650965096505091939550919395565b6000806000806000856002811115611c0657fe5b336000908152600c602090815260408083208b8452825280832054808452600b9092529091206005810180549398509196509450906000198101908110611c4957fe5b60009182526020909120600a90910201600781018054919350906000198101908110611c7157fe5b906000526020600020906006020190506002548611151515611c9257600080fd5b60088201546101009004600160a060020a03163314611cb057600080fd5b600382015460ff1615611cc257600080fd5b600381015460ff61010090910416151560011415611ce35760019450611d00565b600381015462010000900460ff16151560011415611d0057600294505b86337f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e75622276876002811115611d2f57fe5b60408051918252519081900360200190a3611d5587866002811115611d5057fe5b614258565b50505050505050565b60055481565b600354600160a060020a03163314611db4576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600455565b606060008060008060008060008060008d604051908082528060200260200182016040528015611df3578160200160208202803883390190505b50995060009650600160a060020a038b1615611e2657600160a060020a038b166000908152600e60205260409020611e29565b600d5b95508e1515611e3b5760009750611ed5565b600094505b8554851015611e7e5785548f90879087908110611e5957fe5b6000918252602090912001541415611e7357849750611e7e565b600190940193611e40565b871515611ed5576040805160e560020a62461bcd02815260206004820152601660248201527f54686520637572736f7220697320696e76616c69642e00000000000000000000604482015290519081900360640190fd5b8715611ef7578b611eed578554889003600101611ef2565b876001015b611f0a565b8b611f03576001611f06565b60005b60ff165b93505b8b611f1c578554841115611f21565b855484105b1561216e57858c611f36578654859003611f38565b845b81548110611f4257fe5b6000918252602080832090910154808352600b9091526040909120600581018054929550909350906000198101908110611f7857fe5b60009182526020909120600a9091020190508c3515801590611fac57506000600483015460ff166003811115611faa57fe5b145b80611fd7575060208d013515801590611fd757506001600483015460ff166003811115611fd557fe5b145b80612010575060408d01351580159061200257506002600483015460ff16600381111561200057fe5b145b80156120105750805460ff16155b80612049575060608d01351580159061203b57506003600483015460ff16600381111561203957fe5b145b80156120495750805460ff16155b80612081575060808d01351580159061207457506002600483015460ff16600381111561207257fe5b145b80156120815750805460ff165b806120b9575060a08d0135158015906120ac57506003600483015460ff1660038111156120aa57fe5b145b80156120b95750805460ff165b806120de575060c08d0135158015906120de57506005810154600160a060020a031633145b80612103575060e08d01351580159061210357506006810154600160a060020a031633145b15612163578d87101561215a57858c612120578654859003612122565b845b8154811061212c57fe5b90600052602060002001548a8881518110151561214557fe5b60209081029091010152600190960195612163565b6001985061216e565b600190930192611f0d565b50505050505050509550959350505050565b600a5481565b600c60209081526000928352604080842090915290825290205481565b600d8054829081106121b157fe5b600091825260209091200154905081565b6121ca6144e7565b6000858152600b60205260408120600581018054919291829190889081106121ee57fe5b90600052602060002090600a02019150816007018681548110151561220f57fe5b60009182526020808320600160a060020a03891684526005600690930201918201905260409182902082516060810190935290925060038282826020028201915b8154815260200190600101908083116122505750505050509350505050949350505050565b600054600160a060020a031681565b60075481565b600e602052816000526040600020818154811015156122a557fe5b90600052602060002001600091509150505481565b6000848152600b60205260408120600581018054919291829190879081106122de57fe5b90600052602060002090600a020191508490505b60078201548110801561230c575083158061230c57508381105b15610fd55761231d88888884613540565b6001016122f2565b60085481565b6000838152600b60205260408120908080806002600486015460ff16600381111561235257fe5b148061237057506003600486015460ff16600381111561236e57fe5b145b15156123ec576040805160e560020a62461bcd02815260206004820152602660248201527f54686520746f6b656e206d757374206861766520612070656e64696e6720726560448201527f71756573742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600585018054600019810190811061240057fe5b90600052602060002090600a020193506006548460020154420311151515612498576040805160e560020a62461bcd02815260206004820152603260248201527f4368616c6c656e676573206d757374206f6363757220647572696e672074686560448201527f206368616c6c656e676520706572696f642e0000000000000000000000000000606482015290519081900360840190fd5b835460ff1615612518576040805160e560020a62461bcd02815260206004820152603260248201527f54686520726571756573742073686f756c64206e6f74206861766520616c726560448201527f616479206265656e2064697370757465642e0000000000000000000000000000606482015290519081900360840190fd5b60068401805473ffffffffffffffffffffffffffffffffffffffff191633179055600784018054600019810190811061254d57fe5b600091825260209182902060088701546040517ff7434ea900000000000000000000000000000000000000000000000000000000815260048101948552600989018054600261010060018316158102600019019092160460248401819052600696909602909401985092909104600160a060020a03169363f7434ea99390918291604490910190849080156126235780601f106125f857610100808354040283529160200191612623565b820191906000526020600020905b81548152906001019060200180831161260657829003601f168201915b505092505050602060405180830381600087803b15801561264357600080fd5b505af1158015612657573d6000803e3d6000fd5b505050506040513d602081101561266d57600080fd5b5051600554600a549193506126b9916126ad906127109061269590879063ffffffff61411d16565b81151561269e57fe5b8691900463ffffffff61415a16565b9063ffffffff61415a16565b90506126c983600233348561416f565b8083600201541015612725576040805160e560020a62461bcd02815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038301805462ff0000191662010000179055600884015460028054604080517fc13517e1000000000000000000000000000000000000000000000000000000008152600481018381526024820192835260098a018054600181161561010090810260001901909116969096046044840181905295909604600160a060020a03169563c13517e195899594919360640190849080156128055780601f106127da57610100808354040283529160200191612805565b820191906000526020600020905b8154815290600101906020018083116127e857829003601f168201915b505093505050506020604051808303818588803b15801561282557600080fd5b505af1158015612839573d6000803e3d6000fd5b50505050506040513d602081101561285057600080fd5b5051600185810182905560088601546101009004600160a060020a03166000908152600c6020908152604080832094835293905291909120899055845460ff191681178555600785018054916128a8919083016144b6565b5060048301546128be908363ffffffff61423b16565b6004840155600184015460088501546101009004600160a060020a03167f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d6002600489015460ff16600381111561291157fe5b146129245760075460020260010161292b565b6007546002025b8b60018a6005018054905003604051602001808360001916600019168152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083106129945780518252601f199092019160209182019101612975565b51815160209384036101000a600019018019909216911617905260408051929094018290038220968252810195909552508051938490030192915050a36006840154600585015460048701546040518b93600160a060020a039081169316916000805160206147a28339815191529160ff9091169060019060009080846003811115612a1c57fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a46000861115610fd55760058501546040805160208082018c905260001990930181830152815180820383018152606090910191829052805133939192918291908401908083835b60208310612aa65780518252601f199092019160209182019101612a87565b518151600019602094850361010090810a91909101918216911992909216179091526040805195909301859003852060088d01548387529286018f90529650600160a060020a0391041693507fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c928d92508c918190810184848082843760405192018290039550909350505050a45050505050505050565b60045481565b600b6020908152600091825260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909291839190830182828015612bdb5780601f10612bb057610100808354040283529160200191612bdb565b820191906000526020600020905b815481529060010190602001808311612bbe57829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c795780601f10612c4e57610100808354040283529160200191612c79565b820191906000526020600020905b815481529060010190602001808311612c5c57829003601f168201915b505050506002838101546003850180546040805160206101006001851615026000190190931695909504601f81018390048302860183019091528085529596600160a060020a0390931695929450909190830182828015612d1b5780601f10612cf057610100808354040283529160200191612d1b565b820191906000526020600020905b815481529060010190602001808311612cfe57829003601f168201915b5050506004909301549192505060ff1685565b600354600160a060020a03163314612d7e576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600955565b6000612d8d6144e7565b612d956144e7565b6000868152600b60205260408120600581018054839182918a908110612db757fe5b90600052602060002090600a020191508160070188815481101515612dd857fe5b9060005260206000209060060201905060018260070180549050038814158160000182600301836004015482600380602002604051908101604052809291908260038015612e3b576020028201915b815481526020019060010190808311612e27575b5050604080516060810191829052949750869350600392509050826000855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411612e5a57905050505050509150965096509650965050505093509350935093565b600d545b90565b6000806000806000808c8c8c8c8c8c8c6040516020018088888082843782019150508686808284376c01000000000000000000000000600160a060020a0388160292019182525060140183838082843782019150509750505050505050506040516020818303038152906040526040518082805190602001908083835b60208310612f485780518252601f199092019160209182019101612f29565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206000818152600b9092529290206005810154929a5098505015159150613106905057612f9d858e8e614506565b50612fac600186018c8c614506565b5060028501805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038b16179055612fe5600386018989614506565b50600d869080600181540180825580915050906001820390600052602060002001600090919290919091509060001916905550600e60008a600160a060020a0316600160a060020a0316815260200190815260200160002086908060018154018082558091505090600182039060005260206000200160009091929091909150906000191690555088600160a060020a03167fe06ec53edc3679388991a8310fd45c6a8368784489fe5a7bee90717385efc28d8e8e8e8e8d8d6040518080602001806020018060200184810384528a8a82818152602001925080828437909101858103845288815260200190508888808284379091018581038352868152602001905086868082843760405192018290039b50909950505050505050505050a25b6000600486015460ff16600381111561311b57fe5b141561313d576004850180546002919060ff19166001835b02179055506131e3565b6001600486015460ff16600381111561315257fe5b141561316e576004850180546003919060ff1916600183613133565b6040805160e560020a62461bcd028152602060048201526024808201527f546f6b656e20616c72656164792068617320612070656e64696e67207265717560448201527f6573742e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6005850180546131f68260018301614584565b8154811061320057fe5b60009182526020909120600a9091020193503360048501600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283161790554260028681019190915560005460088701805474ffffffffffffffffffffffffffffffffffffffff001916610100929094168202939093179092556001805461329d9360098901938284161590910260001901909116046145b0565b506007840180546132b182600183016144b6565b815481106132bb57fe5b600091825260209091206006909102019250857fa3038500b3c6dba812512e25571133d315bfe339f7f8ab4d56e9cad98318e2706002600488015460ff16600381111561330457fe5b60408051929091148252519081900360200190a260088401546040517ff7434ea90000000000000000000000000000000000000000000000000000000081526020600482019081526009870180546002610100600183161581026000190190921604602485018190529404600160a060020a03169363f7434ea9939192918291604490910190849080156133d95780601f106133ae576101008083540402835291602001916133d9565b820191906000526020600020905b8154815290600101906020018083116133bc57829003601f168201915b505092505050602060405180830381600087803b1580156133f957600080fd5b505af115801561340d573d6000803e3d6000fd5b505050506040513d602081101561342357600080fd5b5051600454600a5491935061344b916126ad906127109061269590879063ffffffff61411d16565b905061345b83600133348561416f565b80836001015410156134b7576040805160e560020a62461bcd02815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038301805461ff00191661010017905585600060048601600101546004880154604051600160a060020a03909216916000805160206147a28339815191529160ff169060009081908084600381111561350d57fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a450505050505050505050505050565b6000838152600b6020526040812060058101805491929182918291829182918990811061356957fe5b90600052602060002090600a02019450846007018781548110151561358a57fe5b600091825260209091206003870154600690920201945060ff1615156135af57600080fd5b845460ff1615806135d257506000600886015460ff1660028111156135d057fe5b145b156136ac5760008460010154116135ea576000613628565b836001015484600201546004860154600160a060020a038d16600090815260058801602052604090209290910191600101540281151561362657fe5b045b9150600084600201541161363d57600061367b565b836001015484600201546004860154600160a060020a038d16600090815260058801602052604090209290910191600201540281151561367957fe5b045b600160a060020a038b1660009081526005860160205260408120600181018290556002015582810193509050613786565b6008850154600090859060ff1660028111156136c457fe5b600381106136ce57fe5b0154116136dc576000613747565b6008850154849060ff1660028111156136f157fe5b600381106136fb57fe5b01546004850154600160a060020a038c1660009081526005870160205260409020600888015460ff16600281111561372f57fe5b6003811061373957fe5b01540281151561374557fe5b045b600160a060020a038b16600090815260058601602052604081206008880154929550909160ff16600281111561377957fe5b6003811061378357fe5b01555b604080518881526020810185905281518a92600160a060020a038e16928d927fea1e4a64c44a9979a3521f67bc0c27e16b79ecff122406c701db571d6df96ab1929181900390910190a4604051600160a060020a038b169084156108fc029085906000818181858888f1505050505050505050505050505050565b600354600160a060020a03163314613851576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600855565b600354600160a060020a031633146138a6576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790556138da60018383614506565b50505050565b6000818152600b602052604081206001600482015460ff16600381111561390357fe5b148061392157506003600482015460ff16600381111561391f57fe5b145b9392505050565b6000806000806139366144e7565b6000878152600b6020526040812060050180548291829160609183918c90811061395c57fe5b60009182526020909120600a909102018054600182015460028301546003808501546007860154600887015460408051606081019182905298995060ff97881698969795969386169560048b0195939490831693610100909304600160a060020a03169260098c019287919082845b8154600160a060020a031681526001909101906020018083116139cb575050845460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a5086945092508401905082828015613a765780601f10613a4b57610100808354040283529160200191613a76565b820191906000526020600020905b815481529060010190602001808311613a5957829003601f168201915b50505050509050995099509950995099509950995099509950509295985092959850929598565b600354600160a060020a03163314613aed576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600655565b61271081565b600354600160a060020a03163314613b48576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600780546001019081905560408051602080825281018690526002909202917f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d91879187918190810184848082843760405192018290039550909350505050a26007546002026001017f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d83836040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a250505050565b600354600160a060020a03163314613c57576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600555565b600354600160a060020a03163314613cac576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000818152600b602052604081206005810180549192916000198101908110613d0057fe5b90600052602060002090600a0201905060065481600201544203111515613d97576040805160e560020a62461bcd02815260206004820152602f60248201527f54696d6520746f206368616c6c656e6765207468652072657175657374206d7560448201527f73742068617665207061737365642e0000000000000000000000000000000000606482015290519081900360840190fd5b805460ff1615613e17576040805160e560020a62461bcd02815260206004820152602360248201527f54686520726571756573742073686f756c64206e6f742062652064697370757460448201527f65642e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6002600483015460ff166003811115613e2c57fe5b1415613e4d576004820180546001919060ff191682805b0217905550613ece565b6003600483015460ff166003811115613e6257fe5b1415613e7e576004820180546000919060ff1916600183613e43565b6040805160e560020a62461bcd02815260206004820152601860248201527f5468657265206d757374206265206120726571756573742e0000000000000000604482015290519081900360640190fd5b60038101805460ff1916600117905560058082015490830154613f0291600160a060020a0316908590600019016000613540565b82600060048301600101546004850154604051600160a060020a03909216916000805160206147a28339815191529160ff1690600090819080846003811115613f4757fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a4505050565b6000838152600b602052604081206005810180549192916000198101908110613f9557fe5b60009182526020909120600a90910201600381015490915060ff161561402b576040805160e560020a62461bcd02815260206004820152602960248201527f5468652064697370757465206d757374206e6f7420616c72656164792062652060448201527f7265736f6c7665642e0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600582015460408051602080820189905260001990930181830152815180820383018152606090910191829052805133939192918291908401908083835b602083106140885780518252601f199092019160209182019101614069565b518151600019602094850361010090810a91909101918216911992909216179091526040805195909301859003852060088a01548387529286018c90529650600160a060020a0391041693507fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c928a925089918190810184848082843760405192018290039550909350505050a45050505050565b6000808315156141305760009150614153565b5082820282848281151561414057fe5b041461414e57600019614150565b805b91505b5092915050565b60008282018381101561414e57600019614150565b6000806141a48461419f8989600281111561418657fe5b6003811061419057fe5b0154869063ffffffff61423b16565b614491565b600160a060020a038716600090815260058a0160205260409020919350915082908760028111156141d157fe5b600381106141db57fe5b018054909101905581878760028111156141f157fe5b600381106141fb57fe5b018054909101905560048701805483019055604051600160a060020a0386169082156108fc029083906000818181858888f1505050505050505050505050565b60008282111561424d57506000614252565b508082035b92915050565b336000908152600c60209081526040808320858452825280832054808452600b909252822060058101805492939192829190600019810190811061429857fe5b90600052602060002090600a020191508460028111156142b457fe5b905060018160028111156142c457fe5b1415614316576002600484015460ff1660038111156142df57fe5b14156142f95760048301805460ff19166001179055614311565b6004830180546000919060ff19166001835b02179055505b614372565b6002600484015460ff16600381111561432b57fe5b1415614347576004830180546000919060ff191660018361430b565b6003600484015460ff16600381111561435c57fe5b14156143725760048301805460ff191660011790555b60038201805460ff1916600117905584600281111561438d57fe5b60088301805460ff191660018360028111156143a557fe5b021790555060008160028111156143b857fe5b1415614405576143f26004830160015b600381106143d257fe5b01546005850154600160a060020a03909116908690600019016000613540565b6144006004830160026143c8565b614418565b614418826004018260028111156143c857fe5b60068201546005830154600485015484546040518894600160a060020a039081169416926000805160206147a28339815191529260ff918216929116906000908084600381111561446557fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a4505050505050565b600080838311156144a7575082905060006144af565b508190508083035b9250929050565b8154818355818111156144e2576006028160060283600052602060002091820191016144e29190614625565b505050565b6060604051908101604052806003906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106145475782800160ff19823516178555614574565b82800160010185558215614574579182015b82811115614574578235825591602001919060010190614559565b5061458092915061465d565b5090565b8154818355818111156144e257600a0281600a0283600052602060002091820191016144e29190614677565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106145e95780548555614574565b8280016001018555821561457457600052602060002091601f016020900482015b8281111561457457825482559160010191906001019061460a565b612ea991905b8082111561458057600061463f82826146fd565b61464d600383016000614712565b506000600482015560060161462b565b612ea991905b808211156145805760008155600101614663565b612ea991905b8082111561458057805460ff199081168255600060018301819055600283018190556003830180549092169091556146b860048301826146fd565b6146c6600783016000614719565b60088201805474ffffffffffffffffffffffffffffffffffffffffff191690556146f460098301600061473d565b50600a0161467d565b50600081556001016000815560010160009055565b5060009055565b508054600082556006029060005260206000209081019061473a9190614625565b50565b50805460018160011615610100020316600290046000825580601f10614763575061473a565b601f01602090049060005260206000209081019061473a919061465d56005468652063616c6c6572206d7573742062652074686520676f7665726e6f722e1d939a93a378cb71bc38b0480cac752dd80d8951166c558440209d33b1f4ae68a165627a7a72305820a5816e3f2608535115c04224f8c4cd7b3fe6d85dc9a9051079c870c2109645d1002961606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d000000000000000000000000988b3a538b618c7a603e1c11ab82cd16dbe28069000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000280000000000000000000000000334f12afb7d8740868be0471963961653307523400000000000000000000000000000000000000000000000004a67ba0e06a26800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ebe0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000008f2f697066732f516d567a466b796f68334b44394533434146424d684161424b313646344e54576b313645544e31564655594d4e752f426363783370717970776b39784d59753566396279327266697a696168786b6f656e65625a7a5252794d64323247796e7a67345a356b6e76746737334538424751685665684a706663566431374d346f73785a674863786971390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008f2f697066732f516d63555936346f4d4a4d59317263464d574334647955707a5769556a5a3861504145736264485441534b5654352f42636476723763507165537969387450626a574b54506d796e485154435337326b54534374436b6b4e7878756a684776386d5463473570373267543747656e413177337370546a7933684156467944385073566f52426e6454510000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101e95763ffffffff60e060020a60003504166282a36d81146101ee5780630c340a24146102155780630c7ac7b6146102465780631126ca5e146102d057806312ce3525146102f7578063171dff6e146103115780631d5120851461034157806329ccf8ea146103565780632baf80ee1461039e5780632d8b70a1146103af578063311a6c5614610540578063329cedb41461055b57806334f06fb9146105705780633b77d60614610588578063416583411461061757806346106fea1461062c5780634d12e34e1461065057806352bc0e60146106685780636cc6cde1146106ca5780636cdc090f146106df57806373a7800b146106f45780637a086f96146107185780637b94338314610745578063873db1a71461075a5780638c10fef314610771578063904194a31461078657806392239dff14610910578063974121b2146109285780639f181b5e146109ba578063a05359ff146109cf578063a1c2bf4d14610a07578063adc7faba14610a31578063ba7079ca14610a49578063beabdb7b14610a76578063bfbcff1a14610aa2578063d36fdb1814610bba578063d661dd3114610bd2578063d706be3114610be7578063dd0f026514610c13578063e4c0aaf414610c2b578063e9c2416614610c4c578063f48a0b3114610c64575b600080fd5b3480156101fa57600080fd5b50610203610c88565b60408051918252519081900360200190f35b34801561022157600080fd5b5061022a610c8e565b60408051600160a060020a039092168252519081900360200190f35b34801561025257600080fd5b5061025b610c9d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029557818101518382015260200161027d565b50505050905090810190601f1680156102c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102dc57600080fd5b50610203600435600160a060020a0360243516604435610d2a565b34801561030357600080fd5b5061030f600435610f3c565b005b34801561031d57600080fd5b5061030f600160a060020a036004351660243560443560643560843560a435610f91565b34801561034d57600080fd5b50610203610fdf565b34801561036257600080fd5b5061036b610fe5565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b61030f60043560ff6024351661117b565b3480156103bb57600080fd5b506103c76004356119eb565b60405180806020018060200187600160a060020a0316600160a060020a03168152602001806020018660038111156103fb57fe5b60ff16815260200185815260200184810384528a818151815260200191508051906020019080838360005b8381101561043e578181015183820152602001610426565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b5084810383528951815289516020918201918b019080838360005b8381101561049e578181015183820152602001610486565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b838110156104fe5781810151838201526020016104e6565b50505050905090810190601f16801561052b5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b34801561054c57600080fd5b5061030f600435602435611bf2565b34801561056757600080fd5b50610203611d5e565b34801561057c57600080fd5b5061030f600435611d64565b34801561059457600080fd5b506105b86004356024356044610144351515600160a060020a036101643516611db9565b604051808060200183151515158152602001828103825284818151815260200191508051906020019060200280838360005b838110156106025781810151838201526020016105ea565b50505050905001935050505060405180910390f35b34801561062357600080fd5b50610203612180565b34801561063857600080fd5b50610203600160a060020a0360043516602435612186565b34801561065c57600080fd5b506102036004356121a3565b34801561067457600080fd5b50610692600435602435604435600160a060020a03606435166121c2565b6040518082606080838360005b838110156106b757818101518382015260200161069f565b5050505090500191505060405180910390f35b3480156106d657600080fd5b5061022a612275565b3480156106eb57600080fd5b50610203612284565b34801561070057600080fd5b50610203600160a060020a036004351660243561228a565b34801561072457600080fd5b5061030f600160a060020a03600435166024356044356064356084356122ba565b34801561075157600080fd5b50610203612325565b61030f60048035906024803590810191013561232b565b34801561077d57600080fd5b50610203612b3e565b34801561079257600080fd5b5061079e600435612b44565b60405180806020018060200186600160a060020a0316600160a060020a03168152602001806020018560038111156107d257fe5b60ff168152602001848103845289818151815260200191508051906020019080838360005b8381101561080f5781810151838201526020016107f7565b50505050905090810190601f16801561083c5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b8381101561086f578181015183820152602001610857565b50505050905090810190601f16801561089c5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b838110156108cf5781810151838201526020016108b7565b50505050905090810190601f1680156108fc5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b34801561091c57600080fd5b5061030f600435612d2e565b34801561093457600080fd5b50610946600435602435604435612d83565b60405184151581526020810184606080838360005b8381101561097357818101518382015260200161095b565b5050505090500183600360200280838360005b8381101561099e578181015183820152602001610986565b5050505090500182815260200194505050505060405180910390f35b3480156109c657600080fd5b50610203612ea5565b61030f6024600480358281019290820135918135808301929082013591600160a060020a036044351691606435908101910135612eac565b348015610a1357600080fd5b5061030f600160a060020a0360043516602435604435606435613540565b348015610a3d57600080fd5b5061030f600435613801565b348015610a5557600080fd5b5061030f60048035600160a060020a03169060248035908101910135613856565b348015610a8257600080fd5b50610a8e6004356138e0565b604080519115158252519081900360200190f35b348015610aae57600080fd5b50610abd600435602435613928565b604051808a1515151581526020018981526020018881526020018715151515815260200186600360200280838360005b83811015610b05578181015183820152602001610aed565b50505050905001858152602001846002811115610b1e57fe5b60ff16815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b77578181015183820152602001610b5f565b50505050905090810190601f168015610ba45780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b348015610bc657600080fd5b5061030f600435613a9d565b348015610bde57600080fd5b50610203613af2565b348015610bf357600080fd5b5061030f6024600480358281019290820135918135918201910135613af8565b348015610c1f57600080fd5b5061030f600435613c07565b348015610c3757600080fd5b5061030f600160a060020a0360043516613c5c565b348015610c5857600080fd5b5061030f600435613cdb565b348015610c7057600080fd5b5061030f600480359060248035908101910135613f70565b60065481565b600354600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610d225780601f10610cf757610100808354040283529160200191610d22565b820191906000526020600020905b815481529060010190602001808311610d0557829003601f168201915b505050505081565b6000838152600b602052604081206005018054829182918291829182919088908110610d5257fe5b60009182526020909120600a90910201600381015490955060ff161515610d7857610f30565b600093505b6007850154841015610f305760078501805485908110610d9957fe5b600091825260209091208654600690920201935060ff161580610dce57506000600886015460ff166002811115610dcc57fe5b145b15610e85576000836001015411610de6576000610e24565b826002015483600101546004850154600160a060020a038b166000908152600587016020526040902092909101916001015402811515610e2257fe5b045b91506000836002015411610e39576000610e77565b826002015483600101546004850154600160a060020a038b166000908152600587016020526040902092909101916002015402811515610e7557fe5b045b905080820186019550610f25565b6008850154600090849060ff166002811115610e9d57fe5b60038110610ea757fe5b015411610eb5576000610f20565b6008850154839060ff166002811115610eca57fe5b60038110610ed457fe5b01546004840154600160a060020a038a1660009081526005860160205260409020600888015460ff166002811115610f0857fe5b60038110610f1257fe5b015402811515610f1e57fe5b045b860195505b600190930192610d7d565b50505050509392505050565b600354600160a060020a03163314610f8c576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600a55565b6000858152600b60205260409020845b600582015481108015610fbb5750841580610fbb57508481105b15610fd557610fcd88888387876122ba565b600101610fa1565b5050505050505050565b60095481565b600080808080808080805b600d5483101561117057600b6000600d8581548110151561100d57fe5b60009182526020808320909101548352820192909252604001902060058101805491935090600019810190811061104057fe5b600091825260208220600a909102019150600483015460ff16600381111561106457fe5b141561107557600190980197611165565b6001600483015460ff16600381111561108a57fe5b141561109b57600190970196611165565b6002600483015460ff1660038111156110b057fe5b1480156110bf5750805460ff16155b156110cf57600190960195611165565b6003600483015460ff1660038111156110e457fe5b1480156110f35750805460ff16155b1561110357600190950194611165565b6002600483015460ff16600381111561111857fe5b1480156111265750805460ff165b1561113657600190940193611165565b6003600483015460ff16600381111561114b57fe5b1480156111595750805460ff165b15611165576001909301925b600190920191610ff0565b505050909192939495565b600080808080808080808060018b600281111561119457fe5b14806111ab575060028b60028111156111a957fe5b145b15156111b657600080fd5b60008c8152600b602052604090209950600260048b015460ff1660038111156111db57fe5b14806111f95750600360048b015460ff1660038111156111f757fe5b145b1515611275576040805160e560020a62461bcd02815260206004820152602660248201527f54686520746f6b656e206d757374206861766520612070656e64696e6720726560448201527f71756573742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60058a018054600019810190811061128957fe5b60009182526020909120600a90910201805490995060ff16151561131d576040805160e560020a62461bcd02815260206004820152603260248201527f412064697370757465206d7573742068617665206265656e207261697365642060448201527f746f2066756e6420616e2061707065616c2e0000000000000000000000000000606482015290519081900360840190fd5b8860080160019054906101000a9004600160a060020a0316600160a060020a031663afe15cfb8a600101546040518263ffffffff1660e060020a028152600401808281526020019150506040805180830381600087803b15801561138057600080fd5b505af1158015611394573d6000803e3d6000fd5b505050506040513d60408110156113aa57600080fd5b50805160209091015190985096504288118015906113c757508642105b1515611443576040805160e560020a62461bcd02815260206004820152603460248201527f436f6e747269627574696f6e73206d757374206265206d61646520776974686960448201527f6e207468652061707065616c20706572696f642e000000000000000000000000606482015290519081900360840190fd5b600789018054600019810190811061145757fe5b906000526020600020906006020195508860080160019054906101000a9004600160a060020a0316600160a060020a0316631c3db16d8a600101546040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b1580156114cb57600080fd5b505af11580156114df573d6000803e3d6000fd5b505050506040513d60208110156114f557600080fd5b5051600281111561150257fe5b9450600185600281111561151257fe5b1415611521576002935061153a565b600285600281111561152f57fe5b141561153a57600193505b83600281111561154657fe5b8b600281111561155257fe5b1415806115655750600288880304884203105b1515611607576040805160e560020a62461bcd02815260206004820152604560248201527f546865206c6f736572206d75737420636f6e7472696275746520647572696e6760448201527f207468652066697273742068616c66206f66207468652061707065616c20706560648201527f72696f642e000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b84600281111561161357fe5b8b600281111561161f57fe5b141561162f57600854925061165d565b83600281111561163b57fe5b8b600281111561164757fe5b141561165757600954925061165d565b600a5492505b60088901546001808b0154604080517ff23f16e6000000000000000000000000000000000000000000000000000000008152600481018381526024820192835260098f018054600261010097821615880260001901909116046044840181905295909604600160a060020a03169563f23f16e6959093919260640190849080156117285780601f106116fd57610100808354040283529160200191611728565b820191906000526020600020905b81548152906001019060200180831161170b57829003601f168201915b50509350505050602060405180830381600087803b15801561174957600080fd5b505af115801561175d573d6000803e3d6000fd5b505050506040513d602081101561177357600080fd5b505191506117a561271061178d848663ffffffff61411d16565b81151561179657fe5b8491900463ffffffff61415a16565b90506117b4868c33348561416f565b80868c60028111156117c257fe5b600381106117cc57fe5b01541061180f576001866003018c60028111156117e557fe5b600381106117ef57fe5b602091828204019190066101000a81548160ff0219169083151502179055505b600386015462010000900460ff16801561183257506003860154610100900460ff165b156119dd5760088901546001808b0154604080517f49912f88000000000000000000000000000000000000000000000000000000008152600481018381526024820192835260098f018054600261010097821615880260001901909116046044840181905295909604600160a060020a0316956349912f8895899594919360640190849080156119035780601f106118d857610100808354040283529160200191611903565b820191906000526020600020905b8154815290600101906020018083116118e657829003601f168201915b505093505050506000604051808303818588803b15801561192357600080fd5b505af1158015611937573d6000803e3d6000fd5b50505060078b01805492506119509150600183016144b6565b506004860154611966908363ffffffff61423b16565b60048781019190915560068a015460058b0154918c01546040518f93600160a060020a039384169316916000805160206147a28339815191529160ff909116906001908190808460038111156119b857fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a45b505050505050505050505050565b6000818152600b602090815260408083206002808201546004830154600584015484548651601f600183811615610100026000190190931696909604958601899004890281018901909752848752606098899890978997899788979196879695870195600160a060020a0390931694600388019460ff90921693928891830182828015611ab95780601f10611a8e57610100808354040283529160200191611ab9565b820191906000526020600020905b815481529060010190602001808311611a9c57829003601f168201915b5050885460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959b508a945092508401905082828015611b475780601f10611b1c57610100808354040283529160200191611b47565b820191906000526020600020905b815481529060010190602001808311611b2a57829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a5088945092508401905082828015611bd55780601f10611baa57610100808354040283529160200191611bd5565b820191906000526020600020905b815481529060010190602001808311611bb857829003601f168201915b505050505092509650965096509650965096505091939550919395565b6000806000806000856002811115611c0657fe5b336000908152600c602090815260408083208b8452825280832054808452600b9092529091206005810180549398509196509450906000198101908110611c4957fe5b60009182526020909120600a90910201600781018054919350906000198101908110611c7157fe5b906000526020600020906006020190506002548611151515611c9257600080fd5b60088201546101009004600160a060020a03163314611cb057600080fd5b600382015460ff1615611cc257600080fd5b600381015460ff61010090910416151560011415611ce35760019450611d00565b600381015462010000900460ff16151560011415611d0057600294505b86337f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e75622276876002811115611d2f57fe5b60408051918252519081900360200190a3611d5587866002811115611d5057fe5b614258565b50505050505050565b60055481565b600354600160a060020a03163314611db4576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600455565b606060008060008060008060008060008d604051908082528060200260200182016040528015611df3578160200160208202803883390190505b50995060009650600160a060020a038b1615611e2657600160a060020a038b166000908152600e60205260409020611e29565b600d5b95508e1515611e3b5760009750611ed5565b600094505b8554851015611e7e5785548f90879087908110611e5957fe5b6000918252602090912001541415611e7357849750611e7e565b600190940193611e40565b871515611ed5576040805160e560020a62461bcd02815260206004820152601660248201527f54686520637572736f7220697320696e76616c69642e00000000000000000000604482015290519081900360640190fd5b8715611ef7578b611eed578554889003600101611ef2565b876001015b611f0a565b8b611f03576001611f06565b60005b60ff165b93505b8b611f1c578554841115611f21565b855484105b1561216e57858c611f36578654859003611f38565b845b81548110611f4257fe5b6000918252602080832090910154808352600b9091526040909120600581018054929550909350906000198101908110611f7857fe5b60009182526020909120600a9091020190508c3515801590611fac57506000600483015460ff166003811115611faa57fe5b145b80611fd7575060208d013515801590611fd757506001600483015460ff166003811115611fd557fe5b145b80612010575060408d01351580159061200257506002600483015460ff16600381111561200057fe5b145b80156120105750805460ff16155b80612049575060608d01351580159061203b57506003600483015460ff16600381111561203957fe5b145b80156120495750805460ff16155b80612081575060808d01351580159061207457506002600483015460ff16600381111561207257fe5b145b80156120815750805460ff165b806120b9575060a08d0135158015906120ac57506003600483015460ff1660038111156120aa57fe5b145b80156120b95750805460ff165b806120de575060c08d0135158015906120de57506005810154600160a060020a031633145b80612103575060e08d01351580159061210357506006810154600160a060020a031633145b15612163578d87101561215a57858c612120578654859003612122565b845b8154811061212c57fe5b90600052602060002001548a8881518110151561214557fe5b60209081029091010152600190960195612163565b6001985061216e565b600190930192611f0d565b50505050505050509550959350505050565b600a5481565b600c60209081526000928352604080842090915290825290205481565b600d8054829081106121b157fe5b600091825260209091200154905081565b6121ca6144e7565b6000858152600b60205260408120600581018054919291829190889081106121ee57fe5b90600052602060002090600a02019150816007018681548110151561220f57fe5b60009182526020808320600160a060020a03891684526005600690930201918201905260409182902082516060810190935290925060038282826020028201915b8154815260200190600101908083116122505750505050509350505050949350505050565b600054600160a060020a031681565b60075481565b600e602052816000526040600020818154811015156122a557fe5b90600052602060002001600091509150505481565b6000848152600b60205260408120600581018054919291829190879081106122de57fe5b90600052602060002090600a020191508490505b60078201548110801561230c575083158061230c57508381105b15610fd55761231d88888884613540565b6001016122f2565b60085481565b6000838152600b60205260408120908080806002600486015460ff16600381111561235257fe5b148061237057506003600486015460ff16600381111561236e57fe5b145b15156123ec576040805160e560020a62461bcd02815260206004820152602660248201527f54686520746f6b656e206d757374206861766520612070656e64696e6720726560448201527f71756573742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600585018054600019810190811061240057fe5b90600052602060002090600a020193506006548460020154420311151515612498576040805160e560020a62461bcd02815260206004820152603260248201527f4368616c6c656e676573206d757374206f6363757220647572696e672074686560448201527f206368616c6c656e676520706572696f642e0000000000000000000000000000606482015290519081900360840190fd5b835460ff1615612518576040805160e560020a62461bcd02815260206004820152603260248201527f54686520726571756573742073686f756c64206e6f74206861766520616c726560448201527f616479206265656e2064697370757465642e0000000000000000000000000000606482015290519081900360840190fd5b60068401805473ffffffffffffffffffffffffffffffffffffffff191633179055600784018054600019810190811061254d57fe5b600091825260209182902060088701546040517ff7434ea900000000000000000000000000000000000000000000000000000000815260048101948552600989018054600261010060018316158102600019019092160460248401819052600696909602909401985092909104600160a060020a03169363f7434ea99390918291604490910190849080156126235780601f106125f857610100808354040283529160200191612623565b820191906000526020600020905b81548152906001019060200180831161260657829003601f168201915b505092505050602060405180830381600087803b15801561264357600080fd5b505af1158015612657573d6000803e3d6000fd5b505050506040513d602081101561266d57600080fd5b5051600554600a549193506126b9916126ad906127109061269590879063ffffffff61411d16565b81151561269e57fe5b8691900463ffffffff61415a16565b9063ffffffff61415a16565b90506126c983600233348561416f565b8083600201541015612725576040805160e560020a62461bcd02815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038301805462ff0000191662010000179055600884015460028054604080517fc13517e1000000000000000000000000000000000000000000000000000000008152600481018381526024820192835260098a018054600181161561010090810260001901909116969096046044840181905295909604600160a060020a03169563c13517e195899594919360640190849080156128055780601f106127da57610100808354040283529160200191612805565b820191906000526020600020905b8154815290600101906020018083116127e857829003601f168201915b505093505050506020604051808303818588803b15801561282557600080fd5b505af1158015612839573d6000803e3d6000fd5b50505050506040513d602081101561285057600080fd5b5051600185810182905560088601546101009004600160a060020a03166000908152600c6020908152604080832094835293905291909120899055845460ff191681178555600785018054916128a8919083016144b6565b5060048301546128be908363ffffffff61423b16565b6004840155600184015460088501546101009004600160a060020a03167f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d6002600489015460ff16600381111561291157fe5b146129245760075460020260010161292b565b6007546002025b8b60018a6005018054905003604051602001808360001916600019168152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083106129945780518252601f199092019160209182019101612975565b51815160209384036101000a600019018019909216911617905260408051929094018290038220968252810195909552508051938490030192915050a36006840154600585015460048701546040518b93600160a060020a039081169316916000805160206147a28339815191529160ff9091169060019060009080846003811115612a1c57fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a46000861115610fd55760058501546040805160208082018c905260001990930181830152815180820383018152606090910191829052805133939192918291908401908083835b60208310612aa65780518252601f199092019160209182019101612a87565b518151600019602094850361010090810a91909101918216911992909216179091526040805195909301859003852060088d01548387529286018f90529650600160a060020a0391041693507fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c928d92508c918190810184848082843760405192018290039550909350505050a45050505050505050565b60045481565b600b6020908152600091825260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909291839190830182828015612bdb5780601f10612bb057610100808354040283529160200191612bdb565b820191906000526020600020905b815481529060010190602001808311612bbe57829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c795780601f10612c4e57610100808354040283529160200191612c79565b820191906000526020600020905b815481529060010190602001808311612c5c57829003601f168201915b505050506002838101546003850180546040805160206101006001851615026000190190931695909504601f81018390048302860183019091528085529596600160a060020a0390931695929450909190830182828015612d1b5780601f10612cf057610100808354040283529160200191612d1b565b820191906000526020600020905b815481529060010190602001808311612cfe57829003601f168201915b5050506004909301549192505060ff1685565b600354600160a060020a03163314612d7e576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600955565b6000612d8d6144e7565b612d956144e7565b6000868152600b60205260408120600581018054839182918a908110612db757fe5b90600052602060002090600a020191508160070188815481101515612dd857fe5b9060005260206000209060060201905060018260070180549050038814158160000182600301836004015482600380602002604051908101604052809291908260038015612e3b576020028201915b815481526020019060010190808311612e27575b5050604080516060810191829052949750869350600392509050826000855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411612e5a57905050505050509150965096509650965050505093509350935093565b600d545b90565b6000806000806000808c8c8c8c8c8c8c6040516020018088888082843782019150508686808284376c01000000000000000000000000600160a060020a0388160292019182525060140183838082843782019150509750505050505050506040516020818303038152906040526040518082805190602001908083835b60208310612f485780518252601f199092019160209182019101612f29565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206000818152600b9092529290206005810154929a5098505015159150613106905057612f9d858e8e614506565b50612fac600186018c8c614506565b5060028501805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038b16179055612fe5600386018989614506565b50600d869080600181540180825580915050906001820390600052602060002001600090919290919091509060001916905550600e60008a600160a060020a0316600160a060020a0316815260200190815260200160002086908060018154018082558091505090600182039060005260206000200160009091929091909150906000191690555088600160a060020a03167fe06ec53edc3679388991a8310fd45c6a8368784489fe5a7bee90717385efc28d8e8e8e8e8d8d6040518080602001806020018060200184810384528a8a82818152602001925080828437909101858103845288815260200190508888808284379091018581038352868152602001905086868082843760405192018290039b50909950505050505050505050a25b6000600486015460ff16600381111561311b57fe5b141561313d576004850180546002919060ff19166001835b02179055506131e3565b6001600486015460ff16600381111561315257fe5b141561316e576004850180546003919060ff1916600183613133565b6040805160e560020a62461bcd028152602060048201526024808201527f546f6b656e20616c72656164792068617320612070656e64696e67207265717560448201527f6573742e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6005850180546131f68260018301614584565b8154811061320057fe5b60009182526020909120600a9091020193503360048501600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039283161790554260028681019190915560005460088701805474ffffffffffffffffffffffffffffffffffffffff001916610100929094168202939093179092556001805461329d9360098901938284161590910260001901909116046145b0565b506007840180546132b182600183016144b6565b815481106132bb57fe5b600091825260209091206006909102019250857fa3038500b3c6dba812512e25571133d315bfe339f7f8ab4d56e9cad98318e2706002600488015460ff16600381111561330457fe5b60408051929091148252519081900360200190a260088401546040517ff7434ea90000000000000000000000000000000000000000000000000000000081526020600482019081526009870180546002610100600183161581026000190190921604602485018190529404600160a060020a03169363f7434ea9939192918291604490910190849080156133d95780601f106133ae576101008083540402835291602001916133d9565b820191906000526020600020905b8154815290600101906020018083116133bc57829003601f168201915b505092505050602060405180830381600087803b1580156133f957600080fd5b505af115801561340d573d6000803e3d6000fd5b505050506040513d602081101561342357600080fd5b5051600454600a5491935061344b916126ad906127109061269590879063ffffffff61411d16565b905061345b83600133348561416f565b80836001015410156134b7576040805160e560020a62461bcd02815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038301805461ff00191661010017905585600060048601600101546004880154604051600160a060020a03909216916000805160206147a28339815191529160ff169060009081908084600381111561350d57fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a450505050505050505050505050565b6000838152600b6020526040812060058101805491929182918291829182918990811061356957fe5b90600052602060002090600a02019450846007018781548110151561358a57fe5b600091825260209091206003870154600690920201945060ff1615156135af57600080fd5b845460ff1615806135d257506000600886015460ff1660028111156135d057fe5b145b156136ac5760008460010154116135ea576000613628565b836001015484600201546004860154600160a060020a038d16600090815260058801602052604090209290910191600101540281151561362657fe5b045b9150600084600201541161363d57600061367b565b836001015484600201546004860154600160a060020a038d16600090815260058801602052604090209290910191600201540281151561367957fe5b045b600160a060020a038b1660009081526005860160205260408120600181018290556002015582810193509050613786565b6008850154600090859060ff1660028111156136c457fe5b600381106136ce57fe5b0154116136dc576000613747565b6008850154849060ff1660028111156136f157fe5b600381106136fb57fe5b01546004850154600160a060020a038c1660009081526005870160205260409020600888015460ff16600281111561372f57fe5b6003811061373957fe5b01540281151561374557fe5b045b600160a060020a038b16600090815260058601602052604081206008880154929550909160ff16600281111561377957fe5b6003811061378357fe5b01555b604080518881526020810185905281518a92600160a060020a038e16928d927fea1e4a64c44a9979a3521f67bc0c27e16b79ecff122406c701db571d6df96ab1929181900390910190a4604051600160a060020a038b169084156108fc029085906000818181858888f1505050505050505050505050505050565b600354600160a060020a03163314613851576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600855565b600354600160a060020a031633146138a6576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790556138da60018383614506565b50505050565b6000818152600b602052604081206001600482015460ff16600381111561390357fe5b148061392157506003600482015460ff16600381111561391f57fe5b145b9392505050565b6000806000806139366144e7565b6000878152600b6020526040812060050180548291829160609183918c90811061395c57fe5b60009182526020909120600a909102018054600182015460028301546003808501546007860154600887015460408051606081019182905298995060ff97881698969795969386169560048b0195939490831693610100909304600160a060020a03169260098c019287919082845b8154600160a060020a031681526001909101906020018083116139cb575050845460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a5086945092508401905082828015613a765780601f10613a4b57610100808354040283529160200191613a76565b820191906000526020600020905b815481529060010190602001808311613a5957829003601f168201915b50505050509050995099509950995099509950995099509950509295985092959850929598565b600354600160a060020a03163314613aed576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600655565b61271081565b600354600160a060020a03163314613b48576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600780546001019081905560408051602080825281018690526002909202917f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d91879187918190810184848082843760405192018290039550909350505050a26007546002026001017f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d83836040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a250505050565b600354600160a060020a03163314613c57576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b600555565b600354600160a060020a03163314613cac576040805160e560020a62461bcd0281526020600482018190526024820152600080516020614782833981519152604482015290519081900360640190fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000818152600b602052604081206005810180549192916000198101908110613d0057fe5b90600052602060002090600a0201905060065481600201544203111515613d97576040805160e560020a62461bcd02815260206004820152602f60248201527f54696d6520746f206368616c6c656e6765207468652072657175657374206d7560448201527f73742068617665207061737365642e0000000000000000000000000000000000606482015290519081900360840190fd5b805460ff1615613e17576040805160e560020a62461bcd02815260206004820152602360248201527f54686520726571756573742073686f756c64206e6f742062652064697370757460448201527f65642e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6002600483015460ff166003811115613e2c57fe5b1415613e4d576004820180546001919060ff191682805b0217905550613ece565b6003600483015460ff166003811115613e6257fe5b1415613e7e576004820180546000919060ff1916600183613e43565b6040805160e560020a62461bcd02815260206004820152601860248201527f5468657265206d757374206265206120726571756573742e0000000000000000604482015290519081900360640190fd5b60038101805460ff1916600117905560058082015490830154613f0291600160a060020a0316908590600019016000613540565b82600060048301600101546004850154604051600160a060020a03909216916000805160206147a28339815191529160ff1690600090819080846003811115613f4757fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a4505050565b6000838152600b602052604081206005810180549192916000198101908110613f9557fe5b60009182526020909120600a90910201600381015490915060ff161561402b576040805160e560020a62461bcd02815260206004820152602960248201527f5468652064697370757465206d757374206e6f7420616c72656164792062652060448201527f7265736f6c7665642e0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600582015460408051602080820189905260001990930181830152815180820383018152606090910191829052805133939192918291908401908083835b602083106140885780518252601f199092019160209182019101614069565b518151600019602094850361010090810a91909101918216911992909216179091526040805195909301859003852060088a01548387529286018c90529650600160a060020a0391041693507fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c928a925089918190810184848082843760405192018290039550909350505050a45050505050565b6000808315156141305760009150614153565b5082820282848281151561414057fe5b041461414e57600019614150565b805b91505b5092915050565b60008282018381101561414e57600019614150565b6000806141a48461419f8989600281111561418657fe5b6003811061419057fe5b0154869063ffffffff61423b16565b614491565b600160a060020a038716600090815260058a0160205260409020919350915082908760028111156141d157fe5b600381106141db57fe5b018054909101905581878760028111156141f157fe5b600381106141fb57fe5b018054909101905560048701805483019055604051600160a060020a0386169082156108fc029083906000818181858888f1505050505050505050505050565b60008282111561424d57506000614252565b508082035b92915050565b336000908152600c60209081526040808320858452825280832054808452600b909252822060058101805492939192829190600019810190811061429857fe5b90600052602060002090600a020191508460028111156142b457fe5b905060018160028111156142c457fe5b1415614316576002600484015460ff1660038111156142df57fe5b14156142f95760048301805460ff19166001179055614311565b6004830180546000919060ff19166001835b02179055505b614372565b6002600484015460ff16600381111561432b57fe5b1415614347576004830180546000919060ff191660018361430b565b6003600484015460ff16600381111561435c57fe5b14156143725760048301805460ff191660011790555b60038201805460ff1916600117905584600281111561438d57fe5b60088301805460ff191660018360028111156143a557fe5b021790555060008160028111156143b857fe5b1415614405576143f26004830160015b600381106143d257fe5b01546005850154600160a060020a03909116908690600019016000613540565b6144006004830160026143c8565b614418565b614418826004018260028111156143c857fe5b60068201546005830154600485015484546040518894600160a060020a039081169416926000805160206147a28339815191529260ff918216929116906000908084600381111561446557fe5b60ff168152921515602084015250151560408083019190915251908190036060019150a4505050505050565b600080838311156144a7575082905060006144af565b508190508083035b9250929050565b8154818355818111156144e2576006028160060283600052602060002091820191016144e29190614625565b505050565b6060604051908101604052806003906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106145475782800160ff19823516178555614574565b82800160010185558215614574579182015b82811115614574578235825591602001919060010190614559565b5061458092915061465d565b5090565b8154818355818111156144e257600a0281600a0283600052602060002091820191016144e29190614677565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106145e95780548555614574565b8280016001018555821561457457600052602060002091601f016020900482015b8281111561457457825482559160010191906001019061460a565b612ea991905b8082111561458057600061463f82826146fd565b61464d600383016000614712565b506000600482015560060161462b565b612ea991905b808211156145805760008155600101614663565b612ea991905b8082111561458057805460ff199081168255600060018301819055600283018190556003830180549092169091556146b860048301826146fd565b6146c6600783016000614719565b60088201805474ffffffffffffffffffffffffffffffffffffffffff191690556146f460098301600061473d565b50600a0161467d565b50600081556001016000815560010160009055565b5060009055565b508054600082556006029060005260206000209081019061473a9190614625565b50565b50805460018160011615610100020316600290046000825580601f10614763575061473a565b601f01602090049060005260206000209081019061473a919061465d56005468652063616c6c6572206d7573742062652074686520676f7665726e6f722e1d939a93a378cb71bc38b0480cac752dd80d8951166c558440209d33b1f4ae68a165627a7a72305820a5816e3f2608535115c04224f8c4cd7b3fe6d85dc9a9051079c870c2109645d10029

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

000000000000000000000000988b3a538b618c7a603e1c11ab82cd16dbe28069000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000280000000000000000000000000334f12afb7d8740868be0471963961653307523400000000000000000000000000000000000000000000000004a67ba0e06a26800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ebe0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000008f2f697066732f516d567a466b796f68334b44394533434146424d684161424b313646344e54576b313645544e31564655594d4e752f426363783370717970776b39784d59753566396279327266697a696168786b6f656e65625a7a5252794d64323247796e7a67345a356b6e76746737334538424751685665684a706663566431374d346f73785a674863786971390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008f2f697066732f516d63555936346f4d4a4d59317263464d574334647955707a5769556a5a3861504145736264485441534b5654352f42636476723763507165537969387450626a574b54506d796e485154435337326b54534374436b6b4e7878756a684776386d5463473570373267543747656e413177337370546a7933684156467944385073566f52426e6454510000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _arbitrator (address): 0x988b3A538b618C7A603e1c11Ab82Cd16dbE28069
Arg [1] : _arbitratorExtraData (bytes): 0x00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003
Arg [2] : _registrationMetaEvidence (string): /ipfs/QmVzFkyoh3KD9E3CAFBMhAaBK16F4NTWk16ETN1VFUYMNu/Bccx3pqypwk9xMYu5f9by2rfiziahxkoenebZzRRyMd22Gynzg4Z5knvtg73E8BGQhVehJpfcVd17M4osxZgHcxiq9
Arg [3] : _clearingMetaEvidence (string): /ipfs/QmcUY64oMJMY1rcFMWC4dyUpzWiUjZ8aPAEsbdHTASKVT5/Bcdvr7cPqeSyi8tPbjWKTPmynHQTCS72kTSCtCkkNxxujhGv8mTcG5p72gT7GenA1w3spTjy3hAVFyD8PsVoRBndTQ
Arg [4] : _governor (address): 0x334F12AfB7D8740868bE04719639616533075234
Arg [5] : _requesterBaseDeposit (uint256): 335091153175717504
Arg [6] : _challengerBaseDeposit (uint256): 0
Arg [7] : _challengePeriodDuration (uint256): 453600
Arg [8] : _sharedStakeMultiplier (uint256): 1
Arg [9] : _winnerStakeMultiplier (uint256): 1
Arg [10] : _loserStakeMultiplier (uint256): 2

-----Encoded View---------------
26 Constructor Arguments found :
Arg [0] : 000000000000000000000000988b3a538b618c7a603e1c11ab82cd16dbe28069
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000280
Arg [4] : 000000000000000000000000334f12afb7d8740868be04719639616533075234
Arg [5] : 00000000000000000000000000000000000000000000000004a67ba0e06a2680
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 000000000000000000000000000000000000000000000000000000000006ebe0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [14] : 000000000000000000000000000000000000000000000000000000000000008f
Arg [15] : 2f697066732f516d567a466b796f68334b44394533434146424d684161424b31
Arg [16] : 3646344e54576b313645544e31564655594d4e752f426363783370717970776b
Arg [17] : 39784d59753566396279327266697a696168786b6f656e65625a7a5252794d64
Arg [18] : 323247796e7a67345a356b6e76746737334538424751685665684a7066635664
Arg [19] : 31374d346f73785a674863786971390000000000000000000000000000000000
Arg [20] : 000000000000000000000000000000000000000000000000000000000000008f
Arg [21] : 2f697066732f516d63555936346f4d4a4d59317263464d574334647955707a57
Arg [22] : 69556a5a3861504145736264485441534b5654352f4263647672376350716553
Arg [23] : 7969387450626a574b54506d796e485154435337326b54534374436b6b4e7878
Arg [24] : 756a684776386d5463473570373267543747656e413177337370546a79336841
Arg [25] : 56467944385073566f52426e6454510000000000000000000000000000000000


Swarm Source

bzzr://a5816e3f2608535115c04224f8c4cd7b3fe6d85dc9a9051079c870c2109645d1

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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