From f4851db199869164622d25186e84976448b3aca5 Mon Sep 17 00:00:00 2001 From: shotaronowhere Date: Tue, 8 Aug 2023 18:32:40 +0100 Subject: [PATCH] chore(testnet): sepolia deployment --- deployments/sepolia/.chainId | 1 + deployments/sepolia/BatchWithdraw.json | 147 ++ .../sepolia/EnhancedAppealableArbitrator.json | 867 +++++++ deployments/sepolia/GTCRFactory.json | 199 ++ deployments/sepolia/GeneralizedTCRView.json | 1159 ++++++++++ deployments/sepolia/LightBatchWithdraw.json | 147 ++ deployments/sepolia/LightGTCRFactory.json | 235 ++ deployments/sepolia/LightGeneralizedTCR.json | 1992 +++++++++++++++++ .../sepolia/LightGeneralizedTCRView.json | 670 ++++++ deployments/sepolia/RelayMock.json | 76 + hardhat.config.js | 18 + package.json | 2 + 12 files changed, 5513 insertions(+) create mode 100644 deployments/sepolia/.chainId create mode 100644 deployments/sepolia/BatchWithdraw.json create mode 100644 deployments/sepolia/EnhancedAppealableArbitrator.json create mode 100644 deployments/sepolia/GTCRFactory.json create mode 100644 deployments/sepolia/GeneralizedTCRView.json create mode 100644 deployments/sepolia/LightBatchWithdraw.json create mode 100644 deployments/sepolia/LightGTCRFactory.json create mode 100644 deployments/sepolia/LightGeneralizedTCR.json create mode 100644 deployments/sepolia/LightGeneralizedTCRView.json create mode 100644 deployments/sepolia/RelayMock.json diff --git a/deployments/sepolia/.chainId b/deployments/sepolia/.chainId new file mode 100644 index 0000000..bd8d1cd --- /dev/null +++ b/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/deployments/sepolia/BatchWithdraw.json b/deployments/sepolia/BatchWithdraw.json new file mode 100644 index 0000000..183a0a7 --- /dev/null +++ b/deployments/sepolia/BatchWithdraw.json @@ -0,0 +1,147 @@ +{ + "address": "0xb01C9DE0e9dE0a6cAb6df586484707b7078De684", + "abi": [ + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_contributor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_cursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundCursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundCount", + "type": "uint256" + } + ], + "name": "batchRequestWithdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_contributor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_request", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_cursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + } + ], + "name": "batchRoundWithdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x4ebc57e6506f9434cbead633f94f20be2000526c65eda102adbc49adbf63179e", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0xb01C9DE0e9dE0a6cAb6df586484707b7078De684", + "transactionIndex": 25, + "gasUsed": "314175", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd8d5a91ed6e5359175b346127679018cbdf0f0371324dae9fe4f861fa28b5aaa", + "transactionHash": "0x4ebc57e6506f9434cbead633f94f20be2000526c65eda102adbc49adbf63179e", + "logs": [], + "blockNumber": 4048374, + "cumulativeGasUsed": "17529165", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_contributor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_cursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundCursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundCount\",\"type\":\"uint256\"}],\"name\":\"batchRequestWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_contributor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_request\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_cursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"}],\"name\":\"batchRoundWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"batchRequestWithdraw(address,address,bytes32,uint256,uint256,uint256,uint256)\":{\"details\":\"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.\",\"params\":{\"_address\":\"The address of the GTCR.\",\"_contributor\":\"The address that made contributions to the request.\",\"_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.\",\"_cursor\":\"The request from which to start withdrawing.\",\"_itemID\":\"The ID of the item with funds to be withdrawn.\",\"_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.\",\"_roundCursor\":\"The round of each request from where to start withdrawing.\"}},\"batchRoundWithdraw(address,address,bytes32,uint256,uint256,uint256)\":{\"details\":\"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.\",\"params\":{\"_address\":\"The address of the GTCR.\",\"_contributor\":\"The address that made contributions to the request.\",\"_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.\",\"_cursor\":\"The round from where to start withdrawing.\",\"_itemID\":\"The ID of the item with funds to be withdrawn.\",\"_request\":\"The request from which to withdraw contributions.\"}}},\"title\":\"BatchWithdraw Withdraw fees and rewards from contributions to disputes rounds in batches.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/BatchWithdraw.sol\":\"BatchWithdraw\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/BatchWithdraw.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport { GeneralizedTCR } from \\\"./GeneralizedTCR.sol\\\";\\n\\n/**\\n * @title BatchWithdraw\\n * Withdraw fees and rewards from contributions to disputes rounds in batches.\\n */\\ncontract BatchWithdraw {\\n\\n /** @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.\\n * @param _address The address of the GTCR.\\n * @param _contributor The address that made contributions to the request.\\n * @param _itemID The ID of the item with funds to be withdrawn.\\n * @param _request The request from which to withdraw contributions.\\n * @param _cursor The round from where to start withdrawing.\\n * @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.\\n */\\n function batchRoundWithdraw(\\n address _address,\\n address payable _contributor,\\n bytes32 _itemID,\\n uint _request,\\n uint _cursor,\\n uint _count\\n ) public {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n (,,,,,uint numberOfRounds,,,,) = gtcr.getRequestInfo(_itemID, _request);\\n for (uint i = _cursor; i < numberOfRounds && (_count == 0 || i < _count); i++)\\n gtcr.withdrawFeesAndRewards(_contributor, _itemID, _request, i);\\n }\\n\\n /** @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.\\n * @param _address The address of the GTCR.\\n * @param _contributor The address that made contributions to the request.\\n * @param _itemID The ID of the item with funds to be withdrawn.\\n * @param _cursor The request from which to start withdrawing.\\n * @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.\\n * @param _roundCursor The round of each request from where to start withdrawing.\\n * @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.\\n */\\n function batchRequestWithdraw(\\n address _address,\\n address payable _contributor,\\n bytes32 _itemID,\\n uint _cursor,\\n uint _count,\\n uint _roundCursor,\\n uint _roundCount\\n ) external {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n (\\n ,\\n ,\\n uint numberOfRequests\\n ) = gtcr.getItemInfo(_itemID);\\n for (uint i = _cursor; i < numberOfRequests && (_count == 0 || i < _count); i++)\\n batchRoundWithdraw(_address, _contributor, _itemID, i, _roundCursor, _roundCount);\\n }\\n}\\n\",\"keccak256\":\"0x2662b52d2b0d8f3f49c1e7149291f2906f891ce4b0ec4627a465838a993c71d6\"},\"contracts/GeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1, @mtsalenc]\\n * @reviewers: [@clesaege*, @ferittuncer, @satello*, @remedcu, @fnanni-0, @shalzz, @MerlinEgalite]\\n * @auditors: []\\n * @bounties: [{ link: https://github.com/kleros/tcr/issues/20, maxPayout: 25 ETH }]\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport { IArbitrable, IArbitrator } from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport { IEvidence } from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport { CappedMath } from \\\"./utils/CappedMath.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */ // It is the user responsibility to accept ETH.\\n\\n/**\\n * @title GeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n */\\ncontract GeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n bytes data; // The data describing the item.\\n Status status; // The current status of the item.\\n Request[] requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n bool disputed; // True if a dispute was raised.\\n uint disputeID; // ID of the dispute, if any.\\n uint submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n bool resolved; // True if the request was executed and/or any raised disputes were resolved.\\n address payable[3] parties; // Address of requester and challenger, if any, in the form parties[party].\\n Round[] rounds; // Tracks each round of a dispute in the form rounds[roundID].\\n Party ruling; // The final ruling given, if any.\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n uint metaEvidenceID; // The meta evidence to be used in a dispute for this case.\\n }\\n\\n struct Round {\\n uint[3] amountPaid; // Tracks the sum paid for each Party in this round. Includes arbitration fees, fee stakes and deposits.\\n bool[3] hasPaid; // True if the Party has fully paid its fee in this round.\\n uint feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n mapping(address => uint[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n /* Storage */\\n\\n IArbitrator public arbitrator; // The arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data for the arbitrator contract.\\n\\n uint RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n\\n address public governor; // The address that can make changes to the parameters of the contract.\\n uint public submissionBaseDeposit; // The base deposit to submit an item.\\n uint public removalBaseDeposit; // The base deposit to remove an item.\\n uint public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n uint public metaEvidenceUpdates; // The number of times the meta evidence has been updated. Used to track the latest meta evidence ID.\\n\\n // Multipliers are in basis points.\\n uint public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n bytes32[] public itemList; // List of IDs of all submitted items.\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint => bytes32)) public arbitratorDisputeIDToItem; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItem[arbitrator][disputeID].\\n mapping(bytes32 => uint) public itemIDtoIndex; // Maps an item's ID to its position in the list in the form itemIDtoIndex[itemID].\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor {require(msg.sender == governor, \\\"The caller must be the governor.\\\"); _;}\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the request.\\n * @param _roundIndex The index of the round.\\n * @param _disputed Whether the request is disputed.\\n * @param _resolved Whether the request is executed.\\n */\\n event ItemStatusChange(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n uint indexed _roundIndex,\\n bool _disputed,\\n bool _resolved\\n );\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _submitter The address of the requester.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _data The item data.\\n */\\n event ItemSubmitted(\\n bytes32 indexed _itemID,\\n address indexed _submitter,\\n uint indexed _evidenceGroupID,\\n bytes _data\\n );\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the latest request.\\n * @param _requestType Whether it is a registration or a removal request.\\n */\\n event RequestSubmitted(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n Status indexed _requestType\\n );\\n\\n /**\\n * @dev Emitted when someone submits a request. This is useful to quickly find an item and request from an evidence event and vice-versa.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the latest request.\\n * @param _evidenceGroupID The evidence group ID used for this request.\\n */\\n event RequestEvidenceGroupID(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n uint indexed _evidenceGroupID\\n );\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal.\\n * @param _itemID The ID of the item.\\n * @param _contributor The address making the contribution.\\n * @param _request The index of the request.\\n * @param _round The index of the round receiving the contribution.\\n * @param _amount The amount of the contribution.\\n * @param _side The party receiving the contribution.\\n */\\n event AppealContribution(\\n bytes32 indexed _itemID,\\n address indexed _contributor,\\n uint indexed _request,\\n uint _round,\\n uint _amount,\\n Party _side\\n );\\n\\n /** @dev Emitted when one of the parties successfully paid its appeal fees.\\n * @param _itemID The ID of the item.\\n * @param _request The index of the request.\\n * @param _round The index of the round.\\n * @param _side The side that is fully funded.\\n */\\n event HasPaidAppealFee(\\n bytes32 indexed _itemID,\\n uint indexed _request,\\n uint indexed _round,\\n Party _side\\n );\\n\\n /** @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Deploy the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _submissionBaseDeposit The base deposit to submit an item.\\n * @param _removalBaseDeposit The base deposit to remove an item.\\n * @param _submissionChallengeBaseDeposit The base deposit to challenge a submission.\\n * @param _removalChallengeBaseDeposit The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n */\\n constructor(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n address _connectedTCR,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence,\\n address _governor,\\n uint _submissionBaseDeposit,\\n uint _removalBaseDeposit,\\n uint _submissionChallengeBaseDeposit,\\n uint _removalChallengeBaseDeposit,\\n uint _challengePeriodDuration,\\n uint[3] memory _stakeMultipliers\\n ) public {\\n emit MetaEvidence(0, _registrationMetaEvidence);\\n emit MetaEvidence(1, _clearingMetaEvidence);\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n governor = _governor;\\n submissionBaseDeposit = _submissionBaseDeposit;\\n removalBaseDeposit = _removalBaseDeposit;\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /** @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The data describing the item.\\n */\\n function addItem(bytes calldata _item) external payable {\\n bytes32 itemID = keccak256(_item);\\n require(items[itemID].status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n requestStatusChange(_item, submissionBaseDeposit);\\n }\\n\\n /** @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n require(items[_itemID].status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n Item storage item = items[_itemID];\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n // Using `length` instead of `length - 1` because a new request will be added on requestStatusChange().\\n uint requestIndex = item.requests.length;\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, requestIndex)));\\n\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n requestStatusChange(item.data, removalBaseDeposit);\\n }\\n\\n /** @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n require(\\n item.status == Status.RegistrationRequested || item.status == Status.ClearingRequested,\\n \\\"The item must have a pending request.\\\"\\n );\\n\\n Request storage request = item.requests[item.requests.length - 1];\\n require(now - request.submissionTime <= challengePeriodDuration, \\\"Challenges must occur during the challenge period.\\\");\\n require(!request.disputed, \\\"The request should not have already been disputed.\\\");\\n\\n request.parties[uint(Party.Challenger)] = msg.sender;\\n\\n Round storage round = request.rounds[0];\\n uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);\\n uint challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n uint totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n contribute(round, Party.Challenger, msg.sender, msg.value, totalCost);\\n require(round.amountPaid[uint(Party.Challenger)] >= totalCost, \\\"You must fully fund your side.\\\");\\n round.hasPaid[uint(Party.Challenger)] = true;\\n\\n // Raise a dispute.\\n request.disputeID = request.arbitrator.createDispute.value(arbitrationCost)(RULING_OPTIONS, request.arbitratorExtraData);\\n arbitratorDisputeIDToItem[address(request.arbitrator)][request.disputeID] = _itemID;\\n request.disputed = true;\\n request.rounds.length++;\\n round.feeRewards = round.feeRewards.subCap(arbitrationCost);\\n\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, item.requests.length - 1)));\\n emit Dispute(\\n request.arbitrator,\\n request.disputeID,\\n request.metaEvidenceID,\\n evidenceGroupID\\n );\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(request.arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n }\\n\\n /** @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side == Party.Requester || _side == Party.Challenger, \\\"Invalid side.\\\");\\n require(\\n items[_itemID].status == Status.RegistrationRequested || items[_itemID].status == Status.ClearingRequested,\\n \\\"The item must have a pending request.\\\"\\n );\\n Request storage request = items[_itemID].requests[items[_itemID].requests.length - 1];\\n require(request.disputed, \\\"A dispute must have been raised to fund an appeal.\\\");\\n (uint appealPeriodStart, uint appealPeriodEnd) = request.arbitrator.appealPeriod(request.disputeID);\\n require(\\n now >= appealPeriodStart && now < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n /* solium-disable indentation */\\n uint multiplier;\\n {\\n Party winner = Party(request.arbitrator.currentRuling(request.disputeID));\\n Party loser;\\n if (winner == Party.Requester)\\n loser = Party.Challenger;\\n else if (winner == Party.Challenger)\\n loser = Party.Requester;\\n require(_side != loser || (now-appealPeriodStart < (appealPeriodEnd-appealPeriodStart)/2), \\\"The loser must contribute during the first half of the appeal period.\\\");\\n\\n\\n if (_side == winner)\\n multiplier = winnerStakeMultiplier;\\n else if (_side == loser)\\n multiplier = loserStakeMultiplier;\\n else\\n multiplier = sharedStakeMultiplier;\\n }\\n /* solium-enable indentation */\\n\\n Round storage round = request.rounds[request.rounds.length - 1];\\n uint appealCost = request.arbitrator.appealCost(request.disputeID, request.arbitratorExtraData);\\n uint totalCost = appealCost.addCap((appealCost.mulCap(multiplier)) / MULTIPLIER_DIVISOR);\\n uint contribution = contribute(round, _side, msg.sender, msg.value, totalCost);\\n\\n emit AppealContribution(\\n _itemID,\\n msg.sender,\\n items[_itemID].requests.length - 1,\\n request.rounds.length - 1,\\n contribution,\\n _side\\n );\\n\\n if (round.amountPaid[uint(_side)] >= totalCost) {\\n round.hasPaid[uint(_side)] = true;\\n emit HasPaidAppealFee(_itemID, items[_itemID].requests.length - 1, request.rounds.length - 1, _side);\\n }\\n\\n // Raise appeal if both sides are fully funded.\\n if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) {\\n request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData);\\n request.rounds.length++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n\\n /** @dev Reimburses contributions if no disputes were raised. If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw from.\\n * @param _round The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(address payable _beneficiary, bytes32 _itemID, uint _request, uint _round) public {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n require(request.resolved, \\\"Request must be resolved.\\\");\\n\\n uint reward;\\n if (!round.hasPaid[uint(Party.Requester)] || !round.hasPaid[uint(Party.Challenger)]) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward = round.contributions[_beneficiary][uint(Party.Requester)] + round.contributions[_beneficiary][uint(Party.Challenger)];\\n } else if (request.ruling == Party.None) {\\n // Reimburse unspent fees proportionally if there is no winner or loser.\\n uint rewardRequester = round.amountPaid[uint(Party.Requester)] > 0\\n ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.amountPaid[uint(Party.Challenger)] + round.amountPaid[uint(Party.Requester)])\\n : 0;\\n uint rewardChallenger = round.amountPaid[uint(Party.Challenger)] > 0\\n ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.amountPaid[uint(Party.Challenger)] + round.amountPaid[uint(Party.Requester)])\\n : 0;\\n\\n reward = rewardRequester + rewardChallenger;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint(request.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.amountPaid[uint(request.ruling)]\\n : 0;\\n\\n }\\n round.contributions[_beneficiary][uint(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint(Party.Challenger)] = 0;\\n\\n _beneficiary.send(reward);\\n }\\n\\n /** @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n require(\\n now - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n require(!request.disputed, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Registered;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Absent;\\n else\\n revert(\\\"There must be a request.\\\");\\n\\n request.resolved = true;\\n emit ItemStatusChange(_itemID, item.requests.length - 1, request.rounds.length - 1, false, true);\\n\\n withdrawFeesAndRewards(request.parties[uint(Party.Requester)], _itemID, item.requests.length - 1, 0); // Automatically withdraw for the requester.\\n }\\n\\n /** @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) public {\\n Party resultRuling = Party(_ruling);\\n bytes32 itemID = arbitratorDisputeIDToItem[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n\\n Request storage request = item.requests[item.requests.length - 1];\\n Round storage round = request.rounds[request.rounds.length - 1];\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n require(address(request.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n require(!request.resolved, \\\"The request must not be resolved.\\\");\\n\\n // The ruling is inverted if the loser paid its fees.\\n 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.\\n resultRuling = Party.Requester;\\n else if (round.hasPaid[uint(Party.Challenger)] == true)\\n resultRuling = Party.Challenger;\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, uint(resultRuling));\\n executeRuling(_disputeID, uint(resultRuling));\\n }\\n\\n /** @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n require(!request.resolved, \\\"The dispute must not already be resolved.\\\");\\n\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, item.requests.length - 1)));\\n emit Evidence(request.arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeTimeToChallenge(uint _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /** @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /** @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /** @dev Change the arbitrator to be used for disputes that may be raised. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitrator The new trusted arbitrator to be used in disputes.\\n * @param _arbitratorExtraData The extra data used by the new arbitrator.\\n */\\n function changeArbitrator(IArbitrator _arbitrator, bytes calldata _arbitratorExtraData) external onlyGovernor {\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n /** @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /** @dev Update the meta evidence used for disputes.\\n * @param _registrationMetaEvidence The meta evidence to be used for future registration request disputes.\\n * @param _clearingMetaEvidence The meta evidence to be used for future clearing request disputes.\\n */\\n function changeMetaEvidence(string calldata _registrationMetaEvidence, string calldata _clearingMetaEvidence) external onlyGovernor {\\n metaEvidenceUpdates++;\\n emit MetaEvidence(2 * metaEvidenceUpdates, _registrationMetaEvidence);\\n emit MetaEvidence(2 * metaEvidenceUpdates + 1, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /** @dev Submit a request to change item's status. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The data describing the item.\\n * @param _baseDeposit The base deposit for the request.\\n */\\n function requestStatusChange(bytes memory _item, uint _baseDeposit) internal {\\n bytes32 itemID = keccak256(_item);\\n Item storage item = items[itemID];\\n\\n // Using `length` instead of `length - 1` as index because a new request will be added.\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(itemID, item.requests.length)));\\n if (item.requests.length == 0) {\\n item.data = _item;\\n itemList.push(itemID);\\n itemIDtoIndex[itemID] = itemList.length - 1;\\n\\n emit ItemSubmitted(itemID, msg.sender, evidenceGroupID, item.data);\\n }\\n\\n Request storage request = item.requests[item.requests.length++];\\n if (item.status == Status.Absent) {\\n item.status = Status.RegistrationRequested;\\n request.metaEvidenceID = 2 * metaEvidenceUpdates;\\n } else if (item.status == Status.Registered) {\\n item.status = Status.ClearingRequested;\\n request.metaEvidenceID = 2 * metaEvidenceUpdates + 1;\\n }\\n\\n request.parties[uint(Party.Requester)] = msg.sender;\\n request.submissionTime = now;\\n request.arbitrator = arbitrator;\\n request.arbitratorExtraData = arbitratorExtraData;\\n\\n Round storage round = request.rounds[request.rounds.length++];\\n\\n uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);\\n uint totalCost = arbitrationCost.addCap(_baseDeposit);\\n contribute(round, Party.Requester, msg.sender, msg.value, totalCost);\\n require(round.amountPaid[uint(Party.Requester)] >= totalCost, \\\"You must fully fund your side.\\\");\\n round.hasPaid[uint(Party.Requester)] = true;\\n\\n emit ItemStatusChange(itemID, item.requests.length - 1, request.rounds.length - 1, false, false);\\n emit RequestSubmitted(itemID, item.requests.length - 1, item.status);\\n emit RequestEvidenceGroupID(itemID, item.requests.length - 1, evidenceGroupID);\\n }\\n\\n /** @dev Returns the contribution value and remainder from available ETH and required amount.\\n * @param _available The amount of ETH available for the contribution.\\n * @param _requiredAmount The amount of ETH required for the contribution.\\n * @return taken The amount of ETH taken.\\n * @return remainder The amount of ETH left from the contribution.\\n */\\n function calculateContribution(uint _available, uint _requiredAmount)\\n internal\\n pure\\n returns(uint taken, uint remainder)\\n {\\n if (_requiredAmount > _available)\\n return (_available, 0); // Take whatever is available, return 0 as leftover ETH.\\n else\\n return (_requiredAmount, _available - _requiredAmount);\\n }\\n\\n /** @dev Make a fee contribution.\\n * @param _round The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(Round storage _round, Party _side, address payable _contributor, uint _amount, uint _totalRequired) internal returns (uint) {\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint contribution; // Amount contributed.\\n uint remainingETH; // Remaining ETH to send back.\\n (contribution, remainingETH) = calculateContribution(_amount, _totalRequired.subCap(_round.amountPaid[uint(_side)]));\\n _round.contributions[_contributor][uint(_side)] += contribution;\\n _round.amountPaid[uint(_side)] += contribution;\\n _round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n _contributor.send(remainingETH); // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n\\n return contribution;\\n }\\n\\n /** @dev Execute the ruling of a dispute.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function executeRuling(uint _disputeID, uint _ruling) internal {\\n bytes32 itemID = arbitratorDisputeIDToItem[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n\\n Party winner = Party(_ruling);\\n\\n if (winner == Party.Requester) { // Execute Request.\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Registered;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Absent;\\n } else {\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Absent;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Registered;\\n }\\n\\n request.resolved = true;\\n request.ruling = Party(_ruling);\\n\\n emit ItemStatusChange(itemID, item.requests.length - 1, request.rounds.length - 1, true, true);\\n\\n // Automatically withdraw first deposits and reimbursements (first round only).\\n if (winner == Party.None) {\\n withdrawFeesAndRewards(request.parties[uint(Party.Requester)], itemID, item.requests.length - 1, 0);\\n withdrawFeesAndRewards(request.parties[uint(Party.Challenger)], itemID, item.requests.length - 1, 0);\\n } else {\\n withdrawFeesAndRewards(request.parties[uint(winner)], itemID, item.requests.length - 1, 0);\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /** @dev Returns the number of items that were submitted. Includes items that never made it to the list or were later removed.\\n * @return count The number of items on the list.\\n */\\n function itemCount() external view returns (uint count) {\\n return itemList.length;\\n }\\n\\n /** @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _request The request to query.\\n * @param _round The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint _request,\\n uint _round,\\n address _contributor\\n ) external view returns(uint[3] memory contributions) {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /** @dev Returns item's information. Includes length of requests array.\\n * @param _itemID The ID of the queried item.\\n * @return data The data describing the item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Length of list of status change requests made for the item.\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n bytes memory data,\\n Status status,\\n uint numberOfRequests\\n )\\n {\\n Item storage item = items[_itemID];\\n return (\\n item.data,\\n item.status,\\n item.requests.length\\n );\\n }\\n\\n /** @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _request The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any..\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint _request)\\n external\\n view\\n returns (\\n bool disputed,\\n uint disputeID,\\n uint submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint numberOfRounds,\\n Party ruling,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_request];\\n return (\\n request.disputed,\\n request.disputeID,\\n request.submissionTime,\\n request.resolved,\\n request.parties,\\n request.rounds.length,\\n request.ruling,\\n request.arbitrator,\\n request.arbitratorExtraData,\\n request.metaEvidenceID\\n );\\n }\\n\\n /** @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _request The request to be queried.\\n * @param _round The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(bytes32 _itemID, uint _request, uint _round)\\n external\\n view\\n returns (\\n bool appealed,\\n uint[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n return (\\n _round != (request.rounds.length - 1),\\n round.amountPaid,\\n round.hasPaid,\\n round.feeRewards\\n );\\n }\\n}\\n\",\"keccak256\":\"0xea6a9de52c72e2b3263dbfbd28b3344e0cb1eaa6f1b69313a177b6aaa7a92cbc\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506104b9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630c7c04881461003b5780634746851c14610085575b600080fd5b610083600480360360c081101561005157600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a001356100d3565b005b610083600480360360e081101561009b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c00135610306565b60008690506000816001600160a01b031663bfbcff1a87876040518363ffffffff1660e01b8152600401808381526020018281526020019250505060006040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261018081101561016457600080fd5b81516020830151604080850151606086015160e08701516101008801516101208901516101408a0180519651989a97999598949760808101979496939592949293810192909190846401000000008211156101be57600080fd5b9083019060208201858111156101d357600080fd5b82516401000000008111828201881017156101ed57600080fd5b82525081516020918201929091019080838360005b8381101561021a578181015183820152602001610202565b50505050905090810190601f1680156102475780820380516001836020036101000a031916815260200191505b5060405250949a508d99505050505050505050505b8181108015610272575083158061027257508381105b156102fb576040805163a1c2bf4d60e01b81526001600160a01b038a81166004830152602482018a9052604482018990526064820184905291519185169163a1c2bf4d9160848082019260009290919082900301818387803b1580156102d757600080fd5b505af11580156102eb573d6000803e3d6000fd5b50506001909201915061025c9050565b505050505050505050565b60008790506000816001600160a01b0316634aac84e5886040518263ffffffff1660e01b81526004018082815260200191505060006040518083038186803b15801561035157600080fd5b505afa158015610365573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052606081101561038e57600080fd5b81019080805160405193929190846401000000008211156103ae57600080fd5b9083019060208201858111156103c357600080fd5b82516401000000008111828201881017156103dd57600080fd5b82525081516020918201929091019080838360005b8381101561040a5781810151838201526020016103f2565b50505050905090810190601f1680156104375780820380516001836020036101000a031916815260200191505b5060409081520151935088925050505b818110801561045d575085158061045d57508581105b15610478576104708a8a8a8489896100d3565b600101610447565b5050505050505050505056fea265627a7a723158204bb1570419a4a3f559a5c2f3b7c0099d07508a9f4fc4f4ad963c1c2daad2cc0e64736f6c63430005110032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80630c7c04881461003b5780634746851c14610085575b600080fd5b610083600480360360c081101561005157600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a001356100d3565b005b610083600480360360e081101561009b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c00135610306565b60008690506000816001600160a01b031663bfbcff1a87876040518363ffffffff1660e01b8152600401808381526020018281526020019250505060006040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261018081101561016457600080fd5b81516020830151604080850151606086015160e08701516101008801516101208901516101408a0180519651989a97999598949760808101979496939592949293810192909190846401000000008211156101be57600080fd5b9083019060208201858111156101d357600080fd5b82516401000000008111828201881017156101ed57600080fd5b82525081516020918201929091019080838360005b8381101561021a578181015183820152602001610202565b50505050905090810190601f1680156102475780820380516001836020036101000a031916815260200191505b5060405250949a508d99505050505050505050505b8181108015610272575083158061027257508381105b156102fb576040805163a1c2bf4d60e01b81526001600160a01b038a81166004830152602482018a9052604482018990526064820184905291519185169163a1c2bf4d9160848082019260009290919082900301818387803b1580156102d757600080fd5b505af11580156102eb573d6000803e3d6000fd5b50506001909201915061025c9050565b505050505050505050565b60008790506000816001600160a01b0316634aac84e5886040518263ffffffff1660e01b81526004018082815260200191505060006040518083038186803b15801561035157600080fd5b505afa158015610365573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052606081101561038e57600080fd5b81019080805160405193929190846401000000008211156103ae57600080fd5b9083019060208201858111156103c357600080fd5b82516401000000008111828201881017156103dd57600080fd5b82525081516020918201929091019080838360005b8381101561040a5781810151838201526020016103f2565b50505050905090810190601f1680156104375780820380516001836020036101000a031916815260200191505b5060409081520151935088925050505b818110801561045d575085158061045d57508581105b15610478576104708a8a8a8489896100d3565b600101610447565b5050505050505050505056fea265627a7a723158204bb1570419a4a3f559a5c2f3b7c0099d07508a9f4fc4f4ad963c1c2daad2cc0e64736f6c63430005110032", + "devdoc": { + "methods": { + "batchRequestWithdraw(address,address,bytes32,uint256,uint256,uint256,uint256)": { + "details": "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.", + "params": { + "_address": "The address of the GTCR.", + "_contributor": "The address that made contributions to the request.", + "_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.", + "_cursor": "The request from which to start withdrawing.", + "_itemID": "The ID of the item with funds to be withdrawn.", + "_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.", + "_roundCursor": "The round of each request from where to start withdrawing." + } + }, + "batchRoundWithdraw(address,address,bytes32,uint256,uint256,uint256)": { + "details": "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.", + "params": { + "_address": "The address of the GTCR.", + "_contributor": "The address that made contributions to the request.", + "_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.", + "_cursor": "The round from where to start withdrawing.", + "_itemID": "The ID of the item with funds to be withdrawn.", + "_request": "The request from which to withdraw contributions." + } + } + }, + "title": "BatchWithdraw Withdraw fees and rewards from contributions to disputes rounds in batches." + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/sepolia/EnhancedAppealableArbitrator.json b/deployments/sepolia/EnhancedAppealableArbitrator.json new file mode 100644 index 0000000..7176624 --- /dev/null +++ b/deployments/sepolia/EnhancedAppealableArbitrator.json @@ -0,0 +1,867 @@ +{ + "address": "0x8FeAB350A304140b1593A38a13607d122BEC44b6", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_arbitrationPrice", + "type": "uint256" + }, + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_timeOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "appealDisputeIDsToDisputeIDs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "appealDisputes", + "outputs": [ + { + "internalType": "uint256", + "name": "rulingTime", + "type": "uint256" + }, + { + "internalType": "contract IArbitrator", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "appealDisputeID", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_timeOut", + "type": "uint256" + } + ], + "name": "changeTimeOut", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "disputeStatus", + "outputs": [ + { + "internalType": "enum IArbitrator.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "contract IArbitrable", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "uint256", + "name": "choices", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "enum IArbitrator.DisputeStatus", + "name": "status", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getAppealDisputeID", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "giveRuling", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_arbitrationPrice", + "type": "uint256" + } + ], + "name": "setArbitrationPrice", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "timeOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x11d6aa4b24a83dc3e2fa385dc551781950d12e26ce3c0173d5beff6ec0820df2", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0x8FeAB350A304140b1593A38a13607d122BEC44b6", + "transactionIndex": 29, + "gasUsed": "1603953", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa98c4e7a4c88365a7516f74672187af169cceb2c359ff5f61240052ccf5eccb2", + "transactionHash": "0x11d6aa4b24a83dc3e2fa385dc551781950d12e26ce3c0173d5beff6ec0820df2", + "logs": [], + "blockNumber": 4048250, + "cumulativeGasUsed": "12165333", + "status": 1, + "byzantium": true + }, + "args": [ + 1000, + "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "0x85", + 180 + ], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_arbitrationPrice\",\"type\":\"uint256\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_timeOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"appealDisputeIDsToDisputeIDs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"appealDisputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rulingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"appealDisputeID\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_timeOut\",\"type\":\"uint256\"}],\"name\":\"changeTimeOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"disputeStatus\",\"outputs\":[{\"internalType\":\"enum IArbitrator.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"contract IArbitrable\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"choices\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"enum IArbitrator.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getAppealDisputeID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"giveRuling\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_arbitrationPrice\",\"type\":\"uint256\"}],\"name\":\"setArbitrationPrice\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"timeOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Enrique Piqueras - \",\"details\":\"Implementation of `AppealableArbitrator` that supports `appealPeriod`.\",\"methods\":{\"appeal(uint256,bytes)\":{\"details\":\"Appeals a ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Additional info about the appeal.\"}},\"appealCost(uint256,bytes)\":{\"details\":\"Gets the cost of appeal for the specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Additional info about the appeal.\"},\"return\":\"The cost of the appeal.\"},\"appealPeriod(uint256)\":{\"details\":\"Compute the start and end of the dispute's current or next appeal period, if possible.\",\"params\":{\"_disputeID\":\"ID of the dispute.\"},\"return\":\"The start and end of the period.\"},\"arbitrationCost(bytes)\":{\"details\":\"Cost of arbitration. Accessor to arbitrationPrice.\",\"params\":{\"_extraData\":\"Not used by this contract.\"},\"return\":\"fee Amount to be paid.\"},\"changeArbitrator(address)\":{\"details\":\"Changes the back up arbitrator.\",\"params\":{\"_arbitrator\":\"The new back up arbitrator.\"}},\"changeTimeOut(uint256)\":{\"details\":\"Changes the time out.\",\"params\":{\"_timeOut\":\"The new time out.\"}},\"constructor\":{\"details\":\"Constructs the `EnhancedAppealableArbitrator` contract.\",\"params\":{\"_arbitrationPrice\":\"The amount to be paid for arbitration.\",\"_arbitrator\":\"The back up arbitrator.\",\"_arbitratorExtraData\":\"Not used by this contract.\",\"_timeOut\":\"The time out for the appeal period.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute. Must be called by the arbitrable contract. Must be paid at least arbitrationCost().\",\"params\":{\"_choices\":\"Amount of choices the arbitrator can make in this dispute. When ruling ruling<=choices.\",\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"return\":\"disputeID ID of the dispute created.\"},\"currentRuling(uint256)\":{\"details\":\"Return the ruling of a dispute.\",\"params\":{\"_disputeID\":\"ID of the dispute to rule.\"},\"return\":\"ruling The ruling which would or has been given.\"},\"disputeStatus(uint256)\":{\"details\":\"Gets the status of the specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"return\":\"The status.\"},\"getAppealDisputeID(uint256)\":{\"details\":\"Gets the specified dispute's latest appeal ID.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"giveRuling(uint256,uint256)\":{\"details\":\"Gives a ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_ruling\":\"The ruling.\"}},\"rule(uint256,uint256)\":{\"details\":\"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.\",\"params\":{\"_disputeID\":\"ID of the dispute in the IArbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\"}},\"setArbitrationPrice(uint256)\":{\"details\":\"Set the arbitration price. Only callable by the owner.\",\"params\":{\"_arbitrationPrice\":\"Amount to be paid for arbitration.\"}}},\"title\":\"EnhancedAppealableArbitrator\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/test-purposes/EnhancedAppealableArbitrator.sol\":\"EnhancedAppealableArbitrator\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"contracts/test-purposes/AppealableArbitrator.sol\":{\"content\":\"/**\\n* https://contributing.kleros.io/smart-contract-workflow\\n* @authors: [@epiqueras, @ferittuncer, @unknownunknown1, @mtsalenc]\\n* @reviewers: []\\n* @auditors: []\\n* @bounties: []\\n* @deployments: []\\n*/\\n\\npragma solidity ^0.5.11;\\n\\nimport \\\"./CentralizedArbitrator.sol\\\";\\n\\n/**\\n * @title AppealableArbitrator\\n * @dev A centralized arbitrator that can be appealed.\\n */\\ncontract AppealableArbitrator is CentralizedArbitrator, IArbitrable {\\n /* Structs */\\n\\n struct AppealDispute {\\n uint rulingTime;\\n IArbitrator arbitrator;\\n uint appealDisputeID;\\n }\\n\\n /* Modifiers */\\n\\n modifier onlyArbitrator {require(msg.sender == address(arbitrator), \\\"Can only be called by the arbitrator.\\\"); _;}\\n modifier requireAppealFee(uint _disputeID, bytes memory _extraData) {\\n require(msg.value >= appealCost(_disputeID, _extraData), \\\"Not enough ETH to cover appeal costs.\\\");\\n _;\\n }\\n\\n /* Storage */\\n\\n uint public timeOut;\\n mapping(uint => AppealDispute) public appealDisputes;\\n mapping(uint => uint) public appealDisputeIDsToDisputeIDs;\\n IArbitrator public arbitrator;\\n bytes public arbitratorExtraData; // Extra data to require particular dispute and appeal behaviour.\\n\\n /* Constructor */\\n\\n /** @dev Constructs the `AppealableArbitrator` contract.\\n * @param _arbitrationPrice The amount to be paid for arbitration.\\n * @param _arbitrator The back up arbitrator.\\n * @param _arbitratorExtraData Not used by this contract.\\n * @param _timeOut The time out for the appeal period.\\n */\\n constructor(\\n uint _arbitrationPrice,\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n uint _timeOut\\n ) public CentralizedArbitrator(_arbitrationPrice) {\\n timeOut = _timeOut;\\n }\\n\\n /* External */\\n\\n /** @dev Changes the back up arbitrator.\\n * @param _arbitrator The new back up arbitrator.\\n */\\n function changeArbitrator(IArbitrator _arbitrator) external onlyOwner {\\n arbitrator = _arbitrator;\\n }\\n\\n /** @dev Changes the time out.\\n * @param _timeOut The new time out.\\n */\\n function changeTimeOut(uint _timeOut) external onlyOwner {\\n timeOut = _timeOut;\\n }\\n\\n /* External Views */\\n\\n /** @dev Gets the specified dispute's latest appeal ID.\\n * @param _disputeID The ID of the dispute.\\n */\\n function getAppealDisputeID(uint _disputeID) external view returns(uint disputeID) {\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0)))\\n disputeID = AppealableArbitrator(address(appealDisputes[_disputeID].arbitrator)).getAppealDisputeID(appealDisputes[_disputeID].appealDisputeID);\\n else disputeID = _disputeID;\\n }\\n\\n /* Public */\\n\\n /** @dev Appeals a ruling.\\n * @param _disputeID The ID of the dispute.\\n * @param _extraData Additional info about the appeal.\\n */\\n function appeal(uint _disputeID, bytes memory _extraData) public payable requireAppealFee(_disputeID, _extraData) {\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0)))\\n appealDisputes[_disputeID].arbitrator.appeal.value(msg.value)(appealDisputes[_disputeID].appealDisputeID, _extraData);\\n else {\\n appealDisputes[_disputeID].arbitrator = arbitrator;\\n appealDisputes[_disputeID].appealDisputeID = arbitrator.createDispute.value(msg.value)(disputes[_disputeID].choices, _extraData);\\n appealDisputeIDsToDisputeIDs[appealDisputes[_disputeID].appealDisputeID] = _disputeID;\\n }\\n }\\n\\n /** @dev Gives a ruling.\\n * @param _disputeID The ID of the dispute.\\n * @param _ruling The ruling.\\n */\\n function giveRuling(uint _disputeID, uint _ruling) public {\\n require(disputes[_disputeID].status != DisputeStatus.Solved, \\\"The specified dispute is already resolved.\\\");\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0))) {\\n require(IArbitrator(msg.sender) == appealDisputes[_disputeID].arbitrator, \\\"Appealed disputes must be ruled by their back up arbitrator.\\\");\\n super._giveRuling(_disputeID, _ruling);\\n } else {\\n require(msg.sender == owner, \\\"Not appealed disputes must be ruled by the owner.\\\");\\n if (disputes[_disputeID].status == DisputeStatus.Appealable) {\\n if (now - appealDisputes[_disputeID].rulingTime > timeOut)\\n super._giveRuling(_disputeID, disputes[_disputeID].ruling);\\n else revert(\\\"Time out time has not passed yet.\\\");\\n } else {\\n disputes[_disputeID].ruling = _ruling;\\n disputes[_disputeID].status = DisputeStatus.Appealable;\\n appealDisputes[_disputeID].rulingTime = now;\\n emit AppealPossible(_disputeID, disputes[_disputeID].arbitrated);\\n }\\n }\\n }\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the IArbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) public onlyArbitrator {\\n emit Ruling(IArbitrator(msg.sender),_disputeID,_ruling);\\n\\n executeRuling(_disputeID,_ruling);\\n }\\n\\n /* Public Views */\\n\\n /** @dev Gets the cost of appeal for the specified dispute.\\n * @param _disputeID The ID of the dispute.\\n * @param _extraData Additional info about the appeal.\\n * @return The cost of the appeal.\\n */\\n function appealCost(uint _disputeID, bytes memory _extraData) public view returns(uint cost) {\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0)))\\n cost = appealDisputes[_disputeID].arbitrator.appealCost(appealDisputes[_disputeID].appealDisputeID, _extraData);\\n else if (disputes[_disputeID].status == DisputeStatus.Appealable) cost = arbitrator.arbitrationCost(_extraData);\\n else cost = NOT_PAYABLE_VALUE;\\n }\\n\\n /** @dev Gets the status of the specified dispute.\\n * @param _disputeID The ID of the dispute.\\n * @return The status.\\n */\\n function disputeStatus(uint _disputeID) public view returns(DisputeStatus status) {\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0)))\\n status = appealDisputes[_disputeID].arbitrator.disputeStatus(appealDisputes[_disputeID].appealDisputeID);\\n else status = disputes[_disputeID].status;\\n }\\n\\n /** @dev Return the ruling of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return ruling The ruling which would or has been given.\\n */\\n function currentRuling(uint _disputeID) public view returns(uint ruling) {\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0))) // Appealed.\\n ruling = appealDisputes[_disputeID].arbitrator.currentRuling(appealDisputes[_disputeID].appealDisputeID); // Retrieve ruling from the arbitrator whom the dispute is appealed to.\\n else ruling = disputes[_disputeID].ruling; // Not appealed, basic case.\\n }\\n\\n /* Internal */\\n\\n /** @dev Executes the ruling of the specified dispute.\\n * @param _disputeID The ID of the dispute.\\n * @param _ruling The ruling.\\n */\\n function executeRuling(uint _disputeID, uint _ruling) internal {\\n require(\\n appealDisputes[appealDisputeIDsToDisputeIDs[_disputeID]].arbitrator != IArbitrator(address(0)),\\n \\\"The dispute must have been appealed.\\\"\\n );\\n giveRuling(appealDisputeIDsToDisputeIDs[_disputeID], _ruling);\\n }\\n}\",\"keccak256\":\"0x9c988275034b701b2cb32ccc0cfeb82aaff0cedda1fcbff6ffc3e68deb44f44f\"},\"contracts/test-purposes/CentralizedArbitrator.sol\":{\"content\":\"/**\\n * @authors: [@clesaege, @n1c01a5, @epiqueras, @ferittuncer, @unknownunknown1, @mtsalenc]\\n * @reviewers: [@clesaege*, @unknownunknown1*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.11;\\n\\nimport { IArbitrator, IArbitrable } from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\n\\n/** @title Centralized Arbitrator\\n * @dev This is a centralized arbitrator deciding alone on the result of disputes. No appeals are possible.\\n */\\ncontract CentralizedArbitrator is IArbitrator {\\n\\n address public owner = msg.sender;\\n uint arbitrationPrice; // Not public because arbitrationCost already acts as an accessor.\\n uint constant NOT_PAYABLE_VALUE = (2**256-2)/2; // High value to be sure that the appeal is too expensive.\\n\\n struct DisputeStruct {\\n IArbitrable arbitrated;\\n uint choices;\\n uint fee;\\n uint ruling;\\n DisputeStatus status;\\n }\\n\\n modifier onlyOwner {require(msg.sender==owner, \\\"Can only be called by the owner.\\\"); _;}\\n modifier requireArbitrationFee(bytes memory _extraData) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"Not enough ETH to cover arbitration costs.\\\");\\n _;\\n }\\n\\n DisputeStruct[] public disputes;\\n\\n /** @dev Constructor. Set the initial arbitration price.\\n * @param _arbitrationPrice Amount to be paid for arbitration.\\n */\\n constructor(uint _arbitrationPrice) public {\\n arbitrationPrice = _arbitrationPrice;\\n }\\n\\n /** @dev Set the arbitration price. Only callable by the owner.\\n * @param _arbitrationPrice Amount to be paid for arbitration.\\n */\\n function setArbitrationPrice(uint _arbitrationPrice) public onlyOwner {\\n arbitrationPrice = _arbitrationPrice;\\n }\\n\\n /** @dev Cost of arbitration. Accessor to arbitrationPrice.\\n * @param _extraData Not used by this contract.\\n * @return fee Amount to be paid.\\n */\\n function arbitrationCost(bytes memory _extraData) public view returns(uint fee) {\\n return arbitrationPrice;\\n }\\n\\n /** @dev Cost of appeal. Since it is not possible, it's a high value which can never be paid.\\n * @param _disputeID ID of the dispute to be appealed. Not used by this contract.\\n * @param _extraData Not used by this contract.\\n * @return fee Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes memory _extraData) public view returns(uint fee) {\\n return NOT_PAYABLE_VALUE;\\n }\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost().\\n * @param _choices Amount of choices the arbitrator can make in this dispute. When ruling ruling<=choices.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes memory _extraData) public payable requireArbitrationFee(_extraData) returns(uint disputeID) {\\n disputeID = disputes.push(DisputeStruct({\\n arbitrated: IArbitrable(msg.sender),\\n choices: _choices,\\n fee: msg.value,\\n ruling: 0,\\n status: DisputeStatus.Waiting\\n })) - 1; // Create the dispute and return its number.\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n /** @dev Give a ruling. UNTRUSTED.\\n * @param _disputeID ID of the dispute to rule.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 means \\\"Not able/wanting to make a decision\\\".\\n */\\n function _giveRuling(uint _disputeID, uint _ruling) internal {\\n DisputeStruct storage dispute = disputes[_disputeID];\\n require(_ruling <= dispute.choices, \\\"Invalid ruling.\\\");\\n require(dispute.status != DisputeStatus.Solved, \\\"The dispute must not be solved already.\\\");\\n\\n dispute.ruling = _ruling;\\n dispute.status = DisputeStatus.Solved;\\n\\n msg.sender.send(dispute.fee); // Avoid blocking.\\n dispute.arbitrated.rule(_disputeID,_ruling);\\n }\\n\\n /** @dev Give a ruling. UNTRUSTED.\\n * @param _disputeID ID of the dispute to rule.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 means \\\"Not able/wanting to make a decision\\\".\\n */\\n function giveRuling(uint _disputeID, uint _ruling) public onlyOwner {\\n return _giveRuling(_disputeID, _ruling);\\n }\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) public view returns(DisputeStatus status) {\\n return disputes[_disputeID].status;\\n }\\n\\n /** @dev Return the ruling of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return ruling The ruling which would or has been given.\\n */\\n function currentRuling(uint _disputeID) public view returns(uint ruling) {\\n return disputes[_disputeID].ruling;\\n }\\n}\",\"keccak256\":\"0xa6650ba99e48a8fa7408d60d42e0139a0c5c0713e199a8bc43b0002209496cf4\"},\"contracts/test-purposes/EnhancedAppealableArbitrator.sol\":{\"content\":\"/**\\n * @authors: [@epiqueras, @unknownunknown1, @mtsalenc]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.11;\\n\\nimport \\\"./AppealableArbitrator.sol\\\";\\n\\n/**\\n * @title EnhancedAppealableArbitrator\\n * @author Enrique Piqueras - \\n * @dev Implementation of `AppealableArbitrator` that supports `appealPeriod`.\\n */\\ncontract EnhancedAppealableArbitrator is AppealableArbitrator {\\n /* Constructor */\\n\\n /* solium-disable no-empty-blocks */\\n /** @dev Constructs the `EnhancedAppealableArbitrator` contract.\\n * @param _arbitrationPrice The amount to be paid for arbitration.\\n * @param _arbitrator The back up arbitrator.\\n * @param _arbitratorExtraData Not used by this contract.\\n * @param _timeOut The time out for the appeal period.\\n */\\n constructor(\\n uint256 _arbitrationPrice,\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n uint256 _timeOut\\n ) public AppealableArbitrator(_arbitrationPrice, _arbitrator, _arbitratorExtraData, _timeOut) {}\\n\\n /* solium-enable no-empty-blocks */\\n\\n /* Public Views */\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible.\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n if (appealDisputes[_disputeID].arbitrator != IArbitrator(address(0)))\\n (start, end) = appealDisputes[_disputeID].arbitrator.appealPeriod(\\n appealDisputes[_disputeID].appealDisputeID\\n );\\n else {\\n start = appealDisputes[_disputeID].rulingTime;\\n require(start != 0, \\\"The specified dispute is not appealable.\\\");\\n end = start + timeOut;\\n }\\n }\\n\\n /** @dev Appeals a ruling.\\n * @param _disputeID The ID of the dispute.\\n * @param _extraData Additional info about the appeal.\\n */\\n function appeal(uint256 _disputeID, bytes memory _extraData)\\n public\\n payable\\n requireAppealFee(_disputeID, _extraData)\\n {\\n emit AppealDecision(_disputeID, IArbitrable(msg.sender));\\n return super.appeal(_disputeID, _extraData);\\n }\\n}\\n\",\"keccak256\":\"0xa07a067d01ae3852d01059bf0a6bfbb885cb522972cf867a1fe3ba6090e18f76\"}},\"version\":1}", + "bytecode": "0x6080604052600080546001600160a01b0319163317905534801561002257600080fd5b50604051611bdd380380611bdd8339818101604052608081101561004557600080fd5b8151602083015160408085018051915193959294830192918464010000000082111561007057600080fd5b90830190602082018581111561008557600080fd5b825164010000000081118282018810171561009f57600080fd5b82525081516020918201929091019080838360005b838110156100cc5781810151838201526020016100b4565b50505050905090810190601f1680156100f95780820380516001836020036101000a031916815260200191505b506040526020015160019590955550505060039190915550611abd806101206000396000f3fe60806040526004361061011e5760003560e01c80636cc6cde1116100a0578063c97c4d5c11610064578063c97c4d5c146105a7578063f23f16e6146105d7578063f7434ea91461068f578063fc548f0814610740578063ffb43c48146107735761011e565b80636cc6cde1146104495780638da5cb5b1461047a57806394e9cb961461048f578063afe15cfb146104b9578063c13517e1146104fc5761011e565b8063311a6c56116100e7578063311a6c561461028b57806337025d21146102bd57806349912f881461030d578063564a565d146103b8578063614d85e1146104345761011e565b8062b58205146101235780630c7ac7b61461015f57806310f169e8146101e957806319810619146102375780631c3db16d14610261575b600080fd5b34801561012f57600080fd5b5061014d6004803603602081101561014657600080fd5b503561079d565b60408051918252519081900360200190f35b34801561016b57600080fd5b506101746107af565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ae578181015183820152602001610196565b50505050905090810190601f1680156101db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f557600080fd5b506102136004803603602081101561020c57600080fd5b503561083d565b6040518082600281111561022357fe5b60ff16815260200191505060405180910390f35b34801561024357600080fd5b5061014d6004803603602081101561025a57600080fd5b5035610919565b34801561026d57600080fd5b5061014d6004803603602081101561028457600080fd5b503561099a565b34801561029757600080fd5b506102bb600480360360408110156102ae57600080fd5b5080359060200135610a3d565b005b3480156102c957600080fd5b506102e7600480360360208110156102e057600080fd5b5035610acb565b604080519384526001600160a01b03909216602084015282820152519081900360600190f35b6102bb6004803603604081101561032357600080fd5b81359190810190604081016020820135600160201b81111561034457600080fd5b82018360208201111561035657600080fd5b803590602001918460018302840111600160201b8311171561037757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610af5945050505050565b3480156103c457600080fd5b506103e2600480360360208110156103db57600080fd5b5035610b7c565b60405180866001600160a01b03166001600160a01b0316815260200185815260200184815260200183815260200182600281111561041c57fe5b60ff1681526020019550505050505060405180910390f35b34801561044057600080fd5b5061014d610bc7565b34801561045557600080fd5b5061045e610bcd565b604080516001600160a01b039092168252519081900360200190f35b34801561048657600080fd5b5061045e610bdc565b34801561049b57600080fd5b506102bb600480360360208110156104b257600080fd5b5035610beb565b3480156104c557600080fd5b506104e3600480360360208110156104dc57600080fd5b5035610c4f565b6040805192835260208301919091528051918290030190f35b61014d6004803603604081101561051257600080fd5b81359190810190604081016020820135600160201b81111561053357600080fd5b82018360208201111561054557600080fd5b803590602001918460018302840111600160201b8311171561056657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d63945050505050565b3480156105b357600080fd5b506102bb600480360360408110156105ca57600080fd5b5080359060200135610eb0565b3480156105e357600080fd5b5061014d600480360360408110156105fa57600080fd5b81359190810190604081016020820135600160201b81111561061b57600080fd5b82018360208201111561062d57600080fd5b803590602001918460018302840111600160201b8311171561064e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611168945050505050565b34801561069b57600080fd5b5061014d600480360360208110156106b257600080fd5b810190602081018135600160201b8111156106cc57600080fd5b8201836020820111156106de57600080fd5b803590602001918460018302840111600160201b831117156106ff57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611376945050505050565b34801561074c57600080fd5b506102bb6004803603602081101561076357600080fd5b50356001600160a01b031661137d565b34801561077f57600080fd5b506102bb6004803603602081101561079657600080fd5b50356113fe565b60056020526000908152604090205481565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b6000818152600460205260408120600101546001600160a01b0316156108ed576000828152600460208181526040928390206001810154600290910154845163021e2d3d60e31b81529384015292516001600160a01b03909316926310f169e8926024808201939291829003018186803b1580156108ba57600080fd5b505afa1580156108ce573d6000803e3d6000fd5b505050506040513d60208110156108e457600080fd5b50519050610914565b600282815481106108fa57fe5b600091825260209091206004600590920201015460ff1690505b919050565b6000818152600460205260408120600101546001600160a01b0316156109965760008281526004602081815260409283902060018101546002909101548451631981061960e01b81529384015292516001600160a01b03909316926319810619926024808201939291829003018186803b1580156108ba57600080fd5b5090565b6000818152600460205260408120600101546001600160a01b031615610a175760008281526004602081815260409283902060018101546002909101548451631c3db16d60e01b81529384015292516001600160a01b0390931692631c3db16d926024808201939291829003018186803b1580156108ba57600080fd5b60028281548110610a2457fe5b9060005260206000209060050201600301549050919050565b6006546001600160a01b03163314610a865760405162461bcd60e51b81526004018080602001828103825260258152602001806119f56025913960400191505060405180910390fd5b604080518281529051839133917f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769181900360200190a3610ac78282611462565b5050565b60046020526000908152604090208054600182015460029092015490916001600160a01b03169083565b8181610b018282611168565b341015610b3f5760405162461bcd60e51b81526004018080602001828103825260258152602001806119756025913960400191505060405180910390fd5b604051339085907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3610b7684846114de565b50505050565b60028181548110610b8957fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909160ff1685565b60035481565b6006546001600160a01b031681565b6000546001600160a01b031681565b6000546001600160a01b03163314610c4a576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792062652063616c6c656420627920746865206f776e65722e604482015290519081900360640190fd5b600355565b60008181526004602052604081206001015481906001600160a01b031615610d0a576000838152600460208190526040918290206001810154600290910154835163afe15cfb60e01b81529283015282516001600160a01b039091169263afe15cfb9260248082019391829003018186803b158015610ccd57600080fd5b505afa158015610ce1573d6000803e3d6000fd5b505050506040513d6040811015610cf757600080fd5b5080516020909101519092509050610d5e565b600083815260046020526040902054915081610d575760405162461bcd60e51b81526004018080602001828103825260288152602001806119266028913960400191505060405180910390fd5b5060035481015b915091565b600081610d6f81611376565b341015610dad5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a1a602a913960400191505060405180910390fd5b600160026040518060a00160405280336001600160a01b031681526020018781526020013481526020016000815260200160006002811115610deb57fe5b9052815460018082018085556000948552602094859020845160059094020180546001600160a01b0319166001600160a01b03909416939093178355938301518282015560408301516002808401919091556060840151600384015560808401516004840180549193909260ff19909216918490811115610e6857fe5b02179055505050039150336001600160a01b0316827f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99560405160405180910390a35092915050565b6002808381548110610ebe57fe5b600091825260209091206004600590920201015460ff166002811115610ee057fe5b1415610f1d5760405162461bcd60e51b815260040180806020018281038252602a81526020018061199a602a913960400191505060405180910390fd5b6000828152600460205260409020600101546001600160a01b031615610fa4576000828152600460205260409020600101546001600160a01b03163314610f955760405162461bcd60e51b815260040180806020018281038252603c8152602001806118ea603c913960400191505060405180910390fd5b610f9f8282611789565b610ac7565b6000546001600160a01b03163314610fed5760405162461bcd60e51b81526004018080602001828103825260318152602001806119c46031913960400191505060405180910390fd5b600160028381548110610ffc57fe5b600091825260209091206004600590920201015460ff16600281111561101e57fe5b14156110a2576003546000838152600460205260409020544203111561106b57611066826002848154811061104f57fe5b906000526020600020906005020160030154611789565b610f9f565b60405162461bcd60e51b8152600401808060200182810382526021815260200180611a446021913960400191505060405180910390fd5b80600283815481106110b057fe5b9060005260206000209060050201600301819055506001600283815481106110d457fe5b60009182526020909120600460059092020101805460ff191660018360028111156110fb57fe5b02179055506000828152600460205260409020429055600280548390811061111f57fe5b600091825260208220600590910201546040516001600160a01b039091169184917fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f9190a35050565b6000828152600460205260408120600101546001600160a01b0316156112855760008381526004602081815260408084206001810154600290910154825163791f8b7360e11b8152948501818152602486019384528851604487015288516001600160a01b039093169663f23f16e69692958a959294929360640192908601918190849084905b838110156112075781810151838201526020016111ef565b50505050905090810190601f1680156112345780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561125257600080fd5b505afa158015611266573d6000803e3d6000fd5b505050506040513d602081101561127c57600080fd5b50519050611370565b60016002848154811061129457fe5b600091825260209091206004600590920201015460ff1660028111156112b657fe5b14156113665760065460405163f7434ea960e01b81526020600482018181528551602484015285516001600160a01b039094169363f7434ea993879383926044909201919085019080838360005b8381101561131c578181015183820152602001611304565b50505050905090810190601f1680156113495780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561125257600080fd5b506001600160ff1b035b92915050565b5060015490565b6000546001600160a01b031633146113dc576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792062652063616c6c656420627920746865206f776e65722e604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461145d576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792062652063616c6c656420627920746865206f776e65722e604482015290519081900360640190fd5b600155565b600082815260056020908152604080832054835260049091529020600101546001600160a01b03166114c55760405162461bcd60e51b8152600401808060200182810382526024815260200180611a656024913960400191505060405180910390fd5b600082815260056020526040902054610ac79082610eb0565b81816114ea8282611168565b3410156115285760405162461bcd60e51b81526004018080602001828103825260258152602001806119756025913960400191505060405180910390fd5b6000848152600460205260409020600101546001600160a01b0316156116365760008481526004602081815260408084206001810154600290910154825163093225f160e31b8152948501818152602486019384528951604487015289516001600160a01b03909316966349912f8896349693958c959394909360649092019290860191908190849084905b838110156115cc5781810151838201526020016115b4565b50505050905090810190601f1680156115f95780820380516001836020036101000a031916815260200191505b5093505050506000604051808303818588803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b5050505050610b76565b60068054600086815260046020526040902060010180546001600160a01b0319166001600160a01b03928316179055905460028054919092169163c13517e1913491908890811061168357fe5b906000526020600020906005020160010154866040518463ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116e85781810151838201526020016116d0565b50505050905090810190601f1680156117155780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561173457600080fd5b505af1158015611748573d6000803e3d6000fd5b50505050506040513d602081101561175f57600080fd5b50516000858152600460209081526040808320600201849055928252600590522084905550505050565b60006002838154811061179857fe5b9060005260206000209060050201905080600101548211156117f3576040805162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b604482015290519081900360640190fd5b6002600482015460ff16600281111561180857fe5b14156118455760405162461bcd60e51b815260040180806020018281038252602781526020018061194e6027913960400191505060405180910390fd5b6003810182905560048101805460ff1916600290811790915581015460405133916108fc811502916000818181858888f1505083546040805163188d362b60e11b8152600481018990526024810188905290516001600160a01b03909216945063311a6c569350604480820193506000929182900301818387803b1580156118cc57600080fd5b505af11580156118e0573d6000803e3d6000fd5b5050505050505056fe41707065616c6564206469737075746573206d7573742062652072756c6564206279207468656972206261636b2075702061726269747261746f722e546865207370656369666965642064697370757465206973206e6f742061707065616c61626c652e5468652064697370757465206d757374206e6f7420626520736f6c76656420616c72656164792e4e6f7420656e6f7567682045544820746f20636f7665722061707065616c20636f7374732e54686520737065636966696564206469737075746520697320616c7265616479207265736f6c7665642e4e6f742061707065616c6564206469737075746573206d7573742062652072756c656420627920746865206f776e65722e43616e206f6e6c792062652063616c6c6564206279207468652061726269747261746f722e4e6f7420656e6f7567682045544820746f20636f766572206172626974726174696f6e20636f7374732e54696d65206f75742074696d6520686173206e6f7420706173736564207965742e5468652064697370757465206d7573742068617665206265656e2061707065616c65642ea265627a7a723158204b9598f977ac51cd4d02e0c4784aaaace2ae6570fd87f66b8cd26501efa7654764736f6c63430005110032", + "deployedBytecode": "0x60806040526004361061011e5760003560e01c80636cc6cde1116100a0578063c97c4d5c11610064578063c97c4d5c146105a7578063f23f16e6146105d7578063f7434ea91461068f578063fc548f0814610740578063ffb43c48146107735761011e565b80636cc6cde1146104495780638da5cb5b1461047a57806394e9cb961461048f578063afe15cfb146104b9578063c13517e1146104fc5761011e565b8063311a6c56116100e7578063311a6c561461028b57806337025d21146102bd57806349912f881461030d578063564a565d146103b8578063614d85e1146104345761011e565b8062b58205146101235780630c7ac7b61461015f57806310f169e8146101e957806319810619146102375780631c3db16d14610261575b600080fd5b34801561012f57600080fd5b5061014d6004803603602081101561014657600080fd5b503561079d565b60408051918252519081900360200190f35b34801561016b57600080fd5b506101746107af565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ae578181015183820152602001610196565b50505050905090810190601f1680156101db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f557600080fd5b506102136004803603602081101561020c57600080fd5b503561083d565b6040518082600281111561022357fe5b60ff16815260200191505060405180910390f35b34801561024357600080fd5b5061014d6004803603602081101561025a57600080fd5b5035610919565b34801561026d57600080fd5b5061014d6004803603602081101561028457600080fd5b503561099a565b34801561029757600080fd5b506102bb600480360360408110156102ae57600080fd5b5080359060200135610a3d565b005b3480156102c957600080fd5b506102e7600480360360208110156102e057600080fd5b5035610acb565b604080519384526001600160a01b03909216602084015282820152519081900360600190f35b6102bb6004803603604081101561032357600080fd5b81359190810190604081016020820135600160201b81111561034457600080fd5b82018360208201111561035657600080fd5b803590602001918460018302840111600160201b8311171561037757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610af5945050505050565b3480156103c457600080fd5b506103e2600480360360208110156103db57600080fd5b5035610b7c565b60405180866001600160a01b03166001600160a01b0316815260200185815260200184815260200183815260200182600281111561041c57fe5b60ff1681526020019550505050505060405180910390f35b34801561044057600080fd5b5061014d610bc7565b34801561045557600080fd5b5061045e610bcd565b604080516001600160a01b039092168252519081900360200190f35b34801561048657600080fd5b5061045e610bdc565b34801561049b57600080fd5b506102bb600480360360208110156104b257600080fd5b5035610beb565b3480156104c557600080fd5b506104e3600480360360208110156104dc57600080fd5b5035610c4f565b6040805192835260208301919091528051918290030190f35b61014d6004803603604081101561051257600080fd5b81359190810190604081016020820135600160201b81111561053357600080fd5b82018360208201111561054557600080fd5b803590602001918460018302840111600160201b8311171561056657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d63945050505050565b3480156105b357600080fd5b506102bb600480360360408110156105ca57600080fd5b5080359060200135610eb0565b3480156105e357600080fd5b5061014d600480360360408110156105fa57600080fd5b81359190810190604081016020820135600160201b81111561061b57600080fd5b82018360208201111561062d57600080fd5b803590602001918460018302840111600160201b8311171561064e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611168945050505050565b34801561069b57600080fd5b5061014d600480360360208110156106b257600080fd5b810190602081018135600160201b8111156106cc57600080fd5b8201836020820111156106de57600080fd5b803590602001918460018302840111600160201b831117156106ff57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611376945050505050565b34801561074c57600080fd5b506102bb6004803603602081101561076357600080fd5b50356001600160a01b031661137d565b34801561077f57600080fd5b506102bb6004803603602081101561079657600080fd5b50356113fe565b60056020526000908152604090205481565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b6000818152600460205260408120600101546001600160a01b0316156108ed576000828152600460208181526040928390206001810154600290910154845163021e2d3d60e31b81529384015292516001600160a01b03909316926310f169e8926024808201939291829003018186803b1580156108ba57600080fd5b505afa1580156108ce573d6000803e3d6000fd5b505050506040513d60208110156108e457600080fd5b50519050610914565b600282815481106108fa57fe5b600091825260209091206004600590920201015460ff1690505b919050565b6000818152600460205260408120600101546001600160a01b0316156109965760008281526004602081815260409283902060018101546002909101548451631981061960e01b81529384015292516001600160a01b03909316926319810619926024808201939291829003018186803b1580156108ba57600080fd5b5090565b6000818152600460205260408120600101546001600160a01b031615610a175760008281526004602081815260409283902060018101546002909101548451631c3db16d60e01b81529384015292516001600160a01b0390931692631c3db16d926024808201939291829003018186803b1580156108ba57600080fd5b60028281548110610a2457fe5b9060005260206000209060050201600301549050919050565b6006546001600160a01b03163314610a865760405162461bcd60e51b81526004018080602001828103825260258152602001806119f56025913960400191505060405180910390fd5b604080518281529051839133917f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769181900360200190a3610ac78282611462565b5050565b60046020526000908152604090208054600182015460029092015490916001600160a01b03169083565b8181610b018282611168565b341015610b3f5760405162461bcd60e51b81526004018080602001828103825260258152602001806119756025913960400191505060405180910390fd5b604051339085907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3610b7684846114de565b50505050565b60028181548110610b8957fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909160ff1685565b60035481565b6006546001600160a01b031681565b6000546001600160a01b031681565b6000546001600160a01b03163314610c4a576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792062652063616c6c656420627920746865206f776e65722e604482015290519081900360640190fd5b600355565b60008181526004602052604081206001015481906001600160a01b031615610d0a576000838152600460208190526040918290206001810154600290910154835163afe15cfb60e01b81529283015282516001600160a01b039091169263afe15cfb9260248082019391829003018186803b158015610ccd57600080fd5b505afa158015610ce1573d6000803e3d6000fd5b505050506040513d6040811015610cf757600080fd5b5080516020909101519092509050610d5e565b600083815260046020526040902054915081610d575760405162461bcd60e51b81526004018080602001828103825260288152602001806119266028913960400191505060405180910390fd5b5060035481015b915091565b600081610d6f81611376565b341015610dad5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a1a602a913960400191505060405180910390fd5b600160026040518060a00160405280336001600160a01b031681526020018781526020013481526020016000815260200160006002811115610deb57fe5b9052815460018082018085556000948552602094859020845160059094020180546001600160a01b0319166001600160a01b03909416939093178355938301518282015560408301516002808401919091556060840151600384015560808401516004840180549193909260ff19909216918490811115610e6857fe5b02179055505050039150336001600160a01b0316827f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99560405160405180910390a35092915050565b6002808381548110610ebe57fe5b600091825260209091206004600590920201015460ff166002811115610ee057fe5b1415610f1d5760405162461bcd60e51b815260040180806020018281038252602a81526020018061199a602a913960400191505060405180910390fd5b6000828152600460205260409020600101546001600160a01b031615610fa4576000828152600460205260409020600101546001600160a01b03163314610f955760405162461bcd60e51b815260040180806020018281038252603c8152602001806118ea603c913960400191505060405180910390fd5b610f9f8282611789565b610ac7565b6000546001600160a01b03163314610fed5760405162461bcd60e51b81526004018080602001828103825260318152602001806119c46031913960400191505060405180910390fd5b600160028381548110610ffc57fe5b600091825260209091206004600590920201015460ff16600281111561101e57fe5b14156110a2576003546000838152600460205260409020544203111561106b57611066826002848154811061104f57fe5b906000526020600020906005020160030154611789565b610f9f565b60405162461bcd60e51b8152600401808060200182810382526021815260200180611a446021913960400191505060405180910390fd5b80600283815481106110b057fe5b9060005260206000209060050201600301819055506001600283815481106110d457fe5b60009182526020909120600460059092020101805460ff191660018360028111156110fb57fe5b02179055506000828152600460205260409020429055600280548390811061111f57fe5b600091825260208220600590910201546040516001600160a01b039091169184917fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f9190a35050565b6000828152600460205260408120600101546001600160a01b0316156112855760008381526004602081815260408084206001810154600290910154825163791f8b7360e11b8152948501818152602486019384528851604487015288516001600160a01b039093169663f23f16e69692958a959294929360640192908601918190849084905b838110156112075781810151838201526020016111ef565b50505050905090810190601f1680156112345780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561125257600080fd5b505afa158015611266573d6000803e3d6000fd5b505050506040513d602081101561127c57600080fd5b50519050611370565b60016002848154811061129457fe5b600091825260209091206004600590920201015460ff1660028111156112b657fe5b14156113665760065460405163f7434ea960e01b81526020600482018181528551602484015285516001600160a01b039094169363f7434ea993879383926044909201919085019080838360005b8381101561131c578181015183820152602001611304565b50505050905090810190601f1680156113495780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561125257600080fd5b506001600160ff1b035b92915050565b5060015490565b6000546001600160a01b031633146113dc576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792062652063616c6c656420627920746865206f776e65722e604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461145d576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c792062652063616c6c656420627920746865206f776e65722e604482015290519081900360640190fd5b600155565b600082815260056020908152604080832054835260049091529020600101546001600160a01b03166114c55760405162461bcd60e51b8152600401808060200182810382526024815260200180611a656024913960400191505060405180910390fd5b600082815260056020526040902054610ac79082610eb0565b81816114ea8282611168565b3410156115285760405162461bcd60e51b81526004018080602001828103825260258152602001806119756025913960400191505060405180910390fd5b6000848152600460205260409020600101546001600160a01b0316156116365760008481526004602081815260408084206001810154600290910154825163093225f160e31b8152948501818152602486019384528951604487015289516001600160a01b03909316966349912f8896349693958c959394909360649092019290860191908190849084905b838110156115cc5781810151838201526020016115b4565b50505050905090810190601f1680156115f95780820380516001836020036101000a031916815260200191505b5093505050506000604051808303818588803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b5050505050610b76565b60068054600086815260046020526040902060010180546001600160a01b0319166001600160a01b03928316179055905460028054919092169163c13517e1913491908890811061168357fe5b906000526020600020906005020160010154866040518463ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116e85781810151838201526020016116d0565b50505050905090810190601f1680156117155780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b15801561173457600080fd5b505af1158015611748573d6000803e3d6000fd5b50505050506040513d602081101561175f57600080fd5b50516000858152600460209081526040808320600201849055928252600590522084905550505050565b60006002838154811061179857fe5b9060005260206000209060050201905080600101548211156117f3576040805162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b604482015290519081900360640190fd5b6002600482015460ff16600281111561180857fe5b14156118455760405162461bcd60e51b815260040180806020018281038252602781526020018061194e6027913960400191505060405180910390fd5b6003810182905560048101805460ff1916600290811790915581015460405133916108fc811502916000818181858888f1505083546040805163188d362b60e11b8152600481018990526024810188905290516001600160a01b03909216945063311a6c569350604480820193506000929182900301818387803b1580156118cc57600080fd5b505af11580156118e0573d6000803e3d6000fd5b5050505050505056fe41707065616c6564206469737075746573206d7573742062652072756c6564206279207468656972206261636b2075702061726269747261746f722e546865207370656369666965642064697370757465206973206e6f742061707065616c61626c652e5468652064697370757465206d757374206e6f7420626520736f6c76656420616c72656164792e4e6f7420656e6f7567682045544820746f20636f7665722061707065616c20636f7374732e54686520737065636966696564206469737075746520697320616c7265616479207265736f6c7665642e4e6f742061707065616c6564206469737075746573206d7573742062652072756c656420627920746865206f776e65722e43616e206f6e6c792062652063616c6c6564206279207468652061726269747261746f722e4e6f7420656e6f7567682045544820746f20636f766572206172626974726174696f6e20636f7374732e54696d65206f75742074696d6520686173206e6f7420706173736564207965742e5468652064697370757465206d7573742068617665206265656e2061707065616c65642ea265627a7a723158204b9598f977ac51cd4d02e0c4784aaaace2ae6570fd87f66b8cd26501efa7654764736f6c63430005110032", + "devdoc": { + "author": "Enrique Piqueras - ", + "details": "Implementation of `AppealableArbitrator` that supports `appealPeriod`.", + "methods": { + "appeal(uint256,bytes)": { + "details": "Appeals a ruling.", + "params": { + "_disputeID": "The ID of the dispute.", + "_extraData": "Additional info about the appeal." + } + }, + "appealCost(uint256,bytes)": { + "details": "Gets the cost of appeal for the specified dispute.", + "params": { + "_disputeID": "The ID of the dispute.", + "_extraData": "Additional info about the appeal." + }, + "return": "The cost of the appeal." + }, + "appealPeriod(uint256)": { + "details": "Compute the start and end of the dispute's current or next appeal period, if possible.", + "params": { + "_disputeID": "ID of the dispute." + }, + "return": "The start and end of the period." + }, + "arbitrationCost(bytes)": { + "details": "Cost of arbitration. Accessor to arbitrationPrice.", + "params": { + "_extraData": "Not used by this contract." + }, + "return": "fee Amount to be paid." + }, + "changeArbitrator(address)": { + "details": "Changes the back up arbitrator.", + "params": { + "_arbitrator": "The new back up arbitrator." + } + }, + "changeTimeOut(uint256)": { + "details": "Changes the time out.", + "params": { + "_timeOut": "The new time out." + } + }, + "constructor": { + "details": "Constructs the `EnhancedAppealableArbitrator` contract.", + "params": { + "_arbitrationPrice": "The amount to be paid for arbitration.", + "_arbitrator": "The back up arbitrator.", + "_arbitratorExtraData": "Not used by this contract.", + "_timeOut": "The time out for the appeal period." + } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute. Must be called by the arbitrable contract. Must be paid at least arbitrationCost().", + "params": { + "_choices": "Amount of choices the arbitrator can make in this dispute. When ruling ruling<=choices.", + "_extraData": "Can be used to give additional info on the dispute to be created." + }, + "return": "disputeID ID of the dispute created." + }, + "currentRuling(uint256)": { + "details": "Return the ruling of a dispute.", + "params": { + "_disputeID": "ID of the dispute to rule." + }, + "return": "ruling The ruling which would or has been given." + }, + "disputeStatus(uint256)": { + "details": "Gets the status of the specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "return": "The status." + }, + "getAppealDisputeID(uint256)": { + "details": "Gets the specified dispute's latest appeal ID.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "giveRuling(uint256,uint256)": { + "details": "Gives a ruling.", + "params": { + "_disputeID": "The ID of the dispute.", + "_ruling": "The ruling." + } + }, + "rule(uint256,uint256)": { + "details": "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.", + "params": { + "_disputeID": "ID of the dispute in the IArbitrator contract.", + "_ruling": "Ruling given by the arbitrator. Note that 0 is reserved for \"Not able/wanting to make a decision\"." + } + }, + "setArbitrationPrice(uint256)": { + "details": "Set the arbitration price. Only callable by the owner.", + "params": { + "_arbitrationPrice": "Amount to be paid for arbitration." + } + } + }, + "title": "EnhancedAppealableArbitrator" + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [ + { + "astId": 6210, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6212, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "arbitrationPrice", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 6264, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(DisputeStruct)6233_storage)dyn_storage" + }, + { + "astId": 5719, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "timeOut", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 5723, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "appealDisputes", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_struct(AppealDispute)5684_storage)" + }, + { + "astId": 5727, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "appealDisputeIDsToDisputeIDs", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 5729, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "arbitrator", + "offset": 0, + "slot": "6", + "type": "t_contract(IArbitrator)99" + }, + { + "astId": 5731, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "7", + "type": "t_bytes_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)6233_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)6233_storage", + "encoding": "dynamic_array", + "label": "struct CentralizedArbitrator.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitrable)18": { + "encoding": "inplace", + "label": "contract IArbitrable", + "numberOfBytes": "20" + }, + "t_contract(IArbitrator)99": { + "encoding": "inplace", + "label": "contract IArbitrator", + "numberOfBytes": "20" + }, + "t_enum(DisputeStatus)25": { + "encoding": "inplace", + "label": "enum IArbitrator.DisputeStatus", + "numberOfBytes": "1" + }, + "t_mapping(t_uint256,t_struct(AppealDispute)5684_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct AppealableArbitrator.AppealDispute)", + "numberOfBytes": "32", + "value": "t_struct(AppealDispute)5684_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(AppealDispute)5684_storage": { + "encoding": "inplace", + "label": "struct AppealableArbitrator.AppealDispute", + "members": [ + { + "astId": 5679, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "rulingTime", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 5681, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "arbitrator", + "offset": 0, + "slot": "1", + "type": "t_contract(IArbitrator)99" + }, + { + "astId": 5683, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "appealDisputeID", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_struct(DisputeStruct)6233_storage": { + "encoding": "inplace", + "label": "struct CentralizedArbitrator.DisputeStruct", + "members": [ + { + "astId": 6224, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "arbitrated", + "offset": 0, + "slot": "0", + "type": "t_contract(IArbitrable)18" + }, + { + "astId": 6226, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "choices", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 6228, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "fee", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 6230, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "ruling", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 6232, + "contract": "contracts/test-purposes/EnhancedAppealableArbitrator.sol:EnhancedAppealableArbitrator", + "label": "status", + "offset": 0, + "slot": "4", + "type": "t_enum(DisputeStatus)25" + } + ], + "numberOfBytes": "160" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/deployments/sepolia/GTCRFactory.json b/deployments/sepolia/GTCRFactory.json new file mode 100644 index 0000000..de2fd89 --- /dev/null +++ b/deployments/sepolia/GTCRFactory.json @@ -0,0 +1,199 @@ +{ + "address": "0xcB4B48d2A7a44247A00048963F169d2b4Ab045a6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract GeneralizedTCR", + "name": "_address", + "type": "address" + } + ], + "name": "NewGTCR", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "count", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_connectedTCR", + "type": "address" + }, + { + "internalType": "string", + "name": "_registrationMetaEvidence", + "type": "string" + }, + { + "internalType": "string", + "name": "_clearingMetaEvidence", + "type": "string" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_submissionBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_removalBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_submissionChallengeBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_removalChallengeBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_challengePeriodDuration", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "_stakeMultipliers", + "type": "uint256[3]" + } + ], + "name": "deploy", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "instances", + "outputs": [ + { + "internalType": "contract GeneralizedTCR", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x7af3cb0a0e25caabd63ec9b2857205c9a9ee804231087dc679eb49bca4218cc0", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0xcB4B48d2A7a44247A00048963F169d2b4Ab045a6", + "transactionIndex": 31, + "gasUsed": "4160340", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd26074df49b12ddc0bf8b18fda1edf0301345f9671068ccb7f2782aded536bbc", + "transactionHash": "0x7af3cb0a0e25caabd63ec9b2857205c9a9ee804231087dc679eb49bca4218cc0", + "logs": [], + "blockNumber": 4048282, + "cumulativeGasUsed": "13648107", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract GeneralizedTCR\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"NewGTCR\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_connectedTCR\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_registrationMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_clearingMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_submissionBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_removalBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_submissionChallengeBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_removalChallengeBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_challengePeriodDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"_stakeMultipliers\",\"type\":\"uint256[3]\"}],\"name\":\"deploy\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"instances\",\"outputs\":[{\"internalType\":\"contract GeneralizedTCR\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"count()\":{\"return\":\"The number of deployed tcrs using this factory.\"},\"deploy(address,bytes,address,string,string,address,uint256,uint256,uint256,uint256,uint256,uint256[3])\":{\"details\":\"Deploy the arbitrable curated registry.\",\"params\":{\"_arbitrator\":\"Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\",\"_arbitratorExtraData\":\"Extra data for the trusted arbitrator contract.\",\"_challengePeriodDuration\":\"The time in seconds parties have to challenge a request.\",\"_clearingMetaEvidence\":\"The URI of the meta evidence object for clearing requests.\",\"_connectedTCR\":\"The address of the TCR that stores related TCR addresses. This parameter can be left empty.\",\"_governor\":\"The trusted governor of this contract.\",\"_registrationMetaEvidence\":\"The URI of the meta evidence object for registration requests.\",\"_removalBaseDeposit\":\"The base deposit to remove an item.\",\"_removalChallengeBaseDeposit\":\"The base deposit to challenge a removal request.\",\"_stakeMultipliers\":\"Multipliers of the arbitration cost in basis points (see GeneralizedTCR MULTIPLIER_DIVISOR) as follows: - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when it's the first round or the arbitrator refused to arbitrate). - The multiplier applied to the winner's fee stake for an appeal round. - The multiplier applied to the loser's fee stake for an appeal round.\",\"_submissionBaseDeposit\":\"The base deposit to submit an item.\",\"_submissionChallengeBaseDeposit\":\"The base deposit to challenge a submission.\"}}},\"title\":\"GTCRFactory This contract acts as a registry for GeneralizedTCR instances.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/GTCRFactory.sol\":\"GTCRFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/GTCRFactory.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc]\\n * @reviewers: [@clesaege, @unknownunknown1, @ferittuncer, @satello, @MerlinEgalite]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport { GeneralizedTCR, IArbitrator } from \\\"./GeneralizedTCR.sol\\\";\\n\\n/* solium-disable max-len */\\n\\n/**\\n * @title GTCRFactory\\n * This contract acts as a registry for GeneralizedTCR instances.\\n */\\ncontract GTCRFactory {\\n\\n /**\\n * @dev Emitted when a new Generalized TCR contract is deployed using this factory.\\n * @param _address The address of the newly deployed Generalized TCR.\\n */\\n event NewGTCR(GeneralizedTCR indexed _address);\\n\\n GeneralizedTCR[] public instances;\\n\\n /**\\n * @dev Deploy the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _submissionBaseDeposit The base deposit to submit an item.\\n * @param _removalBaseDeposit The base deposit to remove an item.\\n * @param _submissionChallengeBaseDeposit The base deposit to challenge a submission.\\n * @param _removalChallengeBaseDeposit The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see GeneralizedTCR MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when it's the first round or the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for an appeal round.\\n * - The multiplier applied to the loser's fee stake for an appeal round.\\n */\\n function deploy(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n address _connectedTCR,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence,\\n address _governor,\\n uint _submissionBaseDeposit,\\n uint _removalBaseDeposit,\\n uint _submissionChallengeBaseDeposit,\\n uint _removalChallengeBaseDeposit,\\n uint _challengePeriodDuration,\\n uint[3] memory _stakeMultipliers\\n ) public {\\n GeneralizedTCR instance = new GeneralizedTCR(\\n _arbitrator,\\n _arbitratorExtraData,\\n _connectedTCR,\\n _registrationMetaEvidence,\\n _clearingMetaEvidence,\\n _governor,\\n _submissionBaseDeposit,\\n _removalBaseDeposit,\\n _submissionChallengeBaseDeposit,\\n _removalChallengeBaseDeposit,\\n _challengePeriodDuration,\\n _stakeMultipliers\\n );\\n instances.push(instance);\\n emit NewGTCR(instance);\\n }\\n\\n /**\\n * @return The number of deployed tcrs using this factory.\\n */\\n function count() external view returns (uint) {\\n return instances.length;\\n }\\n}\\n\",\"keccak256\":\"0xfdb4f1627a29ad1d0d4ba6775c2dbf4de1b9a4b851eb3fd3f82932776c07e4a2\"},\"contracts/GeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1, @mtsalenc]\\n * @reviewers: [@clesaege*, @ferittuncer, @satello*, @remedcu, @fnanni-0, @shalzz, @MerlinEgalite]\\n * @auditors: []\\n * @bounties: [{ link: https://github.com/kleros/tcr/issues/20, maxPayout: 25 ETH }]\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport { IArbitrable, IArbitrator } from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport { IEvidence } from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport { CappedMath } from \\\"./utils/CappedMath.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */ // It is the user responsibility to accept ETH.\\n\\n/**\\n * @title GeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n */\\ncontract GeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n bytes data; // The data describing the item.\\n Status status; // The current status of the item.\\n Request[] requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n bool disputed; // True if a dispute was raised.\\n uint disputeID; // ID of the dispute, if any.\\n uint submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n bool resolved; // True if the request was executed and/or any raised disputes were resolved.\\n address payable[3] parties; // Address of requester and challenger, if any, in the form parties[party].\\n Round[] rounds; // Tracks each round of a dispute in the form rounds[roundID].\\n Party ruling; // The final ruling given, if any.\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n uint metaEvidenceID; // The meta evidence to be used in a dispute for this case.\\n }\\n\\n struct Round {\\n uint[3] amountPaid; // Tracks the sum paid for each Party in this round. Includes arbitration fees, fee stakes and deposits.\\n bool[3] hasPaid; // True if the Party has fully paid its fee in this round.\\n uint feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n mapping(address => uint[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n /* Storage */\\n\\n IArbitrator public arbitrator; // The arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data for the arbitrator contract.\\n\\n uint RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n\\n address public governor; // The address that can make changes to the parameters of the contract.\\n uint public submissionBaseDeposit; // The base deposit to submit an item.\\n uint public removalBaseDeposit; // The base deposit to remove an item.\\n uint public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n uint public metaEvidenceUpdates; // The number of times the meta evidence has been updated. Used to track the latest meta evidence ID.\\n\\n // Multipliers are in basis points.\\n uint public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n bytes32[] public itemList; // List of IDs of all submitted items.\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint => bytes32)) public arbitratorDisputeIDToItem; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItem[arbitrator][disputeID].\\n mapping(bytes32 => uint) public itemIDtoIndex; // Maps an item's ID to its position in the list in the form itemIDtoIndex[itemID].\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor {require(msg.sender == governor, \\\"The caller must be the governor.\\\"); _;}\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the request.\\n * @param _roundIndex The index of the round.\\n * @param _disputed Whether the request is disputed.\\n * @param _resolved Whether the request is executed.\\n */\\n event ItemStatusChange(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n uint indexed _roundIndex,\\n bool _disputed,\\n bool _resolved\\n );\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _submitter The address of the requester.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _data The item data.\\n */\\n event ItemSubmitted(\\n bytes32 indexed _itemID,\\n address indexed _submitter,\\n uint indexed _evidenceGroupID,\\n bytes _data\\n );\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the latest request.\\n * @param _requestType Whether it is a registration or a removal request.\\n */\\n event RequestSubmitted(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n Status indexed _requestType\\n );\\n\\n /**\\n * @dev Emitted when someone submits a request. This is useful to quickly find an item and request from an evidence event and vice-versa.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the latest request.\\n * @param _evidenceGroupID The evidence group ID used for this request.\\n */\\n event RequestEvidenceGroupID(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n uint indexed _evidenceGroupID\\n );\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal.\\n * @param _itemID The ID of the item.\\n * @param _contributor The address making the contribution.\\n * @param _request The index of the request.\\n * @param _round The index of the round receiving the contribution.\\n * @param _amount The amount of the contribution.\\n * @param _side The party receiving the contribution.\\n */\\n event AppealContribution(\\n bytes32 indexed _itemID,\\n address indexed _contributor,\\n uint indexed _request,\\n uint _round,\\n uint _amount,\\n Party _side\\n );\\n\\n /** @dev Emitted when one of the parties successfully paid its appeal fees.\\n * @param _itemID The ID of the item.\\n * @param _request The index of the request.\\n * @param _round The index of the round.\\n * @param _side The side that is fully funded.\\n */\\n event HasPaidAppealFee(\\n bytes32 indexed _itemID,\\n uint indexed _request,\\n uint indexed _round,\\n Party _side\\n );\\n\\n /** @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Deploy the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _submissionBaseDeposit The base deposit to submit an item.\\n * @param _removalBaseDeposit The base deposit to remove an item.\\n * @param _submissionChallengeBaseDeposit The base deposit to challenge a submission.\\n * @param _removalChallengeBaseDeposit The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n */\\n constructor(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n address _connectedTCR,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence,\\n address _governor,\\n uint _submissionBaseDeposit,\\n uint _removalBaseDeposit,\\n uint _submissionChallengeBaseDeposit,\\n uint _removalChallengeBaseDeposit,\\n uint _challengePeriodDuration,\\n uint[3] memory _stakeMultipliers\\n ) public {\\n emit MetaEvidence(0, _registrationMetaEvidence);\\n emit MetaEvidence(1, _clearingMetaEvidence);\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n governor = _governor;\\n submissionBaseDeposit = _submissionBaseDeposit;\\n removalBaseDeposit = _removalBaseDeposit;\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /** @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The data describing the item.\\n */\\n function addItem(bytes calldata _item) external payable {\\n bytes32 itemID = keccak256(_item);\\n require(items[itemID].status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n requestStatusChange(_item, submissionBaseDeposit);\\n }\\n\\n /** @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n require(items[_itemID].status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n Item storage item = items[_itemID];\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n // Using `length` instead of `length - 1` because a new request will be added on requestStatusChange().\\n uint requestIndex = item.requests.length;\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, requestIndex)));\\n\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n requestStatusChange(item.data, removalBaseDeposit);\\n }\\n\\n /** @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n require(\\n item.status == Status.RegistrationRequested || item.status == Status.ClearingRequested,\\n \\\"The item must have a pending request.\\\"\\n );\\n\\n Request storage request = item.requests[item.requests.length - 1];\\n require(now - request.submissionTime <= challengePeriodDuration, \\\"Challenges must occur during the challenge period.\\\");\\n require(!request.disputed, \\\"The request should not have already been disputed.\\\");\\n\\n request.parties[uint(Party.Challenger)] = msg.sender;\\n\\n Round storage round = request.rounds[0];\\n uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);\\n uint challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n uint totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n contribute(round, Party.Challenger, msg.sender, msg.value, totalCost);\\n require(round.amountPaid[uint(Party.Challenger)] >= totalCost, \\\"You must fully fund your side.\\\");\\n round.hasPaid[uint(Party.Challenger)] = true;\\n\\n // Raise a dispute.\\n request.disputeID = request.arbitrator.createDispute.value(arbitrationCost)(RULING_OPTIONS, request.arbitratorExtraData);\\n arbitratorDisputeIDToItem[address(request.arbitrator)][request.disputeID] = _itemID;\\n request.disputed = true;\\n request.rounds.length++;\\n round.feeRewards = round.feeRewards.subCap(arbitrationCost);\\n\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, item.requests.length - 1)));\\n emit Dispute(\\n request.arbitrator,\\n request.disputeID,\\n request.metaEvidenceID,\\n evidenceGroupID\\n );\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(request.arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n }\\n\\n /** @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side == Party.Requester || _side == Party.Challenger, \\\"Invalid side.\\\");\\n require(\\n items[_itemID].status == Status.RegistrationRequested || items[_itemID].status == Status.ClearingRequested,\\n \\\"The item must have a pending request.\\\"\\n );\\n Request storage request = items[_itemID].requests[items[_itemID].requests.length - 1];\\n require(request.disputed, \\\"A dispute must have been raised to fund an appeal.\\\");\\n (uint appealPeriodStart, uint appealPeriodEnd) = request.arbitrator.appealPeriod(request.disputeID);\\n require(\\n now >= appealPeriodStart && now < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n /* solium-disable indentation */\\n uint multiplier;\\n {\\n Party winner = Party(request.arbitrator.currentRuling(request.disputeID));\\n Party loser;\\n if (winner == Party.Requester)\\n loser = Party.Challenger;\\n else if (winner == Party.Challenger)\\n loser = Party.Requester;\\n require(_side != loser || (now-appealPeriodStart < (appealPeriodEnd-appealPeriodStart)/2), \\\"The loser must contribute during the first half of the appeal period.\\\");\\n\\n\\n if (_side == winner)\\n multiplier = winnerStakeMultiplier;\\n else if (_side == loser)\\n multiplier = loserStakeMultiplier;\\n else\\n multiplier = sharedStakeMultiplier;\\n }\\n /* solium-enable indentation */\\n\\n Round storage round = request.rounds[request.rounds.length - 1];\\n uint appealCost = request.arbitrator.appealCost(request.disputeID, request.arbitratorExtraData);\\n uint totalCost = appealCost.addCap((appealCost.mulCap(multiplier)) / MULTIPLIER_DIVISOR);\\n uint contribution = contribute(round, _side, msg.sender, msg.value, totalCost);\\n\\n emit AppealContribution(\\n _itemID,\\n msg.sender,\\n items[_itemID].requests.length - 1,\\n request.rounds.length - 1,\\n contribution,\\n _side\\n );\\n\\n if (round.amountPaid[uint(_side)] >= totalCost) {\\n round.hasPaid[uint(_side)] = true;\\n emit HasPaidAppealFee(_itemID, items[_itemID].requests.length - 1, request.rounds.length - 1, _side);\\n }\\n\\n // Raise appeal if both sides are fully funded.\\n if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) {\\n request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData);\\n request.rounds.length++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n\\n /** @dev Reimburses contributions if no disputes were raised. If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw from.\\n * @param _round The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(address payable _beneficiary, bytes32 _itemID, uint _request, uint _round) public {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n require(request.resolved, \\\"Request must be resolved.\\\");\\n\\n uint reward;\\n if (!round.hasPaid[uint(Party.Requester)] || !round.hasPaid[uint(Party.Challenger)]) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward = round.contributions[_beneficiary][uint(Party.Requester)] + round.contributions[_beneficiary][uint(Party.Challenger)];\\n } else if (request.ruling == Party.None) {\\n // Reimburse unspent fees proportionally if there is no winner or loser.\\n uint rewardRequester = round.amountPaid[uint(Party.Requester)] > 0\\n ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.amountPaid[uint(Party.Challenger)] + round.amountPaid[uint(Party.Requester)])\\n : 0;\\n uint rewardChallenger = round.amountPaid[uint(Party.Challenger)] > 0\\n ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.amountPaid[uint(Party.Challenger)] + round.amountPaid[uint(Party.Requester)])\\n : 0;\\n\\n reward = rewardRequester + rewardChallenger;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint(request.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.amountPaid[uint(request.ruling)]\\n : 0;\\n\\n }\\n round.contributions[_beneficiary][uint(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint(Party.Challenger)] = 0;\\n\\n _beneficiary.send(reward);\\n }\\n\\n /** @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n require(\\n now - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n require(!request.disputed, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Registered;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Absent;\\n else\\n revert(\\\"There must be a request.\\\");\\n\\n request.resolved = true;\\n emit ItemStatusChange(_itemID, item.requests.length - 1, request.rounds.length - 1, false, true);\\n\\n withdrawFeesAndRewards(request.parties[uint(Party.Requester)], _itemID, item.requests.length - 1, 0); // Automatically withdraw for the requester.\\n }\\n\\n /** @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) public {\\n Party resultRuling = Party(_ruling);\\n bytes32 itemID = arbitratorDisputeIDToItem[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n\\n Request storage request = item.requests[item.requests.length - 1];\\n Round storage round = request.rounds[request.rounds.length - 1];\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n require(address(request.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n require(!request.resolved, \\\"The request must not be resolved.\\\");\\n\\n // The ruling is inverted if the loser paid its fees.\\n 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.\\n resultRuling = Party.Requester;\\n else if (round.hasPaid[uint(Party.Challenger)] == true)\\n resultRuling = Party.Challenger;\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, uint(resultRuling));\\n executeRuling(_disputeID, uint(resultRuling));\\n }\\n\\n /** @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n require(!request.resolved, \\\"The dispute must not already be resolved.\\\");\\n\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, item.requests.length - 1)));\\n emit Evidence(request.arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeTimeToChallenge(uint _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /** @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /** @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /** @dev Change the arbitrator to be used for disputes that may be raised. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitrator The new trusted arbitrator to be used in disputes.\\n * @param _arbitratorExtraData The extra data used by the new arbitrator.\\n */\\n function changeArbitrator(IArbitrator _arbitrator, bytes calldata _arbitratorExtraData) external onlyGovernor {\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n /** @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /** @dev Update the meta evidence used for disputes.\\n * @param _registrationMetaEvidence The meta evidence to be used for future registration request disputes.\\n * @param _clearingMetaEvidence The meta evidence to be used for future clearing request disputes.\\n */\\n function changeMetaEvidence(string calldata _registrationMetaEvidence, string calldata _clearingMetaEvidence) external onlyGovernor {\\n metaEvidenceUpdates++;\\n emit MetaEvidence(2 * metaEvidenceUpdates, _registrationMetaEvidence);\\n emit MetaEvidence(2 * metaEvidenceUpdates + 1, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /** @dev Submit a request to change item's status. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The data describing the item.\\n * @param _baseDeposit The base deposit for the request.\\n */\\n function requestStatusChange(bytes memory _item, uint _baseDeposit) internal {\\n bytes32 itemID = keccak256(_item);\\n Item storage item = items[itemID];\\n\\n // Using `length` instead of `length - 1` as index because a new request will be added.\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(itemID, item.requests.length)));\\n if (item.requests.length == 0) {\\n item.data = _item;\\n itemList.push(itemID);\\n itemIDtoIndex[itemID] = itemList.length - 1;\\n\\n emit ItemSubmitted(itemID, msg.sender, evidenceGroupID, item.data);\\n }\\n\\n Request storage request = item.requests[item.requests.length++];\\n if (item.status == Status.Absent) {\\n item.status = Status.RegistrationRequested;\\n request.metaEvidenceID = 2 * metaEvidenceUpdates;\\n } else if (item.status == Status.Registered) {\\n item.status = Status.ClearingRequested;\\n request.metaEvidenceID = 2 * metaEvidenceUpdates + 1;\\n }\\n\\n request.parties[uint(Party.Requester)] = msg.sender;\\n request.submissionTime = now;\\n request.arbitrator = arbitrator;\\n request.arbitratorExtraData = arbitratorExtraData;\\n\\n Round storage round = request.rounds[request.rounds.length++];\\n\\n uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);\\n uint totalCost = arbitrationCost.addCap(_baseDeposit);\\n contribute(round, Party.Requester, msg.sender, msg.value, totalCost);\\n require(round.amountPaid[uint(Party.Requester)] >= totalCost, \\\"You must fully fund your side.\\\");\\n round.hasPaid[uint(Party.Requester)] = true;\\n\\n emit ItemStatusChange(itemID, item.requests.length - 1, request.rounds.length - 1, false, false);\\n emit RequestSubmitted(itemID, item.requests.length - 1, item.status);\\n emit RequestEvidenceGroupID(itemID, item.requests.length - 1, evidenceGroupID);\\n }\\n\\n /** @dev Returns the contribution value and remainder from available ETH and required amount.\\n * @param _available The amount of ETH available for the contribution.\\n * @param _requiredAmount The amount of ETH required for the contribution.\\n * @return taken The amount of ETH taken.\\n * @return remainder The amount of ETH left from the contribution.\\n */\\n function calculateContribution(uint _available, uint _requiredAmount)\\n internal\\n pure\\n returns(uint taken, uint remainder)\\n {\\n if (_requiredAmount > _available)\\n return (_available, 0); // Take whatever is available, return 0 as leftover ETH.\\n else\\n return (_requiredAmount, _available - _requiredAmount);\\n }\\n\\n /** @dev Make a fee contribution.\\n * @param _round The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(Round storage _round, Party _side, address payable _contributor, uint _amount, uint _totalRequired) internal returns (uint) {\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint contribution; // Amount contributed.\\n uint remainingETH; // Remaining ETH to send back.\\n (contribution, remainingETH) = calculateContribution(_amount, _totalRequired.subCap(_round.amountPaid[uint(_side)]));\\n _round.contributions[_contributor][uint(_side)] += contribution;\\n _round.amountPaid[uint(_side)] += contribution;\\n _round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n _contributor.send(remainingETH); // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n\\n return contribution;\\n }\\n\\n /** @dev Execute the ruling of a dispute.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function executeRuling(uint _disputeID, uint _ruling) internal {\\n bytes32 itemID = arbitratorDisputeIDToItem[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n\\n Party winner = Party(_ruling);\\n\\n if (winner == Party.Requester) { // Execute Request.\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Registered;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Absent;\\n } else {\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Absent;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Registered;\\n }\\n\\n request.resolved = true;\\n request.ruling = Party(_ruling);\\n\\n emit ItemStatusChange(itemID, item.requests.length - 1, request.rounds.length - 1, true, true);\\n\\n // Automatically withdraw first deposits and reimbursements (first round only).\\n if (winner == Party.None) {\\n withdrawFeesAndRewards(request.parties[uint(Party.Requester)], itemID, item.requests.length - 1, 0);\\n withdrawFeesAndRewards(request.parties[uint(Party.Challenger)], itemID, item.requests.length - 1, 0);\\n } else {\\n withdrawFeesAndRewards(request.parties[uint(winner)], itemID, item.requests.length - 1, 0);\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /** @dev Returns the number of items that were submitted. Includes items that never made it to the list or were later removed.\\n * @return count The number of items on the list.\\n */\\n function itemCount() external view returns (uint count) {\\n return itemList.length;\\n }\\n\\n /** @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _request The request to query.\\n * @param _round The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint _request,\\n uint _round,\\n address _contributor\\n ) external view returns(uint[3] memory contributions) {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /** @dev Returns item's information. Includes length of requests array.\\n * @param _itemID The ID of the queried item.\\n * @return data The data describing the item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Length of list of status change requests made for the item.\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n bytes memory data,\\n Status status,\\n uint numberOfRequests\\n )\\n {\\n Item storage item = items[_itemID];\\n return (\\n item.data,\\n item.status,\\n item.requests.length\\n );\\n }\\n\\n /** @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _request The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any..\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint _request)\\n external\\n view\\n returns (\\n bool disputed,\\n uint disputeID,\\n uint submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint numberOfRounds,\\n Party ruling,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_request];\\n return (\\n request.disputed,\\n request.disputeID,\\n request.submissionTime,\\n request.resolved,\\n request.parties,\\n request.rounds.length,\\n request.ruling,\\n request.arbitrator,\\n request.arbitratorExtraData,\\n request.metaEvidenceID\\n );\\n }\\n\\n /** @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _request The request to be queried.\\n * @param _round The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(bytes32 _itemID, uint _request, uint _round)\\n external\\n view\\n returns (\\n bool appealed,\\n uint[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n return (\\n _round != (request.rounds.length - 1),\\n round.amountPaid,\\n round.hasPaid,\\n round.feeRewards\\n );\\n }\\n}\\n\",\"keccak256\":\"0xea6a9de52c72e2b3263dbfbd28b3344e0cb1eaa6f1b69313a177b6aaa7a92cbc\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50614a4e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806306661abd14610046578063a2f7b3a514610060578063e50f5f9114610099575b600080fd5b61004e6102cd565b60408051918252519081900360200190f35b61007d6004803603602081101561007657600080fd5b50356102d3565b604080516001600160a01b039092168252519081900360200190f35b6102cb60048036036101c08110156100b057600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100db57600080fd5b8201836020820111156100ed57600080fd5b8035906020019184600183028401116401000000008311171561010f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092956001600160a01b0385351695909490935060408101925060200135905064010000000081111561017357600080fd5b82018360208201111561018557600080fd5b803590602001918460018302840111640100000000831117156101a757600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101fa57600080fd5b82018360208201111561020c57600080fd5b8035906020019184600183028401116401000000008311171561022e57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516060818101835294976001600160a01b038735169760208801359793840135968085013596506080850135955060a085013594929391926101208101929160c09091019060039083908390808284376000920191909152509194506102fa9350505050565b005b60005490565b600081815481106102e057fe5b6000918252602090912001546001600160a01b0316905081565b60008c8c8c8c8c8c8c8c8c8c8c8c60405161031490610588565b808d6001600160a01b03166001600160a01b03168152602001806020018c6001600160a01b03166001600160a01b0316815260200180602001806020018b6001600160a01b03166001600160a01b031681526020018a815260200189815260200188815260200187815260200186815260200185600360200280838360005b838110156103ab578181015183820152602001610393565b5050505090500184810384528f818151815260200191508051906020019080838360005b838110156103e75781810151838201526020016103cf565b50505050905090810190601f1680156104145780820380516001836020036101000a031916815260200191505b5084810383528d5181528d516020918201918f019080838360005b8381101561044757818101518382015260200161042f565b50505050905090810190601f1680156104745780820380516001836020036101000a031916815260200191505b5084810382528c5181528c516020918201918e019080838360005b838110156104a757818101518382015260200161048f565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509f50505050505050505050505050505050604051809103906000f080158015610502573d6000803e3d6000fd5b50600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b038416908117909155604051929350917f704e94f24d7a41dd1af49e0bbd12aa4fb9ade0accd11001b9d1de7d756a5464f9190a250505050505050505050505050565b61448380620005978339019056fe6080604052600280553480156200001557600080fd5b50604051620044833803806200448383398181016040526101c08110156200003c57600080fd5b8151602083018051604051929492938301929190846401000000008211156200006457600080fd5b9083019060208201858111156200007a57600080fd5b82516401000000008111828201881017156200009557600080fd5b82525081516020918201929091019080838360005b83811015620000c4578181015183820152602001620000aa565b50505050905090810190601f168015620000f25780820380516001836020036101000a031916815260200191505b506040818152602083015192018051929491939192846401000000008211156200011b57600080fd5b9083019060208201858111156200013157600080fd5b82516401000000008111828201881017156200014c57600080fd5b82525081516020918201929091019080838360005b838110156200017b57818101518382015260200162000161565b50505050905090810190601f168015620001a95780820380516001836020036101000a031916815260200191505b5060405260200180516040519392919084640100000000821115620001cd57600080fd5b908301906020820185811115620001e357600080fd5b8251640100000000811182820188101715620001fe57600080fd5b82525081516020918201929091019080838360005b838110156200022d57818101518382015260200162000213565b50505050905090810190601f1680156200025b5780820380516001836020036101000a031916815260200191505b506040818152602083810151848301516060860151608087015160a088015160c08901518689528d51878a01528d51959b50939950919790969195929460e09091019360009360008051602062004463833981519152938e93909283928301918501908083838a5b83811015620002dd578181015183820152602001620002c3565b50505050905090810190601f1680156200030b5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2600160008051602062004463833981519152896040518080602001828103825283818151815260200191508051906020019080838360005b838110156200036a57818101518382015260200162000350565b50505050905090810190601f168015620003985780820380516001836020036101000a031916815260200191505b509250505060405180910390a26040516001600160a01b038b16907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a2600080546001600160a01b0319166001600160a01b038e161790558a51620004099060019060208e019062000460565b50600380546001600160a01b0319166001600160a01b0398909816979097179096556004949094556005929092556006556007556008558051600c556020810151600a5560400151600b5550620005059350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004a357805160ff1916838001178555620004d3565b82800160010185558215620004d3579182015b82811115620004d3578251825591602001919060010190620004b6565b50620004e1929150620004e5565b5090565b6200050291905b80821115620004e15760008155600101620004ec565b90565b613f4e80620005156000396000f3fe6080604052600436106102505760003560e01c806392239dff11610139578063bfbcff1a116100b6578063d661dd311161007a578063d661dd3114610c3f578063d706be3114610c54578063dd78cb5914610d1f578063e4c0aaf414610d49578063e9c2416614610d7c578063f48a0b3114610da657610250565b8063bfbcff1a14610a34578063c104817d14610b68578063c2f2beea14610b92578063d294ccef14610ba7578063d36fdb1814610c1557610250565b8063a37b6ad4116100fd578063a37b6ad414610922578063adc7faba14610937578063b4d7953914610961578063ba7079ca14610994578063bb0b86ff14610a1f57610250565b806392239dff1461076a578063974121b21461079457806397e90e501461083e57806398eeadf0146108b3578063a1c2bf4d146108dd57610250565b806348f343f3116101d25780636cdc090f116101965780636cdc090f14610653578063787471a9146106685780637b9433831461067d578063873db1a7146106925780638a0d1e61146107075780638c88c1491461074057610250565b806348f343f3146104375780634aac84e5146104ee57806352bc0e60146105ac5780636bfb0d01146106295780636cc6cde11461063e57610250565b80632baf80ee116102195780632baf80ee14610378578063311a6c561461039e57806333e5d047146103ce5780633d4d3600146103f8578063416583411461042257610250565b806282a36d146102555780630c340a241461027c5780630c7ac7b6146102ad57806312ce3525146103375780631d51208514610363575b600080fd5b34801561026157600080fd5b5061026a610e28565b60408051918252519081900360200190f35b34801561028857600080fd5b50610291610e2e565b604080516001600160a01b039092168252519081900360200190f35b3480156102b957600080fd5b506102c2610e3d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102fc5781810151838201526020016102e4565b50505050905090810190601f1680156103295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561034357600080fd5b506103616004803603602081101561035a57600080fd5b5035610eca565b005b34801561036f57600080fd5b5061026a610f1c565b6103616004803603604081101561038e57600080fd5b508035906020013560ff16610f22565b3480156103aa57600080fd5b50610361600480360360408110156103c157600080fd5b5080359060200135611703565b3480156103da57600080fd5b50610361600480360360208110156103f157600080fd5b503561190a565b34801561040457600080fd5b5061026a6004803603602081101561041b57600080fd5b503561195c565b34801561042e57600080fd5b5061026a61197a565b34801561044357600080fd5b506104616004803603602081101561045a57600080fd5b5035611980565b604051808060200183600381111561047557fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b838110156104b257818101518382015260200161049a565b50505050905090810190601f1680156104df5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156104fa57600080fd5b506105186004803603602081101561051157600080fd5b5035611a2a565b604051808060200184600381111561052c57fe5b60ff168152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561056f578181015183820152602001610557565b50505050905090810190601f16801561059c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b3480156105b857600080fd5b506105f1600480360360808110156105cf57600080fd5b50803590602081013590604081013590606001356001600160a01b0316611aea565b6040518082606080838360005b838110156106165781810151838201526020016105fe565b5050505090500191505060405180910390f35b34801561063557600080fd5b5061026a611b9a565b34801561064a57600080fd5b50610291611ba1565b34801561065f57600080fd5b5061026a611bb0565b34801561067457600080fd5b5061026a611bb6565b34801561068957600080fd5b5061026a611bbc565b610361600480360360408110156106a857600080fd5b81359190810190604081016020820135600160201b8111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460018302840111600160201b831117156106fc57600080fd5b509092509050611bc2565b34801561071357600080fd5b5061026a6004803603604081101561072a57600080fd5b506001600160a01b03813516906020013561215a565b34801561074c57600080fd5b506103616004803603602081101561076357600080fd5b5035612177565b34801561077657600080fd5b506103616004803603602081101561078d57600080fd5b50356121c9565b3480156107a057600080fd5b506107ca600480360360608110156107b757600080fd5b508035906020810135906040013561221b565b60405184151581526020810184606080838360005b838110156107f75781810151838201526020016107df565b5050505090500183600360200280838360005b8381101561082257818101518382015260200161080a565b5050505090500182815260200194505050505060405180910390f35b6103616004803603604081101561085457600080fd5b81359190810190604081016020820135600160201b81111561087557600080fd5b82018360208201111561088757600080fd5b803590602001918460018302840111600160201b831117156108a857600080fd5b50909250905061233c565b3480156108bf57600080fd5b5061026a600480360360208110156108d657600080fd5b50356124ea565b3480156108e957600080fd5b506103616004803603608081101561090057600080fd5b506001600160a01b0381351690602081013590604081013590606001356124fc565b34801561092e57600080fd5b5061026a6127b0565b34801561094357600080fd5b506103616004803603602081101561095a57600080fd5b50356127b6565b34801561096d57600080fd5b506103616004803603602081101561098457600080fd5b50356001600160a01b0316612808565b3480156109a057600080fd5b50610361600480360360408110156109b757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109e157600080fd5b8201836020820111156109f357600080fd5b803590602001918460018302840111600160201b83111715610a1457600080fd5b50909250905061288c565b348015610a2b57600080fd5b5061026a612900565b348015610a4057600080fd5b50610a6460048036036040811015610a5757600080fd5b5080359060200135612906565b604051808b1515151581526020018a81526020018981526020018815151515815260200187600360200280838360005b83811015610aac578181015183820152602001610a94565b50505050905001868152602001856002811115610ac557fe5b60ff168152602001846001600160a01b03166001600160a01b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610b24578181015183820152602001610b0c565b50505050905090810190601f168015610b515780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b348015610b7457600080fd5b5061036160048036036020811015610b8b57600080fd5b5035612a8a565b348015610b9e57600080fd5b5061026a612adc565b61036160048036036020811015610bbd57600080fd5b810190602081018135600160201b811115610bd757600080fd5b820183602082011115610be957600080fd5b803590602001918460018302840111600160201b83111715610c0a57600080fd5b509092509050612ae2565b348015610c2157600080fd5b5061036160048036036020811015610c3857600080fd5b5035612bc4565b348015610c4b57600080fd5b5061026a612c16565b348015610c6057600080fd5b5061036160048036036040811015610c7757600080fd5b810190602081018135600160201b811115610c9157600080fd5b820183602082011115610ca357600080fd5b803590602001918460018302840111600160201b83111715610cc457600080fd5b919390929091602081019035600160201b811115610ce157600080fd5b820183602082011115610cf357600080fd5b803590602001918460018302840111600160201b83111715610d1457600080fd5b509092509050612c1c565b348015610d2b57600080fd5b5061036160048036036020811015610d4257600080fd5b5035612d48565b348015610d5557600080fd5b5061036160048036036020811015610d6c57600080fd5b50356001600160a01b0316612d9a565b348015610d8857600080fd5b5061036160048036036020811015610d9f57600080fd5b5035612e09565b348015610db257600080fd5b5061036160048036036040811015610dc957600080fd5b81359190810190604081016020820135600160201b811115610dea57600080fd5b820183602082011115610dfc57600080fd5b803590602001918460018302840111600160201b83111715610e1d57600080fd5b509092509050613001565b60085481565b6003546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610ec25780601f10610e9757610100808354040283529160200191610ec2565b820191906000526020600020905b815481529060010190602001808311610ea557829003601f168201915b505050505081565b6003546001600160a01b03163314610f17576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600c55565b600b5481565b6001816002811115610f3057fe5b1480610f4757506002816002811115610f4557fe5b145b610f88576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21039b4b2329760991b604482015290519081900360640190fd5b60026000838152600e602052604090206001015460ff166003811115610faa57fe5b1480610fd5575060036000838152600e602052604090206001015460ff166003811115610fd357fe5b145b6110105760405162461bcd60e51b8152600401808060200182810382526025815260200180613ef56025913960400191505060405180910390fd5b6000828152600e602052604081206002018054600019810190811061103157fe5b60009182526020909120600b90910201805490915060ff166110845760405162461bcd60e51b8152600401808060200182810382526032815260200180613ec36032913960400191505060405180910390fd5b6000808260080160019054906101000a90046001600160a01b03166001600160a01b031663afe15cfb84600101546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b1580156110e557600080fd5b505afa1580156110f9573d6000803e3d6000fd5b505050506040513d604081101561110f57600080fd5b508051602090910151909250905042821180159061112c57508042105b6111675760405162461bcd60e51b8152600401808060200182810382526034815260200180613d316034913960400191505060405180910390fd5b6000808460080160019054906101000a90046001600160a01b03166001600160a01b0316631c3db16d86600101546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156111c957600080fd5b505afa1580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b5051600281111561120057fe5b90506000600182600281111561121257fe5b141561122057506002611238565b600282600281111561122e57fe5b1415611238575060015b80600281111561124457fe5b87600281111561125057fe5b1415806112635750600285850304854203105b61129e5760405162461bcd60e51b8152600401808060200182810382526045815260200180613db76045913960600191505060405180910390fd5b8160028111156112aa57fe5b8760028111156112b657fe5b14156112c657600a5492506112f4565b8060028111156112d257fe5b8760028111156112de57fe5b14156112ee57600b5492506112f4565b600c5492505b505060078401805460009190600019810190811061130e57fe5b60009182526020822060088801546001808a01546040805163791f8b7360e11b8152600481018381526024820192835260098e01805460026101009782161588026000190190911604604484018190526006999099029097019950939094046001600160a01b03169563f23f16e695929492939260640190849080156113d55780601f106113aa576101008083540402835291602001916113d5565b820191906000526020600020905b8154815290600101906020018083116113b857829003601f168201915b5050935050505060206040518083038186803b1580156113f457600080fd5b505afa158015611408573d6000803e3d6000fd5b505050506040513d602081101561141e57600080fd5b50519050600061145061271061143a848763ffffffff61312e16565b8161144157fe5b8491900463ffffffff61316416565b90506000611461848a333486613179565b90506001600e60008c81526020019081526020016000206002018054905003336001600160a01b03168b7fd2dc318ba4003f1a6794e033a06e7d6500078805db9f67674ca0bfd2f33c5f3d60018c6007018054905003858e604051808481526020018381526020018260028111156114d557fe5b60ff168152602001935050505060405180910390a481848a60028111156114f857fe5b6003811061150257fe5b0154106115b3576001846003018a600281111561151b57fe5b6003811061152557fe5b602091828204019190066101000a81548160ff02191690831515021790555060018860070180549050036001600e60008d815260200190815260200160002060020180549050038b7f2307dcf798ac8d587c57c5327f7a79292152779aa7f3a2931e817fa2b09d9ff38c6040518082600281111561159f57fe5b60ff16815260200191505060405180910390a45b600384015462010000900460ff1680156115d657506003840154610100900460ff165b156116f75760088801546001808a01546040805163093225f160e31b8152600481018381526024820192835260098e0180546002610100978216158802600019019091160460448401819052959096046001600160a01b0316956349912f88958a95949193606401908490801561168e5780601f106116635761010080835404028352916020019161168e565b820191906000526020600020905b81548152906001019060200180831161167157829003601f168201915b505093505050506000604051808303818588803b1580156116ae57600080fd5b505af11580156116c2573d6000803e3d6000fd5b50505060078a01805492506116db9150600183016139b9565b5060048401546116f1908463ffffffff61324916565b60048501555b50505050505050505050565b600081600281111561171157fe5b336000908152600f60209081526040808320878452825280832054808452600e9092528220600281018054949550919390929190600019810190811061175357fe5b6000918252602082206007600b90920201908101805491935090600019810190811061177b57fe5b906000526020600020906006020190506002548611156117da576040805162461bcd60e51b815260206004820152601560248201527424b73b30b634b210393ab634b7339037b83a34b7b760591b604482015290519081900360640190fd5b600882015461010090046001600160a01b0316331461182a5760405162461bcd60e51b8152600401808060200182810382526025815260200180613e466025913960400191505060405180910390fd5b600382015460ff161561186e5760405162461bcd60e51b8152600401808060200182810382526021815260200180613dfc6021913960400191505060405180910390fd5b600381015460ff6101009091041615156001141561188f57600194506118ac565b600381015462010000900460ff161515600114156118ac57600294505b86337f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222768760028111156118db57fe5b60408051918252519081900360200190a3611901878660028111156118fc57fe5b613264565b50505050505050565b6003546001600160a01b03163314611957576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600455565b600d818154811061196957fe5b600091825260209091200154905081565b600c5481565b600e6020908152600091825260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909291839190830182828015611a175780601f106119ec57610100808354040283529160200191611a17565b820191906000526020600020905b8154815290600101906020018083116119fa57829003601f168201915b5050506001909301549192505060ff1682565b6000818152600e60209081526040808320600180820154600280840154845486516101009582161595909502600019011691909104601f8101879004870284018701909552848352606096958695859460ff9094169391859190830182828015611ad55780601f10611aaa57610100808354040283529160200191611ad5565b820191906000526020600020905b815481529060010190602001808311611ab857829003601f168201915b50505050509250935093509350509193909250565b611af26139e5565b6000858152600e6020526040812060028101805491929187908110611b1357fe5b90600052602060002090600b020190506000816007018681548110611b3457fe5b600091825260208083206001600160a01b03891684526005600690930201918201905260409182902082516060810190935290925060038282826020028201915b815481526020019060010190808311611b755750505050509350505050949350505050565b600d545b90565b6000546001600160a01b031681565b60095481565b60075481565b600a5481565b6000838152600e602052604090206002600182015460ff166003811115611be557fe5b1480611c0357506003600182015460ff166003811115611c0157fe5b145b611c3e5760405162461bcd60e51b8152600401808060200182810382526025815260200180613ef56025913960400191505060405180910390fd5b600281018054600091906000198101908110611c5657fe5b90600052602060002090600b02019050600854816002015442031115611cad5760405162461bcd60e51b8152600401808060200182810382526032815260200180613e6b6032913960400191505060405180910390fd5b805460ff1615611cee5760405162461bcd60e51b8152600401808060200182810382526032815260200180613d656032913960400191505060405180910390fd5b6006810180546001600160a01b03191633179055600781018054600091908290611d1457fe5b60009182526020808320600886015460405163f7434ea960e01b8152600481019384526009880180546002610100600183161581026000190190921604602484018190526006979097029094019750929091046001600160a01b03169363f7434ea99391829160449091019084908015611dcf5780601f10611da457610100808354040283529160200191611dcf565b820191906000526020600020905b815481529060010190602001808311611db257829003601f168201915b50509250505060206040518083038186803b158015611ded57600080fd5b505afa158015611e01573d6000803e3d6000fd5b505050506040513d6020811015611e1757600080fd5b5051905060006002600186015460ff166003811115611e3257fe5b14611e3f57600754611e43565b6006545b90506000611e57838363ffffffff61316416565b9050611e67846002333485613179565b508084600201541015611ec1576040805162461bcd60e51b815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038401805462ff00001916620100001790556008850154600280546040805163c13517e160e01b8152600481018381526024820192835260098b0180546001811615610100908102600019019091169690960460448401819052959096046001600160a01b03169563c13517e1958a959491936064019084908015611f885780601f10611f5d57610100808354040283529160200191611f88565b820191906000526020600020905b815481529060010190602001808311611f6b57829003601f168201915b505093505050506020604051808303818588803b158015611fa857600080fd5b505af1158015611fbc573d6000803e3d6000fd5b50505050506040513d6020811015611fd357600080fd5b50516001868101829055600887015461010090046001600160a01b03166000908152600f60209081526040808320948352939052919091208a9055855460ff1916811786556007860180549161202b919083016139b9565b506004840154612041908463ffffffff61324916565b600485015560028601546040805160208082018d9052600019909301818301528151808203830181526060820180845281519190940120600189015460088a0154600a8b015490955260808301829052925190936001600160a01b0361010090910416917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d919081900360a00190a387156116f757600886015460408051602080825281018b9052339284926101009091046001600160a01b0316917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918e918e9181908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a450505050505050505050565b600f60209081526000928352604080842090915290825290205481565b6003546001600160a01b031633146121c4576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600555565b6003546001600160a01b03163314612216576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600b55565b60006122256139e5565b61222d6139e5565b6000868152600e602052604081206002810180548391908990811061224e57fe5b90600052602060002090600b02019050600081600701888154811061226f57fe5b90600052602060002090600602019050600182600701805490500388141581600001826003018360040154826003806020026040519081016040528092919082600380156122d2576020028201915b8154815260200190600101908083116122be575b5050604080516060810191829052949750869350600392509050826000855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116122f157905050505050509150965096509650965050505093509350935093565b60016000848152600e602052604090206001015460ff16600381111561235e57fe5b1461239a5760405162461bcd60e51b8152600401808060200182810382526026815260200180613e9d6026913960400191505060405180910390fd5b6000838152600e60205260409020811561244d57600281015460408051602080820188905281830184905282518083038401815260608301938490528051908201206000549184526080830187905292339284926001600160a01b0316917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918a918a91819060a001848480828437600083820152604051601f909101601f19169092018290039550909350505050a450505b805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181526124e492909184918301828280156124d75780601f106124ac576101008083540402835291602001916124d7565b820191906000526020600020905b8154815290600101906020018083116124ba57829003601f168201915b5050505050600554613499565b50505050565b60106020526000908152604090205481565b6000838152600e602052604081206002810180549192918590811061251d57fe5b90600052602060002090600b02019050600081600701848154811061253e57fe5b600091825260209091206003840154600690920201915060ff166125a9576040805162461bcd60e51b815260206004820152601960248201527f52657175657374206d757374206265207265736f6c7665642e00000000000000604482015290519081900360640190fd5b6003810154600090610100900460ff1615806125d05750600382015462010000900460ff16155b1561260157506001600160a01b03871660009081526005820160205260409020600281015460019091015401612767565b6000600884015460ff16600281111561261657fe5b14156126cb5760008083600101541161263057600061266c565b8260010154836002015460048501546001600160a01b038c1660009081526005870160205260409020929091019160010154028161266a57fe5b045b90506000808460020154116126825760006126be565b8360010154846002015460048601546001600160a01b038d166000908152600588016020526040902092909101916002015402816126bc57fe5b045b9190910191506127679050565b6008830154600090839060ff1660028111156126e357fe5b600381106126ed57fe5b0154116126fb576000612764565b6008830154829060ff16600281111561271057fe5b6003811061271a57fe5b015460048301546001600160a01b038a1660009081526005850160205260409020600886015460ff16600281111561274e57fe5b6003811061275857fe5b0154028161276257fe5b045b90505b6001600160a01b038816600081815260058401602052604080822060018101839055600201829055516108fc84150291849190818181858888f150505050505050505050505050565b60065481565b6003546001600160a01b03163314612803576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600a55565b6003546001600160a01b03163314612855576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b6040516001600160a01b038216907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a250565b6003546001600160a01b031633146128d9576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0385161790556124e460018383613a03565b60045481565b6000806000806129146139e5565b60008060006060600080600e60008e81526020019081526020016000206002018c8154811061293f57fe5b60009182526020909120600b9091020180546001820154600283015460038085015460078601546008870154600a880154604080516060810191829052999a5060ff98891699979896979487169660048c01969495908416946101009094046001600160a01b03169360098d01939288919082845b81546001600160a01b031681526001909101906020018083116129b4575050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959b5087945092508401905082828015612a5f5780601f10612a3457610100808354040283529160200191612a5f565b820191906000526020600020905b815481529060010190602001808311612a4257829003601f168201915b505050505091509a509a509a509a509a509a509a509a509a509a50509295989b9194979a5092959850565b6003546001600160a01b03163314612ad7576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600655565b60055481565b60008282604051808383808284376040519201829003909120945060009350612b0a92505050565b6000828152600e602052604090206001015460ff166003811115612b2a57fe5b14612b7c576040805162461bcd60e51b815260206004820181905260248201527f4974656d206d75737420626520616273656e7420746f2062652061646465642e604482015290519081900360640190fd5b612bbf83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060045491506134999050565b505050565b6003546001600160a01b03163314612c11576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600855565b61271081565b6003546001600160a01b03163314612c69576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600980546001019081905560408051602080825281018690526002909202917f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d918791879181908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a26009546002026001017f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a250505050565b6003546001600160a01b03163314612d95576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600755565b6003546001600160a01b03163314612de7576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600e602052604081206002810180549192916000198101908110612e2e57fe5b90600052602060002090600b020190506008548160020154420311612e845760405162461bcd60e51b8152600401808060200182810382526028815260200180613d096028913960400191505060405180910390fd5b805460ff1615612ec55760405162461bcd60e51b8152600401808060200182810382526023815260200180613ce66023913960400191505060405180910390fd5b6002600183015460ff166003811115612eda57fe5b1415612ef8576001828101805460ff191682805b0217905550612f77565b6003600183015460ff166003811115612f0d57fe5b1415612f2a576001808301805460009260ff199091169083612eee565b6040805162461bcd60e51b815260206004820152601860248201527f5468657265206d757374206265206120726571756573742e0000000000000000604482015290519081900360640190fd5b60038101805460ff191660019081179091556007820154600284015460408051600081526020810194909452805160001993840194929093019287927f298f9b7df751fd9e63ad99b4f83c2509c67421163d60b5cc6573f40f24abe58192908290030190a460058101546002830154612bbf916001600160a01b03169085906000190160006124fc565b6000838152600e60205260408120600281018054919291600019810190811061302657fe5b60009182526020909120600b90910201600381015490915060ff161561307d5760405162461bcd60e51b8152600401808060200182810382526029815260200180613e1d6029913960400191505060405180910390fd5b600282015460408051602080820189905260001990930181830152815180820383018152606082019283905280519084012060088501549383526080820187905292339284926101009092046001600160a01b0316917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918a918a9190819060a001848480828437600083820152604051601f909101601f19169092018290039550909350505050a4505050505050565b60008261313d5750600061315e565b8282028284828161314a57fe5b04146131585760001961315a565b805b9150505b92915050565b6000828201838110156131585760001961315a565b600080806131af856131aa8a8a600281111561319157fe5b6003811061319b57fe5b0154879063ffffffff61324916565b613994565b6001600160a01b038816600090815260058b0160205260409020919350915082908860028111156131dc57fe5b600381106131e657fe5b018054909101905581888860028111156131fc57fe5b6003811061320657fe5b0180549091019055600488018054830190556040516001600160a01b0387169082156108fc029083906000818181858888f150949b9a5050505050505050505050565b60008282111561325b5750600061315e565b5080820361315e565b336000908152600f60209081526040808320858452825280832054808452600e90925282206002810180549293919260001981019081106132a157fe5b90600052602060002090600b0201905060008460028111156132bf57fe5b905060018160028111156132cf57fe5b141561333e576002600184015460ff1660038111156132ea57fe5b1415613305576001838101805460ff19169091179055613339565b6003600184015460ff16600381111561331a57fe5b1415613339576001808401805460009260ff1990911690835b02179055505b61339c565b6002600184015460ff16600381111561335357fe5b1415613370576001808401805460009260ff199091169083613333565b6003600184015460ff16600381111561338557fe5b141561339c576001838101805460ff191690911790555b60038201805460ff191660011790558460028111156133b757fe5b60088301805460ff191660018360028111156133cf57fe5b02179055506007820154600284015460408051600180825260208201528151600019948501949093019288927f298f9b7df751fd9e63ad99b4f83c2509c67421163d60b5cc6573f40f24abe581928290030190a4600081600281111561343157fe5b141561347e5761346b6004830160015b6003811061344b57fe5b015460028501546001600160a01b039091169086906000190160006124fc565b613479600483016002613441565b613491565b6134918260040182600281111561344157fe5b505050505050565b81516020808401919091206000818152600e83526040908190206002810154825180860185905280840182905283518082038501815260609091019093528251929094019190912091929091906135fb5784516134fc9083906020880190613a81565b50600d8054600180820183557fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5909101859055905460008581526010602090815260409182902060001993840190558151818152865460029581161561010002909401909316939093049282018390528392339287927f909f6b266555a57aee2c82ba6326605749e5eb297f67e1a4ad0bc9c7f0d013ee92889291829190820190849080156135ec5780601f106135c1576101008083540402835291602001916135ec565b820191906000526020600020905b8154815290600101906020018083116135cf57829003601f168201915b50509250505060405180910390a45b600282018054600091906136128260018301613aef565b8154811061361c57fe5b600091825260208220600b909102019150600184015460ff16600381111561364057fe5b14156136665760018301805460ff1916600290811790915560095402600a82015561369d565b60018084015460ff16600381111561367a57fe5b141561369d576001838101805460ff1916600317905560095460020201600a8201555b600581018054336001600160a01b031990911617905542600280830191909155600054600883018054610100600160a81b0319166101006001600160a01b0390931683021790556001805461370393600986019382841615026000190190911604613b1b565b506007810180546000919061371b82600183016139b9565b8154811061372557fe5b60009182526020808320600886015460405163f7434ea960e01b8152600481019384526009880180546002610100600183161581026000190190921604602484018190526006979097029094019750929091046001600160a01b03169363f7434ea993918291604490910190849080156137e05780601f106137b5576101008083540402835291602001916137e0565b820191906000526020600020905b8154815290600101906020018083116137c357829003601f168201915b50509250505060206040518083038186803b1580156137fe57600080fd5b505afa158015613812573d6000803e3d6000fd5b505050506040513d602081101561382857600080fd5b50519050600061383e828963ffffffff61316416565b905061384e836001333485613179565b5080836001015410156138a8576040805162461bcd60e51b815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038301805461ff001916610100179055600784015460028701546040805160008082526020820152815160001994850194909301928b927f298f9b7df751fd9e63ad99b4f83c2509c67421163d60b5cc6573f40f24abe581928290030190a4600186015460ff16600381111561391b57fe5b60028701546040516000199091019089907f3df0d1fdcd07576fccf91c63cc392d4b6facc79e6df12df6482342e3ed9d3b2090600090a460028601546040518691600019019089907f6a1ec219a182810abe6f25702d9e60eabaaf29e7d1c87bc0a778b845be86e06190600090a4505050505050505050565b600080838311156139aa575082905060006139b2565b508190508083035b9250929050565b815481835581811115612bbf57600602816006028360005260206000209182019101612bbf9190613b90565b60405180606001604052806003906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613a445782800160ff19823516178555613a71565b82800160010185558215613a71579182015b82811115613a71578235825591602001919060010190613a56565b50613a7d929150613bc8565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613ac257805160ff1916838001178555613a71565b82800160010185558215613a71579182015b82811115613a71578251825591602001919060010190613ad4565b815481835581811115612bbf57600b0281600b028360005260206000209182019101612bbf9190613be2565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613b545780548555613a71565b82800160010185558215613a7157600052602060002091601f016020900482015b82811115613a71578254825591600101919060010190613b75565b611b9e91905b80821115613a7d576000613baa8282613c61565b613bb8600383016000613c76565b5060006004820155600601613b96565b611b9e91905b80821115613a7d5760008155600101613bce565b611b9e91905b80821115613a7d57805460ff19908116825560006001830181905560028301819055600383018054909216909155613c236004830182613c61565b613c31600783016000613c7d565b6008820180546001600160a81b0319169055613c51600983016000613ca1565b506000600a820155600b01613be8565b50600081556001016000815560010160009055565b5060009055565b5080546000825560060290600052602060002090810190613c9e9190613b90565b50565b50805460018160011615610100020316600290046000825580601f10613cc75750613c9e565b601f016020900490600052602060002090810190613c9e9190613bc856fe54686520726571756573742073686f756c64206e6f742062652064697370757465642e54696d6520746f206368616c6c656e6765207468652072657175657374206d75737420706173732e436f6e747269627574696f6e73206d757374206265206d6164652077697468696e207468652061707065616c20706572696f642e54686520726571756573742073686f756c64206e6f74206861766520616c7265616479206265656e2064697370757465642e5468652063616c6c6572206d7573742062652074686520676f7665726e6f722e546865206c6f736572206d75737420636f6e7472696275746520647572696e67207468652066697273742068616c66206f66207468652061707065616c20706572696f642e5468652072657175657374206d757374206e6f74206265207265736f6c7665642e5468652064697370757465206d757374206e6f7420616c7265616479206265207265736f6c7665642e4f6e6c79207468652061726269747261746f722063616e206769766520612072756c696e674368616c6c656e676573206d757374206f6363757220647572696e6720746865206368616c6c656e676520706572696f642e4974656d206d757374206265207265676973746572656420746f2062652072656d6f7665642e412064697370757465206d7573742068617665206265656e2072616973656420746f2066756e6420616e2061707065616c2e546865206974656d206d757374206861766520612070656e64696e6720726571756573742ea265627a7a72315820d548acb594d3d7b3bb141a16e7eaa81bc8b9a9bc86907879533f2121c1bf415164736f6c6343000511003261606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7da265627a7a72315820a81b1e023f6110d38f8a12c5d62ffc1d41ab134732a0f72f1a65096e25e7bd8564736f6c63430005110032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806306661abd14610046578063a2f7b3a514610060578063e50f5f9114610099575b600080fd5b61004e6102cd565b60408051918252519081900360200190f35b61007d6004803603602081101561007657600080fd5b50356102d3565b604080516001600160a01b039092168252519081900360200190f35b6102cb60048036036101c08110156100b057600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100db57600080fd5b8201836020820111156100ed57600080fd5b8035906020019184600183028401116401000000008311171561010f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092956001600160a01b0385351695909490935060408101925060200135905064010000000081111561017357600080fd5b82018360208201111561018557600080fd5b803590602001918460018302840111640100000000831117156101a757600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101fa57600080fd5b82018360208201111561020c57600080fd5b8035906020019184600183028401116401000000008311171561022e57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516060818101835294976001600160a01b038735169760208801359793840135968085013596506080850135955060a085013594929391926101208101929160c09091019060039083908390808284376000920191909152509194506102fa9350505050565b005b60005490565b600081815481106102e057fe5b6000918252602090912001546001600160a01b0316905081565b60008c8c8c8c8c8c8c8c8c8c8c8c60405161031490610588565b808d6001600160a01b03166001600160a01b03168152602001806020018c6001600160a01b03166001600160a01b0316815260200180602001806020018b6001600160a01b03166001600160a01b031681526020018a815260200189815260200188815260200187815260200186815260200185600360200280838360005b838110156103ab578181015183820152602001610393565b5050505090500184810384528f818151815260200191508051906020019080838360005b838110156103e75781810151838201526020016103cf565b50505050905090810190601f1680156104145780820380516001836020036101000a031916815260200191505b5084810383528d5181528d516020918201918f019080838360005b8381101561044757818101518382015260200161042f565b50505050905090810190601f1680156104745780820380516001836020036101000a031916815260200191505b5084810382528c5181528c516020918201918e019080838360005b838110156104a757818101518382015260200161048f565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509f50505050505050505050505050505050604051809103906000f080158015610502573d6000803e3d6000fd5b50600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b038416908117909155604051929350917f704e94f24d7a41dd1af49e0bbd12aa4fb9ade0accd11001b9d1de7d756a5464f9190a250505050505050505050505050565b61448380620005978339019056fe6080604052600280553480156200001557600080fd5b50604051620044833803806200448383398181016040526101c08110156200003c57600080fd5b8151602083018051604051929492938301929190846401000000008211156200006457600080fd5b9083019060208201858111156200007a57600080fd5b82516401000000008111828201881017156200009557600080fd5b82525081516020918201929091019080838360005b83811015620000c4578181015183820152602001620000aa565b50505050905090810190601f168015620000f25780820380516001836020036101000a031916815260200191505b506040818152602083015192018051929491939192846401000000008211156200011b57600080fd5b9083019060208201858111156200013157600080fd5b82516401000000008111828201881017156200014c57600080fd5b82525081516020918201929091019080838360005b838110156200017b57818101518382015260200162000161565b50505050905090810190601f168015620001a95780820380516001836020036101000a031916815260200191505b5060405260200180516040519392919084640100000000821115620001cd57600080fd5b908301906020820185811115620001e357600080fd5b8251640100000000811182820188101715620001fe57600080fd5b82525081516020918201929091019080838360005b838110156200022d57818101518382015260200162000213565b50505050905090810190601f1680156200025b5780820380516001836020036101000a031916815260200191505b506040818152602083810151848301516060860151608087015160a088015160c08901518689528d51878a01528d51959b50939950919790969195929460e09091019360009360008051602062004463833981519152938e93909283928301918501908083838a5b83811015620002dd578181015183820152602001620002c3565b50505050905090810190601f1680156200030b5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2600160008051602062004463833981519152896040518080602001828103825283818151815260200191508051906020019080838360005b838110156200036a57818101518382015260200162000350565b50505050905090810190601f168015620003985780820380516001836020036101000a031916815260200191505b509250505060405180910390a26040516001600160a01b038b16907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a2600080546001600160a01b0319166001600160a01b038e161790558a51620004099060019060208e019062000460565b50600380546001600160a01b0319166001600160a01b0398909816979097179096556004949094556005929092556006556007556008558051600c556020810151600a5560400151600b5550620005059350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004a357805160ff1916838001178555620004d3565b82800160010185558215620004d3579182015b82811115620004d3578251825591602001919060010190620004b6565b50620004e1929150620004e5565b5090565b6200050291905b80821115620004e15760008155600101620004ec565b90565b613f4e80620005156000396000f3fe6080604052600436106102505760003560e01c806392239dff11610139578063bfbcff1a116100b6578063d661dd311161007a578063d661dd3114610c3f578063d706be3114610c54578063dd78cb5914610d1f578063e4c0aaf414610d49578063e9c2416614610d7c578063f48a0b3114610da657610250565b8063bfbcff1a14610a34578063c104817d14610b68578063c2f2beea14610b92578063d294ccef14610ba7578063d36fdb1814610c1557610250565b8063a37b6ad4116100fd578063a37b6ad414610922578063adc7faba14610937578063b4d7953914610961578063ba7079ca14610994578063bb0b86ff14610a1f57610250565b806392239dff1461076a578063974121b21461079457806397e90e501461083e57806398eeadf0146108b3578063a1c2bf4d146108dd57610250565b806348f343f3116101d25780636cdc090f116101965780636cdc090f14610653578063787471a9146106685780637b9433831461067d578063873db1a7146106925780638a0d1e61146107075780638c88c1491461074057610250565b806348f343f3146104375780634aac84e5146104ee57806352bc0e60146105ac5780636bfb0d01146106295780636cc6cde11461063e57610250565b80632baf80ee116102195780632baf80ee14610378578063311a6c561461039e57806333e5d047146103ce5780633d4d3600146103f8578063416583411461042257610250565b806282a36d146102555780630c340a241461027c5780630c7ac7b6146102ad57806312ce3525146103375780631d51208514610363575b600080fd5b34801561026157600080fd5b5061026a610e28565b60408051918252519081900360200190f35b34801561028857600080fd5b50610291610e2e565b604080516001600160a01b039092168252519081900360200190f35b3480156102b957600080fd5b506102c2610e3d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102fc5781810151838201526020016102e4565b50505050905090810190601f1680156103295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561034357600080fd5b506103616004803603602081101561035a57600080fd5b5035610eca565b005b34801561036f57600080fd5b5061026a610f1c565b6103616004803603604081101561038e57600080fd5b508035906020013560ff16610f22565b3480156103aa57600080fd5b50610361600480360360408110156103c157600080fd5b5080359060200135611703565b3480156103da57600080fd5b50610361600480360360208110156103f157600080fd5b503561190a565b34801561040457600080fd5b5061026a6004803603602081101561041b57600080fd5b503561195c565b34801561042e57600080fd5b5061026a61197a565b34801561044357600080fd5b506104616004803603602081101561045a57600080fd5b5035611980565b604051808060200183600381111561047557fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b838110156104b257818101518382015260200161049a565b50505050905090810190601f1680156104df5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156104fa57600080fd5b506105186004803603602081101561051157600080fd5b5035611a2a565b604051808060200184600381111561052c57fe5b60ff168152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561056f578181015183820152602001610557565b50505050905090810190601f16801561059c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b3480156105b857600080fd5b506105f1600480360360808110156105cf57600080fd5b50803590602081013590604081013590606001356001600160a01b0316611aea565b6040518082606080838360005b838110156106165781810151838201526020016105fe565b5050505090500191505060405180910390f35b34801561063557600080fd5b5061026a611b9a565b34801561064a57600080fd5b50610291611ba1565b34801561065f57600080fd5b5061026a611bb0565b34801561067457600080fd5b5061026a611bb6565b34801561068957600080fd5b5061026a611bbc565b610361600480360360408110156106a857600080fd5b81359190810190604081016020820135600160201b8111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460018302840111600160201b831117156106fc57600080fd5b509092509050611bc2565b34801561071357600080fd5b5061026a6004803603604081101561072a57600080fd5b506001600160a01b03813516906020013561215a565b34801561074c57600080fd5b506103616004803603602081101561076357600080fd5b5035612177565b34801561077657600080fd5b506103616004803603602081101561078d57600080fd5b50356121c9565b3480156107a057600080fd5b506107ca600480360360608110156107b757600080fd5b508035906020810135906040013561221b565b60405184151581526020810184606080838360005b838110156107f75781810151838201526020016107df565b5050505090500183600360200280838360005b8381101561082257818101518382015260200161080a565b5050505090500182815260200194505050505060405180910390f35b6103616004803603604081101561085457600080fd5b81359190810190604081016020820135600160201b81111561087557600080fd5b82018360208201111561088757600080fd5b803590602001918460018302840111600160201b831117156108a857600080fd5b50909250905061233c565b3480156108bf57600080fd5b5061026a600480360360208110156108d657600080fd5b50356124ea565b3480156108e957600080fd5b506103616004803603608081101561090057600080fd5b506001600160a01b0381351690602081013590604081013590606001356124fc565b34801561092e57600080fd5b5061026a6127b0565b34801561094357600080fd5b506103616004803603602081101561095a57600080fd5b50356127b6565b34801561096d57600080fd5b506103616004803603602081101561098457600080fd5b50356001600160a01b0316612808565b3480156109a057600080fd5b50610361600480360360408110156109b757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109e157600080fd5b8201836020820111156109f357600080fd5b803590602001918460018302840111600160201b83111715610a1457600080fd5b50909250905061288c565b348015610a2b57600080fd5b5061026a612900565b348015610a4057600080fd5b50610a6460048036036040811015610a5757600080fd5b5080359060200135612906565b604051808b1515151581526020018a81526020018981526020018815151515815260200187600360200280838360005b83811015610aac578181015183820152602001610a94565b50505050905001868152602001856002811115610ac557fe5b60ff168152602001846001600160a01b03166001600160a01b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610b24578181015183820152602001610b0c565b50505050905090810190601f168015610b515780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b348015610b7457600080fd5b5061036160048036036020811015610b8b57600080fd5b5035612a8a565b348015610b9e57600080fd5b5061026a612adc565b61036160048036036020811015610bbd57600080fd5b810190602081018135600160201b811115610bd757600080fd5b820183602082011115610be957600080fd5b803590602001918460018302840111600160201b83111715610c0a57600080fd5b509092509050612ae2565b348015610c2157600080fd5b5061036160048036036020811015610c3857600080fd5b5035612bc4565b348015610c4b57600080fd5b5061026a612c16565b348015610c6057600080fd5b5061036160048036036040811015610c7757600080fd5b810190602081018135600160201b811115610c9157600080fd5b820183602082011115610ca357600080fd5b803590602001918460018302840111600160201b83111715610cc457600080fd5b919390929091602081019035600160201b811115610ce157600080fd5b820183602082011115610cf357600080fd5b803590602001918460018302840111600160201b83111715610d1457600080fd5b509092509050612c1c565b348015610d2b57600080fd5b5061036160048036036020811015610d4257600080fd5b5035612d48565b348015610d5557600080fd5b5061036160048036036020811015610d6c57600080fd5b50356001600160a01b0316612d9a565b348015610d8857600080fd5b5061036160048036036020811015610d9f57600080fd5b5035612e09565b348015610db257600080fd5b5061036160048036036040811015610dc957600080fd5b81359190810190604081016020820135600160201b811115610dea57600080fd5b820183602082011115610dfc57600080fd5b803590602001918460018302840111600160201b83111715610e1d57600080fd5b509092509050613001565b60085481565b6003546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610ec25780601f10610e9757610100808354040283529160200191610ec2565b820191906000526020600020905b815481529060010190602001808311610ea557829003601f168201915b505050505081565b6003546001600160a01b03163314610f17576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600c55565b600b5481565b6001816002811115610f3057fe5b1480610f4757506002816002811115610f4557fe5b145b610f88576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21039b4b2329760991b604482015290519081900360640190fd5b60026000838152600e602052604090206001015460ff166003811115610faa57fe5b1480610fd5575060036000838152600e602052604090206001015460ff166003811115610fd357fe5b145b6110105760405162461bcd60e51b8152600401808060200182810382526025815260200180613ef56025913960400191505060405180910390fd5b6000828152600e602052604081206002018054600019810190811061103157fe5b60009182526020909120600b90910201805490915060ff166110845760405162461bcd60e51b8152600401808060200182810382526032815260200180613ec36032913960400191505060405180910390fd5b6000808260080160019054906101000a90046001600160a01b03166001600160a01b031663afe15cfb84600101546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b1580156110e557600080fd5b505afa1580156110f9573d6000803e3d6000fd5b505050506040513d604081101561110f57600080fd5b508051602090910151909250905042821180159061112c57508042105b6111675760405162461bcd60e51b8152600401808060200182810382526034815260200180613d316034913960400191505060405180910390fd5b6000808460080160019054906101000a90046001600160a01b03166001600160a01b0316631c3db16d86600101546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156111c957600080fd5b505afa1580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b5051600281111561120057fe5b90506000600182600281111561121257fe5b141561122057506002611238565b600282600281111561122e57fe5b1415611238575060015b80600281111561124457fe5b87600281111561125057fe5b1415806112635750600285850304854203105b61129e5760405162461bcd60e51b8152600401808060200182810382526045815260200180613db76045913960600191505060405180910390fd5b8160028111156112aa57fe5b8760028111156112b657fe5b14156112c657600a5492506112f4565b8060028111156112d257fe5b8760028111156112de57fe5b14156112ee57600b5492506112f4565b600c5492505b505060078401805460009190600019810190811061130e57fe5b60009182526020822060088801546001808a01546040805163791f8b7360e11b8152600481018381526024820192835260098e01805460026101009782161588026000190190911604604484018190526006999099029097019950939094046001600160a01b03169563f23f16e695929492939260640190849080156113d55780601f106113aa576101008083540402835291602001916113d5565b820191906000526020600020905b8154815290600101906020018083116113b857829003601f168201915b5050935050505060206040518083038186803b1580156113f457600080fd5b505afa158015611408573d6000803e3d6000fd5b505050506040513d602081101561141e57600080fd5b50519050600061145061271061143a848763ffffffff61312e16565b8161144157fe5b8491900463ffffffff61316416565b90506000611461848a333486613179565b90506001600e60008c81526020019081526020016000206002018054905003336001600160a01b03168b7fd2dc318ba4003f1a6794e033a06e7d6500078805db9f67674ca0bfd2f33c5f3d60018c6007018054905003858e604051808481526020018381526020018260028111156114d557fe5b60ff168152602001935050505060405180910390a481848a60028111156114f857fe5b6003811061150257fe5b0154106115b3576001846003018a600281111561151b57fe5b6003811061152557fe5b602091828204019190066101000a81548160ff02191690831515021790555060018860070180549050036001600e60008d815260200190815260200160002060020180549050038b7f2307dcf798ac8d587c57c5327f7a79292152779aa7f3a2931e817fa2b09d9ff38c6040518082600281111561159f57fe5b60ff16815260200191505060405180910390a45b600384015462010000900460ff1680156115d657506003840154610100900460ff165b156116f75760088801546001808a01546040805163093225f160e31b8152600481018381526024820192835260098e0180546002610100978216158802600019019091160460448401819052959096046001600160a01b0316956349912f88958a95949193606401908490801561168e5780601f106116635761010080835404028352916020019161168e565b820191906000526020600020905b81548152906001019060200180831161167157829003601f168201915b505093505050506000604051808303818588803b1580156116ae57600080fd5b505af11580156116c2573d6000803e3d6000fd5b50505060078a01805492506116db9150600183016139b9565b5060048401546116f1908463ffffffff61324916565b60048501555b50505050505050505050565b600081600281111561171157fe5b336000908152600f60209081526040808320878452825280832054808452600e9092528220600281018054949550919390929190600019810190811061175357fe5b6000918252602082206007600b90920201908101805491935090600019810190811061177b57fe5b906000526020600020906006020190506002548611156117da576040805162461bcd60e51b815260206004820152601560248201527424b73b30b634b210393ab634b7339037b83a34b7b760591b604482015290519081900360640190fd5b600882015461010090046001600160a01b0316331461182a5760405162461bcd60e51b8152600401808060200182810382526025815260200180613e466025913960400191505060405180910390fd5b600382015460ff161561186e5760405162461bcd60e51b8152600401808060200182810382526021815260200180613dfc6021913960400191505060405180910390fd5b600381015460ff6101009091041615156001141561188f57600194506118ac565b600381015462010000900460ff161515600114156118ac57600294505b86337f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222768760028111156118db57fe5b60408051918252519081900360200190a3611901878660028111156118fc57fe5b613264565b50505050505050565b6003546001600160a01b03163314611957576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600455565b600d818154811061196957fe5b600091825260209091200154905081565b600c5481565b600e6020908152600091825260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909291839190830182828015611a175780601f106119ec57610100808354040283529160200191611a17565b820191906000526020600020905b8154815290600101906020018083116119fa57829003601f168201915b5050506001909301549192505060ff1682565b6000818152600e60209081526040808320600180820154600280840154845486516101009582161595909502600019011691909104601f8101879004870284018701909552848352606096958695859460ff9094169391859190830182828015611ad55780601f10611aaa57610100808354040283529160200191611ad5565b820191906000526020600020905b815481529060010190602001808311611ab857829003601f168201915b50505050509250935093509350509193909250565b611af26139e5565b6000858152600e6020526040812060028101805491929187908110611b1357fe5b90600052602060002090600b020190506000816007018681548110611b3457fe5b600091825260208083206001600160a01b03891684526005600690930201918201905260409182902082516060810190935290925060038282826020028201915b815481526020019060010190808311611b755750505050509350505050949350505050565b600d545b90565b6000546001600160a01b031681565b60095481565b60075481565b600a5481565b6000838152600e602052604090206002600182015460ff166003811115611be557fe5b1480611c0357506003600182015460ff166003811115611c0157fe5b145b611c3e5760405162461bcd60e51b8152600401808060200182810382526025815260200180613ef56025913960400191505060405180910390fd5b600281018054600091906000198101908110611c5657fe5b90600052602060002090600b02019050600854816002015442031115611cad5760405162461bcd60e51b8152600401808060200182810382526032815260200180613e6b6032913960400191505060405180910390fd5b805460ff1615611cee5760405162461bcd60e51b8152600401808060200182810382526032815260200180613d656032913960400191505060405180910390fd5b6006810180546001600160a01b03191633179055600781018054600091908290611d1457fe5b60009182526020808320600886015460405163f7434ea960e01b8152600481019384526009880180546002610100600183161581026000190190921604602484018190526006979097029094019750929091046001600160a01b03169363f7434ea99391829160449091019084908015611dcf5780601f10611da457610100808354040283529160200191611dcf565b820191906000526020600020905b815481529060010190602001808311611db257829003601f168201915b50509250505060206040518083038186803b158015611ded57600080fd5b505afa158015611e01573d6000803e3d6000fd5b505050506040513d6020811015611e1757600080fd5b5051905060006002600186015460ff166003811115611e3257fe5b14611e3f57600754611e43565b6006545b90506000611e57838363ffffffff61316416565b9050611e67846002333485613179565b508084600201541015611ec1576040805162461bcd60e51b815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038401805462ff00001916620100001790556008850154600280546040805163c13517e160e01b8152600481018381526024820192835260098b0180546001811615610100908102600019019091169690960460448401819052959096046001600160a01b03169563c13517e1958a959491936064019084908015611f885780601f10611f5d57610100808354040283529160200191611f88565b820191906000526020600020905b815481529060010190602001808311611f6b57829003601f168201915b505093505050506020604051808303818588803b158015611fa857600080fd5b505af1158015611fbc573d6000803e3d6000fd5b50505050506040513d6020811015611fd357600080fd5b50516001868101829055600887015461010090046001600160a01b03166000908152600f60209081526040808320948352939052919091208a9055855460ff1916811786556007860180549161202b919083016139b9565b506004840154612041908463ffffffff61324916565b600485015560028601546040805160208082018d9052600019909301818301528151808203830181526060820180845281519190940120600189015460088a0154600a8b015490955260808301829052925190936001600160a01b0361010090910416917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d919081900360a00190a387156116f757600886015460408051602080825281018b9052339284926101009091046001600160a01b0316917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918e918e9181908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a450505050505050505050565b600f60209081526000928352604080842090915290825290205481565b6003546001600160a01b031633146121c4576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600555565b6003546001600160a01b03163314612216576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600b55565b60006122256139e5565b61222d6139e5565b6000868152600e602052604081206002810180548391908990811061224e57fe5b90600052602060002090600b02019050600081600701888154811061226f57fe5b90600052602060002090600602019050600182600701805490500388141581600001826003018360040154826003806020026040519081016040528092919082600380156122d2576020028201915b8154815260200190600101908083116122be575b5050604080516060810191829052949750869350600392509050826000855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116122f157905050505050509150965096509650965050505093509350935093565b60016000848152600e602052604090206001015460ff16600381111561235e57fe5b1461239a5760405162461bcd60e51b8152600401808060200182810382526026815260200180613e9d6026913960400191505060405180910390fd5b6000838152600e60205260409020811561244d57600281015460408051602080820188905281830184905282518083038401815260608301938490528051908201206000549184526080830187905292339284926001600160a01b0316917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918a918a91819060a001848480828437600083820152604051601f909101601f19169092018290039550909350505050a450505b805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181526124e492909184918301828280156124d75780601f106124ac576101008083540402835291602001916124d7565b820191906000526020600020905b8154815290600101906020018083116124ba57829003601f168201915b5050505050600554613499565b50505050565b60106020526000908152604090205481565b6000838152600e602052604081206002810180549192918590811061251d57fe5b90600052602060002090600b02019050600081600701848154811061253e57fe5b600091825260209091206003840154600690920201915060ff166125a9576040805162461bcd60e51b815260206004820152601960248201527f52657175657374206d757374206265207265736f6c7665642e00000000000000604482015290519081900360640190fd5b6003810154600090610100900460ff1615806125d05750600382015462010000900460ff16155b1561260157506001600160a01b03871660009081526005820160205260409020600281015460019091015401612767565b6000600884015460ff16600281111561261657fe5b14156126cb5760008083600101541161263057600061266c565b8260010154836002015460048501546001600160a01b038c1660009081526005870160205260409020929091019160010154028161266a57fe5b045b90506000808460020154116126825760006126be565b8360010154846002015460048601546001600160a01b038d166000908152600588016020526040902092909101916002015402816126bc57fe5b045b9190910191506127679050565b6008830154600090839060ff1660028111156126e357fe5b600381106126ed57fe5b0154116126fb576000612764565b6008830154829060ff16600281111561271057fe5b6003811061271a57fe5b015460048301546001600160a01b038a1660009081526005850160205260409020600886015460ff16600281111561274e57fe5b6003811061275857fe5b0154028161276257fe5b045b90505b6001600160a01b038816600081815260058401602052604080822060018101839055600201829055516108fc84150291849190818181858888f150505050505050505050505050565b60065481565b6003546001600160a01b03163314612803576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600a55565b6003546001600160a01b03163314612855576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b6040516001600160a01b038216907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a250565b6003546001600160a01b031633146128d9576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0385161790556124e460018383613a03565b60045481565b6000806000806129146139e5565b60008060006060600080600e60008e81526020019081526020016000206002018c8154811061293f57fe5b60009182526020909120600b9091020180546001820154600283015460038085015460078601546008870154600a880154604080516060810191829052999a5060ff98891699979896979487169660048c01969495908416946101009094046001600160a01b03169360098d01939288919082845b81546001600160a01b031681526001909101906020018083116129b4575050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959b5087945092508401905082828015612a5f5780601f10612a3457610100808354040283529160200191612a5f565b820191906000526020600020905b815481529060010190602001808311612a4257829003601f168201915b505050505091509a509a509a509a509a509a509a509a509a509a50509295989b9194979a5092959850565b6003546001600160a01b03163314612ad7576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600655565b60055481565b60008282604051808383808284376040519201829003909120945060009350612b0a92505050565b6000828152600e602052604090206001015460ff166003811115612b2a57fe5b14612b7c576040805162461bcd60e51b815260206004820181905260248201527f4974656d206d75737420626520616273656e7420746f2062652061646465642e604482015290519081900360640190fd5b612bbf83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060045491506134999050565b505050565b6003546001600160a01b03163314612c11576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600855565b61271081565b6003546001600160a01b03163314612c69576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600980546001019081905560408051602080825281018690526002909202917f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d918791879181908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a26009546002026001017f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a250505050565b6003546001600160a01b03163314612d95576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600755565b6003546001600160a01b03163314612de7576040805162461bcd60e51b81526020600482018190526024820152600080516020613d97833981519152604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600e602052604081206002810180549192916000198101908110612e2e57fe5b90600052602060002090600b020190506008548160020154420311612e845760405162461bcd60e51b8152600401808060200182810382526028815260200180613d096028913960400191505060405180910390fd5b805460ff1615612ec55760405162461bcd60e51b8152600401808060200182810382526023815260200180613ce66023913960400191505060405180910390fd5b6002600183015460ff166003811115612eda57fe5b1415612ef8576001828101805460ff191682805b0217905550612f77565b6003600183015460ff166003811115612f0d57fe5b1415612f2a576001808301805460009260ff199091169083612eee565b6040805162461bcd60e51b815260206004820152601860248201527f5468657265206d757374206265206120726571756573742e0000000000000000604482015290519081900360640190fd5b60038101805460ff191660019081179091556007820154600284015460408051600081526020810194909452805160001993840194929093019287927f298f9b7df751fd9e63ad99b4f83c2509c67421163d60b5cc6573f40f24abe58192908290030190a460058101546002830154612bbf916001600160a01b03169085906000190160006124fc565b6000838152600e60205260408120600281018054919291600019810190811061302657fe5b60009182526020909120600b90910201600381015490915060ff161561307d5760405162461bcd60e51b8152600401808060200182810382526029815260200180613e1d6029913960400191505060405180910390fd5b600282015460408051602080820189905260001990930181830152815180820383018152606082019283905280519084012060088501549383526080820187905292339284926101009092046001600160a01b0316917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918a918a9190819060a001848480828437600083820152604051601f909101601f19169092018290039550909350505050a4505050505050565b60008261313d5750600061315e565b8282028284828161314a57fe5b04146131585760001961315a565b805b9150505b92915050565b6000828201838110156131585760001961315a565b600080806131af856131aa8a8a600281111561319157fe5b6003811061319b57fe5b0154879063ffffffff61324916565b613994565b6001600160a01b038816600090815260058b0160205260409020919350915082908860028111156131dc57fe5b600381106131e657fe5b018054909101905581888860028111156131fc57fe5b6003811061320657fe5b0180549091019055600488018054830190556040516001600160a01b0387169082156108fc029083906000818181858888f150949b9a5050505050505050505050565b60008282111561325b5750600061315e565b5080820361315e565b336000908152600f60209081526040808320858452825280832054808452600e90925282206002810180549293919260001981019081106132a157fe5b90600052602060002090600b0201905060008460028111156132bf57fe5b905060018160028111156132cf57fe5b141561333e576002600184015460ff1660038111156132ea57fe5b1415613305576001838101805460ff19169091179055613339565b6003600184015460ff16600381111561331a57fe5b1415613339576001808401805460009260ff1990911690835b02179055505b61339c565b6002600184015460ff16600381111561335357fe5b1415613370576001808401805460009260ff199091169083613333565b6003600184015460ff16600381111561338557fe5b141561339c576001838101805460ff191690911790555b60038201805460ff191660011790558460028111156133b757fe5b60088301805460ff191660018360028111156133cf57fe5b02179055506007820154600284015460408051600180825260208201528151600019948501949093019288927f298f9b7df751fd9e63ad99b4f83c2509c67421163d60b5cc6573f40f24abe581928290030190a4600081600281111561343157fe5b141561347e5761346b6004830160015b6003811061344b57fe5b015460028501546001600160a01b039091169086906000190160006124fc565b613479600483016002613441565b613491565b6134918260040182600281111561344157fe5b505050505050565b81516020808401919091206000818152600e83526040908190206002810154825180860185905280840182905283518082038501815260609091019093528251929094019190912091929091906135fb5784516134fc9083906020880190613a81565b50600d8054600180820183557fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5909101859055905460008581526010602090815260409182902060001993840190558151818152865460029581161561010002909401909316939093049282018390528392339287927f909f6b266555a57aee2c82ba6326605749e5eb297f67e1a4ad0bc9c7f0d013ee92889291829190820190849080156135ec5780601f106135c1576101008083540402835291602001916135ec565b820191906000526020600020905b8154815290600101906020018083116135cf57829003601f168201915b50509250505060405180910390a45b600282018054600091906136128260018301613aef565b8154811061361c57fe5b600091825260208220600b909102019150600184015460ff16600381111561364057fe5b14156136665760018301805460ff1916600290811790915560095402600a82015561369d565b60018084015460ff16600381111561367a57fe5b141561369d576001838101805460ff1916600317905560095460020201600a8201555b600581018054336001600160a01b031990911617905542600280830191909155600054600883018054610100600160a81b0319166101006001600160a01b0390931683021790556001805461370393600986019382841615026000190190911604613b1b565b506007810180546000919061371b82600183016139b9565b8154811061372557fe5b60009182526020808320600886015460405163f7434ea960e01b8152600481019384526009880180546002610100600183161581026000190190921604602484018190526006979097029094019750929091046001600160a01b03169363f7434ea993918291604490910190849080156137e05780601f106137b5576101008083540402835291602001916137e0565b820191906000526020600020905b8154815290600101906020018083116137c357829003601f168201915b50509250505060206040518083038186803b1580156137fe57600080fd5b505afa158015613812573d6000803e3d6000fd5b505050506040513d602081101561382857600080fd5b50519050600061383e828963ffffffff61316416565b905061384e836001333485613179565b5080836001015410156138a8576040805162461bcd60e51b815260206004820152601e60248201527f596f75206d7573742066756c6c792066756e6420796f757220736964652e0000604482015290519081900360640190fd5b60038301805461ff001916610100179055600784015460028701546040805160008082526020820152815160001994850194909301928b927f298f9b7df751fd9e63ad99b4f83c2509c67421163d60b5cc6573f40f24abe581928290030190a4600186015460ff16600381111561391b57fe5b60028701546040516000199091019089907f3df0d1fdcd07576fccf91c63cc392d4b6facc79e6df12df6482342e3ed9d3b2090600090a460028601546040518691600019019089907f6a1ec219a182810abe6f25702d9e60eabaaf29e7d1c87bc0a778b845be86e06190600090a4505050505050505050565b600080838311156139aa575082905060006139b2565b508190508083035b9250929050565b815481835581811115612bbf57600602816006028360005260206000209182019101612bbf9190613b90565b60405180606001604052806003906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613a445782800160ff19823516178555613a71565b82800160010185558215613a71579182015b82811115613a71578235825591602001919060010190613a56565b50613a7d929150613bc8565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613ac257805160ff1916838001178555613a71565b82800160010185558215613a71579182015b82811115613a71578251825591602001919060010190613ad4565b815481835581811115612bbf57600b0281600b028360005260206000209182019101612bbf9190613be2565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613b545780548555613a71565b82800160010185558215613a7157600052602060002091601f016020900482015b82811115613a71578254825591600101919060010190613b75565b611b9e91905b80821115613a7d576000613baa8282613c61565b613bb8600383016000613c76565b5060006004820155600601613b96565b611b9e91905b80821115613a7d5760008155600101613bce565b611b9e91905b80821115613a7d57805460ff19908116825560006001830181905560028301819055600383018054909216909155613c236004830182613c61565b613c31600783016000613c7d565b6008820180546001600160a81b0319169055613c51600983016000613ca1565b506000600a820155600b01613be8565b50600081556001016000815560010160009055565b5060009055565b5080546000825560060290600052602060002090810190613c9e9190613b90565b50565b50805460018160011615610100020316600290046000825580601f10613cc75750613c9e565b601f016020900490600052602060002090810190613c9e9190613bc856fe54686520726571756573742073686f756c64206e6f742062652064697370757465642e54696d6520746f206368616c6c656e6765207468652072657175657374206d75737420706173732e436f6e747269627574696f6e73206d757374206265206d6164652077697468696e207468652061707065616c20706572696f642e54686520726571756573742073686f756c64206e6f74206861766520616c7265616479206265656e2064697370757465642e5468652063616c6c6572206d7573742062652074686520676f7665726e6f722e546865206c6f736572206d75737420636f6e7472696275746520647572696e67207468652066697273742068616c66206f66207468652061707065616c20706572696f642e5468652072657175657374206d757374206e6f74206265207265736f6c7665642e5468652064697370757465206d757374206e6f7420616c7265616479206265207265736f6c7665642e4f6e6c79207468652061726269747261746f722063616e206769766520612072756c696e674368616c6c656e676573206d757374206f6363757220647572696e6720746865206368616c6c656e676520706572696f642e4974656d206d757374206265207265676973746572656420746f2062652072656d6f7665642e412064697370757465206d7573742068617665206265656e2072616973656420746f2066756e6420616e2061707065616c2e546865206974656d206d757374206861766520612070656e64696e6720726571756573742ea265627a7a72315820d548acb594d3d7b3bb141a16e7eaa81bc8b9a9bc86907879533f2121c1bf415164736f6c6343000511003261606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7da265627a7a72315820a81b1e023f6110d38f8a12c5d62ffc1d41ab134732a0f72f1a65096e25e7bd8564736f6c63430005110032", + "devdoc": { + "methods": { + "count()": { + "return": "The number of deployed tcrs using this factory." + }, + "deploy(address,bytes,address,string,string,address,uint256,uint256,uint256,uint256,uint256,uint256[3])": { + "details": "Deploy the arbitrable curated registry.", + "params": { + "_arbitrator": "Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.", + "_arbitratorExtraData": "Extra data for the trusted arbitrator contract.", + "_challengePeriodDuration": "The time in seconds parties have to challenge a request.", + "_clearingMetaEvidence": "The URI of the meta evidence object for clearing requests.", + "_connectedTCR": "The address of the TCR that stores related TCR addresses. This parameter can be left empty.", + "_governor": "The trusted governor of this contract.", + "_registrationMetaEvidence": "The URI of the meta evidence object for registration requests.", + "_removalBaseDeposit": "The base deposit to remove an item.", + "_removalChallengeBaseDeposit": "The base deposit to challenge a removal request.", + "_stakeMultipliers": "Multipliers of the arbitration cost in basis points (see GeneralizedTCR MULTIPLIER_DIVISOR) as follows: - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when it's the first round or the arbitrator refused to arbitrate). - The multiplier applied to the winner's fee stake for an appeal round. - The multiplier applied to the loser's fee stake for an appeal round.", + "_submissionBaseDeposit": "The base deposit to submit an item.", + "_submissionChallengeBaseDeposit": "The base deposit to challenge a submission." + } + } + }, + "title": "GTCRFactory This contract acts as a registry for GeneralizedTCR instances." + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [ + { + "astId": 265, + "contract": "contracts/GTCRFactory.sol:GTCRFactory", + "label": "instances", + "offset": 0, + "slot": "0", + "type": "t_array(t_contract(GeneralizedTCR)2713)dyn_storage" + } + ], + "types": { + "t_array(t_contract(GeneralizedTCR)2713)dyn_storage": { + "base": "t_contract(GeneralizedTCR)2713", + "encoding": "dynamic_array", + "label": "contract GeneralizedTCR[]", + "numberOfBytes": "32" + }, + "t_contract(GeneralizedTCR)2713": { + "encoding": "inplace", + "label": "contract GeneralizedTCR", + "numberOfBytes": "20" + } + } + } +} diff --git a/deployments/sepolia/GeneralizedTCRView.json b/deployments/sepolia/GeneralizedTCRView.json new file mode 100644 index 0000000..9ffafd1 --- /dev/null +++ b/deployments/sepolia/GeneralizedTCRView.json @@ -0,0 +1,1159 @@ +{ + "address": "0x20E1D44c64Ec03ECe12133743bEc7019f3aAe373", + "abi": [ + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_contributor", + "type": "address" + } + ], + "name": "availableRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "rewards", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_cursorIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + }, + { + "internalType": "bool[8]", + "name": "_filter", + "type": "bool[8]" + }, + { + "internalType": "address", + "name": "_party", + "type": "address" + } + ], + "name": "countWithFilter", + "outputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "hasMore", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "fetchArbitrable", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "submissionBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "removalBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionChallengeBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "removalChallengeBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "challengePeriodDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "metaEvidenceUpdates", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "winnerStakeMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loserStakeMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharedStakeMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "MULTIPLIER_DIVISOR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "arbitrationCost", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.ArbitrableData", + "name": "result", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256[4]", + "name": "_targets", + "type": "uint256[4]" + }, + { + "internalType": "bool[9]", + "name": "_filter", + "type": "bool[9]" + }, + { + "internalType": "address", + "name": "_party", + "type": "address" + } + ], + "name": "findIndexForPage", + "outputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "hasMore", + "type": "bool" + }, + { + "internalType": "bool", + "name": "indexFound", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_rlpEncodedMatch", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_cursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + }, + { + "internalType": "bool[4]", + "name": "_skipState", + "type": "bool[4]" + }, + { + "internalType": "bool[]", + "name": "_ignoreColumns", + "type": "bool[]" + } + ], + "name": "findItem", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "ID", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealCost", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "appealStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealEnd", + "type": "uint256" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "challenger", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "currentRuling", + "type": "uint8" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "enum IArbitrator.DisputeStatus", + "name": "disputeStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.QueryResult[]", + "name": "results", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItem", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "ID", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealCost", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "appealStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealEnd", + "type": "uint256" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "challenger", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "currentRuling", + "type": "uint8" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "enum IArbitrator.DisputeStatus", + "name": "disputeStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.QueryResult", + "name": "result", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItemData", + "outputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.ItemData", + "name": "item", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItemRequests", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "challenger", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "metaEvidenceID", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.ItemRequest[]", + "name": "requests", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getLatestRequestData", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.ItemData", + "name": "item", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address payable[3]", + "name": "parties", + "type": "address[3]" + }, + { + "internalType": "uint256", + "name": "numberOfRounds", + "type": "uint256" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "contract IArbitrator", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + } + ], + "internalType": "struct GeneralizedTCRView.RequestData", + "name": "request", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getLatestRoundRequestData", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.ItemData", + "name": "item", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address payable[3]", + "name": "parties", + "type": "address[3]" + }, + { + "internalType": "uint256", + "name": "numberOfRounds", + "type": "uint256" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "contract IArbitrator", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + } + ], + "internalType": "struct GeneralizedTCRView.RequestData", + "name": "request", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.RoundData", + "name": "round", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_cursorIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + }, + { + "internalType": "bool[8]", + "name": "_filter", + "type": "bool[8]" + }, + { + "internalType": "bool", + "name": "_oldestFirst", + "type": "bool" + }, + { + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_limit", + "type": "uint256" + } + ], + "name": "queryItems", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "ID", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealCost", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "appealStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealEnd", + "type": "uint256" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "challenger", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "enum GeneralizedTCR.Party", + "name": "currentRuling", + "type": "uint8" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "enum IArbitrator.DisputeStatus", + "name": "disputeStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct GeneralizedTCRView.QueryResult[]", + "name": "results", + "type": "tuple[]" + }, + { + "internalType": "bool", + "name": "hasMore", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xc407e8e1a287f3e19026a0019136ff6fcb2a81ea35a267d9d2bc392302757386", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0x20E1D44c64Ec03ECe12133743bEc7019f3aAe373", + "transactionIndex": 35, + "gasUsed": "3855593", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4bef632fd745aa8bdcfbc197a9ea253cc7f347e563772045eab21a774a87ed0f", + "transactionHash": "0xc407e8e1a287f3e19026a0019136ff6fcb2a81ea35a267d9d2bc392302757386", + "logs": [], + "blockNumber": 4048369, + "cumulativeGasUsed": "29002847", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"}],\"name\":\"availableRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rewards\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_cursorIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"},{\"internalType\":\"bool[8]\",\"name\":\"_filter\",\"type\":\"bool[8]\"},{\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"}],\"name\":\"countWithFilter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"hasMore\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"fetchArbitrable\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"submissionBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"removalBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionChallengeBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"removalChallengeBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"challengePeriodDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"metaEvidenceUpdates\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winnerStakeMultiplier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"loserStakeMultiplier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sharedStakeMultiplier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"MULTIPLIER_DIVISOR\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arbitrationCost\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.ArbitrableData\",\"name\":\"result\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"uint256[4]\",\"name\":\"_targets\",\"type\":\"uint256[4]\"},{\"internalType\":\"bool[9]\",\"name\":\"_filter\",\"type\":\"bool[9]\"},{\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"}],\"name\":\"findIndexForPage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"hasMore\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"indexFound\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_rlpEncodedMatch\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_cursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"},{\"internalType\":\"bool[4]\",\"name\":\"_skipState\",\"type\":\"bool[4]\"},{\"internalType\":\"bool[]\",\"name\":\"_ignoreColumns\",\"type\":\"bool[]\"}],\"name\":\"findItem\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"ID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealCost\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"appealStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealEnd\",\"type\":\"uint256\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"currentRuling\",\"type\":\"uint8\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"enum IArbitrator.DisputeStatus\",\"name\":\"disputeStatus\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.QueryResult[]\",\"name\":\"results\",\"type\":\"tuple[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItem\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"ID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealCost\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"appealStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealEnd\",\"type\":\"uint256\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"currentRuling\",\"type\":\"uint8\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"enum IArbitrator.DisputeStatus\",\"name\":\"disputeStatus\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.QueryResult\",\"name\":\"result\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItemData\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.ItemData\",\"name\":\"item\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItemRequests\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"metaEvidenceID\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.ItemRequest[]\",\"name\":\"requests\",\"type\":\"tuple[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getLatestRequestData\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.ItemData\",\"name\":\"item\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address payable[3]\",\"name\":\"parties\",\"type\":\"address[3]\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRounds\",\"type\":\"uint256\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"}],\"internalType\":\"struct GeneralizedTCRView.RequestData\",\"name\":\"request\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getLatestRoundRequestData\",\"outputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.ItemData\",\"name\":\"item\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address payable[3]\",\"name\":\"parties\",\"type\":\"address[3]\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRounds\",\"type\":\"uint256\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"}],\"internalType\":\"struct GeneralizedTCRView.RequestData\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.RoundData\",\"name\":\"round\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_cursorIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"},{\"internalType\":\"bool[8]\",\"name\":\"_filter\",\"type\":\"bool[8]\"},{\"internalType\":\"bool\",\"name\":\"_oldestFirst\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_limit\",\"type\":\"uint256\"}],\"name\":\"queryItems\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"ID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealCost\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"appealStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealEnd\",\"type\":\"uint256\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"enum GeneralizedTCR.Party\",\"name\":\"currentRuling\",\"type\":\"uint8\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"enum IArbitrator.DisputeStatus\",\"name\":\"disputeStatus\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct GeneralizedTCRView.QueryResult[]\",\"name\":\"results\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"hasMore\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"availableRewards(address,bytes32,address)\":{\"details\":\"Return the withdrawable rewards for a contributor.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_contributor\":\"The address of the contributor.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The amount withdrawable per round per request.\"},\"countWithFilter(address,uint256,uint256,bool[8],address)\":{\"details\":\"Count the number of items for a given filter.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_count\":\"The number of items to return.\",\"_cursorIndex\":\"The index of the items from which to start iterating. To start from either the oldest or newest item.\",\"_filter\":\"The filter to use. Each element of the array in sequence means: - Include absent items in result; - Include registered items in result; - Include items with registration requests that are not disputed in result; - Include items with clearing requests that are not disputed in result; - Include disputed items with registration requests in result; - Include disputed items with clearing requests in result; - Include items with a request by _party; - Include items challenged by _party.\",\"_party\":\"The address to use if checking for items with a request or challenged by a specific party.\"},\"return\":\"The query result: - The number of items found for the filter; - Whether there are more items to iterate; - The index of the last item of the query. Useful as a starting point for the next query if counting in multiple steps.\"},\"fetchArbitrable(address)\":{\"details\":\"Fetch arbitrable TCR data in a single call.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\"},\"return\":\"The latest data on an arbitrable TCR contract.\"},\"findIndexForPage(address,uint256[4],bool[9],address)\":{\"details\":\"Find the index of the first item of a page of items for a given filter.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_filter\":\"The filter to use. Each element of the array in sequence means: - Include absent items in result; - Include registered items in result; - Include items with registration requests that are not disputed in result; - Include items with clearing requests that are not disputed in result; - Include disputed items with registration requests in result; - Include disputed items with clearing requests in result; - Include items with a request by _party; - Include items challenged by _party. - Whether to sort from oldest to the newest item.\",\"_party\":\"The address to use if checking for items with a request or challenged by a specific party.\",\"_targets\":\"The targets to use for the query. Each element of the array in sequence means: - The page to search; - The number of items per page; - The number of items to iterate when searching; - The position from where to start iterating.\"},\"return\":\"The query result: - Index of the page, if it was found; - Whether there are more items to iterate; - If the index of the page we are searching was found.\"},\"findItem(address,bytes,uint256,uint256,bool[4],bool[])\":{\"details\":\"Find an item by matching column values exactly. Unless specified in the _ignoreColumns parameter, finding an item requires matching all columns. - Example: Item [18, 'PNK', 'Pinakion', '0xca35b7d915458ef540ade6068dfe2f44e8fa733c'] RLP encoded: 0xe383504e4b128850696e616b696f6e94ca35b7d915458ef540ade6068dfe2f44e8fa733c Input for remix: [\\\"0xe3\\\",\\\"0x83\\\",\\\"0x50\\\",\\\"0x4e\\\",\\\"0x4b\\\",\\\"0x12\\\",\\\"0x88\\\",\\\"0x50\\\",\\\"0x69\\\",\\\"0x6e\\\",\\\"0x61\\\",\\\"0x6b\\\",\\\"0x69\\\",\\\"0x6f\\\",\\\"0x6e\\\",\\\"0x94\\\",\\\"0xca\\\",\\\"0x35\\\",\\\"0xb7\\\",\\\"0xd9\\\",\\\"0x15\\\",\\\"0x45\\\",\\\"0x8e\\\",\\\"0xf5\\\",\\\"0x40\\\",\\\"0xad\\\",\\\"0xe6\\\",\\\"0x06\\\",\\\"0x8d\\\",\\\"0xfe\\\",\\\"0x2f\\\",\\\"0x44\\\",\\\"0xe8\\\",\\\"0xfa\\\",\\\"0x73\\\",\\\"0x3c\\\"]\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_count\":\"The number of items to iterate and return while searching.\",\"_cursor\":\"The index from where to start looking for matches.\",\"_ignoreColumns\":\"Columns to ignore when searching. If this is an array with only false items, then every column must match exactly.\",\"_rlpEncodedMatch\":\"The RLP encoded item to match against the items on the list.\",\"_skipState\":\"Boolean tuple defining whether to skip items in a given state. [Absent, Registered, RegistrationRequested, ClearingRequested].\"},\"return\":\"An array with items that match the query.\"},\"getItem(address,bytes32)\":{\"details\":\"Fetch the latest data on an item in a single call.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The item data.\"},\"getItemData(address,bytes32)\":{\"details\":\"Fetch data of the an item and return a struct.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The round data.\"},\"getItemRequests(address,bytes32)\":{\"details\":\"Fetch all requests for an item.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The items requests.\"},\"getLatestRequestData(address,bytes32)\":{\"details\":\"Fetch the latest request of item.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The round data.\"},\"getLatestRoundRequestData(address,bytes32)\":{\"details\":\"Fetch the latest round of the latest request of an item.\",\"params\":{\"_address\":\"The address of the Generalized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The round data.\"},\"queryItems(address,uint256,uint256,bool[8],bool,address,uint256)\":{\"details\":\"Return the values of the items the query finds. This function is O(n), where n is the number of items. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.\",\"params\":{\"_address\":\"The address of the GTCR to query.\",\"_count\":\"The number of items to iterate.\",\"_cursorIndex\":\"The index of the items from which to start iterating. To start from either the oldest or newest item.\",\"_filter\":\"The filter to use. Each element of the array in sequence means: - Include absent items in result; - Include registered items in result; - Include items with registration requests that are not disputed in result; - Include items with clearing requests that are not disputed in result; - Include disputed items with registration requests in result; - Include disputed items with clearing requests in result; - Include items with a request by _party; - Include items challenged by _party.\",\"_limit\":\"The maximum number of items to return. If set to 0 will return _count items.\",\"_oldestFirst\":\"Whether to sort from oldest to the newest item.\",\"_party\":\"The address to use if checking for items with a request or challenged by a specific party.\"},\"return\":\"The data of the items found and whether there are more items for the current filter and sort.\"}},\"title\":\"GeneralizedTCRView A view contract to fetch, batch, parse and return GTCR contract data efficiently. This contract includes functions that can halt execution due to out-of-gas exceptions. Because of this it should never be relied upon by other contracts.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/view/GeneralizedTCRView.sol\":\"GeneralizedTCRView\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/GeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1, @mtsalenc]\\n * @reviewers: [@clesaege*, @ferittuncer, @satello*, @remedcu, @fnanni-0, @shalzz, @MerlinEgalite]\\n * @auditors: []\\n * @bounties: [{ link: https://github.com/kleros/tcr/issues/20, maxPayout: 25 ETH }]\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport { IArbitrable, IArbitrator } from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport { IEvidence } from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport { CappedMath } from \\\"./utils/CappedMath.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */ // It is the user responsibility to accept ETH.\\n\\n/**\\n * @title GeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n */\\ncontract GeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n bytes data; // The data describing the item.\\n Status status; // The current status of the item.\\n Request[] requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n bool disputed; // True if a dispute was raised.\\n uint disputeID; // ID of the dispute, if any.\\n uint submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n bool resolved; // True if the request was executed and/or any raised disputes were resolved.\\n address payable[3] parties; // Address of requester and challenger, if any, in the form parties[party].\\n Round[] rounds; // Tracks each round of a dispute in the form rounds[roundID].\\n Party ruling; // The final ruling given, if any.\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n uint metaEvidenceID; // The meta evidence to be used in a dispute for this case.\\n }\\n\\n struct Round {\\n uint[3] amountPaid; // Tracks the sum paid for each Party in this round. Includes arbitration fees, fee stakes and deposits.\\n bool[3] hasPaid; // True if the Party has fully paid its fee in this round.\\n uint feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n mapping(address => uint[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n /* Storage */\\n\\n IArbitrator public arbitrator; // The arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data for the arbitrator contract.\\n\\n uint RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n\\n address public governor; // The address that can make changes to the parameters of the contract.\\n uint public submissionBaseDeposit; // The base deposit to submit an item.\\n uint public removalBaseDeposit; // The base deposit to remove an item.\\n uint public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n uint public metaEvidenceUpdates; // The number of times the meta evidence has been updated. Used to track the latest meta evidence ID.\\n\\n // Multipliers are in basis points.\\n uint public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n bytes32[] public itemList; // List of IDs of all submitted items.\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint => bytes32)) public arbitratorDisputeIDToItem; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItem[arbitrator][disputeID].\\n mapping(bytes32 => uint) public itemIDtoIndex; // Maps an item's ID to its position in the list in the form itemIDtoIndex[itemID].\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor {require(msg.sender == governor, \\\"The caller must be the governor.\\\"); _;}\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the request.\\n * @param _roundIndex The index of the round.\\n * @param _disputed Whether the request is disputed.\\n * @param _resolved Whether the request is executed.\\n */\\n event ItemStatusChange(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n uint indexed _roundIndex,\\n bool _disputed,\\n bool _resolved\\n );\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _submitter The address of the requester.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _data The item data.\\n */\\n event ItemSubmitted(\\n bytes32 indexed _itemID,\\n address indexed _submitter,\\n uint indexed _evidenceGroupID,\\n bytes _data\\n );\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the latest request.\\n * @param _requestType Whether it is a registration or a removal request.\\n */\\n event RequestSubmitted(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n Status indexed _requestType\\n );\\n\\n /**\\n * @dev Emitted when someone submits a request. This is useful to quickly find an item and request from an evidence event and vice-versa.\\n * @param _itemID The ID of the affected item.\\n * @param _requestIndex The index of the latest request.\\n * @param _evidenceGroupID The evidence group ID used for this request.\\n */\\n event RequestEvidenceGroupID(\\n bytes32 indexed _itemID,\\n uint indexed _requestIndex,\\n uint indexed _evidenceGroupID\\n );\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal.\\n * @param _itemID The ID of the item.\\n * @param _contributor The address making the contribution.\\n * @param _request The index of the request.\\n * @param _round The index of the round receiving the contribution.\\n * @param _amount The amount of the contribution.\\n * @param _side The party receiving the contribution.\\n */\\n event AppealContribution(\\n bytes32 indexed _itemID,\\n address indexed _contributor,\\n uint indexed _request,\\n uint _round,\\n uint _amount,\\n Party _side\\n );\\n\\n /** @dev Emitted when one of the parties successfully paid its appeal fees.\\n * @param _itemID The ID of the item.\\n * @param _request The index of the request.\\n * @param _round The index of the round.\\n * @param _side The side that is fully funded.\\n */\\n event HasPaidAppealFee(\\n bytes32 indexed _itemID,\\n uint indexed _request,\\n uint indexed _round,\\n Party _side\\n );\\n\\n /** @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Deploy the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _submissionBaseDeposit The base deposit to submit an item.\\n * @param _removalBaseDeposit The base deposit to remove an item.\\n * @param _submissionChallengeBaseDeposit The base deposit to challenge a submission.\\n * @param _removalChallengeBaseDeposit The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n */\\n constructor(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n address _connectedTCR,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence,\\n address _governor,\\n uint _submissionBaseDeposit,\\n uint _removalBaseDeposit,\\n uint _submissionChallengeBaseDeposit,\\n uint _removalChallengeBaseDeposit,\\n uint _challengePeriodDuration,\\n uint[3] memory _stakeMultipliers\\n ) public {\\n emit MetaEvidence(0, _registrationMetaEvidence);\\n emit MetaEvidence(1, _clearingMetaEvidence);\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n governor = _governor;\\n submissionBaseDeposit = _submissionBaseDeposit;\\n removalBaseDeposit = _removalBaseDeposit;\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /** @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The data describing the item.\\n */\\n function addItem(bytes calldata _item) external payable {\\n bytes32 itemID = keccak256(_item);\\n require(items[itemID].status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n requestStatusChange(_item, submissionBaseDeposit);\\n }\\n\\n /** @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n require(items[_itemID].status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n Item storage item = items[_itemID];\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n // Using `length` instead of `length - 1` because a new request will be added on requestStatusChange().\\n uint requestIndex = item.requests.length;\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, requestIndex)));\\n\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n requestStatusChange(item.data, removalBaseDeposit);\\n }\\n\\n /** @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n require(\\n item.status == Status.RegistrationRequested || item.status == Status.ClearingRequested,\\n \\\"The item must have a pending request.\\\"\\n );\\n\\n Request storage request = item.requests[item.requests.length - 1];\\n require(now - request.submissionTime <= challengePeriodDuration, \\\"Challenges must occur during the challenge period.\\\");\\n require(!request.disputed, \\\"The request should not have already been disputed.\\\");\\n\\n request.parties[uint(Party.Challenger)] = msg.sender;\\n\\n Round storage round = request.rounds[0];\\n uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);\\n uint challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n uint totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n contribute(round, Party.Challenger, msg.sender, msg.value, totalCost);\\n require(round.amountPaid[uint(Party.Challenger)] >= totalCost, \\\"You must fully fund your side.\\\");\\n round.hasPaid[uint(Party.Challenger)] = true;\\n\\n // Raise a dispute.\\n request.disputeID = request.arbitrator.createDispute.value(arbitrationCost)(RULING_OPTIONS, request.arbitratorExtraData);\\n arbitratorDisputeIDToItem[address(request.arbitrator)][request.disputeID] = _itemID;\\n request.disputed = true;\\n request.rounds.length++;\\n round.feeRewards = round.feeRewards.subCap(arbitrationCost);\\n\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, item.requests.length - 1)));\\n emit Dispute(\\n request.arbitrator,\\n request.disputeID,\\n request.metaEvidenceID,\\n evidenceGroupID\\n );\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(request.arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n }\\n\\n /** @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side == Party.Requester || _side == Party.Challenger, \\\"Invalid side.\\\");\\n require(\\n items[_itemID].status == Status.RegistrationRequested || items[_itemID].status == Status.ClearingRequested,\\n \\\"The item must have a pending request.\\\"\\n );\\n Request storage request = items[_itemID].requests[items[_itemID].requests.length - 1];\\n require(request.disputed, \\\"A dispute must have been raised to fund an appeal.\\\");\\n (uint appealPeriodStart, uint appealPeriodEnd) = request.arbitrator.appealPeriod(request.disputeID);\\n require(\\n now >= appealPeriodStart && now < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n /* solium-disable indentation */\\n uint multiplier;\\n {\\n Party winner = Party(request.arbitrator.currentRuling(request.disputeID));\\n Party loser;\\n if (winner == Party.Requester)\\n loser = Party.Challenger;\\n else if (winner == Party.Challenger)\\n loser = Party.Requester;\\n require(_side != loser || (now-appealPeriodStart < (appealPeriodEnd-appealPeriodStart)/2), \\\"The loser must contribute during the first half of the appeal period.\\\");\\n\\n\\n if (_side == winner)\\n multiplier = winnerStakeMultiplier;\\n else if (_side == loser)\\n multiplier = loserStakeMultiplier;\\n else\\n multiplier = sharedStakeMultiplier;\\n }\\n /* solium-enable indentation */\\n\\n Round storage round = request.rounds[request.rounds.length - 1];\\n uint appealCost = request.arbitrator.appealCost(request.disputeID, request.arbitratorExtraData);\\n uint totalCost = appealCost.addCap((appealCost.mulCap(multiplier)) / MULTIPLIER_DIVISOR);\\n uint contribution = contribute(round, _side, msg.sender, msg.value, totalCost);\\n\\n emit AppealContribution(\\n _itemID,\\n msg.sender,\\n items[_itemID].requests.length - 1,\\n request.rounds.length - 1,\\n contribution,\\n _side\\n );\\n\\n if (round.amountPaid[uint(_side)] >= totalCost) {\\n round.hasPaid[uint(_side)] = true;\\n emit HasPaidAppealFee(_itemID, items[_itemID].requests.length - 1, request.rounds.length - 1, _side);\\n }\\n\\n // Raise appeal if both sides are fully funded.\\n if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) {\\n request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData);\\n request.rounds.length++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n\\n /** @dev Reimburses contributions if no disputes were raised. If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw from.\\n * @param _round The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(address payable _beneficiary, bytes32 _itemID, uint _request, uint _round) public {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n require(request.resolved, \\\"Request must be resolved.\\\");\\n\\n uint reward;\\n if (!round.hasPaid[uint(Party.Requester)] || !round.hasPaid[uint(Party.Challenger)]) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward = round.contributions[_beneficiary][uint(Party.Requester)] + round.contributions[_beneficiary][uint(Party.Challenger)];\\n } else if (request.ruling == Party.None) {\\n // Reimburse unspent fees proportionally if there is no winner or loser.\\n uint rewardRequester = round.amountPaid[uint(Party.Requester)] > 0\\n ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.amountPaid[uint(Party.Challenger)] + round.amountPaid[uint(Party.Requester)])\\n : 0;\\n uint rewardChallenger = round.amountPaid[uint(Party.Challenger)] > 0\\n ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.amountPaid[uint(Party.Challenger)] + round.amountPaid[uint(Party.Requester)])\\n : 0;\\n\\n reward = rewardRequester + rewardChallenger;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint(request.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.amountPaid[uint(request.ruling)]\\n : 0;\\n\\n }\\n round.contributions[_beneficiary][uint(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint(Party.Challenger)] = 0;\\n\\n _beneficiary.send(reward);\\n }\\n\\n /** @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n require(\\n now - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n require(!request.disputed, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Registered;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Absent;\\n else\\n revert(\\\"There must be a request.\\\");\\n\\n request.resolved = true;\\n emit ItemStatusChange(_itemID, item.requests.length - 1, request.rounds.length - 1, false, true);\\n\\n withdrawFeesAndRewards(request.parties[uint(Party.Requester)], _itemID, item.requests.length - 1, 0); // Automatically withdraw for the requester.\\n }\\n\\n /** @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) public {\\n Party resultRuling = Party(_ruling);\\n bytes32 itemID = arbitratorDisputeIDToItem[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n\\n Request storage request = item.requests[item.requests.length - 1];\\n Round storage round = request.rounds[request.rounds.length - 1];\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n require(address(request.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n require(!request.resolved, \\\"The request must not be resolved.\\\");\\n\\n // The ruling is inverted if the loser paid its fees.\\n 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.\\n resultRuling = Party.Requester;\\n else if (round.hasPaid[uint(Party.Challenger)] == true)\\n resultRuling = Party.Challenger;\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, uint(resultRuling));\\n executeRuling(_disputeID, uint(resultRuling));\\n }\\n\\n /** @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n require(!request.resolved, \\\"The dispute must not already be resolved.\\\");\\n\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(_itemID, item.requests.length - 1)));\\n emit Evidence(request.arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeTimeToChallenge(uint _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /** @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /** @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /** @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /** @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /** @dev Change the arbitrator to be used for disputes that may be raised. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitrator The new trusted arbitrator to be used in disputes.\\n * @param _arbitratorExtraData The extra data used by the new arbitrator.\\n */\\n function changeArbitrator(IArbitrator _arbitrator, bytes calldata _arbitratorExtraData) external onlyGovernor {\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n /** @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /** @dev Update the meta evidence used for disputes.\\n * @param _registrationMetaEvidence The meta evidence to be used for future registration request disputes.\\n * @param _clearingMetaEvidence The meta evidence to be used for future clearing request disputes.\\n */\\n function changeMetaEvidence(string calldata _registrationMetaEvidence, string calldata _clearingMetaEvidence) external onlyGovernor {\\n metaEvidenceUpdates++;\\n emit MetaEvidence(2 * metaEvidenceUpdates, _registrationMetaEvidence);\\n emit MetaEvidence(2 * metaEvidenceUpdates + 1, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /** @dev Submit a request to change item's status. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The data describing the item.\\n * @param _baseDeposit The base deposit for the request.\\n */\\n function requestStatusChange(bytes memory _item, uint _baseDeposit) internal {\\n bytes32 itemID = keccak256(_item);\\n Item storage item = items[itemID];\\n\\n // Using `length` instead of `length - 1` as index because a new request will be added.\\n uint evidenceGroupID = uint(keccak256(abi.encodePacked(itemID, item.requests.length)));\\n if (item.requests.length == 0) {\\n item.data = _item;\\n itemList.push(itemID);\\n itemIDtoIndex[itemID] = itemList.length - 1;\\n\\n emit ItemSubmitted(itemID, msg.sender, evidenceGroupID, item.data);\\n }\\n\\n Request storage request = item.requests[item.requests.length++];\\n if (item.status == Status.Absent) {\\n item.status = Status.RegistrationRequested;\\n request.metaEvidenceID = 2 * metaEvidenceUpdates;\\n } else if (item.status == Status.Registered) {\\n item.status = Status.ClearingRequested;\\n request.metaEvidenceID = 2 * metaEvidenceUpdates + 1;\\n }\\n\\n request.parties[uint(Party.Requester)] = msg.sender;\\n request.submissionTime = now;\\n request.arbitrator = arbitrator;\\n request.arbitratorExtraData = arbitratorExtraData;\\n\\n Round storage round = request.rounds[request.rounds.length++];\\n\\n uint arbitrationCost = request.arbitrator.arbitrationCost(request.arbitratorExtraData);\\n uint totalCost = arbitrationCost.addCap(_baseDeposit);\\n contribute(round, Party.Requester, msg.sender, msg.value, totalCost);\\n require(round.amountPaid[uint(Party.Requester)] >= totalCost, \\\"You must fully fund your side.\\\");\\n round.hasPaid[uint(Party.Requester)] = true;\\n\\n emit ItemStatusChange(itemID, item.requests.length - 1, request.rounds.length - 1, false, false);\\n emit RequestSubmitted(itemID, item.requests.length - 1, item.status);\\n emit RequestEvidenceGroupID(itemID, item.requests.length - 1, evidenceGroupID);\\n }\\n\\n /** @dev Returns the contribution value and remainder from available ETH and required amount.\\n * @param _available The amount of ETH available for the contribution.\\n * @param _requiredAmount The amount of ETH required for the contribution.\\n * @return taken The amount of ETH taken.\\n * @return remainder The amount of ETH left from the contribution.\\n */\\n function calculateContribution(uint _available, uint _requiredAmount)\\n internal\\n pure\\n returns(uint taken, uint remainder)\\n {\\n if (_requiredAmount > _available)\\n return (_available, 0); // Take whatever is available, return 0 as leftover ETH.\\n else\\n return (_requiredAmount, _available - _requiredAmount);\\n }\\n\\n /** @dev Make a fee contribution.\\n * @param _round The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(Round storage _round, Party _side, address payable _contributor, uint _amount, uint _totalRequired) internal returns (uint) {\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint contribution; // Amount contributed.\\n uint remainingETH; // Remaining ETH to send back.\\n (contribution, remainingETH) = calculateContribution(_amount, _totalRequired.subCap(_round.amountPaid[uint(_side)]));\\n _round.contributions[_contributor][uint(_side)] += contribution;\\n _round.amountPaid[uint(_side)] += contribution;\\n _round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n _contributor.send(remainingETH); // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n\\n return contribution;\\n }\\n\\n /** @dev Execute the ruling of a dispute.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function executeRuling(uint _disputeID, uint _ruling) internal {\\n bytes32 itemID = arbitratorDisputeIDToItem[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n Request storage request = item.requests[item.requests.length - 1];\\n\\n Party winner = Party(_ruling);\\n\\n if (winner == Party.Requester) { // Execute Request.\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Registered;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Absent;\\n } else {\\n if (item.status == Status.RegistrationRequested)\\n item.status = Status.Absent;\\n else if (item.status == Status.ClearingRequested)\\n item.status = Status.Registered;\\n }\\n\\n request.resolved = true;\\n request.ruling = Party(_ruling);\\n\\n emit ItemStatusChange(itemID, item.requests.length - 1, request.rounds.length - 1, true, true);\\n\\n // Automatically withdraw first deposits and reimbursements (first round only).\\n if (winner == Party.None) {\\n withdrawFeesAndRewards(request.parties[uint(Party.Requester)], itemID, item.requests.length - 1, 0);\\n withdrawFeesAndRewards(request.parties[uint(Party.Challenger)], itemID, item.requests.length - 1, 0);\\n } else {\\n withdrawFeesAndRewards(request.parties[uint(winner)], itemID, item.requests.length - 1, 0);\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /** @dev Returns the number of items that were submitted. Includes items that never made it to the list or were later removed.\\n * @return count The number of items on the list.\\n */\\n function itemCount() external view returns (uint count) {\\n return itemList.length;\\n }\\n\\n /** @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _request The request to query.\\n * @param _round The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint _request,\\n uint _round,\\n address _contributor\\n ) external view returns(uint[3] memory contributions) {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /** @dev Returns item's information. Includes length of requests array.\\n * @param _itemID The ID of the queried item.\\n * @return data The data describing the item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Length of list of status change requests made for the item.\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n bytes memory data,\\n Status status,\\n uint numberOfRequests\\n )\\n {\\n Item storage item = items[_itemID];\\n return (\\n item.data,\\n item.status,\\n item.requests.length\\n );\\n }\\n\\n /** @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _request The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any..\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint _request)\\n external\\n view\\n returns (\\n bool disputed,\\n uint disputeID,\\n uint submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint numberOfRounds,\\n Party ruling,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_request];\\n return (\\n request.disputed,\\n request.disputeID,\\n request.submissionTime,\\n request.resolved,\\n request.parties,\\n request.rounds.length,\\n request.ruling,\\n request.arbitrator,\\n request.arbitratorExtraData,\\n request.metaEvidenceID\\n );\\n }\\n\\n /** @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _request The request to be queried.\\n * @param _round The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(bytes32 _itemID, uint _request, uint _round)\\n external\\n view\\n returns (\\n bool appealed,\\n uint[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n Request storage request = item.requests[_request];\\n Round storage round = request.rounds[_round];\\n return (\\n _round != (request.rounds.length - 1),\\n round.amountPaid,\\n round.hasPaid,\\n round.feeRewards\\n );\\n }\\n}\\n\",\"keccak256\":\"0xea6a9de52c72e2b3263dbfbd28b3344e0cb1eaa6f1b69313a177b6aaa7a92cbc\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"},\"contracts/view/GeneralizedTCRView.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\npragma experimental ABIEncoderV2;\\n\\nimport { GeneralizedTCR, IArbitrator } from \\\"../GeneralizedTCR.sol\\\";\\nimport { BytesLib } from \\\"solidity-bytes-utils/contracts/BytesLib.sol\\\";\\nimport { RLPReader } from \\\"solidity-rlp/contracts/RLPReader.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */ // It is the user responsibility to accept ETH.\\n\\n/**\\n * @title GeneralizedTCRView\\n * A view contract to fetch, batch, parse and return GTCR contract data efficiently.\\n * This contract includes functions that can halt execution due to out-of-gas exceptions. Because of this it should never be relied upon by other contracts.\\n */\\ncontract GeneralizedTCRView {\\n using RLPReader for RLPReader.RLPItem;\\n using RLPReader for bytes;\\n using BytesLib for bytes;\\n\\n struct QueryResult {\\n bytes32 ID;\\n bytes data;\\n GeneralizedTCR.Status status;\\n bool disputed;\\n bool resolved;\\n uint disputeID;\\n uint appealCost;\\n bool appealed;\\n uint appealStart;\\n uint appealEnd;\\n GeneralizedTCR.Party ruling;\\n address requester;\\n address challenger;\\n address arbitrator;\\n bytes arbitratorExtraData;\\n GeneralizedTCR.Party currentRuling;\\n bool[3] hasPaid;\\n uint feeRewards;\\n uint submissionTime;\\n uint[3] amountPaid;\\n IArbitrator.DisputeStatus disputeStatus;\\n uint numberOfRequests;\\n }\\n\\n struct ArbitrableData {\\n address governor;\\n address arbitrator;\\n bytes arbitratorExtraData;\\n uint submissionBaseDeposit;\\n uint removalBaseDeposit;\\n uint submissionChallengeBaseDeposit;\\n uint removalChallengeBaseDeposit;\\n uint challengePeriodDuration;\\n uint metaEvidenceUpdates;\\n uint winnerStakeMultiplier;\\n uint loserStakeMultiplier;\\n uint sharedStakeMultiplier;\\n uint MULTIPLIER_DIVISOR;\\n uint arbitrationCost;\\n }\\n\\n /** @dev Fetch arbitrable TCR data in a single call.\\n * @param _address The address of the Generalized TCR to query.\\n * @return The latest data on an arbitrable TCR contract.\\n */\\n function fetchArbitrable(address _address) external view returns (ArbitrableData memory result) {\\n GeneralizedTCR tcr = GeneralizedTCR(_address);\\n result.governor = tcr.governor();\\n result.arbitrator = address(tcr.arbitrator());\\n result.arbitratorExtraData = tcr.arbitratorExtraData();\\n result.submissionBaseDeposit = tcr.submissionBaseDeposit();\\n result.removalBaseDeposit = tcr.removalBaseDeposit();\\n result.submissionChallengeBaseDeposit = tcr.submissionChallengeBaseDeposit();\\n result.removalChallengeBaseDeposit = tcr.removalChallengeBaseDeposit();\\n result.challengePeriodDuration = tcr.challengePeriodDuration();\\n result.metaEvidenceUpdates = tcr.metaEvidenceUpdates();\\n result.winnerStakeMultiplier = tcr.winnerStakeMultiplier();\\n result.loserStakeMultiplier = tcr.loserStakeMultiplier();\\n result.sharedStakeMultiplier = tcr.sharedStakeMultiplier();\\n result.MULTIPLIER_DIVISOR = tcr.MULTIPLIER_DIVISOR();\\n result.arbitrationCost = IArbitrator(result.arbitrator).arbitrationCost(result.arbitratorExtraData);\\n }\\n\\n /** @dev Fetch the latest data on an item in a single call.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The item data.\\n */\\n function getItem(address _address, bytes32 _itemID) public view returns (QueryResult memory result) {\\n RoundData memory round = getLatestRoundRequestData(_address, _itemID);\\n result = QueryResult({\\n ID: _itemID,\\n data: round.request.item.data,\\n status: round.request.item.status,\\n disputed: round.request.disputed,\\n resolved: round.request.resolved,\\n disputeID: round.request.disputeID,\\n appealCost: 0,\\n appealed: round.appealed,\\n appealStart: 0,\\n appealEnd: 0,\\n ruling: round.request.ruling,\\n requester: round.request.parties[uint(GeneralizedTCR.Party.Requester)],\\n challenger: round.request.parties[uint(GeneralizedTCR.Party.Challenger)],\\n arbitrator: address(round.request.arbitrator),\\n arbitratorExtraData: round.request.arbitratorExtraData,\\n currentRuling: GeneralizedTCR.Party.None,\\n hasPaid: round.hasPaid,\\n feeRewards: round.feeRewards,\\n submissionTime: round.request.submissionTime,\\n amountPaid: round.amountPaid,\\n disputeStatus: IArbitrator.DisputeStatus.Waiting,\\n numberOfRequests: round.request.item.numberOfRequests\\n });\\n if (round.request.disputed && round.request.arbitrator.disputeStatus(result.disputeID) == IArbitrator.DisputeStatus.Appealable) {\\n result.currentRuling = GeneralizedTCR.Party(round.request.arbitrator.currentRuling(result.disputeID));\\n result.disputeStatus = round.request.arbitrator.disputeStatus(result.disputeID);\\n (result.appealStart, result.appealEnd) = round.request.arbitrator.appealPeriod(result.disputeID);\\n result.appealCost = round.request.arbitrator.appealCost(result.disputeID, result.arbitratorExtraData);\\n }\\n }\\n\\n struct ItemRequest {\\n bool disputed;\\n uint disputeID;\\n uint submissionTime;\\n bool resolved;\\n address requester;\\n address challenger;\\n address arbitrator;\\n bytes arbitratorExtraData;\\n uint metaEvidenceID;\\n }\\n\\n /** @dev Fetch all requests for an item.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The items requests.\\n */\\n function getItemRequests(address _address, bytes32 _itemID) external view returns (ItemRequest[] memory requests) {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n ItemData memory itemData = getItemData(_address, _itemID);\\n requests = new ItemRequest[](itemData.numberOfRequests);\\n for (uint i = 0; i < itemData.numberOfRequests; i++) {\\n (\\n bool disputed,\\n uint disputeID,\\n uint submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n ,\\n ,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint metaEvidenceID\\n ) = gtcr.getRequestInfo(_itemID, i);\\n\\n // Sort requests by newest first.\\n requests[itemData.numberOfRequests - i - 1] = ItemRequest({\\n disputed: disputed,\\n disputeID: disputeID,\\n submissionTime: submissionTime,\\n resolved: resolved,\\n requester: parties[uint(GeneralizedTCR.Party.Requester)],\\n challenger: parties[uint(GeneralizedTCR.Party.Challenger)],\\n arbitrator: address(arbitrator),\\n arbitratorExtraData: arbitratorExtraData,\\n metaEvidenceID: metaEvidenceID\\n });\\n }\\n }\\n\\n /** @dev Find an item by matching column values exactly. Unless specified in the _ignoreColumns parameter, finding an item requires matching all columns.\\n * - Example:\\n * Item [18, 'PNK', 'Pinakion', '0xca35b7d915458ef540ade6068dfe2f44e8fa733c']\\n * RLP encoded: 0xe383504e4b128850696e616b696f6e94ca35b7d915458ef540ade6068dfe2f44e8fa733c\\n * Input for remix: [\\\"0xe3\\\",\\\"0x83\\\",\\\"0x50\\\",\\\"0x4e\\\",\\\"0x4b\\\",\\\"0x12\\\",\\\"0x88\\\",\\\"0x50\\\",\\\"0x69\\\",\\\"0x6e\\\",\\\"0x61\\\",\\\"0x6b\\\",\\\"0x69\\\",\\\"0x6f\\\",\\\"0x6e\\\",\\\"0x94\\\",\\\"0xca\\\",\\\"0x35\\\",\\\"0xb7\\\",\\\"0xd9\\\",\\\"0x15\\\",\\\"0x45\\\",\\\"0x8e\\\",\\\"0xf5\\\",\\\"0x40\\\",\\\"0xad\\\",\\\"0xe6\\\",\\\"0x06\\\",\\\"0x8d\\\",\\\"0xfe\\\",\\\"0x2f\\\",\\\"0x44\\\",\\\"0xe8\\\",\\\"0xfa\\\",\\\"0x73\\\",\\\"0x3c\\\"]\\n * @param _address The address of the Generalized TCR to query.\\n * @param _rlpEncodedMatch The RLP encoded item to match against the items on the list.\\n * @param _cursor The index from where to start looking for matches.\\n * @param _count The number of items to iterate and return while searching.\\n * @param _skipState Boolean tuple defining whether to skip items in a given state. [Absent, Registered, RegistrationRequested, ClearingRequested].\\n * @param _ignoreColumns Columns to ignore when searching. If this is an array with only false items, then every column must match exactly.\\n * @return An array with items that match the query.\\n */\\n function findItem(\\n address _address,\\n bytes memory _rlpEncodedMatch,\\n uint _cursor,\\n uint _count,\\n bool[4] memory _skipState,\\n bool[] memory _ignoreColumns\\n )\\n public\\n view\\n returns (QueryResult[] memory results)\\n {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n RLPReader.RLPItem[] memory matchItem = _rlpEncodedMatch.toRlpItem().toList();\\n results = new QueryResult[](_count == 0 ? gtcr.itemCount() : _count);\\n uint itemsFound;\\n\\n for(uint i = _cursor; i < (_count == 0 ? gtcr.itemCount() : _count); i++) { // Iterate over every item in storage.\\n QueryResult memory item = getItem(_address, gtcr.itemList(i));\\n if (_skipState[uint(item.status)])\\n continue;\\n\\n RLPReader.RLPItem[] memory itemData = item.data.toRlpItem().toList();\\n bool itemFound = true;\\n for (uint j = 0; j < matchItem.length; j++) { // Iterate over every column.\\n if (!_ignoreColumns[j] && !itemData[j].toBytes().equal(matchItem[j].toBytes())) {\\n // This column should not be ignored and it did not match input. Item not found.\\n itemFound = false;\\n break;\\n }\\n }\\n\\n // All not ignored columns matched, item found. Add it\\n if (itemFound) {\\n results[itemsFound] = item;\\n itemsFound++;\\n }\\n }\\n\\n return results;\\n }\\n\\n /** @dev Find the index of the first item of a page of items for a given filter.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _targets The targets to use for the query. Each element of the array in sequence means:\\n * - The page to search;\\n * - The number of items per page;\\n * - The number of items to iterate when searching;\\n * - The position from where to start iterating.\\n * @param _filter The filter to use. Each element of the array in sequence means:\\n * - Include absent items in result;\\n * - Include registered items in result;\\n * - Include items with registration requests that are not disputed in result;\\n * - Include items with clearing requests that are not disputed in result;\\n * - Include disputed items with registration requests in result;\\n * - Include disputed items with clearing requests in result;\\n * - Include items with a request by _party;\\n * - Include items challenged by _party.\\n * - Whether to sort from oldest to the newest item.\\n * @param _party The address to use if checking for items with a request or challenged by a specific party.\\n * @return The query result:\\n * - Index of the page, if it was found;\\n * - Whether there are more items to iterate;\\n * - If the index of the page we are searching was found.\\n */\\n function findIndexForPage(\\n address _address,\\n uint[4] calldata _targets,\\n bool[9] calldata _filter,\\n address _party\\n )\\n external\\n view\\n returns (uint index, bool hasMore, bool indexFound)\\n {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n uint count = _targets[2];\\n uint currPage = 1;\\n uint itemsMatched = 0;\\n\\n if (gtcr.itemCount() == 0) return (0, false, true);\\n\\n // Start iterating from the end if the _cursorIndex is 0 and _oldestFirst is false.\\n // Keep the cursor as is otherwise.\\n uint i = _filter[8] ? _targets[3] : _targets[3] == 0 ? gtcr.itemCount() - 1 : _targets[3];\\n\\n for(; _filter[8] ? i < gtcr.itemCount() && count > 0 : i >= 0 && count > 0; ) {\\n bytes32 itemID = gtcr.itemList(i);\\n QueryResult memory item = getItem(_address, itemID);\\n hasMore = true;\\n if (\\n (_filter[0] && item.status == GeneralizedTCR.Status.Absent) ||\\n (_filter[1] && item.status == GeneralizedTCR.Status.Registered) ||\\n (_filter[2] && item.status == GeneralizedTCR.Status.RegistrationRequested && !item.disputed) ||\\n (_filter[3] && item.status == GeneralizedTCR.Status.ClearingRequested && !item.disputed) ||\\n (_filter[4] && item.status == GeneralizedTCR.Status.RegistrationRequested && item.disputed) ||\\n (_filter[5] && item.status == GeneralizedTCR.Status.ClearingRequested && item.disputed) ||\\n (_filter[6] && item.requester == _party) ||\\n (_filter[7] && item.challenger == _party)\\n ) {\\n itemsMatched++;\\n if (itemsMatched % _targets[1] == 0) {\\n currPage++;\\n if (currPage == _targets[0]){\\n if ((i == 0 && !_filter[8]) || (i == gtcr.itemCount() - 1 && _filter[8])) hasMore = false;\\n return (_filter[8] ? i + 1 : i - 1, hasMore, true);\\n }\\n }\\n }\\n count--;\\n if (count == 0 || (i == 0 && !_filter[8]) || (i == gtcr.itemCount() - 1 && _filter[8])) {\\n hasMore = _filter[8] ? i < gtcr.itemCount() : i > 0;\\n break;\\n }\\n // Move cursor to the left or right depending on _oldestFirst.\\n // Also prevents underflow if the cursor is at the first item.\\n i = _filter[8] ? i + 1 : i == 0 ? 0 : i - 1;\\n }\\n\\n // If sorting by oldest first, and not enough items were found to fill a page, return the cursor index.\\n if (_filter[8] && _targets[3] + _targets[1] > _targets[3] + i) {\\n i = _targets[3];\\n }\\n return (i, hasMore, false);\\n }\\n\\n /** @dev Count the number of items for a given filter.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _cursorIndex The index of the items from which to start iterating. To start from either the oldest or newest item.\\n * @param _count The number of items to return.\\n * @param _filter The filter to use. Each element of the array in sequence means:\\n * - Include absent items in result;\\n * - Include registered items in result;\\n * - Include items with registration requests that are not disputed in result;\\n * - Include items with clearing requests that are not disputed in result;\\n * - Include disputed items with registration requests in result;\\n * - Include disputed items with clearing requests in result;\\n * - Include items with a request by _party;\\n * - Include items challenged by _party.\\n * @param _party The address to use if checking for items with a request or challenged by a specific party.\\n * @return The query result:\\n * - The number of items found for the filter;\\n * - Whether there are more items to iterate;\\n * - The index of the last item of the query. Useful as a starting point for the next query if counting in multiple steps.\\n */\\n function countWithFilter(address _address, uint _cursorIndex, uint _count, bool[8] calldata _filter, address _party)\\n external\\n view\\n returns (uint count, bool hasMore, uint)\\n {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n if (gtcr.itemCount() == 0) return (0, false, 0);\\n\\n uint iterations = 0;\\n for (uint i = _cursorIndex; iterations <= _count && i < gtcr.itemCount(); i++) {\\n bytes32 itemID = gtcr.itemList(i);\\n QueryResult memory item = getItem(_address, itemID);\\n if (\\n (_filter[0] && item.status == GeneralizedTCR.Status.Absent) ||\\n (_filter[1] && item.status == GeneralizedTCR.Status.Registered) ||\\n (_filter[2] && item.status == GeneralizedTCR.Status.RegistrationRequested && !item.disputed) ||\\n (_filter[3] && item.status == GeneralizedTCR.Status.ClearingRequested && !item.disputed) ||\\n (_filter[4] && item.status == GeneralizedTCR.Status.RegistrationRequested && item.disputed) ||\\n (_filter[5] && item.status == GeneralizedTCR.Status.ClearingRequested && item.disputed) ||\\n (_filter[6] && item.requester == _party) ||\\n (_filter[7] && item.challenger == _party)\\n ) {\\n count++;\\n if (iterations >= _count) {\\n return (count, true, i);\\n }\\n }\\n iterations++;\\n }\\n }\\n\\n /** @dev Return the values of the items the query finds. This function is O(n), where n is the number of items. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.\\n * @param _address The address of the GTCR to query.\\n * @param _cursorIndex The index of the items from which to start iterating. To start from either the oldest or newest item.\\n * @param _count The number of items to iterate.\\n * @param _filter The filter to use. Each element of the array in sequence means:\\n * - Include absent items in result;\\n * - Include registered items in result;\\n * - Include items with registration requests that are not disputed in result;\\n * - Include items with clearing requests that are not disputed in result;\\n * - Include disputed items with registration requests in result;\\n * - Include disputed items with clearing requests in result;\\n * - Include items with a request by _party;\\n * - Include items challenged by _party.\\n * @param _oldestFirst Whether to sort from oldest to the newest item.\\n * @param _party The address to use if checking for items with a request or challenged by a specific party.\\n * @param _limit The maximum number of items to return. If set to 0 will return _count items.\\n * @return The data of the items found and whether there are more items for the current filter and sort.\\n */\\n function queryItems(\\n address _address,\\n uint _cursorIndex,\\n uint _count,\\n bool[8] calldata _filter,\\n bool _oldestFirst,\\n address _party,\\n uint _limit\\n )\\n external\\n view\\n returns (QueryResult[] memory results, bool hasMore)\\n {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n results = new QueryResult[](_count);\\n uint index = 0;\\n uint count = _count;\\n if (_limit == 0) _limit = count;\\n\\n if (gtcr.itemCount() == 0) return (results, false);\\n\\n // Start iterating from the end if the _cursorIndex is 0 and _oldestFirst is false.\\n // Keep the cursor as is otherwise.\\n uint i = _oldestFirst ? _cursorIndex : _cursorIndex == 0 ? gtcr.itemCount() - 1 : _cursorIndex;\\n\\n for(; _oldestFirst ? i < gtcr.itemCount() && count > 0 : i >= 0 && count > 0; ) {\\n bytes32 itemID = gtcr.itemList(i);\\n QueryResult memory item = getItem(_address, itemID);\\n hasMore = true;\\n if (\\n (_filter[0] && item.status == GeneralizedTCR.Status.Absent) ||\\n (_filter[1] && item.status == GeneralizedTCR.Status.Registered) ||\\n (_filter[2] && item.status == GeneralizedTCR.Status.RegistrationRequested && !item.disputed) ||\\n (_filter[3] && item.status == GeneralizedTCR.Status.ClearingRequested && !item.disputed) ||\\n (_filter[4] && item.status == GeneralizedTCR.Status.RegistrationRequested && item.disputed) ||\\n (_filter[5] && item.status == GeneralizedTCR.Status.ClearingRequested && item.disputed) ||\\n (_filter[6] && item.requester == _party) ||\\n (_filter[7] && item.challenger == _party)\\n ) {\\n results[index] = item;\\n index++;\\n if (index == _limit) break;\\n }\\n count--;\\n if (count == 0 || (i == 0 && !_oldestFirst) || (i == gtcr.itemCount() - 1 && _oldestFirst)) {\\n hasMore = _oldestFirst ? i < gtcr.itemCount() - 1 : i > 0;\\n break;\\n }\\n // Move cursor to the left or right depending on _oldestFirst.\\n // Also prevents underflow if the cursor is at the first item.\\n i = _oldestFirst ? i + 1 : i == 0 ? 0 : i - 1;\\n }\\n }\\n\\n /** @dev Return the withdrawable rewards for a contributor.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @param _contributor The address of the contributor.\\n * @return The amount withdrawable per round per request.\\n */\\n function availableRewards(address _address, bytes32 _itemID, address _contributor) external view returns (uint rewards) {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n\\n // Using arrays to avoid stack limit.\\n uint[2] memory requestRoundCount = [uint(0), uint(0)];\\n uint[2] memory indexes = [uint(0), uint(0)]; // Request index and round index.\\n\\n (,,requestRoundCount[0]) = gtcr.getItemInfo(_itemID);\\n for (indexes[0]; indexes[0] < requestRoundCount[0]; indexes[0]++) {\\n GeneralizedTCR.Party ruling;\\n bool resolved;\\n (,,, resolved,, requestRoundCount[1], ruling,,,) = gtcr.getRequestInfo(_itemID, indexes[0]);\\n if (!resolved) continue;\\n for (indexes[1]; indexes[1] < requestRoundCount[1]; indexes[1]++) {\\n (\\n ,\\n uint[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint feeRewards\\n ) = gtcr.getRoundInfo(_itemID, indexes[0], indexes[1]);\\n\\n uint[3] memory roundContributions = gtcr.getContributions(_itemID, indexes[0], indexes[1], _contributor);\\n if (!hasPaid[uint(GeneralizedTCR.Party.Requester)] || !hasPaid[uint(GeneralizedTCR.Party.Challenger)]) {\\n // Amount reimbursable if not enough fees were raised to appeal the ruling.\\n rewards += roundContributions[uint(GeneralizedTCR.Party.Requester)] + roundContributions[uint(GeneralizedTCR.Party.Challenger)];\\n } else if (ruling == GeneralizedTCR.Party.None) {\\n // Reimbursable fees proportional if there aren't a winner and loser.\\n rewards += amountPaid[uint(GeneralizedTCR.Party.Requester)] > 0\\n ? (roundContributions[uint(GeneralizedTCR.Party.Requester)] * feeRewards) / (amountPaid[uint(GeneralizedTCR.Party.Challenger)] + amountPaid[uint(GeneralizedTCR.Party.Requester)])\\n : 0;\\n rewards += amountPaid[uint(GeneralizedTCR.Party.Challenger)] > 0\\n ? (roundContributions[uint(GeneralizedTCR.Party.Challenger)] * feeRewards) / (amountPaid[uint(GeneralizedTCR.Party.Challenger)] + amountPaid[uint(GeneralizedTCR.Party.Requester)])\\n : 0;\\n } else {\\n // Contributors to the winner take the rewards.\\n rewards += amountPaid[uint(ruling)] > 0\\n ? (roundContributions[uint(ruling)] * feeRewards) / amountPaid[uint(ruling)]\\n : 0;\\n }\\n }\\n indexes[1] = 0;\\n }\\n }\\n\\n\\n // Functions and structs below used mainly to avoid stack limit.\\n struct ItemData {\\n bytes data;\\n GeneralizedTCR.Status status;\\n uint numberOfRequests;\\n }\\n\\n struct RequestData {\\n ItemData item;\\n bool disputed;\\n uint disputeID;\\n uint submissionTime;\\n bool resolved;\\n address payable[3] parties;\\n uint numberOfRounds;\\n GeneralizedTCR.Party ruling;\\n IArbitrator arbitrator;\\n bytes arbitratorExtraData;\\n }\\n\\n struct RoundData {\\n RequestData request;\\n bool appealed;\\n uint[3] amountPaid;\\n bool[3] hasPaid;\\n uint feeRewards;\\n }\\n\\n /** @dev Fetch data of the an item and return a struct.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The round data.\\n */\\n function getItemData(address _address, bytes32 _itemID) public view returns(ItemData memory item) {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n (\\n bytes memory data,\\n GeneralizedTCR.Status status,\\n uint numberOfRequests\\n ) = gtcr.getItemInfo(_itemID);\\n item = ItemData(data, status, numberOfRequests);\\n }\\n\\n /** @dev Fetch the latest request of item.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The round data.\\n */\\n function getLatestRequestData(address _address, bytes32 _itemID) public view returns (RequestData memory request) {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n ItemData memory item = getItemData(_address, _itemID);\\n (\\n bool disputed,\\n uint disputeID,\\n uint submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint numberOfRounds,\\n GeneralizedTCR.Party ruling,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n ) = gtcr.getRequestInfo(_itemID, item.numberOfRequests - 1);\\n request = RequestData(\\n item,\\n disputed,\\n disputeID,\\n submissionTime,\\n resolved,\\n parties,\\n numberOfRounds,\\n ruling,\\n arbitrator,\\n arbitratorExtraData\\n );\\n }\\n\\n /** @dev Fetch the latest round of the latest request of an item.\\n * @param _address The address of the Generalized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The round data.\\n */\\n function getLatestRoundRequestData(address _address, bytes32 _itemID) public view returns (RoundData memory round) {\\n GeneralizedTCR gtcr = GeneralizedTCR(_address);\\n RequestData memory request = getLatestRequestData(_address, _itemID);\\n (\\n bool appealed,\\n uint[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint feeRewards\\n ) = gtcr.getRoundInfo(_itemID, request.item.numberOfRequests - 1, request.numberOfRounds - 1);\\n round = RoundData(\\n request,\\n appealed,\\n amountPaid,\\n hasPaid,\\n feeRewards\\n );\\n }\\n}\\n\",\"keccak256\":\"0x079fbe6863afa66fdda904d90faf430c21e36851f7a081b4b493763c742c9852\"},\"solidity-bytes-utils/contracts/BytesLib.sol\":{\"content\":\"/*\\n * @title Solidity Bytes Arrays Utils\\n * @author Gon\\u00e7alo S\\u00e1 \\n *\\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\\n */\\n\\npragma solidity ^0.5.0;\\n\\n\\nlibrary BytesLib {\\n function concat(\\n bytes memory _preBytes,\\n bytes memory _postBytes\\n )\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add \\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(0x40, and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n ))\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes_slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes_slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes_slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes_slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(\\n fslot,\\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\\n ),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes_slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes_slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n \\n for { \\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(\\n bytes memory _bytes,\\n uint _start,\\n uint _length\\n )\\n internal\\n pure\\n returns (bytes memory)\\n {\\n require(_bytes.length >= (_start + _length));\\n\\n bytes memory tempBytes;\\n\\n assembly {\\n switch iszero(_length)\\n case 0 {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // The first word of the slice result is potentially a partial\\n // word read from the original array. To read it, we calculate\\n // the length of that partial word and start copying that many\\n // bytes into the array. The first word we copy will start with\\n // data we don't care about, but the last `lengthmod` bytes will\\n // land at the beginning of the contents of the new array. When\\n // we're done copying, we overwrite the full first word with\\n // the actual length of the slice.\\n let lengthmod := and(_length, 31)\\n\\n // The multiplication in the next line is necessary\\n // because when slicing multiples of 32 bytes (lengthmod == 0)\\n // the following copy loop was copying the origin's length\\n // and then ending prematurely not copying everything it should.\\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n let end := add(mc, _length)\\n\\n for {\\n // The multiplication in the next line has the same exact purpose\\n // as the one above.\\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n mstore(tempBytes, _length)\\n\\n //update free-memory pointer\\n //allocating the array padded to 32 bytes like the compiler does now\\n mstore(0x40, and(add(mc, 31), not(31)))\\n }\\n //if we want a zero-length slice let's just return a zero-length array\\n default {\\n tempBytes := mload(0x40)\\n\\n mstore(0x40, add(tempBytes, 0x20))\\n }\\n }\\n\\n return tempBytes;\\n }\\n\\n function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {\\n require(_bytes.length >= (_start + 20));\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {\\n require(_bytes.length >= (_start + 1));\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {\\n require(_bytes.length >= (_start + 2));\\n uint16 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x2), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {\\n require(_bytes.length >= (_start + 4));\\n uint32 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x4), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {\\n require(_bytes.length >= (_start + 8));\\n uint64 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x8), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {\\n require(_bytes.length >= (_start + 12));\\n uint96 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0xc), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {\\n require(_bytes.length >= (_start + 16));\\n uint128 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x10), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {\\n require(_bytes.length >= (_start + 32));\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {\\n require(_bytes.length >= (_start + 32));\\n bytes32 tempBytes32;\\n\\n assembly {\\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempBytes32;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(\\n bytes storage _preBytes,\\n bytes memory _postBytes\\n )\\n internal\\n view\\n returns (bool)\\n {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes_slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes_slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n for {} eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n}\\n\",\"keccak256\":\"0xde793835499803e9a2b59683de8bca5b77e2c4dc63748cf8b72973193e65e656\"},\"solidity-rlp/contracts/RLPReader.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n\\n/*\\n* @author Hamdi Allam hamdi.allam97@gmail.com\\n* Please reach out with any questions or concerns\\n*/\\npragma solidity >=0.5.0 <0.7.0;\\n\\nlibrary RLPReader {\\n uint8 constant STRING_SHORT_START = 0x80;\\n uint8 constant STRING_LONG_START = 0xb8;\\n uint8 constant LIST_SHORT_START = 0xc0;\\n uint8 constant LIST_LONG_START = 0xf8;\\n uint8 constant WORD_SIZE = 32;\\n\\n struct RLPItem {\\n uint len;\\n uint memPtr;\\n }\\n\\n struct Iterator {\\n RLPItem item; // Item that's being iterated over.\\n uint nextPtr; // Position of the next item in the list.\\n }\\n\\n /*\\n * @dev Returns the next element in the iteration. Reverts if it has not next element.\\n * @param self The iterator.\\n * @return The next element in the iteration.\\n */\\n function next(Iterator memory self) internal pure returns (RLPItem memory) {\\n require(hasNext(self));\\n\\n uint ptr = self.nextPtr;\\n uint itemLength = _itemLength(ptr);\\n self.nextPtr = ptr + itemLength;\\n\\n return RLPItem(itemLength, ptr);\\n }\\n\\n /*\\n * @dev Returns true if the iteration has more elements.\\n * @param self The iterator.\\n * @return true if the iteration has more elements.\\n */\\n function hasNext(Iterator memory self) internal pure returns (bool) {\\n RLPItem memory item = self.item;\\n return self.nextPtr < item.memPtr + item.len;\\n }\\n\\n /*\\n * @param item RLP encoded bytes\\n */\\n function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) {\\n uint memPtr;\\n assembly {\\n memPtr := add(item, 0x20)\\n }\\n\\n return RLPItem(item.length, memPtr);\\n }\\n\\n /*\\n * @dev Create an iterator. Reverts if item is not a list.\\n * @param self The RLP item.\\n * @return An 'Iterator' over the item.\\n */\\n function iterator(RLPItem memory self) internal pure returns (Iterator memory) {\\n require(isList(self));\\n\\n uint ptr = self.memPtr + _payloadOffset(self.memPtr);\\n return Iterator(self, ptr);\\n }\\n\\n /*\\n * @param the RLP item.\\n */\\n function rlpLen(RLPItem memory item) internal pure returns (uint) {\\n return item.len;\\n }\\n\\n /*\\n * @param the RLP item.\\n * @return (memPtr, len) pair: location of the item's payload in memory.\\n */\\n function payloadLocation(RLPItem memory item) internal pure returns (uint, uint) {\\n uint offset = _payloadOffset(item.memPtr);\\n uint memPtr = item.memPtr + offset;\\n uint len = item.len - offset; // data length\\n return (memPtr, len);\\n }\\n\\n /*\\n * @param the RLP item.\\n */\\n function payloadLen(RLPItem memory item) internal pure returns (uint) {\\n (, uint len) = payloadLocation(item);\\n return len;\\n }\\n\\n /*\\n * @param the RLP item containing the encoded list.\\n */\\n function toList(RLPItem memory item) internal pure returns (RLPItem[] memory) {\\n require(isList(item));\\n\\n uint items = numItems(item);\\n RLPItem[] memory result = new RLPItem[](items);\\n\\n uint memPtr = item.memPtr + _payloadOffset(item.memPtr);\\n uint dataLen;\\n for (uint i = 0; i < items; i++) {\\n dataLen = _itemLength(memPtr);\\n result[i] = RLPItem(dataLen, memPtr); \\n memPtr = memPtr + dataLen;\\n }\\n\\n return result;\\n }\\n\\n // @return indicator whether encoded payload is a list. negate this function call for isData.\\n function isList(RLPItem memory item) internal pure returns (bool) {\\n if (item.len == 0) return false;\\n\\n uint8 byte0;\\n uint memPtr = item.memPtr;\\n assembly {\\n byte0 := byte(0, mload(memPtr))\\n }\\n\\n if (byte0 < LIST_SHORT_START)\\n return false;\\n return true;\\n }\\n\\n /*\\n * @dev A cheaper version of keccak256(toRlpBytes(item)) that avoids copying memory.\\n * @return keccak256 hash of RLP encoded bytes.\\n */\\n function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) {\\n uint256 ptr = item.memPtr;\\n uint256 len = item.len;\\n bytes32 result;\\n assembly {\\n result := keccak256(ptr, len)\\n }\\n return result;\\n }\\n\\n /*\\n * @dev A cheaper version of keccak256(toBytes(item)) that avoids copying memory.\\n * @return keccak256 hash of the item payload.\\n */\\n function payloadKeccak256(RLPItem memory item) internal pure returns (bytes32) {\\n (uint memPtr, uint len) = payloadLocation(item);\\n bytes32 result;\\n assembly {\\n result := keccak256(memPtr, len)\\n }\\n return result;\\n }\\n\\n /** RLPItem conversions into data types **/\\n\\n // @returns raw rlp encoding in bytes\\n function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) {\\n bytes memory result = new bytes(item.len);\\n if (result.length == 0) return result;\\n \\n uint ptr;\\n assembly {\\n ptr := add(0x20, result)\\n }\\n\\n copy(item.memPtr, ptr, item.len);\\n return result;\\n }\\n\\n // any non-zero byte except \\\"0x80\\\" is considered true\\n function toBoolean(RLPItem memory item) internal pure returns (bool) {\\n require(item.len == 1);\\n uint result;\\n uint memPtr = item.memPtr;\\n assembly {\\n result := byte(0, mload(memPtr))\\n }\\n\\n // SEE Github Issue #5.\\n // Summary: Most commonly used RLP libraries (i.e Geth) will encode\\n // \\\"0\\\" as \\\"0x80\\\" instead of as \\\"0\\\". We handle this edge case explicitly\\n // here.\\n if (result == 0 || result == STRING_SHORT_START) {\\n return false;\\n } else {\\n return true;\\n }\\n }\\n\\n function toAddress(RLPItem memory item) internal pure returns (address) {\\n // 1 byte for the length prefix\\n require(item.len == 21);\\n\\n return address(toUint(item));\\n }\\n\\n function toUint(RLPItem memory item) internal pure returns (uint) {\\n require(item.len > 0 && item.len <= 33);\\n\\n (uint memPtr, uint len) = payloadLocation(item);\\n\\n uint result;\\n assembly {\\n result := mload(memPtr)\\n\\n // shfit to the correct location if neccesary\\n if lt(len, 32) {\\n result := div(result, exp(256, sub(32, len)))\\n }\\n }\\n\\n return result;\\n }\\n\\n // enforces 32 byte length\\n function toUintStrict(RLPItem memory item) internal pure returns (uint) {\\n // one byte prefix\\n require(item.len == 33);\\n\\n uint result;\\n uint memPtr = item.memPtr + 1;\\n assembly {\\n result := mload(memPtr)\\n }\\n\\n return result;\\n }\\n\\n function toBytes(RLPItem memory item) internal pure returns (bytes memory) {\\n require(item.len > 0);\\n\\n (uint memPtr, uint len) = payloadLocation(item);\\n bytes memory result = new bytes(len);\\n\\n uint destPtr;\\n assembly {\\n destPtr := add(0x20, result)\\n }\\n\\n copy(memPtr, destPtr, len);\\n return result;\\n }\\n\\n /*\\n * Private Helpers\\n */\\n\\n // @return number of payload items inside an encoded list.\\n function numItems(RLPItem memory item) private pure returns (uint) {\\n if (item.len == 0) return 0;\\n\\n uint count = 0;\\n uint currPtr = item.memPtr + _payloadOffset(item.memPtr);\\n uint endPtr = item.memPtr + item.len;\\n while (currPtr < endPtr) {\\n currPtr = currPtr + _itemLength(currPtr); // skip over an item\\n count++;\\n }\\n\\n return count;\\n }\\n\\n // @return entire rlp item byte length\\n function _itemLength(uint memPtr) private pure returns (uint) {\\n uint itemLen;\\n uint byte0;\\n assembly {\\n byte0 := byte(0, mload(memPtr))\\n }\\n\\n if (byte0 < STRING_SHORT_START)\\n itemLen = 1;\\n \\n else if (byte0 < STRING_LONG_START)\\n itemLen = byte0 - STRING_SHORT_START + 1;\\n\\n else if (byte0 < LIST_SHORT_START) {\\n assembly {\\n let byteLen := sub(byte0, 0xb7) // # of bytes the actual length is\\n memPtr := add(memPtr, 1) // skip over the first byte\\n \\n /* 32 byte word size */\\n let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to get the len\\n itemLen := add(dataLen, add(byteLen, 1))\\n }\\n }\\n\\n else if (byte0 < LIST_LONG_START) {\\n itemLen = byte0 - LIST_SHORT_START + 1;\\n } \\n\\n else {\\n assembly {\\n let byteLen := sub(byte0, 0xf7)\\n memPtr := add(memPtr, 1)\\n\\n let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to the correct length\\n itemLen := add(dataLen, add(byteLen, 1))\\n }\\n }\\n\\n return itemLen;\\n }\\n\\n // @return number of bytes until the data\\n function _payloadOffset(uint memPtr) private pure returns (uint) {\\n uint byte0;\\n assembly {\\n byte0 := byte(0, mload(memPtr))\\n }\\n\\n if (byte0 < STRING_SHORT_START) \\n return 0;\\n else if (byte0 < STRING_LONG_START || (byte0 >= LIST_SHORT_START && byte0 < LIST_LONG_START))\\n return 1;\\n else if (byte0 < LIST_SHORT_START) // being explicit\\n return byte0 - (STRING_LONG_START - 1) + 1;\\n else\\n return byte0 - (LIST_LONG_START - 1) + 1;\\n }\\n\\n /*\\n * @param src Pointer to source\\n * @param dest Pointer to destination\\n * @param len Amount of memory to copy from the source\\n */\\n function copy(uint src, uint dest, uint len) private pure {\\n if (len == 0) return;\\n\\n // copy as many word sizes as possible\\n for (; len >= WORD_SIZE; len -= WORD_SIZE) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n\\n src += WORD_SIZE;\\n dest += WORD_SIZE;\\n }\\n\\n if (len > 0) {\\n // left over bytes. Mask is used to remove unwanted bytes from the word\\n uint mask = 256 ** (WORD_SIZE - len) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask)) // zero out src\\n let destpart := and(mload(dest), mask) // retrieve the bytes\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x037b5d5b05539e72f62669ca6971bc3098c4ef2948456b8bee35ab2656dec72c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506144c7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80635aca806a116100715780635aca806a1461015b5780637d1d8cc21461017b57806387ef093a1461019b5780639532dece146101bb578063cefded2e146101dc578063f2af2989146101fc576100a9565b80630f4d1e73146100ae57806311b750c3146100d75780631d77211b146100f75780632137f6b5146101195780633f8694791461013b575b600080fd5b6100c16100bc36600461340f565b61021c565b6040516100ce919061422b565b60405180910390f35b6100ea6100e53660046134b6565b610908565b6040516100ce919061426f565b61010a6101053660046135f6565b6109ff565b6040516100ce939291906142a8565b61012c610127366004613453565b610dad565b6040516100ce93929190614280565b61014e6101493660046134b6565b61150a565b6040516100ce919061424d565b61016e61016936600461353d565b61199c565b6040516100ce9190614163565b61018e6101893660046134b6565b611c79565b6040516100ce919061425e565b6101ae6101a93660046134b6565b611db5565b6040516100ce9190614152565b6101ce6101c936600461366d565b611f98565b6040516100ce929190614174565b6101ef6101ea3660046134b6565b61258b565b6040516100ce919061423c565b61020f61020a3660046134f0565b612653565b6040516100ce9190614194565b610224612e46565b6000829050806001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561026257600080fd5b505afa158015610276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029a9190810190613435565b6001600160a01b03908116835260408051636cc6cde160e01b8152905191831691636cc6cde191600480820192602092909190829003018186803b1580156102e157600080fd5b505afa1580156102f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610319919081019061393f565b82602001906001600160a01b031690816001600160a01b031681525050806001600160a01b0316630c7ac7b66040518163ffffffff1660e01b815260040160006040518083038186803b15801561036f57600080fd5b505afa158015610383573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103ab91908101906138b0565b8260400181905250806001600160a01b031663bb0b86ff6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ec57600080fd5b505afa158015610400573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104249190810190613892565b826060018181525050806001600160a01b031663c2f2beea6040518163ffffffff1660e01b815260040160206040518083038186803b15801561046657600080fd5b505afa15801561047a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061049e9190810190613892565b826080018181525050806001600160a01b031663a37b6ad46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e057600080fd5b505afa1580156104f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105189190810190613892565b8260a0018181525050806001600160a01b031663787471a96040518163ffffffff1660e01b815260040160206040518083038186803b15801561055a57600080fd5b505afa15801561056e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105929190810190613892565b8260c0018181525050806001600160a01b03166282a36d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061060b9190810190613892565b8260e0018181525050806001600160a01b0316636cdc090f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561064d57600080fd5b505afa158015610661573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106859190810190613892565b82610100018181525050806001600160a01b0316637b9433836040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107009190810190613892565b82610120018181525050806001600160a01b0316631d5120856040518163ffffffff1660e01b815260040160206040518083038186803b15801561074357600080fd5b505afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061077b9190810190613892565b82610140018181525050806001600160a01b031663416583416040518163ffffffff1660e01b815260040160206040518083038186803b1580156107be57600080fd5b505afa1580156107d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107f69190810190613892565b82610160018181525050806001600160a01b031663d661dd316040518163ffffffff1660e01b815260040160206040518083038186803b15801561083957600080fd5b505afa15801561084d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108719190810190613892565b6101808301526020820151604080840151905163f7434ea960e01b81526001600160a01b039092169163f7434ea9916108ac9160040161421a565b60206040518083038186803b1580156108c457600080fd5b505afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108fc9190810190613892565b6101a083015250919050565b610910612ec7565b82610919612f08565b6109238585611c79565b9050600061092f612f72565b610937612f72565b6000856001600160a01b031663974121b28960018860000151604001510360018960c00151036040518463ffffffff1660e01b815260040161097b939291906141bd565b6101006040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109cc9190810190613749565b6040805160a081018252998a5293151560208a015292880191909152606087015260808601525092979650505050505050565b600080600080889050806001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4157600080fd5b505afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a799190810190613892565b610a8d575060009250829150819050610da2565b6000885b888211158015610b105750826001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610ad557600080fd5b505afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b0d9190810190613892565b81105b15610d9e57604051621ea69b60e91b81526000906001600160a01b03851690633d4d360090610b43908590600401614194565b60206040518083038186803b158015610b5b57600080fd5b505afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b939190810190613892565b9050610b9d612f90565b610ba78d8361150a565b9050610bb660208b018b61372b565b8015610bd15750600081604001516003811115610bcf57fe5b145b80610c025750610be760408b0160208c0161372b565b8015610c025750600181604001516003811115610c0057fe5b145b80610c415750610c1860608b0160408c0161372b565b8015610c335750600281604001516003811115610c3157fe5b145b8015610c4157508060600151155b80610c805750610c5760808b0160608c0161372b565b8015610c725750600381604001516003811115610c7057fe5b145b8015610c8057508060600151155b80610cbe5750610c9660a08b0160808c0161372b565b8015610cb15750600281604001516003811115610caf57fe5b145b8015610cbe575080606001515b80610cfc5750610cd460c08b0160a08c0161372b565b8015610cef5750600381604001516003811115610ced57fe5b145b8015610cfc575080606001515b80610d345750610d1260e08b0160c08c0161372b565b8015610d345750886001600160a01b03168161016001516001600160a01b0316145b80610d6d5750610d4b6101008b0160e08c0161372b565b8015610d6d5750886001600160a01b03168161018001516001600160a01b0316145b15610d90576001909701968a8410610d90575060019550909350610da292505050565b505060019182019101610a91565b5050505b955095509592505050565b600080808681876002602002013590506000600190506000809050836001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0157600080fd5b505afa158015610e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e399190810190613892565b610e525750600095508594506001935061150092505050565b6000610e666101208b016101008c0161372b565b610ef85760608b013515610e7e5760608b0135610ef3565b6001856001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb957600080fd5b505afa158015610ecd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ef19190810190613892565b035b610efe565b60608b01355b90505b610f136101208b016101008c0161372b565b610f205760008411610f9f565b846001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f919190810190613892565b81108015610f9f5750600084115b156114be57604051621ea69b60e91b81526000906001600160a01b03871690633d4d360090610fd2908590600401614194565b60206040518083038186803b158015610fea57600080fd5b505afa158015610ffe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110229190810190613892565b905061102c612f90565b6110368e8361150a565b60019950905061104960208d018d61372b565b8015611064575060008160400151600381111561106257fe5b145b80611095575061107a60408d0160208e0161372b565b8015611095575060018160400151600381111561109357fe5b145b806110d457506110ab60608d0160408e0161372b565b80156110c657506002816040015160038111156110c457fe5b145b80156110d457508060600151155b8061111357506110ea60808d0160608e0161372b565b8015611105575060038160400151600381111561110357fe5b145b801561111357508060600151155b80611151575061112960a08d0160808e0161372b565b8015611144575060028160400151600381111561114257fe5b145b8015611151575080606001515b8061118f575061116760c08d0160a08e0161372b565b8015611182575060038160400151600381111561118057fe5b145b801561118f575080606001515b806111c757506111a560e08d0160c08e0161372b565b80156111c757508a6001600160a01b03168161016001516001600160a01b0316145b8061120057506111de6101008d0160e08e0161372b565b801561120057508a6001600160a01b03168161018001516001600160a01b0316145b15611321576001939093019260208d0135848161121957fe5b0661132157600194909401938c35851415611321578215801561124b57506112496101208d016101008e0161372b565b155b806112e057506001876001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561128c57600080fd5b505afa1580156112a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112c49190810190613892565b03831480156112e057506112e06101208d016101008e0161372b565b156112ea57600098505b6112fc6101208d016101008e0161372b565b611309576001830361130e565b826001015b9950600197506115009650505050505050565b6000199095019485158061134d57508215801561134d575061134b6101208d016101008e0161372b565b155b806113e257506001876001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561138e57600080fd5b505afa1580156113a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113c69190810190613892565b03831480156113e257506113e26101208d016101008e0161372b565b15611483576113f96101208d016101008e0161372b565b611406576000831161147a565b866001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561143f57600080fd5b505afa158015611453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114779190810190613892565b83105b985050506114be565b6114956101208d016101008e0161372b565b6114b05782156114a857600183036114ab565b60005b6114b5565b826001015b92505050610f01565b6114d06101208b016101008c0161372b565b80156114e9575060608b013580820160208d0135909101115b156114f5575060608a01355b965060009450505050505b9450945094915050565b611512612f90565b61151a612ec7565b6115248484610908565b604080516102c0810182528581528251515160208083019190915283515101519293509190820190600381111561155757fe5b815260200182600001516020015115158152602001826000015160800151151581526020018260000151604001518152602001600081526020018260200151151581526020016000815260200160008152602001826000015160e0015160028111156115bf57fe5b8152825160a0908101516020908101516001600160a01b031690830152835101516040909101906002602090810291909101516001600160a01b0390811683528451610100015116908201528251610120015160408201526060016000815260200182606001518152602001826080015181526020018260000151606001518152602001826040015181526020016000600281111561165a57fe5b81528251516040015160209182015282510151909250801561170d575060018151610100015160a084015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e8916116b091600401614194565b60206040518083038186803b1580156116c857600080fd5b505afa1580156116dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611700919081019061395d565b600281111561170b57fe5b145b15611995578051610100015160a0830151604051631c3db16d60e01b81526001600160a01b0390921691631c3db16d9161174991600401614194565b60206040518083038186803b15801561176157600080fd5b505afa158015611775573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117999190810190613892565b60028111156117a457fe5b826101e0019060028111156117b557fe5b908160028111156117c257fe5b9052508051610100015160a083015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e8916117fc91600401614194565b60206040518083038186803b15801561181457600080fd5b505afa158015611828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061184c919081019061395d565b826102800190600281111561185d57fe5b9081600281111561186a57fe5b9052508051610100015160a083015160405163afe15cfb60e01b81526001600160a01b039092169163afe15cfb916118a491600401614194565b604080518083038186803b1580156118bb57600080fd5b505afa1580156118cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506118f3919081019061397b565b610120840152610100808401919091528151015160a08301516101c084015160405163791f8b7360e11b81526001600160a01b039093169263f23f16e69261193f9290916004016142c3565b60206040518083038186803b15801561195757600080fd5b505afa15801561196b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061198f9190810190613892565b60c08301525b5092915050565b606086816119b16119ac89612a7f565b612aa5565b905085156119bf5785611a30565b816001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f857600080fd5b505afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a309190810190613892565b604051908082528060200260200182016040528015611a6957816020015b611a56612f90565b815260200190600190039081611a4e5790505b5092506000875b8715611a7c5787611aed565b836001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015611ab557600080fd5b505afa158015611ac9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611aed9190810190613892565b811015611c6b57611afc612f90565b611b7c8c866001600160a01b0316633d4d3600856040518263ffffffff1660e01b8152600401611b2c9190614194565b60206040518083038186803b158015611b4457600080fd5b505afa158015611b58573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101499190810190613892565b90508781604001516003811115611b8f57fe5b60048110611b9957fe5b602002015115611ba95750611c63565b6060611bbb6119ac8360200151612a7f565b9050600160005b8651811015611c3957898181518110611bd757fe5b6020026020010151158015611c235750611c21611c06888381518110611bf957fe5b6020026020010151612b76565b611c15858481518110611bf957fe5b9063ffffffff612bdc16565b155b15611c315760009150611c39565b600101611bc2565b508015611c5f5782888681518110611c4d57fe5b60209081029190910101526001909401935b5050505b600101611a70565b505050509695505050505050565b611c81612f08565b82611c8a61304b565b611c94858561258b565b9050600080600080611ca4612f72565b600080600060608a6001600160a01b031663bfbcff1a8e60018d60400151036040518363ffffffff1660e01b8152600401611ce09291906141a2565b60006040518083038186803b158015611cf857600080fd5b505afa158015611d0c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611d34919081019061379f565b509850985098509850985098509850985098506040518061014001604052808b81526020018a151581526020018981526020018881526020018715158152602001868152602001858152602001846002811115611d8d57fe5b81526001600160a01b0390931660208401526040909201529c9b505050505050505050505050565b606082611dc061304b565b611dca858561258b565b90508060400151604051908082528060200260200182016040528015611e0a57816020015b611df7613065565b815260200190600190039081611def5790505b50925060005b8160400151811015611f8f57600080600080611e2a612f72565b6000606060008a6001600160a01b031663bfbcff1a8e8b6040518363ffffffff1660e01b8152600401611e5e9291906141a2565b60006040518083038186803b158015611e7657600080fd5b505afa158015611e8a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611eb2919081019061379f565b995099509950505097509750975097509750604051806101200160405280891515815260200188815260200187815260200186151581526020018560016002811115611efa57fe5b60038110611f0457fe5b60200201516001600160a01b0316815260200185600280811115611f2457fe5b60038110611f2e57fe5b60200201516001600160a01b03168152602001846001600160a01b03168152602001838152602001828152508c60018b8d60400151030381518110611f6f57fe5b602002602001018190525050505050505050508080600101915050611e10565b50505092915050565b606060008089905087604051908082528060200260200182016040528015611fda57816020015b611fc7612f90565b815260200190600190039081611fbf5790505b50925060008885611fe9578095505b826001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561202257600080fd5b505afa158015612036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061205a9190810190613892565b61206b57506000925061257f915050565b6000886120f8578b1561207e578b6120f3565b6001846001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b1580156120b957600080fd5b505afa1580156120cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506120f19190810190613892565b035b6120fa565b8b5b90505b8861210b576000821161218a565b836001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561214457600080fd5b505afa158015612158573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061217c9190810190613892565b8110801561218a5750600082115b1561257a57604051621ea69b60e91b81526000906001600160a01b03861690633d4d3600906121bd908590600401614194565b60206040518083038186803b1580156121d557600080fd5b505afa1580156121e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061220d9190810190613892565b9050612217612f90565b6122218f8361150a565b60019750905061223460208d018d61372b565b801561224f575060008160400151600381111561224d57fe5b145b80612280575061226560408d0160208e0161372b565b8015612280575060018160400151600381111561227e57fe5b145b806122bf575061229660608d0160408e0161372b565b80156122b157506002816040015160038111156122af57fe5b145b80156122bf57508060600151155b806122fe57506122d560808d0160608e0161372b565b80156122f057506003816040015160038111156122ee57fe5b145b80156122fe57508060600151155b8061233c575061231460a08d0160808e0161372b565b801561232f575060028160400151600381111561232d57fe5b145b801561233c575080606001515b8061237a575061235260c08d0160a08e0161372b565b801561236d575060038160400151600381111561236b57fe5b145b801561237a575080606001515b806123b2575061239060e08d0160c08e0161372b565b80156123b25750896001600160a01b03168161016001516001600160a01b0316145b806123eb57506123c96101008d0160e08e0161372b565b80156123eb5750896001600160a01b03168161018001516001600160a01b0316145b1561241d57808886815181106123fd57fe5b60209081029190910101526001909401938885141561241d57505061257a565b6000199093019283158061243857508215801561243857508a155b806124bd57506001866001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561247957600080fd5b505afa15801561248d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506124b19190810190613892565b03831480156124bd57508a5b15612550578a6124d05760008311612547565b6001866001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561250b57600080fd5b505afa15801561251f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125439190810190613892565b0383105b9650505061257a565b8a61256c5782156125645760018303612567565b60005b612571565b826001015b925050506120fd565b505050505b97509795505050505050565b61259361304b565b604051634aac84e560e01b8152839060609060009081906001600160a01b03851690634aac84e5906125c9908990600401614194565b60006040518083038186803b1580156125e157600080fd5b505afa1580156125f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261261d91908101906138e5565b925092509250604051806060016040528084815260200183600381111561264057fe5b8152602001919091529695505050505050565b60008361265e6130b0565b50604080518082019091526000808252602082015261267b6130b0565b50604080518082018252600080825260208201529051634aac84e560e01b81526001600160a01b03841690634aac84e5906126ba908990600401614194565b60006040518083038186803b1580156126d257600080fd5b505afa1580156126e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261270e91908101906138e5565b845250505b815181511015612a75578051604051635fde7f8d60e11b815260009182916001600160a01b0387169163bfbcff1a91612750918c916004016141a2565b60006040518083038186803b15801561276857600080fd5b505afa15801561277c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127a4919081019061379f565b509497509195509350899250600191506127bb9050565b602002019190915292509050806127d3575050612a69565b602080850151908401511015612a5f576127eb612f72565b6127f3612f72565b60006001600160a01b03881663974121b28c8884602002015189600160200201516040518463ffffffff1660e01b8152600401612832939291906141bd565b6101006040518083038186803b15801561284b57600080fd5b505afa15801561285f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128839190810190613749565b93509350935050612892612f72565b6001600160a01b0389166352bc0e608d89600060200201518a600160200201518f6040518563ffffffff1660e01b81526004016128d294939291906141e5565b60606040518083038186803b1580156128ea57600080fd5b505afa1580156128fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612922919081019061370d565b6020840151909150158061293857506040830151155b156129525760408101516020820151019990990198612a3e565b600086600281111561296057fe5b14156129cc576020840151612976576000612993565b60208085015160408601519183015191019083028161299157fe5b045b60408501519a01996129a65760006129c3565b6020840151604080860151908301519101908302816129c157fe5b045b8a019950612a3e565b6000848760028111156129db57fe5b600381106129e557fe5b6020020151116129f6576000612a39565b83866002811115612a0357fe5b60038110612a0d57fe5b60200201518282886002811115612a2057fe5b60038110612a2a57fe5b60200201510281612a3757fe5b045b8a0199505b5050505082600160028110612a4f57fe5b60200201805160010190526127d3565b5050600060208201525b80516001018152612713565b5050509392505050565b612a876130ce565b5060408051808201909152815181526020828101908201525b919050565b6060612ab082612c42565b612ab957600080fd5b6000612ac483612c7c565b9050606081604051908082528060200260200182016040528015612b0257816020015b612aef6130ce565b815260200190600190039081612ae75790505b5090506000612b148560200151612cd8565b60208601510190506000805b84811015612b6b57612b3183612d3b565b9150604051806040016040528083815260200184815250848281518110612b5457fe5b602090810291909101015291810191600101612b20565b509195945050505050565b8051606090612b8457600080fd5b600080612b9084612dcf565b915091506060816040519080825280601f01601f191660200182016040528015612bc1576020820181803883390190505b50905060208101612bd3848285612df5565b50949350505050565b815181516000916001918114808314612bf85760009250612c36565b600160208701838101602088015b600284838510011415612c31578051835114612c255760009650600093505b60209283019201612c06565b505050505b50909150505b92915050565b8051600090612c5357506000612aa0565b6020820151805160001a9060c0821015612c7257600092505050612aa0565b5060019392505050565b8051600090612c8d57506000612aa0565b60008090506000612ca18460200151612cd8565b602085015185519181019250015b80821015612ccf57612cc082612d3b565b60019093019290910190612caf565b50909392505050565b8051600090811a6080811015612cf2576000915050612aa0565b60b8811080612d0d575060c08110801590612d0d575060f881105b15612d1c576001915050612aa0565b60c0811015612d305760b519019050612aa0565b60f519019050612aa0565b80516000908190811a6080811015612d565760019150611995565b60b8811015612d6b57607e1981019150611995565b60c0811015612d985760b78103600185019450806020036101000a85510460018201810193505050611995565b60f8811015612dad5760be1981019150611995565b60019390930151602084900360f7016101000a900490920160f5190192915050565b6000806000612de18460200151612cd8565b602085015194519481019594039392505050565b80612dff57612e41565b5b60208110612e1f578251825260209283019290910190601f1901612e00565b8015612e41578251825160208390036101000a60001901801990921691161782525b505050565b604051806101c0016040528060006001600160a01b0316815260200160006001600160a01b031681526020016060815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060a00160405280612eda612f08565b815260006020820152604001612eee612f72565b8152602001612efb612f72565b8152602001600081525090565b604051806101400160405280612f1c61304b565b81526000602082018190526040820181905260608201819052608082015260a001612f45612f72565b81526020016000815260200160006002811115612f5e57fe5b815260006020820152606060409091015290565b60405180606001604052806003906020820280388339509192915050565b604080516102c081018252600080825260606020830152909182019081526020016000151581526020016000151581526020016000815260200160008152602001600015158152602001600081526020016000815260200160006002811115612ff557fe5b8152600060208201819052604082018190526060808301829052608083015260a082015260c001613024612f72565b8152602001600081526020016000815260200161303f612f72565b81526020016000612efb565b604080516060808201909252908152602081016000612efb565b604080516101208101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082015261010081019190915290565b60405180604001604052806002906020820280388339509192915050565b604051806040016040528060008152602001600081525090565b8035612c3c8161443b565b8051612c3c8161443b565b600082601f83011261310f57600080fd5b600361312261311d8261430a565b6142e3565b9150818385602084028201111561313857600080fd5b60005b83811015613164578161314e88826130f3565b845250602092830192919091019060010161313b565b5050505092915050565b600082601f83011261317f57600080fd5b600361318d61311d8261430a565b915081838560208402820111156131a357600080fd5b60005b8381101561316457816131b98882613341565b84525060209283019291909101906001016131a6565b600082601f8301126131e057600080fd5b60046131ee61311d8261430a565b9150818385602084028201111561320457600080fd5b60005b83811015613164578161321a8882613336565b8452506020928301929190910190600101613207565b806101008101831015612c3c57600080fd5b806101208101831015612c3c57600080fd5b600082601f83011261326557600080fd5b813561327361311d82614328565b9150818183526020840193506020810190508385602084028201111561329857600080fd5b60005b8381101561316457816132ae8882613336565b845250602092830192919091019060010161329b565b600082601f8301126132d557600080fd5b60036132e361311d8261430a565b915081838560208402820111156132f957600080fd5b60005b83811015613164578161330f8882613357565b84525060209283019291909101906001016132fc565b8060808101831015612c3c57600080fd5b8035612c3c8161444f565b8051612c3c8161444f565b8035612c3c81614458565b8051612c3c81614458565b600082601f83011261337357600080fd5b815161338161311d82614349565b9150808252602083016020830185838301111561339d57600080fd5b611f8f8382846143ea565b600082601f8301126133b957600080fd5b81356133c761311d82614349565b915080825260208301602083018583830111156133e357600080fd5b611f8f8382846143de565b8051612c3c81614461565b8051612c3c8161446a565b8051612c3c81614477565b60006020828403121561342157600080fd5b600061342d84846130e8565b949350505050565b60006020828403121561344757600080fd5b600061342d84846130f3565b6000806000806101e0858703121561346a57600080fd5b600061347687876130e8565b945050602061348787828801613325565b93505060a061349887828801613242565b9250506101c06134aa878288016130e8565b91505092959194509250565b600080604083850312156134c957600080fd5b60006134d585856130e8565b92505060206134e68582860161334c565b9150509250929050565b60008060006060848603121561350557600080fd5b600061351186866130e8565b93505060206135228682870161334c565b9250506040613533868287016130e8565b9150509250925092565b600080600080600080610120878903121561355757600080fd5b600061356389896130e8565b965050602087013567ffffffffffffffff81111561358057600080fd5b61358c89828a016133a8565b955050604061359d89828a0161334c565b94505060606135ae89828a0161334c565b93505060806135bf89828a016131cf565b92505061010087013567ffffffffffffffff8111156135dd57600080fd5b6135e989828a01613254565b9150509295509295509295565b6000806000806000610180868803121561360f57600080fd5b600061361b88886130e8565b955050602061362c8882890161334c565b945050604061363d8882890161334c565b935050606061364e88828901613230565b925050610160613660888289016130e8565b9150509295509295909350565b60008060008060008060006101c0888a03121561368957600080fd5b60006136958a8a6130e8565b97505060206136a68a828b0161334c565b96505060406136b78a828b0161334c565b95505060606136c88a828b01613230565b9450506101606136da8a828b01613336565b9350506101806136ec8a828b016130e8565b9250506101a06136fe8a828b0161334c565b91505092959891949750929550565b60006060828403121561371f57600080fd5b600061342d84846132c4565b60006020828403121561373d57600080fd5b600061342d8484613336565b600080600080610100858703121561376057600080fd5b600061376c8787613341565b945050602061377d878288016132c4565b935050608061378e8782880161316e565b92505060e06134aa87828801613357565b6000806000806000806000806000806101808b8d0312156137bf57600080fd5b60006137cb8d8d613341565b9a505060206137dc8d828e01613357565b99505060406137ed8d828e01613357565b98505060606137fe8d828e01613341565b975050608061380f8d828e016130fe565b96505060e06138208d828e01613357565b9550506101006138328d828e016133f9565b9450506101206138448d828e016133ee565b9350506101408b015167ffffffffffffffff81111561386257600080fd5b61386e8d828e01613362565b9250506101606138808d828e01613357565b9150509295989b9194979a5092959850565b6000602082840312156138a457600080fd5b600061342d8484613357565b6000602082840312156138c257600080fd5b815167ffffffffffffffff8111156138d957600080fd5b61342d84828501613362565b6000806000606084860312156138fa57600080fd5b835167ffffffffffffffff81111561391157600080fd5b61391d86828701613362565b935050602061392e86828701613404565b925050604061353386828701613357565b60006020828403121561395157600080fd5b600061342d84846133ee565b60006020828403121561396f57600080fd5b600061342d84846133f9565b6000806040838503121561398e57600080fd5b600061399a8585613357565b92505060206134e685828601613357565b60006139b783836139f6565b505060200190565b60006139b78383613bc0565b60006139d78383613d8c565b9392505050565b60006139d78383613e42565b60006139b78383613bc9565b6139ff8161438d565b82525050565b613a0e8161437a565b613a188184612aa0565b9250613a2382614371565b8060005b83811015613a51578151613a3b87826139ab565b9650613a4683614374565b925050600101613a27565b505050505050565b613a628161437a565b613a6c8184612aa0565b9250613a7782614371565b8060005b83811015613a51578151613a8f87826139bf565b9650613a9a83614374565b925050600101613a7b565b6000613ab082614380565b613aba8185614384565b935083602082028501613acc85614374565b8060005b85811015613b065784840389528151613ae985826139cb565b9450613af483614374565b60209a909a0199925050600101613ad0565b5091979650505050505050565b6000613b1e82614380565b613b288185614384565b935083602082028501613b3a85614374565b8060005b85811015613b065784840389528151613b5785826139de565b9450613b6283614374565b60209a909a0199925050600101613b3e565b613b7d8161437a565b613b878184612aa0565b9250613b9282614371565b8060005b83811015613a51578151613baa87826139ea565b9650613bb583614374565b925050600101613b96565b6139ff81614398565b6139ff81614371565b6000613bdd82614380565b613be78185614384565b9350613bf78185602086016143ea565b613c008161441a565b9093019392505050565b6139ff8161439d565b6139ff816143c8565b6139ff816143d3565b80516000906101c0840190613c3a85826139f6565b506020830151613c4d60208601826139f6565b5060408301518482036040860152613c658282613bd2565b9150506060830151613c7a6060860182613bc9565b506080830151613c8d6080860182613bc9565b5060a0830151613ca060a0860182613bc9565b5060c0830151613cb360c0860182613bc9565b5060e0830151613cc660e0860182613bc9565b50610100830151613cdb610100860182613bc9565b50610120830151613cf0610120860182613bc9565b50610140830151613d05610140860182613bc9565b50610160830151613d1a610160860182613bc9565b50610180830151613d2f610180860182613bc9565b506101a0830151613d446101a0860182613bc9565b509392505050565b8051606080845260009190840190613d648282613bd2565b9150506020830151613d796020860182613c1c565b506040830151613d446040860182613bc9565b8051600090610120840190613da18582613bc0565b506020830151613db46020860182613bc9565b506040830151613dc76040860182613bc9565b506060830151613dda6060860182613bc0565b506080830151613ded60808601826139f6565b5060a0830151613e0060a08601826139f6565b5060c0830151613e1360c08601826139f6565b5060e083015184820360e0860152613e2b8282613bd2565b915050610100830151613d44610100860182613bc9565b8051600090610340840190613e578582613bc9565b5060208301518482036020860152613e6f8282613bd2565b9150506040830151613e846040860182613c1c565b506060830151613e976060860182613bc0565b506080830151613eaa6080860182613bc0565b5060a0830151613ebd60a0860182613bc9565b5060c0830151613ed060c0860182613bc9565b5060e0830151613ee360e0860182613bc0565b50610100830151613ef8610100860182613bc9565b50610120830151613f0d610120860182613bc9565b50610140830151613f22610140860182613c13565b50610160830151613f376101608601826139f6565b50610180830151613f4c6101808601826139f6565b506101a0830151613f616101a08601826139f6565b506101c08301518482036101c0860152613f7b8282613bd2565b9150506101e0830151613f926101e0860182613c13565b50610200830151613fa7610200860182613a59565b50610220830151613fbc610260860182613bc9565b50610240830151613fd1610280860182613bc9565b50610260830151613fe66102a0860182613b74565b50610280830151613ffb610300860182613c13565b506102a0830151613d44610320860182613bc9565b8051610180808452600091908401906140298282613d4c565b915050602083015161403e6020860182613bc0565b5060408301516140516040860182613bc9565b5060608301516140646060860182613bc9565b5060808301516140776080860182613bc0565b5060a083015161408a60a0860182613a05565b5060c083015161409e610100860182613bc9565b5060e08301516140b2610120860182613c13565b506101008301516140c7610140860182613c0a565b506101208301518482036101608601526140e18282613bd2565b95945050505050565b8051610120808452600091908401906141038282614010565b91505060208301516141186020860182613bc0565b50604083015161412b6040860182613b74565b50606083015161413e60a0860182613a59565b506080830151613d44610100860182613bc9565b602080825281016139d78184613aa5565b602080825281016139d78184613b13565b604080825281016141858185613b13565b90506139d76020830184613bc0565b60208101612c3c8284613bc9565b604081016141b08285613bc9565b6139d76020830184613bc9565b606081016141cb8286613bc9565b6141d86020830185613bc9565b61342d6040830184613bc9565b608081016141f38287613bc9565b6142006020830186613bc9565b61420d6040830185613bc9565b6140e160608301846139f6565b602080825281016139d78184613bd2565b602080825281016139d78184613c25565b602080825281016139d78184613d4c565b602080825281016139d78184613e42565b602080825281016139d78184614010565b602080825281016139d781846140ea565b6060810161428e8286613bc9565b61429b6020830185613bc0565b61342d6040830184613bc0565b606081016142b68286613bc9565b6141d86020830185613bc0565b604081016142d18285613bc9565b818103602083015261342d8184613bd2565b60405181810167ffffffffffffffff8111828210171561430257600080fd5b604052919050565b600067ffffffffffffffff82111561432157600080fd5b5060200290565b600067ffffffffffffffff82111561433f57600080fd5b5060209081020190565b600067ffffffffffffffff82111561436057600080fd5b506020601f91909101601f19160190565b90565b60200190565b50600390565b5190565b90815260200190565b6000612c3c826143bc565b151590565b6000612c3c8261438d565b80612aa081614424565b80612aa081614431565b6001600160a01b031690565b6000612c3c826143a8565b6000612c3c826143b2565b82818337506000910152565b60005b838110156144055781810151838201526020016143ed565b83811115614414576000848401525b50505050565b601f01601f191690565b6003811061442e57fe5b50565b6004811061442e57fe5b6144448161438d565b811461442e57600080fd5b61444481614398565b61444481614371565b6144448161439d565b6003811061442e57600080fd5b6004811061442e57600080fdfea365627a7a7231582062af74091a1e65fafb3810ee810c07f3aea3bde1761e32a18881d6f30cb402966c6578706572696d656e74616cf564736f6c63430005110040", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80635aca806a116100715780635aca806a1461015b5780637d1d8cc21461017b57806387ef093a1461019b5780639532dece146101bb578063cefded2e146101dc578063f2af2989146101fc576100a9565b80630f4d1e73146100ae57806311b750c3146100d75780631d77211b146100f75780632137f6b5146101195780633f8694791461013b575b600080fd5b6100c16100bc36600461340f565b61021c565b6040516100ce919061422b565b60405180910390f35b6100ea6100e53660046134b6565b610908565b6040516100ce919061426f565b61010a6101053660046135f6565b6109ff565b6040516100ce939291906142a8565b61012c610127366004613453565b610dad565b6040516100ce93929190614280565b61014e6101493660046134b6565b61150a565b6040516100ce919061424d565b61016e61016936600461353d565b61199c565b6040516100ce9190614163565b61018e6101893660046134b6565b611c79565b6040516100ce919061425e565b6101ae6101a93660046134b6565b611db5565b6040516100ce9190614152565b6101ce6101c936600461366d565b611f98565b6040516100ce929190614174565b6101ef6101ea3660046134b6565b61258b565b6040516100ce919061423c565b61020f61020a3660046134f0565b612653565b6040516100ce9190614194565b610224612e46565b6000829050806001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561026257600080fd5b505afa158015610276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029a9190810190613435565b6001600160a01b03908116835260408051636cc6cde160e01b8152905191831691636cc6cde191600480820192602092909190829003018186803b1580156102e157600080fd5b505afa1580156102f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610319919081019061393f565b82602001906001600160a01b031690816001600160a01b031681525050806001600160a01b0316630c7ac7b66040518163ffffffff1660e01b815260040160006040518083038186803b15801561036f57600080fd5b505afa158015610383573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103ab91908101906138b0565b8260400181905250806001600160a01b031663bb0b86ff6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ec57600080fd5b505afa158015610400573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104249190810190613892565b826060018181525050806001600160a01b031663c2f2beea6040518163ffffffff1660e01b815260040160206040518083038186803b15801561046657600080fd5b505afa15801561047a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061049e9190810190613892565b826080018181525050806001600160a01b031663a37b6ad46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e057600080fd5b505afa1580156104f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105189190810190613892565b8260a0018181525050806001600160a01b031663787471a96040518163ffffffff1660e01b815260040160206040518083038186803b15801561055a57600080fd5b505afa15801561056e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105929190810190613892565b8260c0018181525050806001600160a01b03166282a36d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061060b9190810190613892565b8260e0018181525050806001600160a01b0316636cdc090f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561064d57600080fd5b505afa158015610661573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106859190810190613892565b82610100018181525050806001600160a01b0316637b9433836040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107009190810190613892565b82610120018181525050806001600160a01b0316631d5120856040518163ffffffff1660e01b815260040160206040518083038186803b15801561074357600080fd5b505afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061077b9190810190613892565b82610140018181525050806001600160a01b031663416583416040518163ffffffff1660e01b815260040160206040518083038186803b1580156107be57600080fd5b505afa1580156107d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107f69190810190613892565b82610160018181525050806001600160a01b031663d661dd316040518163ffffffff1660e01b815260040160206040518083038186803b15801561083957600080fd5b505afa15801561084d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108719190810190613892565b6101808301526020820151604080840151905163f7434ea960e01b81526001600160a01b039092169163f7434ea9916108ac9160040161421a565b60206040518083038186803b1580156108c457600080fd5b505afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108fc9190810190613892565b6101a083015250919050565b610910612ec7565b82610919612f08565b6109238585611c79565b9050600061092f612f72565b610937612f72565b6000856001600160a01b031663974121b28960018860000151604001510360018960c00151036040518463ffffffff1660e01b815260040161097b939291906141bd565b6101006040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109cc9190810190613749565b6040805160a081018252998a5293151560208a015292880191909152606087015260808601525092979650505050505050565b600080600080889050806001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4157600080fd5b505afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a799190810190613892565b610a8d575060009250829150819050610da2565b6000885b888211158015610b105750826001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610ad557600080fd5b505afa158015610ae9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b0d9190810190613892565b81105b15610d9e57604051621ea69b60e91b81526000906001600160a01b03851690633d4d360090610b43908590600401614194565b60206040518083038186803b158015610b5b57600080fd5b505afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b939190810190613892565b9050610b9d612f90565b610ba78d8361150a565b9050610bb660208b018b61372b565b8015610bd15750600081604001516003811115610bcf57fe5b145b80610c025750610be760408b0160208c0161372b565b8015610c025750600181604001516003811115610c0057fe5b145b80610c415750610c1860608b0160408c0161372b565b8015610c335750600281604001516003811115610c3157fe5b145b8015610c4157508060600151155b80610c805750610c5760808b0160608c0161372b565b8015610c725750600381604001516003811115610c7057fe5b145b8015610c8057508060600151155b80610cbe5750610c9660a08b0160808c0161372b565b8015610cb15750600281604001516003811115610caf57fe5b145b8015610cbe575080606001515b80610cfc5750610cd460c08b0160a08c0161372b565b8015610cef5750600381604001516003811115610ced57fe5b145b8015610cfc575080606001515b80610d345750610d1260e08b0160c08c0161372b565b8015610d345750886001600160a01b03168161016001516001600160a01b0316145b80610d6d5750610d4b6101008b0160e08c0161372b565b8015610d6d5750886001600160a01b03168161018001516001600160a01b0316145b15610d90576001909701968a8410610d90575060019550909350610da292505050565b505060019182019101610a91565b5050505b955095509592505050565b600080808681876002602002013590506000600190506000809050836001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0157600080fd5b505afa158015610e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e399190810190613892565b610e525750600095508594506001935061150092505050565b6000610e666101208b016101008c0161372b565b610ef85760608b013515610e7e5760608b0135610ef3565b6001856001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb957600080fd5b505afa158015610ecd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ef19190810190613892565b035b610efe565b60608b01355b90505b610f136101208b016101008c0161372b565b610f205760008411610f9f565b846001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f919190810190613892565b81108015610f9f5750600084115b156114be57604051621ea69b60e91b81526000906001600160a01b03871690633d4d360090610fd2908590600401614194565b60206040518083038186803b158015610fea57600080fd5b505afa158015610ffe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110229190810190613892565b905061102c612f90565b6110368e8361150a565b60019950905061104960208d018d61372b565b8015611064575060008160400151600381111561106257fe5b145b80611095575061107a60408d0160208e0161372b565b8015611095575060018160400151600381111561109357fe5b145b806110d457506110ab60608d0160408e0161372b565b80156110c657506002816040015160038111156110c457fe5b145b80156110d457508060600151155b8061111357506110ea60808d0160608e0161372b565b8015611105575060038160400151600381111561110357fe5b145b801561111357508060600151155b80611151575061112960a08d0160808e0161372b565b8015611144575060028160400151600381111561114257fe5b145b8015611151575080606001515b8061118f575061116760c08d0160a08e0161372b565b8015611182575060038160400151600381111561118057fe5b145b801561118f575080606001515b806111c757506111a560e08d0160c08e0161372b565b80156111c757508a6001600160a01b03168161016001516001600160a01b0316145b8061120057506111de6101008d0160e08e0161372b565b801561120057508a6001600160a01b03168161018001516001600160a01b0316145b15611321576001939093019260208d0135848161121957fe5b0661132157600194909401938c35851415611321578215801561124b57506112496101208d016101008e0161372b565b155b806112e057506001876001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561128c57600080fd5b505afa1580156112a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112c49190810190613892565b03831480156112e057506112e06101208d016101008e0161372b565b156112ea57600098505b6112fc6101208d016101008e0161372b565b611309576001830361130e565b826001015b9950600197506115009650505050505050565b6000199095019485158061134d57508215801561134d575061134b6101208d016101008e0161372b565b155b806113e257506001876001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561138e57600080fd5b505afa1580156113a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113c69190810190613892565b03831480156113e257506113e26101208d016101008e0161372b565b15611483576113f96101208d016101008e0161372b565b611406576000831161147a565b866001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561143f57600080fd5b505afa158015611453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114779190810190613892565b83105b985050506114be565b6114956101208d016101008e0161372b565b6114b05782156114a857600183036114ab565b60005b6114b5565b826001015b92505050610f01565b6114d06101208b016101008c0161372b565b80156114e9575060608b013580820160208d0135909101115b156114f5575060608a01355b965060009450505050505b9450945094915050565b611512612f90565b61151a612ec7565b6115248484610908565b604080516102c0810182528581528251515160208083019190915283515101519293509190820190600381111561155757fe5b815260200182600001516020015115158152602001826000015160800151151581526020018260000151604001518152602001600081526020018260200151151581526020016000815260200160008152602001826000015160e0015160028111156115bf57fe5b8152825160a0908101516020908101516001600160a01b031690830152835101516040909101906002602090810291909101516001600160a01b0390811683528451610100015116908201528251610120015160408201526060016000815260200182606001518152602001826080015181526020018260000151606001518152602001826040015181526020016000600281111561165a57fe5b81528251516040015160209182015282510151909250801561170d575060018151610100015160a084015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e8916116b091600401614194565b60206040518083038186803b1580156116c857600080fd5b505afa1580156116dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611700919081019061395d565b600281111561170b57fe5b145b15611995578051610100015160a0830151604051631c3db16d60e01b81526001600160a01b0390921691631c3db16d9161174991600401614194565b60206040518083038186803b15801561176157600080fd5b505afa158015611775573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117999190810190613892565b60028111156117a457fe5b826101e0019060028111156117b557fe5b908160028111156117c257fe5b9052508051610100015160a083015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e8916117fc91600401614194565b60206040518083038186803b15801561181457600080fd5b505afa158015611828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061184c919081019061395d565b826102800190600281111561185d57fe5b9081600281111561186a57fe5b9052508051610100015160a083015160405163afe15cfb60e01b81526001600160a01b039092169163afe15cfb916118a491600401614194565b604080518083038186803b1580156118bb57600080fd5b505afa1580156118cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506118f3919081019061397b565b610120840152610100808401919091528151015160a08301516101c084015160405163791f8b7360e11b81526001600160a01b039093169263f23f16e69261193f9290916004016142c3565b60206040518083038186803b15801561195757600080fd5b505afa15801561196b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061198f9190810190613892565b60c08301525b5092915050565b606086816119b16119ac89612a7f565b612aa5565b905085156119bf5785611a30565b816001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f857600080fd5b505afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a309190810190613892565b604051908082528060200260200182016040528015611a6957816020015b611a56612f90565b815260200190600190039081611a4e5790505b5092506000875b8715611a7c5787611aed565b836001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b158015611ab557600080fd5b505afa158015611ac9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611aed9190810190613892565b811015611c6b57611afc612f90565b611b7c8c866001600160a01b0316633d4d3600856040518263ffffffff1660e01b8152600401611b2c9190614194565b60206040518083038186803b158015611b4457600080fd5b505afa158015611b58573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101499190810190613892565b90508781604001516003811115611b8f57fe5b60048110611b9957fe5b602002015115611ba95750611c63565b6060611bbb6119ac8360200151612a7f565b9050600160005b8651811015611c3957898181518110611bd757fe5b6020026020010151158015611c235750611c21611c06888381518110611bf957fe5b6020026020010151612b76565b611c15858481518110611bf957fe5b9063ffffffff612bdc16565b155b15611c315760009150611c39565b600101611bc2565b508015611c5f5782888681518110611c4d57fe5b60209081029190910101526001909401935b5050505b600101611a70565b505050509695505050505050565b611c81612f08565b82611c8a61304b565b611c94858561258b565b9050600080600080611ca4612f72565b600080600060608a6001600160a01b031663bfbcff1a8e60018d60400151036040518363ffffffff1660e01b8152600401611ce09291906141a2565b60006040518083038186803b158015611cf857600080fd5b505afa158015611d0c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611d34919081019061379f565b509850985098509850985098509850985098506040518061014001604052808b81526020018a151581526020018981526020018881526020018715158152602001868152602001858152602001846002811115611d8d57fe5b81526001600160a01b0390931660208401526040909201529c9b505050505050505050505050565b606082611dc061304b565b611dca858561258b565b90508060400151604051908082528060200260200182016040528015611e0a57816020015b611df7613065565b815260200190600190039081611def5790505b50925060005b8160400151811015611f8f57600080600080611e2a612f72565b6000606060008a6001600160a01b031663bfbcff1a8e8b6040518363ffffffff1660e01b8152600401611e5e9291906141a2565b60006040518083038186803b158015611e7657600080fd5b505afa158015611e8a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611eb2919081019061379f565b995099509950505097509750975097509750604051806101200160405280891515815260200188815260200187815260200186151581526020018560016002811115611efa57fe5b60038110611f0457fe5b60200201516001600160a01b0316815260200185600280811115611f2457fe5b60038110611f2e57fe5b60200201516001600160a01b03168152602001846001600160a01b03168152602001838152602001828152508c60018b8d60400151030381518110611f6f57fe5b602002602001018190525050505050505050508080600101915050611e10565b50505092915050565b606060008089905087604051908082528060200260200182016040528015611fda57816020015b611fc7612f90565b815260200190600190039081611fbf5790505b50925060008885611fe9578095505b826001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561202257600080fd5b505afa158015612036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061205a9190810190613892565b61206b57506000925061257f915050565b6000886120f8578b1561207e578b6120f3565b6001846001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b1580156120b957600080fd5b505afa1580156120cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506120f19190810190613892565b035b6120fa565b8b5b90505b8861210b576000821161218a565b836001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561214457600080fd5b505afa158015612158573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061217c9190810190613892565b8110801561218a5750600082115b1561257a57604051621ea69b60e91b81526000906001600160a01b03861690633d4d3600906121bd908590600401614194565b60206040518083038186803b1580156121d557600080fd5b505afa1580156121e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061220d9190810190613892565b9050612217612f90565b6122218f8361150a565b60019750905061223460208d018d61372b565b801561224f575060008160400151600381111561224d57fe5b145b80612280575061226560408d0160208e0161372b565b8015612280575060018160400151600381111561227e57fe5b145b806122bf575061229660608d0160408e0161372b565b80156122b157506002816040015160038111156122af57fe5b145b80156122bf57508060600151155b806122fe57506122d560808d0160608e0161372b565b80156122f057506003816040015160038111156122ee57fe5b145b80156122fe57508060600151155b8061233c575061231460a08d0160808e0161372b565b801561232f575060028160400151600381111561232d57fe5b145b801561233c575080606001515b8061237a575061235260c08d0160a08e0161372b565b801561236d575060038160400151600381111561236b57fe5b145b801561237a575080606001515b806123b2575061239060e08d0160c08e0161372b565b80156123b25750896001600160a01b03168161016001516001600160a01b0316145b806123eb57506123c96101008d0160e08e0161372b565b80156123eb5750896001600160a01b03168161018001516001600160a01b0316145b1561241d57808886815181106123fd57fe5b60209081029190910101526001909401938885141561241d57505061257a565b6000199093019283158061243857508215801561243857508a155b806124bd57506001866001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561247957600080fd5b505afa15801561248d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506124b19190810190613892565b03831480156124bd57508a5b15612550578a6124d05760008311612547565b6001866001600160a01b0316636bfb0d016040518163ffffffff1660e01b815260040160206040518083038186803b15801561250b57600080fd5b505afa15801561251f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125439190810190613892565b0383105b9650505061257a565b8a61256c5782156125645760018303612567565b60005b612571565b826001015b925050506120fd565b505050505b97509795505050505050565b61259361304b565b604051634aac84e560e01b8152839060609060009081906001600160a01b03851690634aac84e5906125c9908990600401614194565b60006040518083038186803b1580156125e157600080fd5b505afa1580156125f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261261d91908101906138e5565b925092509250604051806060016040528084815260200183600381111561264057fe5b8152602001919091529695505050505050565b60008361265e6130b0565b50604080518082019091526000808252602082015261267b6130b0565b50604080518082018252600080825260208201529051634aac84e560e01b81526001600160a01b03841690634aac84e5906126ba908990600401614194565b60006040518083038186803b1580156126d257600080fd5b505afa1580156126e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261270e91908101906138e5565b845250505b815181511015612a75578051604051635fde7f8d60e11b815260009182916001600160a01b0387169163bfbcff1a91612750918c916004016141a2565b60006040518083038186803b15801561276857600080fd5b505afa15801561277c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127a4919081019061379f565b509497509195509350899250600191506127bb9050565b602002019190915292509050806127d3575050612a69565b602080850151908401511015612a5f576127eb612f72565b6127f3612f72565b60006001600160a01b03881663974121b28c8884602002015189600160200201516040518463ffffffff1660e01b8152600401612832939291906141bd565b6101006040518083038186803b15801561284b57600080fd5b505afa15801561285f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128839190810190613749565b93509350935050612892612f72565b6001600160a01b0389166352bc0e608d89600060200201518a600160200201518f6040518563ffffffff1660e01b81526004016128d294939291906141e5565b60606040518083038186803b1580156128ea57600080fd5b505afa1580156128fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612922919081019061370d565b6020840151909150158061293857506040830151155b156129525760408101516020820151019990990198612a3e565b600086600281111561296057fe5b14156129cc576020840151612976576000612993565b60208085015160408601519183015191019083028161299157fe5b045b60408501519a01996129a65760006129c3565b6020840151604080860151908301519101908302816129c157fe5b045b8a019950612a3e565b6000848760028111156129db57fe5b600381106129e557fe5b6020020151116129f6576000612a39565b83866002811115612a0357fe5b60038110612a0d57fe5b60200201518282886002811115612a2057fe5b60038110612a2a57fe5b60200201510281612a3757fe5b045b8a0199505b5050505082600160028110612a4f57fe5b60200201805160010190526127d3565b5050600060208201525b80516001018152612713565b5050509392505050565b612a876130ce565b5060408051808201909152815181526020828101908201525b919050565b6060612ab082612c42565b612ab957600080fd5b6000612ac483612c7c565b9050606081604051908082528060200260200182016040528015612b0257816020015b612aef6130ce565b815260200190600190039081612ae75790505b5090506000612b148560200151612cd8565b60208601510190506000805b84811015612b6b57612b3183612d3b565b9150604051806040016040528083815260200184815250848281518110612b5457fe5b602090810291909101015291810191600101612b20565b509195945050505050565b8051606090612b8457600080fd5b600080612b9084612dcf565b915091506060816040519080825280601f01601f191660200182016040528015612bc1576020820181803883390190505b50905060208101612bd3848285612df5565b50949350505050565b815181516000916001918114808314612bf85760009250612c36565b600160208701838101602088015b600284838510011415612c31578051835114612c255760009650600093505b60209283019201612c06565b505050505b50909150505b92915050565b8051600090612c5357506000612aa0565b6020820151805160001a9060c0821015612c7257600092505050612aa0565b5060019392505050565b8051600090612c8d57506000612aa0565b60008090506000612ca18460200151612cd8565b602085015185519181019250015b80821015612ccf57612cc082612d3b565b60019093019290910190612caf565b50909392505050565b8051600090811a6080811015612cf2576000915050612aa0565b60b8811080612d0d575060c08110801590612d0d575060f881105b15612d1c576001915050612aa0565b60c0811015612d305760b519019050612aa0565b60f519019050612aa0565b80516000908190811a6080811015612d565760019150611995565b60b8811015612d6b57607e1981019150611995565b60c0811015612d985760b78103600185019450806020036101000a85510460018201810193505050611995565b60f8811015612dad5760be1981019150611995565b60019390930151602084900360f7016101000a900490920160f5190192915050565b6000806000612de18460200151612cd8565b602085015194519481019594039392505050565b80612dff57612e41565b5b60208110612e1f578251825260209283019290910190601f1901612e00565b8015612e41578251825160208390036101000a60001901801990921691161782525b505050565b604051806101c0016040528060006001600160a01b0316815260200160006001600160a01b031681526020016060815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060a00160405280612eda612f08565b815260006020820152604001612eee612f72565b8152602001612efb612f72565b8152602001600081525090565b604051806101400160405280612f1c61304b565b81526000602082018190526040820181905260608201819052608082015260a001612f45612f72565b81526020016000815260200160006002811115612f5e57fe5b815260006020820152606060409091015290565b60405180606001604052806003906020820280388339509192915050565b604080516102c081018252600080825260606020830152909182019081526020016000151581526020016000151581526020016000815260200160008152602001600015158152602001600081526020016000815260200160006002811115612ff557fe5b8152600060208201819052604082018190526060808301829052608083015260a082015260c001613024612f72565b8152602001600081526020016000815260200161303f612f72565b81526020016000612efb565b604080516060808201909252908152602081016000612efb565b604080516101208101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082015261010081019190915290565b60405180604001604052806002906020820280388339509192915050565b604051806040016040528060008152602001600081525090565b8035612c3c8161443b565b8051612c3c8161443b565b600082601f83011261310f57600080fd5b600361312261311d8261430a565b6142e3565b9150818385602084028201111561313857600080fd5b60005b83811015613164578161314e88826130f3565b845250602092830192919091019060010161313b565b5050505092915050565b600082601f83011261317f57600080fd5b600361318d61311d8261430a565b915081838560208402820111156131a357600080fd5b60005b8381101561316457816131b98882613341565b84525060209283019291909101906001016131a6565b600082601f8301126131e057600080fd5b60046131ee61311d8261430a565b9150818385602084028201111561320457600080fd5b60005b83811015613164578161321a8882613336565b8452506020928301929190910190600101613207565b806101008101831015612c3c57600080fd5b806101208101831015612c3c57600080fd5b600082601f83011261326557600080fd5b813561327361311d82614328565b9150818183526020840193506020810190508385602084028201111561329857600080fd5b60005b8381101561316457816132ae8882613336565b845250602092830192919091019060010161329b565b600082601f8301126132d557600080fd5b60036132e361311d8261430a565b915081838560208402820111156132f957600080fd5b60005b83811015613164578161330f8882613357565b84525060209283019291909101906001016132fc565b8060808101831015612c3c57600080fd5b8035612c3c8161444f565b8051612c3c8161444f565b8035612c3c81614458565b8051612c3c81614458565b600082601f83011261337357600080fd5b815161338161311d82614349565b9150808252602083016020830185838301111561339d57600080fd5b611f8f8382846143ea565b600082601f8301126133b957600080fd5b81356133c761311d82614349565b915080825260208301602083018583830111156133e357600080fd5b611f8f8382846143de565b8051612c3c81614461565b8051612c3c8161446a565b8051612c3c81614477565b60006020828403121561342157600080fd5b600061342d84846130e8565b949350505050565b60006020828403121561344757600080fd5b600061342d84846130f3565b6000806000806101e0858703121561346a57600080fd5b600061347687876130e8565b945050602061348787828801613325565b93505060a061349887828801613242565b9250506101c06134aa878288016130e8565b91505092959194509250565b600080604083850312156134c957600080fd5b60006134d585856130e8565b92505060206134e68582860161334c565b9150509250929050565b60008060006060848603121561350557600080fd5b600061351186866130e8565b93505060206135228682870161334c565b9250506040613533868287016130e8565b9150509250925092565b600080600080600080610120878903121561355757600080fd5b600061356389896130e8565b965050602087013567ffffffffffffffff81111561358057600080fd5b61358c89828a016133a8565b955050604061359d89828a0161334c565b94505060606135ae89828a0161334c565b93505060806135bf89828a016131cf565b92505061010087013567ffffffffffffffff8111156135dd57600080fd5b6135e989828a01613254565b9150509295509295509295565b6000806000806000610180868803121561360f57600080fd5b600061361b88886130e8565b955050602061362c8882890161334c565b945050604061363d8882890161334c565b935050606061364e88828901613230565b925050610160613660888289016130e8565b9150509295509295909350565b60008060008060008060006101c0888a03121561368957600080fd5b60006136958a8a6130e8565b97505060206136a68a828b0161334c565b96505060406136b78a828b0161334c565b95505060606136c88a828b01613230565b9450506101606136da8a828b01613336565b9350506101806136ec8a828b016130e8565b9250506101a06136fe8a828b0161334c565b91505092959891949750929550565b60006060828403121561371f57600080fd5b600061342d84846132c4565b60006020828403121561373d57600080fd5b600061342d8484613336565b600080600080610100858703121561376057600080fd5b600061376c8787613341565b945050602061377d878288016132c4565b935050608061378e8782880161316e565b92505060e06134aa87828801613357565b6000806000806000806000806000806101808b8d0312156137bf57600080fd5b60006137cb8d8d613341565b9a505060206137dc8d828e01613357565b99505060406137ed8d828e01613357565b98505060606137fe8d828e01613341565b975050608061380f8d828e016130fe565b96505060e06138208d828e01613357565b9550506101006138328d828e016133f9565b9450506101206138448d828e016133ee565b9350506101408b015167ffffffffffffffff81111561386257600080fd5b61386e8d828e01613362565b9250506101606138808d828e01613357565b9150509295989b9194979a5092959850565b6000602082840312156138a457600080fd5b600061342d8484613357565b6000602082840312156138c257600080fd5b815167ffffffffffffffff8111156138d957600080fd5b61342d84828501613362565b6000806000606084860312156138fa57600080fd5b835167ffffffffffffffff81111561391157600080fd5b61391d86828701613362565b935050602061392e86828701613404565b925050604061353386828701613357565b60006020828403121561395157600080fd5b600061342d84846133ee565b60006020828403121561396f57600080fd5b600061342d84846133f9565b6000806040838503121561398e57600080fd5b600061399a8585613357565b92505060206134e685828601613357565b60006139b783836139f6565b505060200190565b60006139b78383613bc0565b60006139d78383613d8c565b9392505050565b60006139d78383613e42565b60006139b78383613bc9565b6139ff8161438d565b82525050565b613a0e8161437a565b613a188184612aa0565b9250613a2382614371565b8060005b83811015613a51578151613a3b87826139ab565b9650613a4683614374565b925050600101613a27565b505050505050565b613a628161437a565b613a6c8184612aa0565b9250613a7782614371565b8060005b83811015613a51578151613a8f87826139bf565b9650613a9a83614374565b925050600101613a7b565b6000613ab082614380565b613aba8185614384565b935083602082028501613acc85614374565b8060005b85811015613b065784840389528151613ae985826139cb565b9450613af483614374565b60209a909a0199925050600101613ad0565b5091979650505050505050565b6000613b1e82614380565b613b288185614384565b935083602082028501613b3a85614374565b8060005b85811015613b065784840389528151613b5785826139de565b9450613b6283614374565b60209a909a0199925050600101613b3e565b613b7d8161437a565b613b878184612aa0565b9250613b9282614371565b8060005b83811015613a51578151613baa87826139ea565b9650613bb583614374565b925050600101613b96565b6139ff81614398565b6139ff81614371565b6000613bdd82614380565b613be78185614384565b9350613bf78185602086016143ea565b613c008161441a565b9093019392505050565b6139ff8161439d565b6139ff816143c8565b6139ff816143d3565b80516000906101c0840190613c3a85826139f6565b506020830151613c4d60208601826139f6565b5060408301518482036040860152613c658282613bd2565b9150506060830151613c7a6060860182613bc9565b506080830151613c8d6080860182613bc9565b5060a0830151613ca060a0860182613bc9565b5060c0830151613cb360c0860182613bc9565b5060e0830151613cc660e0860182613bc9565b50610100830151613cdb610100860182613bc9565b50610120830151613cf0610120860182613bc9565b50610140830151613d05610140860182613bc9565b50610160830151613d1a610160860182613bc9565b50610180830151613d2f610180860182613bc9565b506101a0830151613d446101a0860182613bc9565b509392505050565b8051606080845260009190840190613d648282613bd2565b9150506020830151613d796020860182613c1c565b506040830151613d446040860182613bc9565b8051600090610120840190613da18582613bc0565b506020830151613db46020860182613bc9565b506040830151613dc76040860182613bc9565b506060830151613dda6060860182613bc0565b506080830151613ded60808601826139f6565b5060a0830151613e0060a08601826139f6565b5060c0830151613e1360c08601826139f6565b5060e083015184820360e0860152613e2b8282613bd2565b915050610100830151613d44610100860182613bc9565b8051600090610340840190613e578582613bc9565b5060208301518482036020860152613e6f8282613bd2565b9150506040830151613e846040860182613c1c565b506060830151613e976060860182613bc0565b506080830151613eaa6080860182613bc0565b5060a0830151613ebd60a0860182613bc9565b5060c0830151613ed060c0860182613bc9565b5060e0830151613ee360e0860182613bc0565b50610100830151613ef8610100860182613bc9565b50610120830151613f0d610120860182613bc9565b50610140830151613f22610140860182613c13565b50610160830151613f376101608601826139f6565b50610180830151613f4c6101808601826139f6565b506101a0830151613f616101a08601826139f6565b506101c08301518482036101c0860152613f7b8282613bd2565b9150506101e0830151613f926101e0860182613c13565b50610200830151613fa7610200860182613a59565b50610220830151613fbc610260860182613bc9565b50610240830151613fd1610280860182613bc9565b50610260830151613fe66102a0860182613b74565b50610280830151613ffb610300860182613c13565b506102a0830151613d44610320860182613bc9565b8051610180808452600091908401906140298282613d4c565b915050602083015161403e6020860182613bc0565b5060408301516140516040860182613bc9565b5060608301516140646060860182613bc9565b5060808301516140776080860182613bc0565b5060a083015161408a60a0860182613a05565b5060c083015161409e610100860182613bc9565b5060e08301516140b2610120860182613c13565b506101008301516140c7610140860182613c0a565b506101208301518482036101608601526140e18282613bd2565b95945050505050565b8051610120808452600091908401906141038282614010565b91505060208301516141186020860182613bc0565b50604083015161412b6040860182613b74565b50606083015161413e60a0860182613a59565b506080830151613d44610100860182613bc9565b602080825281016139d78184613aa5565b602080825281016139d78184613b13565b604080825281016141858185613b13565b90506139d76020830184613bc0565b60208101612c3c8284613bc9565b604081016141b08285613bc9565b6139d76020830184613bc9565b606081016141cb8286613bc9565b6141d86020830185613bc9565b61342d6040830184613bc9565b608081016141f38287613bc9565b6142006020830186613bc9565b61420d6040830185613bc9565b6140e160608301846139f6565b602080825281016139d78184613bd2565b602080825281016139d78184613c25565b602080825281016139d78184613d4c565b602080825281016139d78184613e42565b602080825281016139d78184614010565b602080825281016139d781846140ea565b6060810161428e8286613bc9565b61429b6020830185613bc0565b61342d6040830184613bc0565b606081016142b68286613bc9565b6141d86020830185613bc0565b604081016142d18285613bc9565b818103602083015261342d8184613bd2565b60405181810167ffffffffffffffff8111828210171561430257600080fd5b604052919050565b600067ffffffffffffffff82111561432157600080fd5b5060200290565b600067ffffffffffffffff82111561433f57600080fd5b5060209081020190565b600067ffffffffffffffff82111561436057600080fd5b506020601f91909101601f19160190565b90565b60200190565b50600390565b5190565b90815260200190565b6000612c3c826143bc565b151590565b6000612c3c8261438d565b80612aa081614424565b80612aa081614431565b6001600160a01b031690565b6000612c3c826143a8565b6000612c3c826143b2565b82818337506000910152565b60005b838110156144055781810151838201526020016143ed565b83811115614414576000848401525b50505050565b601f01601f191690565b6003811061442e57fe5b50565b6004811061442e57fe5b6144448161438d565b811461442e57600080fd5b61444481614398565b61444481614371565b6144448161439d565b6003811061442e57600080fd5b6004811061442e57600080fdfea365627a7a7231582062af74091a1e65fafb3810ee810c07f3aea3bde1761e32a18881d6f30cb402966c6578706572696d656e74616cf564736f6c63430005110040", + "devdoc": { + "methods": { + "availableRewards(address,bytes32,address)": { + "details": "Return the withdrawable rewards for a contributor.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_contributor": "The address of the contributor.", + "_itemID": "The ID of the item to query." + }, + "return": "The amount withdrawable per round per request." + }, + "countWithFilter(address,uint256,uint256,bool[8],address)": { + "details": "Count the number of items for a given filter.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_count": "The number of items to return.", + "_cursorIndex": "The index of the items from which to start iterating. To start from either the oldest or newest item.", + "_filter": "The filter to use. Each element of the array in sequence means: - Include absent items in result; - Include registered items in result; - Include items with registration requests that are not disputed in result; - Include items with clearing requests that are not disputed in result; - Include disputed items with registration requests in result; - Include disputed items with clearing requests in result; - Include items with a request by _party; - Include items challenged by _party.", + "_party": "The address to use if checking for items with a request or challenged by a specific party." + }, + "return": "The query result: - The number of items found for the filter; - Whether there are more items to iterate; - The index of the last item of the query. Useful as a starting point for the next query if counting in multiple steps." + }, + "fetchArbitrable(address)": { + "details": "Fetch arbitrable TCR data in a single call.", + "params": { + "_address": "The address of the Generalized TCR to query." + }, + "return": "The latest data on an arbitrable TCR contract." + }, + "findIndexForPage(address,uint256[4],bool[9],address)": { + "details": "Find the index of the first item of a page of items for a given filter.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_filter": "The filter to use. Each element of the array in sequence means: - Include absent items in result; - Include registered items in result; - Include items with registration requests that are not disputed in result; - Include items with clearing requests that are not disputed in result; - Include disputed items with registration requests in result; - Include disputed items with clearing requests in result; - Include items with a request by _party; - Include items challenged by _party. - Whether to sort from oldest to the newest item.", + "_party": "The address to use if checking for items with a request or challenged by a specific party.", + "_targets": "The targets to use for the query. Each element of the array in sequence means: - The page to search; - The number of items per page; - The number of items to iterate when searching; - The position from where to start iterating." + }, + "return": "The query result: - Index of the page, if it was found; - Whether there are more items to iterate; - If the index of the page we are searching was found." + }, + "findItem(address,bytes,uint256,uint256,bool[4],bool[])": { + "details": "Find an item by matching column values exactly. Unless specified in the _ignoreColumns parameter, finding an item requires matching all columns. - Example: Item [18, 'PNK', 'Pinakion', '0xca35b7d915458ef540ade6068dfe2f44e8fa733c'] RLP encoded: 0xe383504e4b128850696e616b696f6e94ca35b7d915458ef540ade6068dfe2f44e8fa733c Input for remix: [\"0xe3\",\"0x83\",\"0x50\",\"0x4e\",\"0x4b\",\"0x12\",\"0x88\",\"0x50\",\"0x69\",\"0x6e\",\"0x61\",\"0x6b\",\"0x69\",\"0x6f\",\"0x6e\",\"0x94\",\"0xca\",\"0x35\",\"0xb7\",\"0xd9\",\"0x15\",\"0x45\",\"0x8e\",\"0xf5\",\"0x40\",\"0xad\",\"0xe6\",\"0x06\",\"0x8d\",\"0xfe\",\"0x2f\",\"0x44\",\"0xe8\",\"0xfa\",\"0x73\",\"0x3c\"]", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_count": "The number of items to iterate and return while searching.", + "_cursor": "The index from where to start looking for matches.", + "_ignoreColumns": "Columns to ignore when searching. If this is an array with only false items, then every column must match exactly.", + "_rlpEncodedMatch": "The RLP encoded item to match against the items on the list.", + "_skipState": "Boolean tuple defining whether to skip items in a given state. [Absent, Registered, RegistrationRequested, ClearingRequested]." + }, + "return": "An array with items that match the query." + }, + "getItem(address,bytes32)": { + "details": "Fetch the latest data on an item in a single call.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The item data." + }, + "getItemData(address,bytes32)": { + "details": "Fetch data of the an item and return a struct.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The round data." + }, + "getItemRequests(address,bytes32)": { + "details": "Fetch all requests for an item.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The items requests." + }, + "getLatestRequestData(address,bytes32)": { + "details": "Fetch the latest request of item.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The round data." + }, + "getLatestRoundRequestData(address,bytes32)": { + "details": "Fetch the latest round of the latest request of an item.", + "params": { + "_address": "The address of the Generalized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The round data." + }, + "queryItems(address,uint256,uint256,bool[8],bool,address,uint256)": { + "details": "Return the values of the items the query finds. This function is O(n), where n is the number of items. This could exceed the gas limit, therefore this function should only be used for interface display and not by other contracts.", + "params": { + "_address": "The address of the GTCR to query.", + "_count": "The number of items to iterate.", + "_cursorIndex": "The index of the items from which to start iterating. To start from either the oldest or newest item.", + "_filter": "The filter to use. Each element of the array in sequence means: - Include absent items in result; - Include registered items in result; - Include items with registration requests that are not disputed in result; - Include items with clearing requests that are not disputed in result; - Include disputed items with registration requests in result; - Include disputed items with clearing requests in result; - Include items with a request by _party; - Include items challenged by _party.", + "_limit": "The maximum number of items to return. If set to 0 will return _count items.", + "_oldestFirst": "Whether to sort from oldest to the newest item.", + "_party": "The address to use if checking for items with a request or challenged by a specific party." + }, + "return": "The data of the items found and whether there are more items for the current filter and sort." + } + }, + "title": "GeneralizedTCRView A view contract to fetch, batch, parse and return GTCR contract data efficiently. This contract includes functions that can halt execution due to out-of-gas exceptions. Because of this it should never be relied upon by other contracts." + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/sepolia/LightBatchWithdraw.json b/deployments/sepolia/LightBatchWithdraw.json new file mode 100644 index 0000000..f481a85 --- /dev/null +++ b/deployments/sepolia/LightBatchWithdraw.json @@ -0,0 +1,147 @@ +{ + "address": "0x43458fa7b40Fd7Bb32cC3a2b95186F91A95Ef0c8", + "abi": [ + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_contributor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_cursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundCursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundCount", + "type": "uint256" + } + ], + "name": "batchRequestWithdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_contributor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_request", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_cursor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + } + ], + "name": "batchRoundWithdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xeae5d81555b0a52ab0f87154d3af64035aee470a231e5caea7bf04ca827cd3ac", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0x43458fa7b40Fd7Bb32cC3a2b95186F91A95Ef0c8", + "transactionIndex": 38, + "gasUsed": "273051", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4b65373efbce2004f89fcaa08ad9b0005bef01424e1e51a5614383cf37458970", + "transactionHash": "0xeae5d81555b0a52ab0f87154d3af64035aee470a231e5caea7bf04ca827cd3ac", + "logs": [], + "blockNumber": 4048381, + "cumulativeGasUsed": "18976481", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_contributor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_cursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundCursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundCount\",\"type\":\"uint256\"}],\"name\":\"batchRequestWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_contributor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_request\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_cursor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"}],\"name\":\"batchRoundWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"batchRequestWithdraw(address,address,bytes32,uint256,uint256,uint256,uint256)\":{\"details\":\"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.\",\"params\":{\"_address\":\"The address of the GTCR.\",\"_contributor\":\"The address that made contributions to the request.\",\"_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.\",\"_cursor\":\"The request from which to start withdrawing.\",\"_itemID\":\"The ID of the item with funds to be withdrawn.\",\"_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.\",\"_roundCursor\":\"The round of each request from where to start withdrawing. Round 0 is always empty, so callers can safely start with 1.\"}},\"batchRoundWithdraw(address,address,bytes32,uint256,uint256,uint256)\":{\"details\":\"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.\",\"params\":{\"_address\":\"The address of the LightGTCR.\",\"_contributor\":\"The address that made contributions to the request.\",\"_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.\",\"_cursor\":\"The round from where to start withdrawing. Round 0 is always empty, so callers can safely start with 1.\",\"_itemID\":\"The ID of the item with funds to be withdrawn.\",\"_request\":\"The request from which to withdraw contributions.\"}}},\"title\":\"LightBatchWithdraw Withdraw fees and rewards from contributions to disputes rounds in batches.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/LightBatchWithdraw.sol\":\"LightBatchWithdraw\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/LightBatchWithdraw.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport {LightGeneralizedTCR} from \\\"./LightGeneralizedTCR.sol\\\";\\n\\n/**\\n * @title LightBatchWithdraw\\n * Withdraw fees and rewards from contributions to disputes rounds in batches.\\n */\\ncontract LightBatchWithdraw {\\n /** @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.\\n * @param _address The address of the LightGTCR.\\n * @param _contributor The address that made contributions to the request.\\n * @param _itemID The ID of the item with funds to be withdrawn.\\n * @param _request The request from which to withdraw contributions.\\n * @param _cursor The round from where to start withdrawing. Round 0 is always empty, so callers can safely start with 1.\\n * @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.\\n */\\n function batchRoundWithdraw(\\n address _address,\\n address payable _contributor,\\n bytes32 _itemID,\\n uint256 _request,\\n uint256 _cursor,\\n uint256 _count\\n ) public {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n (, , , , , uint256 numberOfRounds, , , , ) = gtcr.getRequestInfo(_itemID, _request);\\n for (uint256 i = _cursor; i < numberOfRounds && (_count == 0 || i < _cursor + _count); i++)\\n gtcr.withdrawFeesAndRewards(_contributor, _itemID, _request, i);\\n }\\n\\n /** @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.\\n * @param _address The address of the GTCR.\\n * @param _contributor The address that made contributions to the request.\\n * @param _itemID The ID of the item with funds to be withdrawn.\\n * @param _cursor The request from which to start withdrawing.\\n * @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.\\n * @param _roundCursor The round of each request from where to start withdrawing. Round 0 is always empty, so callers can safely start with 1.\\n * @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.\\n */\\n function batchRequestWithdraw(\\n address _address,\\n address payable _contributor,\\n bytes32 _itemID,\\n uint256 _cursor,\\n uint256 _count,\\n uint256 _roundCursor,\\n uint256 _roundCount\\n ) external {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n (, uint256 numberOfRequests, ) = gtcr.getItemInfo(_itemID);\\n for (uint256 i = _cursor; i < numberOfRequests && (_count == 0 || i < _cursor + _count); i++)\\n batchRoundWithdraw(_address, _contributor, _itemID, i, _roundCursor, _roundCount);\\n }\\n}\\n\",\"keccak256\":\"0x566adf0b3301bb5b8f766cb62b11bb193b64b01688cd8e899514ba2284132593\"},\"contracts/LightGeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1*, @mtsalenc*, @hbarcelos*]\\n * @reviewers: [@fnanni-0*, @greenlucid, @shalzz]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\n\\nimport {IArbitrable, IArbitrator} from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport {IEvidence} from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport {CappedMath} from \\\"./utils/CappedMath.sol\\\";\\nimport {CappedMath128} from \\\"./utils/CappedMath128.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */\\n// It is the user responsibility to accept ETH.\\n\\n/**\\n * @title LightGeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n * The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns.\\n */\\ncontract LightGeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint256;\\n using CappedMath128 for uint128;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n enum RequestType {\\n Registration, // Identifies a request to register an item to the registry.\\n Clearing // Identifies a request to remove an item from the registry.\\n }\\n\\n enum DisputeStatus {\\n None, // No dispute was created.\\n AwaitingRuling, // Dispute was created, but the final ruling was not given yet.\\n Resolved // Dispute was ruled.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n Status status; // The current status of the item.\\n uint128 sumDeposit; // The total deposit made by the requester and the challenger (if any).\\n uint120 requestCount; // The number of requests.\\n mapping(uint256 => Request) requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n RequestType requestType;\\n uint64 submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n uint24 arbitrationParamsIndex; // The index for the arbitration params for the request.\\n address payable requester; // Address of the requester.\\n // Pack the requester together with the other parameters, as they are written in the same request.\\n address payable challenger; // Address of the challenger, if any.\\n }\\n\\n struct DisputeData {\\n uint256 disputeID; // The ID of the dispute on the arbitrator.\\n DisputeStatus status; // The current status of the dispute.\\n Party ruling; // The ruling given to a dispute. Only set after it has been resolved.\\n uint240 roundCount; // The number of rounds.\\n mapping(uint256 => Round) rounds; // Data of the different dispute rounds. rounds[roundId].\\n }\\n\\n struct Round {\\n Party sideFunded; // Stores the side that successfully paid the appeal fees in the latest round. Note that if both sides have paid a new round is created.\\n uint256 feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n uint256[3] amountPaid; // Tracks the sum paid for each Party in this round.\\n mapping(address => uint256[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n struct ArbitrationParams {\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n }\\n\\n /* Constants */\\n\\n uint256 public constant RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n uint256 private constant RESERVED_ROUND_ID = 0; // For compatibility with GeneralizedTCR consider the request/challenge cycle the first round (index 0).\\n\\n /* Storage */\\n\\n bool private initialized;\\n\\n address public relayerContract; // The contract that is used to add or remove items directly to speed up the interchain communication.\\n address public governor; // The address that can make changes to the parameters of the contract.\\n\\n uint256 public submissionBaseDeposit; // The base deposit to submit an item.\\n uint256 public removalBaseDeposit; // The base deposit to remove an item.\\n uint256 public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint256 public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint256 public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n\\n // Multipliers are in basis points.\\n uint256 public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint256 public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint256 public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint256 public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint256 => bytes32)) public arbitratorDisputeIDToItemID; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItemID[arbitrator][disputeID].\\n mapping(bytes32 => mapping(uint256 => DisputeData)) public requestsDisputeData; // Maps an item and a request to the data of the dispute related to them. requestsDisputeData[itemID][requestIndex]\\n ArbitrationParams[] public arbitrationParamsChanges;\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor() {\\n require(msg.sender == governor, \\\"The caller must be the governor.\\\");\\n _;\\n }\\n\\n modifier onlyRelayer() {\\n require(msg.sender == relayerContract, \\\"The caller must be the relay.\\\");\\n _;\\n }\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _updatedDirectly Whether this was emitted in either `addItemDirectly` or `removeItemDirectly`. This is used in the subgraph.\\n */\\n event ItemStatusChange(bytes32 indexed _itemID, bool _updatedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _data The item data URI.\\n * @param _addedDirectly Whether the item was added via `addItemDirectly`.\\n */\\n event NewItem(bytes32 indexed _itemID, string _data, bool _addedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n */\\n event RequestSubmitted(bytes32 indexed _itemID, uint256 _evidenceGroupID);\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal. The roundID assumes the initial request and challenge deposits are the first round. This is done so indexers can know more information about the contribution without using call handlers.\\n * @param _itemID The ID of the item.\\n * @param _requestID The index of the request that received the contribution.\\n * @param _roundID The index of the round that received the contribution.\\n * @param _contributor The address making the contribution.\\n * @param _contribution How much of the contribution was accepted.\\n * @param _side The party receiving the contribution.\\n */\\n event Contribution(\\n bytes32 indexed _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address indexed _contributor,\\n uint256 _contribution,\\n Party _side\\n );\\n\\n /**\\n * @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Emitted when someone withdraws more than 0 rewards.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw.\\n * @param _round The round from which to withdraw.\\n * @param _reward The amount withdrawn.\\n */\\n event RewardWithdrawn(\\n address indexed _beneficiary,\\n bytes32 indexed _itemID,\\n uint256 _request,\\n uint256 _round,\\n uint256 _reward\\n );\\n\\n /**\\n * @dev Initialize the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _baseDeposits The base deposits for requests/challenges as follows:\\n * - The base deposit to submit an item.\\n * - The base deposit to remove an item.\\n * - The base deposit to challenge a submission.\\n * - The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n * @param _relayerContract The address of the relay contract to add/remove items directly.\\n */\\n function initialize(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n address _connectedTCR,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence,\\n address _governor,\\n uint256[4] calldata _baseDeposits,\\n uint256 _challengePeriodDuration,\\n uint256[3] calldata _stakeMultipliers,\\n address _relayerContract\\n ) external {\\n require(!initialized, \\\"Already initialized.\\\");\\n\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n governor = _governor;\\n submissionBaseDeposit = _baseDeposits[0];\\n removalBaseDeposit = _baseDeposits[1];\\n submissionChallengeBaseDeposit = _baseDeposits[2];\\n removalChallengeBaseDeposit = _baseDeposits[3];\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n relayerContract = _relayerContract;\\n\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n\\n initialized = true;\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /**\\n * @dev Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _item The URI to the item data.\\n */\\n function addItemDirectly(string calldata _item) external onlyRelayer {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item is added directly once, the next time it is added it will emit this event again.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, true);\\n }\\n\\n item.status = Status.Registered;\\n\\n emit ItemStatusChange(itemID, true);\\n }\\n\\n /**\\n * @dev Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _itemID The ID of the item to remove.\\n */\\n function removeItemDirectly(bytes32 _itemID) external onlyRelayer {\\n Item storage item = items[_itemID];\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n item.status = Status.Absent;\\n\\n emit ItemStatusChange(_itemID, true);\\n }\\n\\n /**\\n * @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The URI to the item data.\\n */\\n function addItem(string calldata _item) external payable {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item was added previously using `addItemDirectly`, the event will be emitted again here.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, false);\\n }\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(submissionBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.RegistrationRequested;\\n\\n request.requestType = RequestType.Registration;\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n\\n emit RequestSubmitted(itemID, getEvidenceGroupID(itemID, item.requestCount - 1));\\n\\n emit Contribution(itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(removalBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.ClearingRequested;\\n\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n request.requestType = RequestType.Clearing;\\n\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, item.requestCount - 1);\\n\\n emit RequestSubmitted(_itemID, evidenceGroupID);\\n\\n emit Contribution(_itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime <= challengePeriodDuration,\\n \\\"Challenges must occur during the challenge period.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not have already been disputed.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitrationParams.arbitratorExtraData);\\n uint256 totalCost;\\n {\\n uint256 challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n }\\n require(msg.value >= totalCost, \\\"You must fully fund the challenge.\\\");\\n\\n emit Contribution(_itemID, lastRequestIndex, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Challenger);\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = item.sumDeposit.addCap(uint128(totalCost)).subCap(uint128(arbitrationCost));\\n\\n request.challenger = msg.sender;\\n\\n // Raise a dispute.\\n disputeData.disputeID = arbitrator.createDispute.value(arbitrationCost)(\\n RULING_OPTIONS,\\n arbitrationParams.arbitratorExtraData\\n );\\n disputeData.status = DisputeStatus.AwaitingRuling;\\n // For compatibility with GeneralizedTCR consider the request/challenge cycle\\n // the first round (index 0), so we need to make the next round index 1.\\n disputeData.roundCount = 2;\\n\\n arbitratorDisputeIDToItemID[address(arbitrator)][disputeData.disputeID] = _itemID;\\n\\n uint256 metaEvidenceID = 2 * request.arbitrationParamsIndex + uint256(request.requestType);\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, lastRequestIndex);\\n emit Dispute(arbitrator, disputeData.disputeID, metaEvidenceID, evidenceGroupID);\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side > Party.None, \\\"Invalid side.\\\");\\n\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(\\n disputeData.status == DisputeStatus.AwaitingRuling,\\n \\\"A dispute must have been raised to fund an appeal.\\\"\\n );\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 lastRoundIndex = disputeData.roundCount - 1;\\n Round storage round = disputeData.rounds[lastRoundIndex];\\n require(round.sideFunded != _side, \\\"Side already fully funded.\\\");\\n\\n uint256 multiplier;\\n {\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = arbitrator.appealPeriod(disputeData.disputeID);\\n require(\\n block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n Party winner = Party(arbitrator.currentRuling(disputeData.disputeID));\\n if (winner == Party.None) {\\n multiplier = sharedStakeMultiplier;\\n } else if (_side == winner) {\\n multiplier = winnerStakeMultiplier;\\n } else {\\n multiplier = loserStakeMultiplier;\\n require(\\n block.timestamp < (appealPeriodStart + appealPeriodEnd) / 2,\\n \\\"The loser must contribute during the first half of the appeal period.\\\"\\n );\\n }\\n }\\n\\n uint256 appealCost = arbitrator.appealCost(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n uint256 totalCost = appealCost.addCap(appealCost.mulCap(multiplier) / MULTIPLIER_DIVISOR);\\n contribute(_itemID, lastRequestIndex, lastRoundIndex, uint256(_side), msg.sender, msg.value, totalCost);\\n\\n if (round.amountPaid[uint256(_side)] >= totalCost) {\\n if (round.sideFunded == Party.None) {\\n round.sideFunded = _side;\\n } else {\\n // Resets the value because both sides are funded.\\n round.sideFunded = Party.None;\\n\\n // Raise appeal if both sides are fully funded.\\n arbitrator.appeal.value(appealCost)(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n disputeData.roundCount++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n }\\n\\n /**\\n * @dev If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _requestID The request from which to withdraw from.\\n * @param _roundID The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(\\n address payable _beneficiary,\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n ) external {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n require(disputeData.status == DisputeStatus.Resolved, \\\"Request must be resolved.\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n\\n uint256 reward;\\n if (_roundID == disputeData.roundCount - 1) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward =\\n round.contributions[_beneficiary][uint256(Party.Requester)] +\\n round.contributions[_beneficiary][uint256(Party.Challenger)];\\n } else if (disputeData.ruling == Party.None) {\\n uint256 totalFeesInRound = round.amountPaid[uint256(Party.Challenger)] +\\n round.amountPaid[uint256(Party.Requester)];\\n uint256 claimableFees = round.contributions[_beneficiary][uint256(Party.Challenger)] +\\n round.contributions[_beneficiary][uint256(Party.Requester)];\\n reward = totalFeesInRound > 0 ? (claimableFees * round.feeRewards) / totalFeesInRound : 0;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint256(disputeData.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint256(disputeData.ruling)] * round.feeRewards) /\\n round.amountPaid[uint256(disputeData.ruling)]\\n : 0;\\n }\\n round.contributions[_beneficiary][uint256(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint256(Party.Challenger)] = 0;\\n\\n if (reward > 0) {\\n _beneficiary.send(reward);\\n emit RewardWithdrawn(_beneficiary, _itemID, _requestID, _roundID, reward);\\n }\\n }\\n\\n /**\\n * @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = items[_itemID].requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested) {\\n item.status = Status.Registered;\\n } else if (item.status == Status.ClearingRequested) {\\n item.status = Status.Absent;\\n } else {\\n revert(\\\"There must be a request.\\\");\\n }\\n\\n emit ItemStatusChange(_itemID, false);\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (sumDeposit > 0) {\\n // reimburse the requester\\n request.requester.send(sumDeposit);\\n }\\n }\\n\\n /**\\n * @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n\\n bytes32 itemID = arbitratorDisputeIDToItemID[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n uint256 lastRequestIndex = items[itemID].requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.AwaitingRuling, \\\"The request must not be resolved.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n require(address(arbitrationParams.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n\\n uint256 finalRuling;\\n Round storage round = disputeData.rounds[disputeData.roundCount - 1];\\n\\n // If one side paid its fees, the ruling is in its favor.\\n // Note that if the other side had also paid, sideFudned would have been reset\\n // and an appeal would have been created.\\n if (round.sideFunded == Party.Requester) {\\n finalRuling = uint256(Party.Requester);\\n } else if (round.sideFunded == Party.Challenger) {\\n finalRuling = uint256(Party.Challenger);\\n } else {\\n finalRuling = _ruling;\\n }\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, finalRuling);\\n\\n Party winner = Party(finalRuling);\\n\\n disputeData.status = DisputeStatus.Resolved;\\n disputeData.ruling = winner;\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (winner == Party.None) {\\n // If the arbitrator refuse to rule, then the item status should be the same it was before the request.\\n // Regarding item.status this is equivalent to the challenger winning the dispute.\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n // Since nobody has won, then we reimburse both parties equally.\\n // If item.sumDeposit is odd, 1 wei will remain in the contract balance.\\n uint256 halfSumDeposit = sumDeposit / 2;\\n\\n request.requester.send(halfSumDeposit);\\n request.challenger.send(halfSumDeposit);\\n } else if (winner == Party.Requester) {\\n item.status = item.status == Status.RegistrationRequested ? Status.Registered : Status.Absent;\\n\\n request.requester.send(sumDeposit);\\n } else {\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n request.challenger.send(sumDeposit);\\n }\\n\\n emit ItemStatusChange(itemID, false);\\n }\\n\\n /**\\n * @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = item.requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n emit Evidence(\\n arbitrationParams.arbitrator,\\n getEvidenceGroupID(_itemID, lastRequestIndex),\\n msg.sender,\\n _evidence\\n );\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeChallengePeriodDuration(uint256 _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint256 _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint256 _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint256 _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint256 _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint256 _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint256 _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint256 _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /**\\n * @dev Change the address of the relay contract.\\n * @param _relayerContract The new address of the relay contract.\\n */\\n function changeRelayerContract(address _relayerContract) external onlyGovernor {\\n relayerContract = _relayerContract;\\n }\\n\\n /**\\n * @notice Changes the params related to arbitration.\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function changeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence\\n ) external onlyGovernor {\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function _doChangeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence\\n ) internal {\\n emit MetaEvidence(2 * arbitrationParamsChanges.length, _registrationMetaEvidence);\\n emit MetaEvidence(2 * arbitrationParamsChanges.length + 1, _clearingMetaEvidence);\\n\\n arbitrationParamsChanges.push(\\n ArbitrationParams({arbitrator: _arbitrator, arbitratorExtraData: _arbitratorExtraData})\\n );\\n }\\n\\n /**\\n * @notice Make a fee contribution.\\n * @dev It cannot be inlined in fundAppeal because of the stack limit.\\n * @param _itemID The item receiving the contribution.\\n * @param _requestID The request to contribute.\\n * @param _roundID The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n uint256 _side,\\n address payable _contributor,\\n uint256 _amount,\\n uint256 _totalRequired\\n ) internal {\\n Round storage round = requestsDisputeData[_itemID][_requestID].rounds[_roundID];\\n uint256 pendingAmount = _totalRequired.subCap(round.amountPaid[_side]);\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution; // Amount contributed.\\n uint256 remainingETH; // Remaining ETH to send back.\\n if (pendingAmount > _amount) {\\n contribution = _amount;\\n } else {\\n contribution = pendingAmount;\\n remainingETH = _amount - pendingAmount;\\n }\\n\\n round.contributions[_contributor][_side] += contribution;\\n round.amountPaid[_side] += contribution;\\n round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n if (remainingETH > 0) {\\n // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n _contributor.send(remainingETH);\\n }\\n\\n if (contribution > 0) {\\n emit Contribution(_itemID, _requestID, _roundID, msg.sender, contribution, Party(_side));\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /**\\n * @dev Gets the evidengeGroupID for a given item and request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The ID of the request.\\n * @return The evidenceGroupID\\n */\\n function getEvidenceGroupID(bytes32 _itemID, uint256 _requestID) public pure returns (uint256) {\\n return uint256(keccak256(abi.encodePacked(_itemID, _requestID)));\\n }\\n\\n /**\\n * @notice Gets the arbitrator for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator address.\\n */\\n function arbitrator() external view returns (IArbitrator) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitrator;\\n }\\n\\n /**\\n * @notice Gets the arbitratorExtraData for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator extra data.\\n */\\n function arbitratorExtraData() external view returns (bytes memory) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitratorExtraData;\\n }\\n\\n /**\\n * @dev Gets the number of times MetaEvidence was updated.\\n * @return The number of times MetaEvidence was updated.\\n */\\n function metaEvidenceUpdates() external view returns (uint256) {\\n return arbitrationParamsChanges.length;\\n }\\n\\n /**\\n * @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The request to query.\\n * @param _roundID The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address _contributor\\n ) external view returns (uint256[3] memory contributions) {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n Round storage round = disputeData.rounds[_roundID];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /**\\n * @dev Returns item's information. Includes the total number of requests for the item\\n * @param _itemID The ID of the queried item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Total number of requests for the item.\\n * @return sumDeposit The total deposit made by the requester and the challenger (if any)\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n Status status,\\n uint256 numberOfRequests,\\n uint256 sumDeposit\\n )\\n {\\n Item storage item = items[_itemID];\\n return (item.status, item.requestCount, item.sumDeposit);\\n }\\n\\n /**\\n * @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint256 _requestID)\\n external\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint256 numberOfRounds,\\n Party ruling,\\n IArbitrator requestArbitrator,\\n bytes memory requestArbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n Request storage request = items[_itemID].requests[_requestID];\\n\\n submissionTime = request.submissionTime;\\n parties[uint256(Party.Requester)] = request.requester;\\n parties[uint256(Party.Challenger)] = request.challenger;\\n\\n (disputed, disputeID, numberOfRounds, ruling) = getRequestDisputeData(_itemID, _requestID);\\n\\n (requestArbitrator, requestArbitratorExtraData, metaEvidenceID) = getRequestArbitrationParams(\\n _itemID,\\n _requestID\\n );\\n resolved = getRequestResolvedStatus(_itemID, _requestID);\\n }\\n\\n /**\\n * @dev Gets the dispute data relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return ruling The final ruling given, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n */\\n function getRequestDisputeData(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 numberOfRounds,\\n Party ruling\\n )\\n {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n return (\\n disputeData.status >= DisputeStatus.AwaitingRuling,\\n disputeData.disputeID,\\n disputeData.roundCount,\\n disputeData.ruling\\n );\\n }\\n\\n /**\\n * @dev Gets the arbitration params relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestArbitrationParams(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_requestID];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n return (\\n arbitrationParams.arbitrator,\\n arbitrationParams.arbitratorExtraData,\\n 2 * request.arbitrationParamsIndex + uint256(request.requestType)\\n );\\n }\\n\\n /**\\n * @dev Gets the resovled status of a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n */\\n function getRequestResolvedStatus(bytes32 _itemID, uint256 _requestID) internal view returns (bool resolved) {\\n Item storage item = items[_itemID];\\n\\n if (item.requestCount == 0) {\\n return false;\\n }\\n\\n if (_requestID < item.requestCount - 1) {\\n // It was resolved because it is not the last request.\\n return true;\\n }\\n\\n return item.sumDeposit == 0;\\n }\\n\\n /**\\n * @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @param _roundID The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n )\\n external\\n view\\n returns (\\n bool appealed,\\n uint256[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint256 feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n require(disputeData.roundCount > _roundID, \\\"Round does not exist\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n appealed = _roundID < disputeData.roundCount - 1;\\n\\n hasPaid[uint256(Party.Requester)] = appealed || round.sideFunded == Party.Requester;\\n hasPaid[uint256(Party.Challenger)] = appealed || round.sideFunded == Party.Challenger;\\n\\n return (appealed, round.amountPaid, hasPaid, round.feeRewards);\\n }\\n}\\n\",\"keccak256\":\"0x3a77a9cd5142744e9dec8d1f74e198b38b53c579e08cb306caa1b84c4c8d0935\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"},\"contracts/utils/CappedMath128.sol\":{\"content\":\"/**\\n * @authors: [@hbarcelos]\\n * @reviewers: [@fnanni-0]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath128 {\\n uint128 private constant UINT128_MAX = 2**128 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function addCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n uint128 c = _a + _b;\\n return c >= _a ? c : UINT128_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function mulCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_a == 0) return 0;\\n\\n uint128 c = _a * _b;\\n return c / _a == _b ? c : UINT128_MAX;\\n }\\n}\\n\",\"keccak256\":\"0xaa86df80a3608032b85628f172d6e4b59c7f8a360a0e661959e865765322375c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506103fa806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630c7c04881461003b5780634746851c14610085575b600080fd5b610083600480360360c081101561005157600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a001356100d3565b005b610083600480360360e081101561009b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c00135610308565b60008690506000816001600160a01b031663bfbcff1a87876040518363ffffffff1660e01b8152600401808381526020018281526020019250505060006040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261018081101561016457600080fd5b81516020830151604080850151606086015160e08701516101008801516101208901516101408a0180519651989a97999598949760808101979496939592949293810192909190846401000000008211156101be57600080fd5b9083019060208201858111156101d357600080fd5b82516401000000008111828201881017156101ed57600080fd5b82525081516020918201929091019080838360005b8381101561021a578181015183820152602001610202565b50505050905090810190601f1680156102475780820380516001836020036101000a031916815260200191505b5060405250949a508d99505050505050505050505b81811080156102745750831580610274575083850181105b156102fd576040805163a1c2bf4d60e01b81526001600160a01b038a81166004830152602482018a9052604482018990526064820184905291519185169163a1c2bf4d9160848082019260009290919082900301818387803b1580156102d957600080fd5b505af11580156102ed573d6000803e3d6000fd5b50506001909201915061025c9050565b505050505050505050565b60008790506000816001600160a01b0316634aac84e5886040518263ffffffff1660e01b81526004018082815260200191505060606040518083038186803b15801561035357600080fd5b505afa158015610367573d6000803e3d6000fd5b505050506040513d606081101561037d57600080fd5b50602001519050855b818110801561039e575085158061039e575085870181105b156103b9576103b18a8a8a8489896100d3565b600101610386565b5050505050505050505056fea265627a7a72315820d6adb5091ba22018f82beedb9ac26a3f8fce0bd47407d16373f921b1396ca96664736f6c63430005110032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80630c7c04881461003b5780634746851c14610085575b600080fd5b610083600480360360c081101561005157600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a001356100d3565b005b610083600480360360e081101561009b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c00135610308565b60008690506000816001600160a01b031663bfbcff1a87876040518363ffffffff1660e01b8152600401808381526020018281526020019250505060006040518083038186803b15801561012657600080fd5b505afa15801561013a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261018081101561016457600080fd5b81516020830151604080850151606086015160e08701516101008801516101208901516101408a0180519651989a97999598949760808101979496939592949293810192909190846401000000008211156101be57600080fd5b9083019060208201858111156101d357600080fd5b82516401000000008111828201881017156101ed57600080fd5b82525081516020918201929091019080838360005b8381101561021a578181015183820152602001610202565b50505050905090810190601f1680156102475780820380516001836020036101000a031916815260200191505b5060405250949a508d99505050505050505050505b81811080156102745750831580610274575083850181105b156102fd576040805163a1c2bf4d60e01b81526001600160a01b038a81166004830152602482018a9052604482018990526064820184905291519185169163a1c2bf4d9160848082019260009290919082900301818387803b1580156102d957600080fd5b505af11580156102ed573d6000803e3d6000fd5b50506001909201915061025c9050565b505050505050505050565b60008790506000816001600160a01b0316634aac84e5886040518263ffffffff1660e01b81526004018082815260200191505060606040518083038186803b15801561035357600080fd5b505afa158015610367573d6000803e3d6000fd5b505050506040513d606081101561037d57600080fd5b50602001519050855b818110801561039e575085158061039e575085870181105b156103b9576103b18a8a8a8489896100d3565b600101610386565b5050505050505050505056fea265627a7a72315820d6adb5091ba22018f82beedb9ac26a3f8fce0bd47407d16373f921b1396ca96664736f6c63430005110032", + "devdoc": { + "methods": { + "batchRequestWithdraw(address,address,bytes32,uint256,uint256,uint256,uint256)": { + "details": "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.", + "params": { + "_address": "The address of the GTCR.", + "_contributor": "The address that made contributions to the request.", + "_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.", + "_cursor": "The request from which to start withdrawing.", + "_itemID": "The ID of the item with funds to be withdrawn.", + "_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.", + "_roundCursor": "The round of each request from where to start withdrawing. Round 0 is always empty, so callers can safely start with 1." + } + }, + "batchRoundWithdraw(address,address,bytes32,uint256,uint256,uint256)": { + "details": "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.", + "params": { + "_address": "The address of the LightGTCR.", + "_contributor": "The address that made contributions to the request.", + "_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.", + "_cursor": "The round from where to start withdrawing. Round 0 is always empty, so callers can safely start with 1.", + "_itemID": "The ID of the item with funds to be withdrawn.", + "_request": "The request from which to withdraw contributions." + } + } + }, + "title": "LightBatchWithdraw Withdraw fees and rewards from contributions to disputes rounds in batches." + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/sepolia/LightGTCRFactory.json b/deployments/sepolia/LightGTCRFactory.json new file mode 100644 index 0000000..60884e9 --- /dev/null +++ b/deployments/sepolia/LightGTCRFactory.json @@ -0,0 +1,235 @@ +{ + "address": "0x3FB8314C628E9afE7677946D3E23443Ce748Ac17", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_GTCR", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract LightGeneralizedTCR", + "name": "_address", + "type": "address" + } + ], + "name": "NewGTCR", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "GTCR", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "count", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_connectedTCR", + "type": "address" + }, + { + "internalType": "string", + "name": "_registrationMetaEvidence", + "type": "string" + }, + { + "internalType": "string", + "name": "_clearingMetaEvidence", + "type": "string" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "uint256[4]", + "name": "_baseDeposits", + "type": "uint256[4]" + }, + { + "internalType": "uint256", + "name": "_challengePeriodDuration", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "_stakeMultipliers", + "type": "uint256[3]" + }, + { + "internalType": "address", + "name": "_relayContract", + "type": "address" + } + ], + "name": "deploy", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "instances", + "outputs": [ + { + "internalType": "contract LightGeneralizedTCR", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xaa9df8a9f63b53e3b707960984fbfbdd17919f471eacf8aa3a866ee02e66acf1", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0x3FB8314C628E9afE7677946D3E23443Ce748Ac17", + "transactionIndex": 63, + "gasUsed": "465242", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5348ad06ff326fa8ac5c0840e617c47157ecf4e1640d2505c1a2227b9ae61f3c", + "transactionHash": "0xaa9df8a9f63b53e3b707960984fbfbdd17919f471eacf8aa3a866ee02e66acf1", + "logs": [], + "blockNumber": 4048287, + "cumulativeGasUsed": "5012897", + "status": 1, + "byzantium": true + }, + "args": [ + "0xBeeB211CfE6632E75992488A66F65b0477FBe96B" + ], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_GTCR\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract LightGeneralizedTCR\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"NewGTCR\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"GTCR\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_connectedTCR\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_registrationMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_clearingMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"uint256[4]\",\"name\":\"_baseDeposits\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256\",\"name\":\"_challengePeriodDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"_stakeMultipliers\",\"type\":\"uint256[3]\"},{\"internalType\":\"address\",\"name\":\"_relayContract\",\"type\":\"address\"}],\"name\":\"deploy\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"instances\",\"outputs\":[{\"internalType\":\"contract LightGeneralizedTCR\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_GTCR\":\"Address of the generalized TCR contract that is going to be used for each new deployment.\"}},\"count()\":{\"return\":\"The number of deployed tcrs using this factory.\"},\"deploy(address,bytes,address,string,string,address,uint256[4],uint256,uint256[3],address)\":{\"details\":\"Deploy the arbitrable curated registry.\",\"params\":{\"_arbitrator\":\"Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\",\"_arbitratorExtraData\":\"Extra data for the trusted arbitrator contract.\",\"_baseDeposits\":\"The base deposits for requests/challenges as follows: - The base deposit to submit an item. - The base deposit to remove an item. - The base deposit to challenge a submission. - The base deposit to challenge a removal request.\",\"_challengePeriodDuration\":\"The time in seconds parties have to challenge a request.\",\"_clearingMetaEvidence\":\"The URI of the meta evidence object for clearing requests.\",\"_connectedTCR\":\"The address of the TCR that stores related TCR addresses. This parameter can be left empty.\",\"_governor\":\"The trusted governor of this contract.\",\"_registrationMetaEvidence\":\"The URI of the meta evidence object for registration requests.\",\"_relayContract\":\"The address of the relay contract to add/remove items directly.\",\"_stakeMultipliers\":\"Multipliers of the arbitration cost in basis points (see LightGeneralizedTCR MULTIPLIER_DIVISOR) as follows: - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round. - The multiplier applied to the winner's fee stake for an appeal round. - The multiplier applied to the loser's fee stake for an appeal round.\"}}},\"title\":\"LightGTCRFactory This contract acts as a registry for LightGeneralizedTCR instances.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/LightGTCRFactory.sol\":\"LightGTCRFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/LightGTCRFactory.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc]\\n * @reviewers: [@fnanni-0, @shalzz]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\nimport {LightGeneralizedTCR, IArbitrator} from \\\"./LightGeneralizedTCR.sol\\\";\\n\\n/* solium-disable max-len */\\n\\n/**\\n * @title LightGTCRFactory\\n * This contract acts as a registry for LightGeneralizedTCR instances.\\n */\\ncontract LightGTCRFactory {\\n /**\\n * @dev Emitted when a new Generalized TCR contract is deployed using this factory.\\n * @param _address The address of the newly deployed Generalized TCR.\\n */\\n event NewGTCR(LightGeneralizedTCR indexed _address);\\n\\n LightGeneralizedTCR[] public instances;\\n address public GTCR;\\n\\n /**\\n * @dev Constructor.\\n * @param _GTCR Address of the generalized TCR contract that is going to be used for each new deployment.\\n */\\n constructor(address _GTCR) public {\\n GTCR = _GTCR;\\n }\\n\\n /**\\n * @dev Deploy the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _baseDeposits The base deposits for requests/challenges as follows:\\n * - The base deposit to submit an item.\\n * - The base deposit to remove an item.\\n * - The base deposit to challenge a submission.\\n * - The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see LightGeneralizedTCR MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round.\\n * - The multiplier applied to the winner's fee stake for an appeal round.\\n * - The multiplier applied to the loser's fee stake for an appeal round.\\n * @param _relayContract The address of the relay contract to add/remove items directly.\\n */\\n function deploy(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n address _connectedTCR,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence,\\n address _governor,\\n uint256[4] memory _baseDeposits,\\n uint256 _challengePeriodDuration,\\n uint256[3] memory _stakeMultipliers,\\n address _relayContract\\n ) public {\\n LightGeneralizedTCR instance = clone(GTCR);\\n instance.initialize(\\n _arbitrator,\\n _arbitratorExtraData,\\n _connectedTCR,\\n _registrationMetaEvidence,\\n _clearingMetaEvidence,\\n _governor,\\n _baseDeposits,\\n _challengePeriodDuration,\\n _stakeMultipliers,\\n _relayContract\\n );\\n instances.push(instance);\\n emit NewGTCR(instance);\\n }\\n\\n /**\\n * @notice Adaptation of @openzeppelin/contracts/proxy/Clones.sol.\\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `GTCR`.\\n * @param _implementation Address of the contract to clone.\\n * This function uses the create opcode, which should never revert.\\n */\\n function clone(address _implementation) internal returns (LightGeneralizedTCR instance) {\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\\n mstore(add(ptr, 0x14), shl(0x60, _implementation))\\n mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\\n instance := create(0, ptr, 0x37)\\n }\\n require(instance != LightGeneralizedTCR(0), \\\"ERC1167: create failed\\\");\\n }\\n\\n /**\\n * @return The number of deployed tcrs using this factory.\\n */\\n function count() external view returns (uint256) {\\n return instances.length;\\n }\\n}\\n\",\"keccak256\":\"0x7982fce960012920e2ab07438b2e3c162d37b7db59cf070fedcd63c552d0a6e7\"},\"contracts/LightGeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1*, @mtsalenc*, @hbarcelos*]\\n * @reviewers: [@fnanni-0*, @greenlucid, @shalzz]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\n\\nimport {IArbitrable, IArbitrator} from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport {IEvidence} from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport {CappedMath} from \\\"./utils/CappedMath.sol\\\";\\nimport {CappedMath128} from \\\"./utils/CappedMath128.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */\\n// It is the user responsibility to accept ETH.\\n\\n/**\\n * @title LightGeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n * The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns.\\n */\\ncontract LightGeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint256;\\n using CappedMath128 for uint128;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n enum RequestType {\\n Registration, // Identifies a request to register an item to the registry.\\n Clearing // Identifies a request to remove an item from the registry.\\n }\\n\\n enum DisputeStatus {\\n None, // No dispute was created.\\n AwaitingRuling, // Dispute was created, but the final ruling was not given yet.\\n Resolved // Dispute was ruled.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n Status status; // The current status of the item.\\n uint128 sumDeposit; // The total deposit made by the requester and the challenger (if any).\\n uint120 requestCount; // The number of requests.\\n mapping(uint256 => Request) requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n RequestType requestType;\\n uint64 submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n uint24 arbitrationParamsIndex; // The index for the arbitration params for the request.\\n address payable requester; // Address of the requester.\\n // Pack the requester together with the other parameters, as they are written in the same request.\\n address payable challenger; // Address of the challenger, if any.\\n }\\n\\n struct DisputeData {\\n uint256 disputeID; // The ID of the dispute on the arbitrator.\\n DisputeStatus status; // The current status of the dispute.\\n Party ruling; // The ruling given to a dispute. Only set after it has been resolved.\\n uint240 roundCount; // The number of rounds.\\n mapping(uint256 => Round) rounds; // Data of the different dispute rounds. rounds[roundId].\\n }\\n\\n struct Round {\\n Party sideFunded; // Stores the side that successfully paid the appeal fees in the latest round. Note that if both sides have paid a new round is created.\\n uint256 feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n uint256[3] amountPaid; // Tracks the sum paid for each Party in this round.\\n mapping(address => uint256[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n struct ArbitrationParams {\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n }\\n\\n /* Constants */\\n\\n uint256 public constant RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n uint256 private constant RESERVED_ROUND_ID = 0; // For compatibility with GeneralizedTCR consider the request/challenge cycle the first round (index 0).\\n\\n /* Storage */\\n\\n bool private initialized;\\n\\n address public relayerContract; // The contract that is used to add or remove items directly to speed up the interchain communication.\\n address public governor; // The address that can make changes to the parameters of the contract.\\n\\n uint256 public submissionBaseDeposit; // The base deposit to submit an item.\\n uint256 public removalBaseDeposit; // The base deposit to remove an item.\\n uint256 public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint256 public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint256 public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n\\n // Multipliers are in basis points.\\n uint256 public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint256 public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint256 public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint256 public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint256 => bytes32)) public arbitratorDisputeIDToItemID; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItemID[arbitrator][disputeID].\\n mapping(bytes32 => mapping(uint256 => DisputeData)) public requestsDisputeData; // Maps an item and a request to the data of the dispute related to them. requestsDisputeData[itemID][requestIndex]\\n ArbitrationParams[] public arbitrationParamsChanges;\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor() {\\n require(msg.sender == governor, \\\"The caller must be the governor.\\\");\\n _;\\n }\\n\\n modifier onlyRelayer() {\\n require(msg.sender == relayerContract, \\\"The caller must be the relay.\\\");\\n _;\\n }\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _updatedDirectly Whether this was emitted in either `addItemDirectly` or `removeItemDirectly`. This is used in the subgraph.\\n */\\n event ItemStatusChange(bytes32 indexed _itemID, bool _updatedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _data The item data URI.\\n * @param _addedDirectly Whether the item was added via `addItemDirectly`.\\n */\\n event NewItem(bytes32 indexed _itemID, string _data, bool _addedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n */\\n event RequestSubmitted(bytes32 indexed _itemID, uint256 _evidenceGroupID);\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal. The roundID assumes the initial request and challenge deposits are the first round. This is done so indexers can know more information about the contribution without using call handlers.\\n * @param _itemID The ID of the item.\\n * @param _requestID The index of the request that received the contribution.\\n * @param _roundID The index of the round that received the contribution.\\n * @param _contributor The address making the contribution.\\n * @param _contribution How much of the contribution was accepted.\\n * @param _side The party receiving the contribution.\\n */\\n event Contribution(\\n bytes32 indexed _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address indexed _contributor,\\n uint256 _contribution,\\n Party _side\\n );\\n\\n /**\\n * @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Emitted when someone withdraws more than 0 rewards.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw.\\n * @param _round The round from which to withdraw.\\n * @param _reward The amount withdrawn.\\n */\\n event RewardWithdrawn(\\n address indexed _beneficiary,\\n bytes32 indexed _itemID,\\n uint256 _request,\\n uint256 _round,\\n uint256 _reward\\n );\\n\\n /**\\n * @dev Initialize the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _baseDeposits The base deposits for requests/challenges as follows:\\n * - The base deposit to submit an item.\\n * - The base deposit to remove an item.\\n * - The base deposit to challenge a submission.\\n * - The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n * @param _relayerContract The address of the relay contract to add/remove items directly.\\n */\\n function initialize(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n address _connectedTCR,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence,\\n address _governor,\\n uint256[4] calldata _baseDeposits,\\n uint256 _challengePeriodDuration,\\n uint256[3] calldata _stakeMultipliers,\\n address _relayerContract\\n ) external {\\n require(!initialized, \\\"Already initialized.\\\");\\n\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n governor = _governor;\\n submissionBaseDeposit = _baseDeposits[0];\\n removalBaseDeposit = _baseDeposits[1];\\n submissionChallengeBaseDeposit = _baseDeposits[2];\\n removalChallengeBaseDeposit = _baseDeposits[3];\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n relayerContract = _relayerContract;\\n\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n\\n initialized = true;\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /**\\n * @dev Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _item The URI to the item data.\\n */\\n function addItemDirectly(string calldata _item) external onlyRelayer {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item is added directly once, the next time it is added it will emit this event again.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, true);\\n }\\n\\n item.status = Status.Registered;\\n\\n emit ItemStatusChange(itemID, true);\\n }\\n\\n /**\\n * @dev Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _itemID The ID of the item to remove.\\n */\\n function removeItemDirectly(bytes32 _itemID) external onlyRelayer {\\n Item storage item = items[_itemID];\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n item.status = Status.Absent;\\n\\n emit ItemStatusChange(_itemID, true);\\n }\\n\\n /**\\n * @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The URI to the item data.\\n */\\n function addItem(string calldata _item) external payable {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item was added previously using `addItemDirectly`, the event will be emitted again here.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, false);\\n }\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(submissionBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.RegistrationRequested;\\n\\n request.requestType = RequestType.Registration;\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n\\n emit RequestSubmitted(itemID, getEvidenceGroupID(itemID, item.requestCount - 1));\\n\\n emit Contribution(itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(removalBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.ClearingRequested;\\n\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n request.requestType = RequestType.Clearing;\\n\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, item.requestCount - 1);\\n\\n emit RequestSubmitted(_itemID, evidenceGroupID);\\n\\n emit Contribution(_itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime <= challengePeriodDuration,\\n \\\"Challenges must occur during the challenge period.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not have already been disputed.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitrationParams.arbitratorExtraData);\\n uint256 totalCost;\\n {\\n uint256 challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n }\\n require(msg.value >= totalCost, \\\"You must fully fund the challenge.\\\");\\n\\n emit Contribution(_itemID, lastRequestIndex, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Challenger);\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = item.sumDeposit.addCap(uint128(totalCost)).subCap(uint128(arbitrationCost));\\n\\n request.challenger = msg.sender;\\n\\n // Raise a dispute.\\n disputeData.disputeID = arbitrator.createDispute.value(arbitrationCost)(\\n RULING_OPTIONS,\\n arbitrationParams.arbitratorExtraData\\n );\\n disputeData.status = DisputeStatus.AwaitingRuling;\\n // For compatibility with GeneralizedTCR consider the request/challenge cycle\\n // the first round (index 0), so we need to make the next round index 1.\\n disputeData.roundCount = 2;\\n\\n arbitratorDisputeIDToItemID[address(arbitrator)][disputeData.disputeID] = _itemID;\\n\\n uint256 metaEvidenceID = 2 * request.arbitrationParamsIndex + uint256(request.requestType);\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, lastRequestIndex);\\n emit Dispute(arbitrator, disputeData.disputeID, metaEvidenceID, evidenceGroupID);\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side > Party.None, \\\"Invalid side.\\\");\\n\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(\\n disputeData.status == DisputeStatus.AwaitingRuling,\\n \\\"A dispute must have been raised to fund an appeal.\\\"\\n );\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 lastRoundIndex = disputeData.roundCount - 1;\\n Round storage round = disputeData.rounds[lastRoundIndex];\\n require(round.sideFunded != _side, \\\"Side already fully funded.\\\");\\n\\n uint256 multiplier;\\n {\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = arbitrator.appealPeriod(disputeData.disputeID);\\n require(\\n block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n Party winner = Party(arbitrator.currentRuling(disputeData.disputeID));\\n if (winner == Party.None) {\\n multiplier = sharedStakeMultiplier;\\n } else if (_side == winner) {\\n multiplier = winnerStakeMultiplier;\\n } else {\\n multiplier = loserStakeMultiplier;\\n require(\\n block.timestamp < (appealPeriodStart + appealPeriodEnd) / 2,\\n \\\"The loser must contribute during the first half of the appeal period.\\\"\\n );\\n }\\n }\\n\\n uint256 appealCost = arbitrator.appealCost(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n uint256 totalCost = appealCost.addCap(appealCost.mulCap(multiplier) / MULTIPLIER_DIVISOR);\\n contribute(_itemID, lastRequestIndex, lastRoundIndex, uint256(_side), msg.sender, msg.value, totalCost);\\n\\n if (round.amountPaid[uint256(_side)] >= totalCost) {\\n if (round.sideFunded == Party.None) {\\n round.sideFunded = _side;\\n } else {\\n // Resets the value because both sides are funded.\\n round.sideFunded = Party.None;\\n\\n // Raise appeal if both sides are fully funded.\\n arbitrator.appeal.value(appealCost)(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n disputeData.roundCount++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n }\\n\\n /**\\n * @dev If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _requestID The request from which to withdraw from.\\n * @param _roundID The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(\\n address payable _beneficiary,\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n ) external {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n require(disputeData.status == DisputeStatus.Resolved, \\\"Request must be resolved.\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n\\n uint256 reward;\\n if (_roundID == disputeData.roundCount - 1) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward =\\n round.contributions[_beneficiary][uint256(Party.Requester)] +\\n round.contributions[_beneficiary][uint256(Party.Challenger)];\\n } else if (disputeData.ruling == Party.None) {\\n uint256 totalFeesInRound = round.amountPaid[uint256(Party.Challenger)] +\\n round.amountPaid[uint256(Party.Requester)];\\n uint256 claimableFees = round.contributions[_beneficiary][uint256(Party.Challenger)] +\\n round.contributions[_beneficiary][uint256(Party.Requester)];\\n reward = totalFeesInRound > 0 ? (claimableFees * round.feeRewards) / totalFeesInRound : 0;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint256(disputeData.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint256(disputeData.ruling)] * round.feeRewards) /\\n round.amountPaid[uint256(disputeData.ruling)]\\n : 0;\\n }\\n round.contributions[_beneficiary][uint256(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint256(Party.Challenger)] = 0;\\n\\n if (reward > 0) {\\n _beneficiary.send(reward);\\n emit RewardWithdrawn(_beneficiary, _itemID, _requestID, _roundID, reward);\\n }\\n }\\n\\n /**\\n * @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = items[_itemID].requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested) {\\n item.status = Status.Registered;\\n } else if (item.status == Status.ClearingRequested) {\\n item.status = Status.Absent;\\n } else {\\n revert(\\\"There must be a request.\\\");\\n }\\n\\n emit ItemStatusChange(_itemID, false);\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (sumDeposit > 0) {\\n // reimburse the requester\\n request.requester.send(sumDeposit);\\n }\\n }\\n\\n /**\\n * @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n\\n bytes32 itemID = arbitratorDisputeIDToItemID[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n uint256 lastRequestIndex = items[itemID].requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.AwaitingRuling, \\\"The request must not be resolved.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n require(address(arbitrationParams.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n\\n uint256 finalRuling;\\n Round storage round = disputeData.rounds[disputeData.roundCount - 1];\\n\\n // If one side paid its fees, the ruling is in its favor.\\n // Note that if the other side had also paid, sideFudned would have been reset\\n // and an appeal would have been created.\\n if (round.sideFunded == Party.Requester) {\\n finalRuling = uint256(Party.Requester);\\n } else if (round.sideFunded == Party.Challenger) {\\n finalRuling = uint256(Party.Challenger);\\n } else {\\n finalRuling = _ruling;\\n }\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, finalRuling);\\n\\n Party winner = Party(finalRuling);\\n\\n disputeData.status = DisputeStatus.Resolved;\\n disputeData.ruling = winner;\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (winner == Party.None) {\\n // If the arbitrator refuse to rule, then the item status should be the same it was before the request.\\n // Regarding item.status this is equivalent to the challenger winning the dispute.\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n // Since nobody has won, then we reimburse both parties equally.\\n // If item.sumDeposit is odd, 1 wei will remain in the contract balance.\\n uint256 halfSumDeposit = sumDeposit / 2;\\n\\n request.requester.send(halfSumDeposit);\\n request.challenger.send(halfSumDeposit);\\n } else if (winner == Party.Requester) {\\n item.status = item.status == Status.RegistrationRequested ? Status.Registered : Status.Absent;\\n\\n request.requester.send(sumDeposit);\\n } else {\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n request.challenger.send(sumDeposit);\\n }\\n\\n emit ItemStatusChange(itemID, false);\\n }\\n\\n /**\\n * @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = item.requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n emit Evidence(\\n arbitrationParams.arbitrator,\\n getEvidenceGroupID(_itemID, lastRequestIndex),\\n msg.sender,\\n _evidence\\n );\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeChallengePeriodDuration(uint256 _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint256 _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint256 _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint256 _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint256 _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint256 _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint256 _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint256 _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /**\\n * @dev Change the address of the relay contract.\\n * @param _relayerContract The new address of the relay contract.\\n */\\n function changeRelayerContract(address _relayerContract) external onlyGovernor {\\n relayerContract = _relayerContract;\\n }\\n\\n /**\\n * @notice Changes the params related to arbitration.\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function changeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence\\n ) external onlyGovernor {\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function _doChangeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence\\n ) internal {\\n emit MetaEvidence(2 * arbitrationParamsChanges.length, _registrationMetaEvidence);\\n emit MetaEvidence(2 * arbitrationParamsChanges.length + 1, _clearingMetaEvidence);\\n\\n arbitrationParamsChanges.push(\\n ArbitrationParams({arbitrator: _arbitrator, arbitratorExtraData: _arbitratorExtraData})\\n );\\n }\\n\\n /**\\n * @notice Make a fee contribution.\\n * @dev It cannot be inlined in fundAppeal because of the stack limit.\\n * @param _itemID The item receiving the contribution.\\n * @param _requestID The request to contribute.\\n * @param _roundID The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n uint256 _side,\\n address payable _contributor,\\n uint256 _amount,\\n uint256 _totalRequired\\n ) internal {\\n Round storage round = requestsDisputeData[_itemID][_requestID].rounds[_roundID];\\n uint256 pendingAmount = _totalRequired.subCap(round.amountPaid[_side]);\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution; // Amount contributed.\\n uint256 remainingETH; // Remaining ETH to send back.\\n if (pendingAmount > _amount) {\\n contribution = _amount;\\n } else {\\n contribution = pendingAmount;\\n remainingETH = _amount - pendingAmount;\\n }\\n\\n round.contributions[_contributor][_side] += contribution;\\n round.amountPaid[_side] += contribution;\\n round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n if (remainingETH > 0) {\\n // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n _contributor.send(remainingETH);\\n }\\n\\n if (contribution > 0) {\\n emit Contribution(_itemID, _requestID, _roundID, msg.sender, contribution, Party(_side));\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /**\\n * @dev Gets the evidengeGroupID for a given item and request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The ID of the request.\\n * @return The evidenceGroupID\\n */\\n function getEvidenceGroupID(bytes32 _itemID, uint256 _requestID) public pure returns (uint256) {\\n return uint256(keccak256(abi.encodePacked(_itemID, _requestID)));\\n }\\n\\n /**\\n * @notice Gets the arbitrator for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator address.\\n */\\n function arbitrator() external view returns (IArbitrator) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitrator;\\n }\\n\\n /**\\n * @notice Gets the arbitratorExtraData for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator extra data.\\n */\\n function arbitratorExtraData() external view returns (bytes memory) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitratorExtraData;\\n }\\n\\n /**\\n * @dev Gets the number of times MetaEvidence was updated.\\n * @return The number of times MetaEvidence was updated.\\n */\\n function metaEvidenceUpdates() external view returns (uint256) {\\n return arbitrationParamsChanges.length;\\n }\\n\\n /**\\n * @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The request to query.\\n * @param _roundID The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address _contributor\\n ) external view returns (uint256[3] memory contributions) {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n Round storage round = disputeData.rounds[_roundID];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /**\\n * @dev Returns item's information. Includes the total number of requests for the item\\n * @param _itemID The ID of the queried item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Total number of requests for the item.\\n * @return sumDeposit The total deposit made by the requester and the challenger (if any)\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n Status status,\\n uint256 numberOfRequests,\\n uint256 sumDeposit\\n )\\n {\\n Item storage item = items[_itemID];\\n return (item.status, item.requestCount, item.sumDeposit);\\n }\\n\\n /**\\n * @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint256 _requestID)\\n external\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint256 numberOfRounds,\\n Party ruling,\\n IArbitrator requestArbitrator,\\n bytes memory requestArbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n Request storage request = items[_itemID].requests[_requestID];\\n\\n submissionTime = request.submissionTime;\\n parties[uint256(Party.Requester)] = request.requester;\\n parties[uint256(Party.Challenger)] = request.challenger;\\n\\n (disputed, disputeID, numberOfRounds, ruling) = getRequestDisputeData(_itemID, _requestID);\\n\\n (requestArbitrator, requestArbitratorExtraData, metaEvidenceID) = getRequestArbitrationParams(\\n _itemID,\\n _requestID\\n );\\n resolved = getRequestResolvedStatus(_itemID, _requestID);\\n }\\n\\n /**\\n * @dev Gets the dispute data relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return ruling The final ruling given, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n */\\n function getRequestDisputeData(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 numberOfRounds,\\n Party ruling\\n )\\n {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n return (\\n disputeData.status >= DisputeStatus.AwaitingRuling,\\n disputeData.disputeID,\\n disputeData.roundCount,\\n disputeData.ruling\\n );\\n }\\n\\n /**\\n * @dev Gets the arbitration params relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestArbitrationParams(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_requestID];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n return (\\n arbitrationParams.arbitrator,\\n arbitrationParams.arbitratorExtraData,\\n 2 * request.arbitrationParamsIndex + uint256(request.requestType)\\n );\\n }\\n\\n /**\\n * @dev Gets the resovled status of a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n */\\n function getRequestResolvedStatus(bytes32 _itemID, uint256 _requestID) internal view returns (bool resolved) {\\n Item storage item = items[_itemID];\\n\\n if (item.requestCount == 0) {\\n return false;\\n }\\n\\n if (_requestID < item.requestCount - 1) {\\n // It was resolved because it is not the last request.\\n return true;\\n }\\n\\n return item.sumDeposit == 0;\\n }\\n\\n /**\\n * @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @param _roundID The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n )\\n external\\n view\\n returns (\\n bool appealed,\\n uint256[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint256 feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n require(disputeData.roundCount > _roundID, \\\"Round does not exist\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n appealed = _roundID < disputeData.roundCount - 1;\\n\\n hasPaid[uint256(Party.Requester)] = appealed || round.sideFunded == Party.Requester;\\n hasPaid[uint256(Party.Challenger)] = appealed || round.sideFunded == Party.Challenger;\\n\\n return (appealed, round.amountPaid, hasPaid, round.feeRewards);\\n }\\n}\\n\",\"keccak256\":\"0x3a77a9cd5142744e9dec8d1f74e198b38b53c579e08cb306caa1b84c4c8d0935\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"},\"contracts/utils/CappedMath128.sol\":{\"content\":\"/**\\n * @authors: [@hbarcelos]\\n * @reviewers: [@fnanni-0]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath128 {\\n uint128 private constant UINT128_MAX = 2**128 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function addCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n uint128 c = _a + _b;\\n return c >= _a ? c : UINT128_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function mulCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_a == 0) return 0;\\n\\n uint128 c = _a * _b;\\n return c / _a == _b ? c : UINT128_MAX;\\n }\\n}\\n\",\"keccak256\":\"0xaa86df80a3608032b85628f172d6e4b59c7f8a360a0e661959e865765322375c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161076a38038061076a8339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b03909216919091179055610707806100636000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806306661abd14610051578063a2f7b3a51461006b578063c6622970146100a4578063d8dcbd27146100ac575b600080fd5b610059610302565b60408051918252519081900360200190f35b6100886004803603602081101561008157600080fd5b5035610308565b604080516001600160a01b039092168252519081900360200190f35b61008861032f565b61030060048036036101e08110156100c357600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ee57600080fd5b82018360208201111561010057600080fd5b8035906020019184600183028401116401000000008311171561012257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092956001600160a01b0385351695909490935060408101925060200135905064010000000081111561018657600080fd5b82018360208201111561019857600080fd5b803590602001918460018302840111640100000000831117156101ba57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561020d57600080fd5b82018360208201111561021f57600080fd5b8035906020019184600183028401116401000000008311171561024157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051608081810190925293966001600160a01b03863516969095909460a0820194509250602001906004908390839080828437600092019190915250506040805160608181019092529295843595909490936080820193509160209091019060039083908390808284376000920191909152509194505050356001600160a01b0316905061033e565b005b60005490565b6000818154811061031557fe5b6000918252602090912001546001600160a01b0316905081565b6001546001600160a01b031681565b600154600090610356906001600160a01b0316610630565b9050806001600160a01b031663baef48e28c8c8c8c8c8c8c8c8c8c6040518b63ffffffff1660e01b8152600401808b6001600160a01b03166001600160a01b03168152602001806020018a6001600160a01b03166001600160a01b031681526020018060200180602001896001600160a01b03166001600160a01b0316815260200188600460200280838360005b838110156103fc5781810151838201526020016103e4565b5050505090500187815260200186600360200280838360005b8381101561042d578181015183820152602001610415565b50505050905001856001600160a01b03166001600160a01b0316815260200184810384528d818151815260200191508051906020019080838360005b83811015610481578181015183820152602001610469565b50505050905090810190601f1680156104ae5780820380516001836020036101000a031916815260200191505b5084810383528b5181528b516020918201918d019080838360005b838110156104e15781810151838201526020016104c9565b50505050905090810190601f16801561050e5780820380516001836020036101000a031916815260200191505b5084810382528a5181528a516020918201918c019080838360005b83811015610541578181015183820152602001610529565b50505050905090810190601f16801561056e5780820380516001836020036101000a031916815260200191505b509d5050505050505050505050505050600060405180830381600087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b5050600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b0386169081179091556040519093507f704e94f24d7a41dd1af49e0bbd12aa4fb9ade0accd11001b9d1de7d756a5464f9250a25050505050505050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b0381166106cd576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b91905056fea265627a7a723158203088403b4c1e7e28cfcc311bbdb87b2fb3ef20e73edacd42fc24b669f7e1ed9a64736f6c63430005110032", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806306661abd14610051578063a2f7b3a51461006b578063c6622970146100a4578063d8dcbd27146100ac575b600080fd5b610059610302565b60408051918252519081900360200190f35b6100886004803603602081101561008157600080fd5b5035610308565b604080516001600160a01b039092168252519081900360200190f35b61008861032f565b61030060048036036101e08110156100c357600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ee57600080fd5b82018360208201111561010057600080fd5b8035906020019184600183028401116401000000008311171561012257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092956001600160a01b0385351695909490935060408101925060200135905064010000000081111561018657600080fd5b82018360208201111561019857600080fd5b803590602001918460018302840111640100000000831117156101ba57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561020d57600080fd5b82018360208201111561021f57600080fd5b8035906020019184600183028401116401000000008311171561024157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051608081810190925293966001600160a01b03863516969095909460a0820194509250602001906004908390839080828437600092019190915250506040805160608181019092529295843595909490936080820193509160209091019060039083908390808284376000920191909152509194505050356001600160a01b0316905061033e565b005b60005490565b6000818154811061031557fe5b6000918252602090912001546001600160a01b0316905081565b6001546001600160a01b031681565b600154600090610356906001600160a01b0316610630565b9050806001600160a01b031663baef48e28c8c8c8c8c8c8c8c8c8c6040518b63ffffffff1660e01b8152600401808b6001600160a01b03166001600160a01b03168152602001806020018a6001600160a01b03166001600160a01b031681526020018060200180602001896001600160a01b03166001600160a01b0316815260200188600460200280838360005b838110156103fc5781810151838201526020016103e4565b5050505090500187815260200186600360200280838360005b8381101561042d578181015183820152602001610415565b50505050905001856001600160a01b03166001600160a01b0316815260200184810384528d818151815260200191508051906020019080838360005b83811015610481578181015183820152602001610469565b50505050905090810190601f1680156104ae5780820380516001836020036101000a031916815260200191505b5084810383528b5181528b516020918201918d019080838360005b838110156104e15781810151838201526020016104c9565b50505050905090810190601f16801561050e5780820380516001836020036101000a031916815260200191505b5084810382528a5181528a516020918201918c019080838360005b83811015610541578181015183820152602001610529565b50505050905090810190601f16801561056e5780820380516001836020036101000a031916815260200191505b509d5050505050505050505050505050600060405180830381600087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b5050600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b0386169081179091556040519093507f704e94f24d7a41dd1af49e0bbd12aa4fb9ade0accd11001b9d1de7d756a5464f9250a25050505050505050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b0381166106cd576040805162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015290519081900360640190fd5b91905056fea265627a7a723158203088403b4c1e7e28cfcc311bbdb87b2fb3ef20e73edacd42fc24b669f7e1ed9a64736f6c63430005110032", + "devdoc": { + "methods": { + "constructor": { + "details": "Constructor.", + "params": { + "_GTCR": "Address of the generalized TCR contract that is going to be used for each new deployment." + } + }, + "count()": { + "return": "The number of deployed tcrs using this factory." + }, + "deploy(address,bytes,address,string,string,address,uint256[4],uint256,uint256[3],address)": { + "details": "Deploy the arbitrable curated registry.", + "params": { + "_arbitrator": "Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.", + "_arbitratorExtraData": "Extra data for the trusted arbitrator contract.", + "_baseDeposits": "The base deposits for requests/challenges as follows: - The base deposit to submit an item. - The base deposit to remove an item. - The base deposit to challenge a submission. - The base deposit to challenge a removal request.", + "_challengePeriodDuration": "The time in seconds parties have to challenge a request.", + "_clearingMetaEvidence": "The URI of the meta evidence object for clearing requests.", + "_connectedTCR": "The address of the TCR that stores related TCR addresses. This parameter can be left empty.", + "_governor": "The trusted governor of this contract.", + "_registrationMetaEvidence": "The URI of the meta evidence object for registration requests.", + "_relayContract": "The address of the relay contract to add/remove items directly.", + "_stakeMultipliers": "Multipliers of the arbitration cost in basis points (see LightGeneralizedTCR MULTIPLIER_DIVISOR) as follows: - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round. - The multiplier applied to the winner's fee stake for an appeal round. - The multiplier applied to the loser's fee stake for an appeal round." + } + } + }, + "title": "LightGTCRFactory This contract acts as a registry for LightGeneralizedTCR instances." + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [ + { + "astId": 2853, + "contract": "contracts/LightGTCRFactory.sol:LightGTCRFactory", + "label": "instances", + "offset": 0, + "slot": "0", + "type": "t_array(t_contract(LightGeneralizedTCR)5670)dyn_storage" + }, + { + "astId": 2855, + "contract": "contracts/LightGTCRFactory.sol:LightGTCRFactory", + "label": "GTCR", + "offset": 0, + "slot": "1", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_contract(LightGeneralizedTCR)5670)dyn_storage": { + "base": "t_contract(LightGeneralizedTCR)5670", + "encoding": "dynamic_array", + "label": "contract LightGeneralizedTCR[]", + "numberOfBytes": "32" + }, + "t_contract(LightGeneralizedTCR)5670": { + "encoding": "inplace", + "label": "contract LightGeneralizedTCR", + "numberOfBytes": "20" + } + } + } +} diff --git a/deployments/sepolia/LightGeneralizedTCR.json b/deployments/sepolia/LightGeneralizedTCR.json new file mode 100644 index 0000000..693409e --- /dev/null +++ b/deployments/sepolia/LightGeneralizedTCR.json @@ -0,0 +1,1992 @@ +{ + "address": "0xBeeB211CfE6632E75992488A66F65b0477FBe96B", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_connectedTCR", + "type": "address" + } + ], + "name": "ConnectedTCRSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_requestID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_contribution", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum LightGeneralizedTCR.Party", + "name": "_side", + "type": "uint8" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "Dispute", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_updatedDirectly", + "type": "bool" + } + ], + "name": "ItemStatusChange", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "MetaEvidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "_data", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_addedDirectly", + "type": "bool" + } + ], + "name": "NewItem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "RequestSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_request", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_reward", + "type": "uint256" + } + ], + "name": "RewardWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "MULTIPLIER_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "RULING_OPTIONS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "string", + "name": "_item", + "type": "string" + } + ], + "name": "addItem", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "string", + "name": "_item", + "type": "string" + } + ], + "name": "addItemDirectly", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitrationParamsChanges", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToItemID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "challengePeriodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "challengeRequest", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_registrationMetaEvidence", + "type": "string" + }, + { + "internalType": "string", + "name": "_clearingMetaEvidence", + "type": "string" + } + ], + "name": "changeArbitrationParams", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_challengePeriodDuration", + "type": "uint256" + } + ], + "name": "changeChallengePeriodDuration", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_connectedTCR", + "type": "address" + } + ], + "name": "changeConnectedTCR", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_loserStakeMultiplier", + "type": "uint256" + } + ], + "name": "changeLoserStakeMultiplier", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_relayerContract", + "type": "address" + } + ], + "name": "changeRelayerContract", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_removalBaseDeposit", + "type": "uint256" + } + ], + "name": "changeRemovalBaseDeposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_removalChallengeBaseDeposit", + "type": "uint256" + } + ], + "name": "changeRemovalChallengeBaseDeposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_sharedStakeMultiplier", + "type": "uint256" + } + ], + "name": "changeSharedStakeMultiplier", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_submissionBaseDeposit", + "type": "uint256" + } + ], + "name": "changeSubmissionBaseDeposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_submissionChallengeBaseDeposit", + "type": "uint256" + } + ], + "name": "changeSubmissionChallengeBaseDeposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_winnerStakeMultiplier", + "type": "uint256" + } + ], + "name": "changeWinnerStakeMultiplier", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "executeRequest", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "_side", + "type": "uint8" + } + ], + "name": "fundAppeal", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_requestID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_contributor", + "type": "address" + } + ], + "name": "getContributions", + "outputs": [ + { + "internalType": "uint256[3]", + "name": "contributions", + "type": "uint256[3]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_requestID", + "type": "uint256" + } + ], + "name": "getEvidenceGroupID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItemInfo", + "outputs": [ + { + "internalType": "enum LightGeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumDeposit", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_requestID", + "type": "uint256" + } + ], + "name": "getRequestInfo", + "outputs": [ + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address payable[3]", + "name": "parties", + "type": "address[3]" + }, + { + "internalType": "uint256", + "name": "numberOfRounds", + "type": "uint256" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "contract IArbitrator", + "name": "requestArbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "requestArbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "metaEvidenceID", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_requestID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_connectedTCR", + "type": "address" + }, + { + "internalType": "string", + "name": "_registrationMetaEvidence", + "type": "string" + }, + { + "internalType": "string", + "name": "_clearingMetaEvidence", + "type": "string" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "uint256[4]", + "name": "_baseDeposits", + "type": "uint256[4]" + }, + { + "internalType": "uint256", + "name": "_challengePeriodDuration", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "_stakeMultipliers", + "type": "uint256[3]" + }, + { + "internalType": "address", + "name": "_relayerContract", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "items", + "outputs": [ + { + "internalType": "enum LightGeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "sumDeposit", + "type": "uint128" + }, + { + "internalType": "uint120", + "name": "requestCount", + "type": "uint120" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "loserStakeMultiplier", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "metaEvidenceUpdates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "relayerContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "removalBaseDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "removalChallengeBaseDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "removeItem", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "removeItemDirectly", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestsDisputeData", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "enum LightGeneralizedTCR.DisputeStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "uint240", + "name": "roundCount", + "type": "uint240" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "sharedStakeMultiplier", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "submissionBaseDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "submissionChallengeBaseDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "winnerStakeMultiplier", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_requestID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xcc1e30cb7c3a23b79ed89293b00109136e2c8203bd9d34393fffbd21eab07509", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0xBeeB211CfE6632E75992488A66F65b0477FBe96B", + "transactionIndex": 35, + "gasUsed": "4185079", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3c06726d47982f47e9e37701d7d212c092a881ab1656bc284782d2a39e0ec818", + "transactionHash": "0xcc1e30cb7c3a23b79ed89293b00109136e2c8203bd9d34393fffbd21eab07509", + "logs": [], + "blockNumber": 4048284, + "cumulativeGasUsed": "20827281", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_connectedTCR\",\"type\":\"address\"}],\"name\":\"ConnectedTCRSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_requestID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_contribution\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"_side\",\"type\":\"uint8\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"Dispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"Evidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_updatedDirectly\",\"type\":\"bool\"}],\"name\":\"ItemStatusChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_data\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_addedDirectly\",\"type\":\"bool\"}],\"name\":\"NewItem\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"RequestSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_request\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_reward\",\"type\":\"uint256\"}],\"name\":\"RewardWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"MULTIPLIER_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"RULING_OPTIONS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"_item\",\"type\":\"string\"}],\"name\":\"addItem\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"_item\",\"type\":\"string\"}],\"name\":\"addItemDirectly\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitrationParamsChanges\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToItemID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"challengePeriodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"challengeRequest\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_registrationMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_clearingMetaEvidence\",\"type\":\"string\"}],\"name\":\"changeArbitrationParams\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_challengePeriodDuration\",\"type\":\"uint256\"}],\"name\":\"changeChallengePeriodDuration\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_connectedTCR\",\"type\":\"address\"}],\"name\":\"changeConnectedTCR\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_loserStakeMultiplier\",\"type\":\"uint256\"}],\"name\":\"changeLoserStakeMultiplier\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_relayerContract\",\"type\":\"address\"}],\"name\":\"changeRelayerContract\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_removalBaseDeposit\",\"type\":\"uint256\"}],\"name\":\"changeRemovalBaseDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_removalChallengeBaseDeposit\",\"type\":\"uint256\"}],\"name\":\"changeRemovalChallengeBaseDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_sharedStakeMultiplier\",\"type\":\"uint256\"}],\"name\":\"changeSharedStakeMultiplier\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_submissionBaseDeposit\",\"type\":\"uint256\"}],\"name\":\"changeSubmissionBaseDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_submissionChallengeBaseDeposit\",\"type\":\"uint256\"}],\"name\":\"changeSubmissionChallengeBaseDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_winnerStakeMultiplier\",\"type\":\"uint256\"}],\"name\":\"changeWinnerStakeMultiplier\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"executeRequest\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"_side\",\"type\":\"uint8\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_requestID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"}],\"name\":\"getContributions\",\"outputs\":[{\"internalType\":\"uint256[3]\",\"name\":\"contributions\",\"type\":\"uint256[3]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_requestID\",\"type\":\"uint256\"}],\"name\":\"getEvidenceGroupID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItemInfo\",\"outputs\":[{\"internalType\":\"enum LightGeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumDeposit\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_requestID\",\"type\":\"uint256\"}],\"name\":\"getRequestInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address payable[3]\",\"name\":\"parties\",\"type\":\"address[3]\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRounds\",\"type\":\"uint256\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"requestArbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"requestArbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"metaEvidenceID\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_requestID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_connectedTCR\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_registrationMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_clearingMetaEvidence\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"uint256[4]\",\"name\":\"_baseDeposits\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256\",\"name\":\"_challengePeriodDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"_stakeMultipliers\",\"type\":\"uint256[3]\"},{\"internalType\":\"address\",\"name\":\"_relayerContract\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"items\",\"outputs\":[{\"internalType\":\"enum LightGeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint128\",\"name\":\"sumDeposit\",\"type\":\"uint128\"},{\"internalType\":\"uint120\",\"name\":\"requestCount\",\"type\":\"uint120\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"loserStakeMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"metaEvidenceUpdates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"relayerContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"removalBaseDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"removalChallengeBaseDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"removeItem\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"removeItemDirectly\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requestsDisputeData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"enum LightGeneralizedTCR.DisputeStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"uint240\",\"name\":\"roundCount\",\"type\":\"uint240\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"sharedStakeMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"submissionBaseDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"submissionChallengeBaseDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"winnerStakeMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_requestID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"addItem(string)\":{\"details\":\"Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\",\"params\":{\"_item\":\"The URI to the item data.\"}},\"addItemDirectly(string)\":{\"details\":\"Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.\",\"params\":{\"_item\":\"The URI to the item data.\"}},\"arbitrator()\":{\"details\":\"Gets the latest value in arbitrationParamsChanges.\",\"return\":\"The arbitrator address.\"},\"arbitratorExtraData()\":{\"details\":\"Gets the latest value in arbitrationParamsChanges.\",\"return\":\"The arbitrator extra data.\"},\"challengeRequest(bytes32,string)\":{\"details\":\"Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\",\"params\":{\"_evidence\":\"A link to an evidence using its URI. Ignored if not provided.\",\"_itemID\":\"The ID of the item which request to challenge.\"}},\"changeArbitrationParams(address,bytes,string,string)\":{\"details\":\"Effectively makes all new items use the new set of params.\",\"params\":{\"_arbitrator\":\"Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\",\"_arbitratorExtraData\":\"Extra data for the trusted arbitrator contract.\",\"_clearingMetaEvidence\":\"The URI of the meta evidence object for clearing requests.\",\"_registrationMetaEvidence\":\"The URI of the meta evidence object for registration requests.\"}},\"changeChallengePeriodDuration(uint256)\":{\"details\":\"Change the duration of the challenge period.\",\"params\":{\"_challengePeriodDuration\":\"The new duration of the challenge period.\"}},\"changeConnectedTCR(address)\":{\"details\":\"Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\",\"params\":{\"_connectedTCR\":\"The address of the connectedTCR contract to use.\"}},\"changeGovernor(address)\":{\"details\":\"Change the governor of the curated registry.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"changeLoserStakeMultiplier(uint256)\":{\"details\":\"Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\",\"params\":{\"_loserStakeMultiplier\":\"Multiplier of arbitration fees that must be paid as fee stake. In basis points.\"}},\"changeRelayerContract(address)\":{\"details\":\"Change the address of the relay contract.\",\"params\":{\"_relayerContract\":\"The new address of the relay contract.\"}},\"changeRemovalBaseDeposit(uint256)\":{\"details\":\"Change the base amount required as a deposit to remove an item.\",\"params\":{\"_removalBaseDeposit\":\"The new base amount of wei required to remove an item.\"}},\"changeRemovalChallengeBaseDeposit(uint256)\":{\"details\":\"Change the base amount required as a deposit to challenge a removal request.\",\"params\":{\"_removalChallengeBaseDeposit\":\"The new base amount of wei required to challenge a removal request.\"}},\"changeSharedStakeMultiplier(uint256)\":{\"details\":\"Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\",\"params\":{\"_sharedStakeMultiplier\":\"Multiplier of arbitration fees that must be paid as fee stake. In basis points.\"}},\"changeSubmissionBaseDeposit(uint256)\":{\"details\":\"Change the base amount required as a deposit to submit an item.\",\"params\":{\"_submissionBaseDeposit\":\"The new base amount of wei required to submit an item.\"}},\"changeSubmissionChallengeBaseDeposit(uint256)\":{\"details\":\"Change the base amount required as a deposit to challenge a submission.\",\"params\":{\"_submissionChallengeBaseDeposit\":\"The new base amount of wei required to challenge a submission.\"}},\"changeWinnerStakeMultiplier(uint256)\":{\"details\":\"Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\",\"params\":{\"_winnerStakeMultiplier\":\"Multiplier of arbitration fees that must be paid as fee stake. In basis points.\"}},\"executeRequest(bytes32)\":{\"details\":\"Executes an unchallenged request if the challenge period has passed.\",\"params\":{\"_itemID\":\"The ID of the item to execute.\"}},\"fundAppeal(bytes32,uint8)\":{\"details\":\"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.\",\"params\":{\"_itemID\":\"The ID of the item which request to fund.\",\"_side\":\"The recipient of the contribution.\"}},\"getContributions(bytes32,uint256,uint256,address)\":{\"details\":\"Gets the contributions made by a party for a given round of a request.\",\"params\":{\"_contributor\":\"The address of the contributor.\",\"_itemID\":\"The ID of the item.\",\"_requestID\":\"The request to query.\",\"_roundID\":\"The round to query.\"},\"return\":\"contributions The contributions.\"},\"getEvidenceGroupID(bytes32,uint256)\":{\"details\":\"Gets the evidengeGroupID for a given item and request.\",\"params\":{\"_itemID\":\"The ID of the item.\",\"_requestID\":\"The ID of the request.\"},\"return\":\"The evidenceGroupID\"},\"getItemInfo(bytes32)\":{\"details\":\"Returns item's information. Includes the total number of requests for the item\",\"params\":{\"_itemID\":\"The ID of the queried item.\"},\"return\":\"status The current status of the item.numberOfRequests Total number of requests for the item.sumDeposit The total deposit made by the requester and the challenger (if any)\"},\"getRequestInfo(bytes32,uint256)\":{\"details\":\"Gets information on a request made for the item.\",\"params\":{\"_itemID\":\"The ID of the queried item.\",\"_requestID\":\"The request to be queried.\"},\"return\":\"disputed True if a dispute was raised.disputeID ID of the dispute, if any.submissionTime Time when the request was made.resolved True if the request was executed and/or any raised disputes were resolved.parties Address of requester and challenger, if any.numberOfRounds Number of rounds of dispute.ruling The final ruling given, if any.arbitrator The arbitrator trusted to solve disputes for this request.arbitratorExtraData The extra data for the trusted arbitrator of this request.metaEvidenceID The meta evidence to be used in a dispute for this case.\"},\"getRoundInfo(bytes32,uint256,uint256)\":{\"details\":\"Gets the information of a round of a request.\",\"params\":{\"_itemID\":\"The ID of the queried item.\",\"_requestID\":\"The request to be queried.\",\"_roundID\":\"The round to be queried.\"},\"return\":\"appealed Whether appealed or not.amountPaid Tracks the sum paid for each Party in this round.hasPaid True if the Party has fully paid its fee in this round.feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\"},\"initialize(address,bytes,address,string,string,address,uint256[4],uint256,uint256[3],address)\":{\"details\":\"Initialize the arbitrable curated registry.\",\"params\":{\"_arbitrator\":\"Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\",\"_arbitratorExtraData\":\"Extra data for the trusted arbitrator contract.\",\"_baseDeposits\":\"The base deposits for requests/challenges as follows: - The base deposit to submit an item. - The base deposit to remove an item. - The base deposit to challenge a submission. - The base deposit to challenge a removal request.\",\"_challengePeriodDuration\":\"The time in seconds parties have to challenge a request.\",\"_clearingMetaEvidence\":\"The URI of the meta evidence object for clearing requests.\",\"_connectedTCR\":\"The address of the TCR that stores related TCR addresses. This parameter can be left empty.\",\"_governor\":\"The trusted governor of this contract.\",\"_registrationMetaEvidence\":\"The URI of the meta evidence object for registration requests.\",\"_relayerContract\":\"The address of the relay contract to add/remove items directly.\",\"_stakeMultipliers\":\"Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows: - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate). - The multiplier applied to the winner's fee stake for the subsequent round. - The multiplier applied to the loser's fee stake for the subsequent round.\"}},\"metaEvidenceUpdates()\":{\"details\":\"Gets the number of times MetaEvidence was updated.\",\"return\":\"The number of times MetaEvidence was updated.\"},\"removeItem(bytes32,string)\":{\"details\":\"Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\",\"params\":{\"_evidence\":\"A link to an evidence using its URI. Ignored if not provided.\",\"_itemID\":\"The ID of the item to remove.\"}},\"removeItemDirectly(bytes32)\":{\"details\":\"Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.\",\"params\":{\"_itemID\":\"The ID of the item to remove.\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED. Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\",\"params\":{\"_disputeID\":\"ID of the dispute in the arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\"}},\"submitEvidence(bytes32,string)\":{\"details\":\"Submit a reference to evidence. EVENT.\",\"params\":{\"_evidence\":\"A link to an evidence using its URI.\",\"_itemID\":\"The ID of the item which the evidence is related to.\"}},\"withdrawFeesAndRewards(address,bytes32,uint256,uint256)\":{\"details\":\"If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\",\"params\":{\"_beneficiary\":\"The address that made contributions to a request.\",\"_itemID\":\"The ID of the item submission to withdraw from.\",\"_requestID\":\"The request from which to withdraw from.\",\"_roundID\":\"The round from which to withdraw from.\"}}},\"title\":\"LightGeneralizedTCR This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding. The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns.\"},\"userdoc\":{\"methods\":{\"arbitrator()\":{\"notice\":\"Gets the arbitrator for new requests.\"},\"arbitratorExtraData()\":{\"notice\":\"Gets the arbitratorExtraData for new requests.\"},\"changeArbitrationParams(address,bytes,string,string)\":{\"notice\":\"Changes the params related to arbitration.\"}}}},\"settings\":{\"compilationTarget\":{\"contracts/LightGeneralizedTCR.sol\":\"LightGeneralizedTCR\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/LightGeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1*, @mtsalenc*, @hbarcelos*]\\n * @reviewers: [@fnanni-0*, @greenlucid, @shalzz]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\n\\nimport {IArbitrable, IArbitrator} from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport {IEvidence} from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport {CappedMath} from \\\"./utils/CappedMath.sol\\\";\\nimport {CappedMath128} from \\\"./utils/CappedMath128.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */\\n// It is the user responsibility to accept ETH.\\n\\n/**\\n * @title LightGeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n * The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns.\\n */\\ncontract LightGeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint256;\\n using CappedMath128 for uint128;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n enum RequestType {\\n Registration, // Identifies a request to register an item to the registry.\\n Clearing // Identifies a request to remove an item from the registry.\\n }\\n\\n enum DisputeStatus {\\n None, // No dispute was created.\\n AwaitingRuling, // Dispute was created, but the final ruling was not given yet.\\n Resolved // Dispute was ruled.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n Status status; // The current status of the item.\\n uint128 sumDeposit; // The total deposit made by the requester and the challenger (if any).\\n uint120 requestCount; // The number of requests.\\n mapping(uint256 => Request) requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n RequestType requestType;\\n uint64 submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n uint24 arbitrationParamsIndex; // The index for the arbitration params for the request.\\n address payable requester; // Address of the requester.\\n // Pack the requester together with the other parameters, as they are written in the same request.\\n address payable challenger; // Address of the challenger, if any.\\n }\\n\\n struct DisputeData {\\n uint256 disputeID; // The ID of the dispute on the arbitrator.\\n DisputeStatus status; // The current status of the dispute.\\n Party ruling; // The ruling given to a dispute. Only set after it has been resolved.\\n uint240 roundCount; // The number of rounds.\\n mapping(uint256 => Round) rounds; // Data of the different dispute rounds. rounds[roundId].\\n }\\n\\n struct Round {\\n Party sideFunded; // Stores the side that successfully paid the appeal fees in the latest round. Note that if both sides have paid a new round is created.\\n uint256 feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n uint256[3] amountPaid; // Tracks the sum paid for each Party in this round.\\n mapping(address => uint256[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n struct ArbitrationParams {\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n }\\n\\n /* Constants */\\n\\n uint256 public constant RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n uint256 private constant RESERVED_ROUND_ID = 0; // For compatibility with GeneralizedTCR consider the request/challenge cycle the first round (index 0).\\n\\n /* Storage */\\n\\n bool private initialized;\\n\\n address public relayerContract; // The contract that is used to add or remove items directly to speed up the interchain communication.\\n address public governor; // The address that can make changes to the parameters of the contract.\\n\\n uint256 public submissionBaseDeposit; // The base deposit to submit an item.\\n uint256 public removalBaseDeposit; // The base deposit to remove an item.\\n uint256 public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint256 public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint256 public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n\\n // Multipliers are in basis points.\\n uint256 public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint256 public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint256 public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint256 public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint256 => bytes32)) public arbitratorDisputeIDToItemID; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItemID[arbitrator][disputeID].\\n mapping(bytes32 => mapping(uint256 => DisputeData)) public requestsDisputeData; // Maps an item and a request to the data of the dispute related to them. requestsDisputeData[itemID][requestIndex]\\n ArbitrationParams[] public arbitrationParamsChanges;\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor() {\\n require(msg.sender == governor, \\\"The caller must be the governor.\\\");\\n _;\\n }\\n\\n modifier onlyRelayer() {\\n require(msg.sender == relayerContract, \\\"The caller must be the relay.\\\");\\n _;\\n }\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _updatedDirectly Whether this was emitted in either `addItemDirectly` or `removeItemDirectly`. This is used in the subgraph.\\n */\\n event ItemStatusChange(bytes32 indexed _itemID, bool _updatedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _data The item data URI.\\n * @param _addedDirectly Whether the item was added via `addItemDirectly`.\\n */\\n event NewItem(bytes32 indexed _itemID, string _data, bool _addedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n */\\n event RequestSubmitted(bytes32 indexed _itemID, uint256 _evidenceGroupID);\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal. The roundID assumes the initial request and challenge deposits are the first round. This is done so indexers can know more information about the contribution without using call handlers.\\n * @param _itemID The ID of the item.\\n * @param _requestID The index of the request that received the contribution.\\n * @param _roundID The index of the round that received the contribution.\\n * @param _contributor The address making the contribution.\\n * @param _contribution How much of the contribution was accepted.\\n * @param _side The party receiving the contribution.\\n */\\n event Contribution(\\n bytes32 indexed _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address indexed _contributor,\\n uint256 _contribution,\\n Party _side\\n );\\n\\n /**\\n * @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Emitted when someone withdraws more than 0 rewards.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw.\\n * @param _round The round from which to withdraw.\\n * @param _reward The amount withdrawn.\\n */\\n event RewardWithdrawn(\\n address indexed _beneficiary,\\n bytes32 indexed _itemID,\\n uint256 _request,\\n uint256 _round,\\n uint256 _reward\\n );\\n\\n /**\\n * @dev Initialize the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _baseDeposits The base deposits for requests/challenges as follows:\\n * - The base deposit to submit an item.\\n * - The base deposit to remove an item.\\n * - The base deposit to challenge a submission.\\n * - The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n * @param _relayerContract The address of the relay contract to add/remove items directly.\\n */\\n function initialize(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n address _connectedTCR,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence,\\n address _governor,\\n uint256[4] calldata _baseDeposits,\\n uint256 _challengePeriodDuration,\\n uint256[3] calldata _stakeMultipliers,\\n address _relayerContract\\n ) external {\\n require(!initialized, \\\"Already initialized.\\\");\\n\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n governor = _governor;\\n submissionBaseDeposit = _baseDeposits[0];\\n removalBaseDeposit = _baseDeposits[1];\\n submissionChallengeBaseDeposit = _baseDeposits[2];\\n removalChallengeBaseDeposit = _baseDeposits[3];\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n relayerContract = _relayerContract;\\n\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n\\n initialized = true;\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /**\\n * @dev Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _item The URI to the item data.\\n */\\n function addItemDirectly(string calldata _item) external onlyRelayer {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item is added directly once, the next time it is added it will emit this event again.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, true);\\n }\\n\\n item.status = Status.Registered;\\n\\n emit ItemStatusChange(itemID, true);\\n }\\n\\n /**\\n * @dev Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _itemID The ID of the item to remove.\\n */\\n function removeItemDirectly(bytes32 _itemID) external onlyRelayer {\\n Item storage item = items[_itemID];\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n item.status = Status.Absent;\\n\\n emit ItemStatusChange(_itemID, true);\\n }\\n\\n /**\\n * @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The URI to the item data.\\n */\\n function addItem(string calldata _item) external payable {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item was added previously using `addItemDirectly`, the event will be emitted again here.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, false);\\n }\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(submissionBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.RegistrationRequested;\\n\\n request.requestType = RequestType.Registration;\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n\\n emit RequestSubmitted(itemID, getEvidenceGroupID(itemID, item.requestCount - 1));\\n\\n emit Contribution(itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(removalBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.ClearingRequested;\\n\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n request.requestType = RequestType.Clearing;\\n\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, item.requestCount - 1);\\n\\n emit RequestSubmitted(_itemID, evidenceGroupID);\\n\\n emit Contribution(_itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime <= challengePeriodDuration,\\n \\\"Challenges must occur during the challenge period.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not have already been disputed.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitrationParams.arbitratorExtraData);\\n uint256 totalCost;\\n {\\n uint256 challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n }\\n require(msg.value >= totalCost, \\\"You must fully fund the challenge.\\\");\\n\\n emit Contribution(_itemID, lastRequestIndex, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Challenger);\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = item.sumDeposit.addCap(uint128(totalCost)).subCap(uint128(arbitrationCost));\\n\\n request.challenger = msg.sender;\\n\\n // Raise a dispute.\\n disputeData.disputeID = arbitrator.createDispute.value(arbitrationCost)(\\n RULING_OPTIONS,\\n arbitrationParams.arbitratorExtraData\\n );\\n disputeData.status = DisputeStatus.AwaitingRuling;\\n // For compatibility with GeneralizedTCR consider the request/challenge cycle\\n // the first round (index 0), so we need to make the next round index 1.\\n disputeData.roundCount = 2;\\n\\n arbitratorDisputeIDToItemID[address(arbitrator)][disputeData.disputeID] = _itemID;\\n\\n uint256 metaEvidenceID = 2 * request.arbitrationParamsIndex + uint256(request.requestType);\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, lastRequestIndex);\\n emit Dispute(arbitrator, disputeData.disputeID, metaEvidenceID, evidenceGroupID);\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side > Party.None, \\\"Invalid side.\\\");\\n\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(\\n disputeData.status == DisputeStatus.AwaitingRuling,\\n \\\"A dispute must have been raised to fund an appeal.\\\"\\n );\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 lastRoundIndex = disputeData.roundCount - 1;\\n Round storage round = disputeData.rounds[lastRoundIndex];\\n require(round.sideFunded != _side, \\\"Side already fully funded.\\\");\\n\\n uint256 multiplier;\\n {\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = arbitrator.appealPeriod(disputeData.disputeID);\\n require(\\n block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n Party winner = Party(arbitrator.currentRuling(disputeData.disputeID));\\n if (winner == Party.None) {\\n multiplier = sharedStakeMultiplier;\\n } else if (_side == winner) {\\n multiplier = winnerStakeMultiplier;\\n } else {\\n multiplier = loserStakeMultiplier;\\n require(\\n block.timestamp < (appealPeriodStart + appealPeriodEnd) / 2,\\n \\\"The loser must contribute during the first half of the appeal period.\\\"\\n );\\n }\\n }\\n\\n uint256 appealCost = arbitrator.appealCost(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n uint256 totalCost = appealCost.addCap(appealCost.mulCap(multiplier) / MULTIPLIER_DIVISOR);\\n contribute(_itemID, lastRequestIndex, lastRoundIndex, uint256(_side), msg.sender, msg.value, totalCost);\\n\\n if (round.amountPaid[uint256(_side)] >= totalCost) {\\n if (round.sideFunded == Party.None) {\\n round.sideFunded = _side;\\n } else {\\n // Resets the value because both sides are funded.\\n round.sideFunded = Party.None;\\n\\n // Raise appeal if both sides are fully funded.\\n arbitrator.appeal.value(appealCost)(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n disputeData.roundCount++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n }\\n\\n /**\\n * @dev If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _requestID The request from which to withdraw from.\\n * @param _roundID The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(\\n address payable _beneficiary,\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n ) external {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n require(disputeData.status == DisputeStatus.Resolved, \\\"Request must be resolved.\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n\\n uint256 reward;\\n if (_roundID == disputeData.roundCount - 1) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward =\\n round.contributions[_beneficiary][uint256(Party.Requester)] +\\n round.contributions[_beneficiary][uint256(Party.Challenger)];\\n } else if (disputeData.ruling == Party.None) {\\n uint256 totalFeesInRound = round.amountPaid[uint256(Party.Challenger)] +\\n round.amountPaid[uint256(Party.Requester)];\\n uint256 claimableFees = round.contributions[_beneficiary][uint256(Party.Challenger)] +\\n round.contributions[_beneficiary][uint256(Party.Requester)];\\n reward = totalFeesInRound > 0 ? (claimableFees * round.feeRewards) / totalFeesInRound : 0;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint256(disputeData.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint256(disputeData.ruling)] * round.feeRewards) /\\n round.amountPaid[uint256(disputeData.ruling)]\\n : 0;\\n }\\n round.contributions[_beneficiary][uint256(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint256(Party.Challenger)] = 0;\\n\\n if (reward > 0) {\\n _beneficiary.send(reward);\\n emit RewardWithdrawn(_beneficiary, _itemID, _requestID, _roundID, reward);\\n }\\n }\\n\\n /**\\n * @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = items[_itemID].requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested) {\\n item.status = Status.Registered;\\n } else if (item.status == Status.ClearingRequested) {\\n item.status = Status.Absent;\\n } else {\\n revert(\\\"There must be a request.\\\");\\n }\\n\\n emit ItemStatusChange(_itemID, false);\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (sumDeposit > 0) {\\n // reimburse the requester\\n request.requester.send(sumDeposit);\\n }\\n }\\n\\n /**\\n * @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n\\n bytes32 itemID = arbitratorDisputeIDToItemID[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n uint256 lastRequestIndex = items[itemID].requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.AwaitingRuling, \\\"The request must not be resolved.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n require(address(arbitrationParams.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n\\n uint256 finalRuling;\\n Round storage round = disputeData.rounds[disputeData.roundCount - 1];\\n\\n // If one side paid its fees, the ruling is in its favor.\\n // Note that if the other side had also paid, sideFudned would have been reset\\n // and an appeal would have been created.\\n if (round.sideFunded == Party.Requester) {\\n finalRuling = uint256(Party.Requester);\\n } else if (round.sideFunded == Party.Challenger) {\\n finalRuling = uint256(Party.Challenger);\\n } else {\\n finalRuling = _ruling;\\n }\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, finalRuling);\\n\\n Party winner = Party(finalRuling);\\n\\n disputeData.status = DisputeStatus.Resolved;\\n disputeData.ruling = winner;\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (winner == Party.None) {\\n // If the arbitrator refuse to rule, then the item status should be the same it was before the request.\\n // Regarding item.status this is equivalent to the challenger winning the dispute.\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n // Since nobody has won, then we reimburse both parties equally.\\n // If item.sumDeposit is odd, 1 wei will remain in the contract balance.\\n uint256 halfSumDeposit = sumDeposit / 2;\\n\\n request.requester.send(halfSumDeposit);\\n request.challenger.send(halfSumDeposit);\\n } else if (winner == Party.Requester) {\\n item.status = item.status == Status.RegistrationRequested ? Status.Registered : Status.Absent;\\n\\n request.requester.send(sumDeposit);\\n } else {\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n request.challenger.send(sumDeposit);\\n }\\n\\n emit ItemStatusChange(itemID, false);\\n }\\n\\n /**\\n * @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = item.requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n emit Evidence(\\n arbitrationParams.arbitrator,\\n getEvidenceGroupID(_itemID, lastRequestIndex),\\n msg.sender,\\n _evidence\\n );\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeChallengePeriodDuration(uint256 _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint256 _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint256 _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint256 _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint256 _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint256 _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint256 _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint256 _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /**\\n * @dev Change the address of the relay contract.\\n * @param _relayerContract The new address of the relay contract.\\n */\\n function changeRelayerContract(address _relayerContract) external onlyGovernor {\\n relayerContract = _relayerContract;\\n }\\n\\n /**\\n * @notice Changes the params related to arbitration.\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function changeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence\\n ) external onlyGovernor {\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function _doChangeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence\\n ) internal {\\n emit MetaEvidence(2 * arbitrationParamsChanges.length, _registrationMetaEvidence);\\n emit MetaEvidence(2 * arbitrationParamsChanges.length + 1, _clearingMetaEvidence);\\n\\n arbitrationParamsChanges.push(\\n ArbitrationParams({arbitrator: _arbitrator, arbitratorExtraData: _arbitratorExtraData})\\n );\\n }\\n\\n /**\\n * @notice Make a fee contribution.\\n * @dev It cannot be inlined in fundAppeal because of the stack limit.\\n * @param _itemID The item receiving the contribution.\\n * @param _requestID The request to contribute.\\n * @param _roundID The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n uint256 _side,\\n address payable _contributor,\\n uint256 _amount,\\n uint256 _totalRequired\\n ) internal {\\n Round storage round = requestsDisputeData[_itemID][_requestID].rounds[_roundID];\\n uint256 pendingAmount = _totalRequired.subCap(round.amountPaid[_side]);\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution; // Amount contributed.\\n uint256 remainingETH; // Remaining ETH to send back.\\n if (pendingAmount > _amount) {\\n contribution = _amount;\\n } else {\\n contribution = pendingAmount;\\n remainingETH = _amount - pendingAmount;\\n }\\n\\n round.contributions[_contributor][_side] += contribution;\\n round.amountPaid[_side] += contribution;\\n round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n if (remainingETH > 0) {\\n // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n _contributor.send(remainingETH);\\n }\\n\\n if (contribution > 0) {\\n emit Contribution(_itemID, _requestID, _roundID, msg.sender, contribution, Party(_side));\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /**\\n * @dev Gets the evidengeGroupID for a given item and request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The ID of the request.\\n * @return The evidenceGroupID\\n */\\n function getEvidenceGroupID(bytes32 _itemID, uint256 _requestID) public pure returns (uint256) {\\n return uint256(keccak256(abi.encodePacked(_itemID, _requestID)));\\n }\\n\\n /**\\n * @notice Gets the arbitrator for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator address.\\n */\\n function arbitrator() external view returns (IArbitrator) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitrator;\\n }\\n\\n /**\\n * @notice Gets the arbitratorExtraData for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator extra data.\\n */\\n function arbitratorExtraData() external view returns (bytes memory) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitratorExtraData;\\n }\\n\\n /**\\n * @dev Gets the number of times MetaEvidence was updated.\\n * @return The number of times MetaEvidence was updated.\\n */\\n function metaEvidenceUpdates() external view returns (uint256) {\\n return arbitrationParamsChanges.length;\\n }\\n\\n /**\\n * @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The request to query.\\n * @param _roundID The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address _contributor\\n ) external view returns (uint256[3] memory contributions) {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n Round storage round = disputeData.rounds[_roundID];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /**\\n * @dev Returns item's information. Includes the total number of requests for the item\\n * @param _itemID The ID of the queried item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Total number of requests for the item.\\n * @return sumDeposit The total deposit made by the requester and the challenger (if any)\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n Status status,\\n uint256 numberOfRequests,\\n uint256 sumDeposit\\n )\\n {\\n Item storage item = items[_itemID];\\n return (item.status, item.requestCount, item.sumDeposit);\\n }\\n\\n /**\\n * @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint256 _requestID)\\n external\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint256 numberOfRounds,\\n Party ruling,\\n IArbitrator requestArbitrator,\\n bytes memory requestArbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n Request storage request = items[_itemID].requests[_requestID];\\n\\n submissionTime = request.submissionTime;\\n parties[uint256(Party.Requester)] = request.requester;\\n parties[uint256(Party.Challenger)] = request.challenger;\\n\\n (disputed, disputeID, numberOfRounds, ruling) = getRequestDisputeData(_itemID, _requestID);\\n\\n (requestArbitrator, requestArbitratorExtraData, metaEvidenceID) = getRequestArbitrationParams(\\n _itemID,\\n _requestID\\n );\\n resolved = getRequestResolvedStatus(_itemID, _requestID);\\n }\\n\\n /**\\n * @dev Gets the dispute data relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return ruling The final ruling given, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n */\\n function getRequestDisputeData(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 numberOfRounds,\\n Party ruling\\n )\\n {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n return (\\n disputeData.status >= DisputeStatus.AwaitingRuling,\\n disputeData.disputeID,\\n disputeData.roundCount,\\n disputeData.ruling\\n );\\n }\\n\\n /**\\n * @dev Gets the arbitration params relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestArbitrationParams(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_requestID];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n return (\\n arbitrationParams.arbitrator,\\n arbitrationParams.arbitratorExtraData,\\n 2 * request.arbitrationParamsIndex + uint256(request.requestType)\\n );\\n }\\n\\n /**\\n * @dev Gets the resovled status of a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n */\\n function getRequestResolvedStatus(bytes32 _itemID, uint256 _requestID) internal view returns (bool resolved) {\\n Item storage item = items[_itemID];\\n\\n if (item.requestCount == 0) {\\n return false;\\n }\\n\\n if (_requestID < item.requestCount - 1) {\\n // It was resolved because it is not the last request.\\n return true;\\n }\\n\\n return item.sumDeposit == 0;\\n }\\n\\n /**\\n * @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @param _roundID The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n )\\n external\\n view\\n returns (\\n bool appealed,\\n uint256[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint256 feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n require(disputeData.roundCount > _roundID, \\\"Round does not exist\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n appealed = _roundID < disputeData.roundCount - 1;\\n\\n hasPaid[uint256(Party.Requester)] = appealed || round.sideFunded == Party.Requester;\\n hasPaid[uint256(Party.Challenger)] = appealed || round.sideFunded == Party.Challenger;\\n\\n return (appealed, round.amountPaid, hasPaid, round.feeRewards);\\n }\\n}\\n\",\"keccak256\":\"0x3a77a9cd5142744e9dec8d1f74e198b38b53c579e08cb306caa1b84c4c8d0935\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"},\"contracts/utils/CappedMath128.sol\":{\"content\":\"/**\\n * @authors: [@hbarcelos]\\n * @reviewers: [@fnanni-0]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath128 {\\n uint128 private constant UINT128_MAX = 2**128 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function addCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n uint128 c = _a + _b;\\n return c >= _a ? c : UINT128_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function mulCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_a == 0) return 0;\\n\\n uint128 c = _a * _b;\\n return c / _a == _b ? c : UINT128_MAX;\\n }\\n}\\n\",\"keccak256\":\"0xaa86df80a3608032b85628f172d6e4b59c7f8a360a0e661959e865765322375c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50614ab9806100206000396000f3fe6080604052600436106102875760003560e01c80638545c6a51161015a578063b4d79539116100c1578063c669439e1161007a578063c669439e14610fb7578063d661dd3114610fcc578063dd78cb5914610fe1578063e4c0aaf41461100b578063e9c241661461103e578063f48a0b311461106857610287565b8063b4d7953914610c9f578063baef48e214610cd2578063bb0b86ff14610e2f578063bfbcff1a14610e44578063c104817d14610f78578063c2f2beea14610fa257610287565b80639c81a827116101135780639c81a827146109fc578063a1c2bf4d14610a35578063a214e71214610a7a578063a37b6ad414610b35578063a43a21a114610b4a578063adc7faba14610c7557610287565b80638545c6a514610799578063873db1a7146108145780638c88c1491461088957806392239dff146108b3578063974121b2146108dd57806397e90e501461098757610287565b806341658341116101fe578063560f7eaf116101b7578063560f7eaf14610706578063626c47e8146107305780636cc6cde1146107455780636cdc090f1461075a578063787471a91461076f5780637b9433831461078457610287565b8063416583411461055057806341e57c061461056557806342d1da941461058f57806348f343f3146105bf5780634aac84e51461062d57806352bc0e601461068957610287565b80631d512085116102505780631d5120851461041a57806327e9f2941461042f5780632baf80ee1461049d578063311a6c56146104c357806333e5d047146104f357806340f1fa651461051d57610287565b806282a36d1461028c57806303f3e206146102b35780630c340a24146103335780630c7ac7b61461036457806312ce3525146103ee575b600080fd5b34801561029857600080fd5b506102a16110ea565b60408051918252519081900360200190f35b3480156102bf57600080fd5b506102e3600480360360408110156102d657600080fd5b50803590602001356110f0565b604051808581526020018460028111156102f957fe5b60ff16815260200183600281111561030d57fe5b60ff1681526001600160f01b039092166020830152506040805191829003019350915050f35b34801561033f57600080fd5b50610348611132565b604080516001600160a01b039092168252519081900360200190f35b34801561037057600080fd5b50610379611141565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103b357818101518382015260200161039b565b50505050905090810190601f1680156103e05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103fa57600080fd5b506104186004803603602081101561041157600080fd5b5035611207565b005b34801561042657600080fd5b506102a1611259565b6104186004803603602081101561044557600080fd5b810190602081018135600160201b81111561045f57600080fd5b82018360208201111561047157600080fd5b803590602001918460018302840111600160201b8311171561049257600080fd5b50909250905061125f565b610418600480360360408110156104b357600080fd5b508035906020013560ff1661173f565b3480156104cf57600080fd5b50610418600480360360408110156104e657600080fd5b5080359060200135611e1b565b3480156104ff57600080fd5b506104186004803603602081101561051657600080fd5b5035612271565b34801561052957600080fd5b506104186004803603602081101561054057600080fd5b50356001600160a01b03166122c3565b34801561055c57600080fd5b506102a1612338565b34801561057157600080fd5b506104186004803603602081101561058857600080fd5b503561233e565b34801561059b57600080fd5b506102a1600480360360408110156105b257600080fd5b508035906020013561242f565b3480156105cb57600080fd5b506105e9600480360360208110156105e257600080fd5b503561245e565b604051808460038111156105f957fe5b60ff1681526001600160801b039093166020840152506001600160781b031660408083019190915251908190036060019150f35b34801561063957600080fd5b506106576004803603602081101561065057600080fd5b5035612494565b6040518084600381111561066757fe5b60ff168152602001838152602001828152602001935050505060405180910390f35b34801561069557600080fd5b506106ce600480360360808110156106ac57600080fd5b50803590602081013590604081013590606001356001600160a01b03166124ca565b6040518082606080838360005b838110156106f35781810151838201526020016106db565b5050505090500191505060405180910390f35b34801561071257600080fd5b506104186004803603602081101561072957600080fd5b5035612543565b34801561073c57600080fd5b506102a1612595565b34801561075157600080fd5b5061034861259a565b34801561076657600080fd5b506102a16125cf565b34801561077b57600080fd5b506102a16125d5565b34801561079057600080fd5b506102a16125db565b3480156107a557600080fd5b50610418600480360360208110156107bc57600080fd5b810190602081018135600160201b8111156107d657600080fd5b8201836020820111156107e857600080fd5b803590602001918460018302840111600160201b8311171561080957600080fd5b5090925090506125e1565b6104186004803603604081101561082a57600080fd5b81359190810190604081016020820135600160201b81111561084b57600080fd5b82018360208201111561085d57600080fd5b803590602001918460018302840111600160201b8311171561087e57600080fd5b5090925090506127aa565b34801561089557600080fd5b50610418600480360360208110156108ac57600080fd5b5035612db5565b3480156108bf57600080fd5b50610418600480360360208110156108d657600080fd5b5035612e07565b3480156108e957600080fd5b506109136004803603606081101561090057600080fd5b5080359060208101359060400135612e59565b60405184151581526020810184606080838360005b83811015610940578181015183820152602001610928565b5050505090500183600360200280838360005b8381101561096b578181015183820152602001610953565b5050505090500182815260200194505050505060405180910390f35b6104186004803603604081101561099d57600080fd5b81359190810190604081016020820135600160201b8111156109be57600080fd5b8201836020820111156109d057600080fd5b803590602001918460018302840111600160201b831117156109f157600080fd5b509092509050613016565b348015610a0857600080fd5b506102a160048036036040811015610a1f57600080fd5b506001600160a01b0381351690602001356134c0565b348015610a4157600080fd5b5061041860048036036080811015610a5857600080fd5b506001600160a01b0381351690602081013590604081013590606001356134dd565b348015610a8657600080fd5b50610aa460048036036020811015610a9d57600080fd5b5035613798565b60405180836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610af9578181015183820152602001610ae1565b50505050905090810190601f168015610b265780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b348015610b4157600080fd5b506102a161385a565b348015610b5657600080fd5b5061041860048036036080811015610b6d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610b9757600080fd5b820183602082011115610ba957600080fd5b803590602001918460018302840111600160201b83111715610bca57600080fd5b919390929091602081019035600160201b811115610be757600080fd5b820183602082011115610bf957600080fd5b803590602001918460018302840111600160201b83111715610c1a57600080fd5b919390929091602081019035600160201b811115610c3757600080fd5b820183602082011115610c4957600080fd5b803590602001918460018302840111600160201b83111715610c6a57600080fd5b509092509050613860565b348015610c8157600080fd5b5061041860048036036020811015610c9857600080fd5b5035613955565b348015610cab57600080fd5b5061041860048036036020811015610cc257600080fd5b50356001600160a01b03166139a7565b348015610cde57600080fd5b5061041860048036036101e0811015610cf657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610d2057600080fd5b820183602082011115610d3257600080fd5b803590602001918460018302840111600160201b83111715610d5357600080fd5b919390926001600160a01b0383351692604081019060200135600160201b811115610d7d57600080fd5b820183602082011115610d8f57600080fd5b803590602001918460018302840111600160201b83111715610db057600080fd5b919390929091602081019035600160201b811115610dcd57600080fd5b820183602082011115610ddf57600080fd5b803590602001918460018302840111600160201b83111715610e0057600080fd5b91935091506001600160a01b038135811691602081019160a08201359160c08101916101209091013516613a2b565b348015610e3b57600080fd5b506102a1613bf5565b348015610e5057600080fd5b50610e7460048036036040811015610e6757600080fd5b5080359060200135613bfb565b604051808b1515151581526020018a81526020018981526020018815151515815260200187600360200280838360005b83811015610ebc578181015183820152602001610ea4565b50505050905001868152602001856002811115610ed557fe5b60ff168152602001846001600160a01b03166001600160a01b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610f34578181015183820152602001610f1c565b50505050905090810190601f168015610f615780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b348015610f8457600080fd5b5061041860048036036020811015610f9b57600080fd5b5035613d34565b348015610fae57600080fd5b506102a1613d86565b348015610fc357600080fd5b50610348613d8c565b348015610fd857600080fd5b506102a1613da0565b348015610fed57600080fd5b506104186004803603602081101561100457600080fd5b5035613da6565b34801561101757600080fd5b506104186004803603602081101561102e57600080fd5b50356001600160a01b0316613df8565b34801561104a57600080fd5b506104186004803603602081101561106157600080fd5b5035613e67565b34801561107457600080fd5b506104186004803603604081101561108b57600080fd5b81359190810190604081016020820135600160201b8111156110ac57600080fd5b8201836020820111156110be57600080fd5b803590602001918460018302840111600160201b831117156110df57600080fd5b509092509050614080565b60065481565b600c6020908152600092835260408084209091529082529020805460019091015460ff808216916101008104909116906201000090046001600160f01b031684565b6001546001600160a01b031681565b600d805460609190600019810190811061115757fe5b90600052602060002090600202016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111fc5780601f106111d1576101008083540402835291602001916111fc565b820191906000526020600020905b8154815290600101906020018083116111df57829003601f168201915b505050505090505b90565b6001546001600160a01b03163314611254576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600955565b60085481565b60008282604051602001808383808284376040805191909301818103601f19018252835280516020918201206000818152600a90925292902080549296509450506001600160781b03600160881b90910481161091506113089050576040805162461bcd60e51b815260206004820152601b60248201527f546f6f206d616e7920726571756573747320666f72206974656d2e0000000000604482015290519081900360640190fd5b6000815460ff16600381111561131a57fe5b1461136c576040805162461bcd60e51b815260206004820181905260248201527f4974656d206d75737420626520616273656e7420746f2062652061646465642e604482015290519081900360640190fd5b8054600160881b90046001600160781b03166113ee576040805160006020820181905282825291810185905283917f93e4d3e9542ddd9eea8962241d920b12b96bce26749667189fd06ed3549019e191879187918060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a25b80546001600160781b03600160881b808304821660018181019093169091026001600160881b039093169290921783556000918252820160205260408120600d805491926000198301929091908390811061144557fe5b60009182526020822060029091020154600d80546001600160a01b039092169350908490811061147157fe5b906000526020600020906002020160010190506000826001600160a01b031663f7434ea9836040518263ffffffff1660e01b8152600401808060200182810382528381815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561152e5780601f106115035761010080835404028352916020019161152e565b820191906000526020600020905b81548152906001019060200180831161151157829003601f168201915b50509250505060206040518083038186803b15801561154c57600080fd5b505afa158015611560573d6000803e3d6000fd5b505050506040513d602081101561157657600080fd5b505160025490915060009061159290839063ffffffff61417216565b9050803410156115e9576040805162461bcd60e51b815260206004820181905260248201527f596f75206d7573742066756c6c792066756e642074686520726571756573742e604482015290519081900360640190fd5b86546002610100600160881b03199091166101006001600160801b03841681029190911760ff1916919091178855865468ffffffffffffffffff19164267ffffffffffffffff169091021762ffffff60481b1916600160481b62ffffff871602176bffffffffffffffffffffffff1633600160601b02178655865488907f73057048557c37c893f346985dc1d461cf12b00f09397bb275613203124c2be1906116aa908390600160881b90046001600160781b03908116600019011661242f565b60408051918252519081900360200190a2865460408051600160881b9092046001600160781b039081166000190116825260006020830152818101839052600160608301525133918a9160008051602061496f8339815191529181900360800190a3803411156117335760405133903483900380156108fc02916000818181858888f150505050505b50505050505050505050565b600081600281111561174d57fe5b1161178f576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21039b4b2329760991b604482015290519081900360640190fd5b6000828152600a602052604090206001815460ff1660038111156117af57fe5b116117eb5760405162461bcd60e51b8152600401808060200182810382526025815260200180614a606025913960400191505060405180910390fd5b80546000196001600160781b03600160881b909204821601166000818152600183810160209081526040808420888552600c835281852086865290925290922090600182015460ff16600281111561183f57fe5b1461187b5760405162461bcd60e51b8152600401808060200182810382526032815260200180614a0c6032913960400191505060405180910390fd5b8154600d8054600092600160481b900462ffffff1690811061189957fe5b60009182526020808320600292830201805460018701546000196001600160f01b03620100009092048216011680865287850190935260409094209094506001600160a01b0390931692909189908111156118f057fe5b815460ff16600281111561190057fe5b1415611953576040805162461bcd60e51b815260206004820152601a60248201527f5369646520616c72656164792066756c6c792066756e6465642e000000000000604482015290519081900360640190fd5b6000806000856001600160a01b031663afe15cfb89600001546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b15801561199f57600080fd5b505afa1580156119b3573d6000803e3d6000fd5b505050506040513d60408110156119c957600080fd5b50805160209091015190925090504282118015906119e657508042105b611a215760405162461bcd60e51b81526004018080602001828103825260348152602001806148836034913960400191505060405180910390fd5b6000866001600160a01b0316631c3db16d8a600001546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611a6b57600080fd5b505afa158015611a7f573d6000803e3d6000fd5b505050506040513d6020811015611a9557600080fd5b50516002811115611aa257fe5b90506000816002811115611ab257fe5b1415611ac2576009549350611b32565b806002811115611ace57fe5b8d6002811115611ada57fe5b1415611aea576007549350611b32565b60085493506002838301044210611b325760405162461bcd60e51b81526004018080602001828103825260458152602001806149096045913960600191505060405180910390fd5b5050506000846001600160a01b031663f23f16e68860000154886001016040518363ffffffff1660e01b81526004018083815260200180602001828103825283818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611bed5780601f10611bc257610100808354040283529160200191611bed565b820191906000526020600020905b815481529060010190602001808311611bd057829003601f168201915b5050935050505060206040518083038186803b158015611c0c57600080fd5b505afa158015611c20573d6000803e3d6000fd5b505050506040513d6020811015611c3657600080fd5b505190506000611c68612710611c52848663ffffffff61419116565b81611c5957fe5b8491900463ffffffff61417216565b9050611c848d8b878f6002811115611c7c57fe5b3334876141bb565b80846002018d6002811115611c9557fe5b60038110611c9f57fe5b015410611e0c576000845460ff166002811115611cb857fe5b1415611ce05783548c90859060ff19166001836002811115611cd657fe5b0217905550611e0c565b835460ff1916845587546040805163093225f160e31b8152600481018381526024820192835260018b8101805460029281161561010002600019011691909104604484018190526001600160a01b038c16956349912f8895899591949290916064019084908015611d925780601f10611d6757610100808354040283529160200191611d92565b820191906000526020600020905b815481529060010190602001808311611d7557829003601f168201915b505093505050506000604051808303818588803b158015611db257600080fd5b505af1158015611dc6573d6000803e3d6000fd5b5050506001808b0180546001600160f01b0362010000808304821685019091160261ffff909116179055860154611e06925090508363ffffffff61430816565b60018501555b50505050505050505050505050565b6002811115611e69576040805162461bcd60e51b815260206004820152601560248201527424b73b30b634b210393ab634b7339037b83a34b7b760591b604482015290519081900360640190fd5b336000908152600b60209081526040808320858452825280832054808452600a835281842080546000196001600160781b03600160881b9092048216011680865260018083018652848720848852600c875285882083895290965293909520919490939092909190600182015460ff166002811115611ee457fe5b14611f205760405162461bcd60e51b815260040180806020018281038252602181526020018061494e6021913960400191505060405180910390fd5b8154600d8054600092600160481b900462ffffff16908110611f3e57fe5b6000918252602090912060029091020180549091506001600160a01b03163314611f995760405162461bcd60e51b815260040180806020018281038252602581526020018061498f6025913960400191505060405180910390fd5b6001808301546000196001600160f01b036201000090920482160116600090815260028401602052604081209091815460ff166002811115611fd757fe5b1415611fe75760015b915061200a565b6002815460ff166002811115611ff957fe5b1415612006576002611fe0565b8891505b6040805183815290518b9133917f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769181900360200190a3600082600281111561204f57fe5b60018601805460ff19166002908117808355929350839261ff0019169061010090849081111561207b57fe5b02179055508754610100600160881b03198116895561010090046001600160801b031660008260028111156120ac57fe5b1415612152576002895460ff1660038111156120c457fe5b146120d05760016120d3565b60005b89548a9060ff191660018360038111156120e957fe5b021790555086546040516002830491600160601b90046001600160a01b0316906108fc8315029083906000818181858888f150505060018a01546040516001600160a01b03909116925083156108fc02915083906000818181858888f19350505050505061223e565b600182600281111561216057fe5b14156121d6576002895460ff16600381111561217857fe5b14612184576000612187565b60015b89548a9060ff1916600183600381111561219d57fe5b02179055508654604051600160601b9091046001600160a01b0316906108fc8315029083906000818181858888f193505050505061223e565b6002895460ff1660038111156121e857fe5b146121f45760016121f7565b60005b89548a9060ff1916600183600381111561220d57fe5b021790555060018701546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b604080516000815290518b9160008051602061483b833981519152919081900360200190a2505050505050505050505050565b6001546001600160a01b031633146122be576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600255565b6001546001600160a01b03163314612310576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60095481565b60005461010090046001600160a01b031633146123a2576040805162461bcd60e51b815260206004820152601d60248201527f5468652063616c6c6572206d757374206265207468652072656c61792e000000604482015290519081900360640190fd5b6000818152600a602052604090206001815460ff1660038111156123c257fe5b146123fe5760405162461bcd60e51b81526004018080602001828103825260268152602001806149e66026913960400191505060405180910390fd5b805460ff1916815560408051600181529051839160008051602061483b833981519152919081900360200190a25050565b604080516020808201859052818301849052825180830384018152606090920190925280519101205b92915050565b600a6020526000908152604090205460ff81169061010081046001600160801b031690600160881b90046001600160781b031683565b6000908152600a602052604090205460ff811691600160881b82046001600160781b03169161010090046001600160801b031690565b6124d2614761565b6000858152600c6020908152604080832087845282528083208684526002810183528184206001600160a01b03871685526005810190935292819020815160608101928390529160039082845b81548152602001906001019080831161251f57505050505092505050949350505050565b6001546001600160a01b03163314612590576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600655565b600281565b600d80546000919060001981019081106125b057fe5b60009182526020909120600290910201546001600160a01b0316905090565b600d5490565b60055481565b60075481565b60005461010090046001600160a01b03163314612645576040805162461bcd60e51b815260206004820152601d60248201527f5468652063616c6c6572206d757374206265207468652072656c61792e000000604482015290519081900360640190fd5b60008282604051602001808383808284376040805191909301818103601f19018252835280516020918201206000818152600a90925292812092965091945090925061268f915050565b815460ff16600381111561269f57fe5b146126f1576040805162461bcd60e51b815260206004820181905260248201527f4974656d206d75737420626520616273656e7420746f2062652061646465642e604482015290519081900360640190fd5b8054600160881b90046001600160781b0316612773576040805160016020820181905282825291810185905283917f93e4d3e9542ddd9eea8962241d920b12b96bce26749667189fd06ed3549019e191879187918060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a25b8054600160ff19909116811782556040805191825251839160008051602061483b833981519152919081900360200190a250505050565b6000838152600a602052604090206001815460ff1660038111156127ca57fe5b116128065760405162461bcd60e51b8152600401808060200182810382526025815260200180614a606025913960400191505060405180910390fd5b8054600160881b90046001600160781b039081166000190116600081815260018301602052604090206006548154610100900467ffffffffffffffff16420311156128825760405162461bcd60e51b81526004018080602001828103825260328152602001806149b46032913960400191505060405180910390fd5b6000868152600c60209081526040808320858452909152812090600182015460ff1660028111156128af57fe5b146128eb5760405162461bcd60e51b81526004018080602001828103825260328152602001806148b76032913960400191505060405180910390fd5b8154600d8054600092600160481b900462ffffff1690811061290957fe5b60009182526020808320600292830201805460405163f7434ea960e01b8152600481019384526001808401805460001992811615610100029290920190911695909504602482018190529296506001600160a01b039091169493859363f7434ea99391929091829160440190849080156129c45780601f10612999576101008083540402835291602001916129c4565b820191906000526020600020905b8154815290600101906020018083116129a757829003601f168201915b50509250505060206040518083038186803b1580156129e257600080fd5b505afa1580156129f6573d6000803e3d6000fd5b505050506040513d6020811015612a0c57600080fd5b505190506000806002895460ff166003811115612a2557fe5b14612a3257600554612a36565b6004545b9050612a48838263ffffffff61417216565b91505080341015612a8a5760405162461bcd60e51b8152600401808060200182810382526022815260200180614a3e6022913960400191505060405180910390fd5b336001600160a01b03168b60008051602061496f83398151915289600085600260405180858152602001848152602001838152602001826002811115612acc57fe5b60ff16815260200194505050505060405180910390a38754612b17908390612b029061010090046001600160801b031684614323565b6001600160801b03169063ffffffff61434916565b8854610100600160881b0319166101006001600160801b0392909216820217895560018781018054336001600160a01b03199091161790556040805163c13517e160e01b81526002600482018181526024830193845289850180549586161590960260001901909416819004604483018190526001600160a01b0389169563c13517e195899593949193909290916064019084908015612bf85780601f10612bcd57610100808354040283529160200191612bf8565b820191906000526020600020905b815481529060010190602001808311612bdb57829003601f168201915b505093505050506020604051808303818588803b158015612c1857600080fd5b505af1158015612c2c573d6000803e3d6000fd5b50505050506040513d6020811015612c4357600080fd5b50518086556001808701805460ff1916821761ffff16620200001790556001600160a01b0385166000908152600b602090815260408083209483529390529182208d9055875460ff1690811115612c9657fe5b8754600262ffffff600160481b909204821602160190506000612cb98d8a61242f565b87546040805185815260208101849052815193945091926001600160a01b038916927f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d92908290030190a38a15612d8057336001600160a01b031681866001600160a01b03167fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c8f8f60405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a45b82341115611e0c5760405133903485900380156108fc02916000818181858888f1505050505050505050505050505050505050565b6001546001600160a01b03163314612e02576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600355565b6001546001600160a01b03163314612e54576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600855565b6000612e63614761565b612e6b614761565b6000868152600a602052604081208054600160881b90046001600160781b03168710612ed8576040805162461bcd60e51b81526020600482015260176024820152762932b8bab2b9ba103237b2b9903737ba1032bc34b9ba1760491b604482015290519081900360640190fd5b6000888152600c602090815260408083208a8452909152902060018101546201000090046001600160f01b03168710612f4f576040805162461bcd60e51b8152602060048201526014602482015273149bdd5b9908191bd95cc81b9bdd08195e1a5cdd60621b604482015290519081900360640190fd5b6000878152600282016020526040902060018201546000196001600160f01b036201000090920482160116881096508680612f9957506001815460ff166002811115612f9757fe5b145b151560208601528680612fbb57506002815460ff166002811115612fb957fe5b145b15156040808701919091526001820154815160608101928390528992600285019289929091849060039082845b815481526020019060010190808311612fe85750505050509250965096509650965050505093509350935093565b6000838152600a6020526040902080546001600160781b03600160881b90910481161061308a576040805162461bcd60e51b815260206004820152601b60248201527f546f6f206d616e7920726571756573747320666f72206974656d2e0000000000604482015290519081900360640190fd5b6001815460ff16600381111561309c57fe5b146130d85760405162461bcd60e51b81526004018080602001828103825260268152602001806149e66026913960400191505060405180910390fd5b80546001600160781b03600160881b808304821660018181019093169091026001600160881b039093169290921783556000918252820160205260408120600d805491926000198301929091908390811061312f57fe5b60009182526020822060029091020154600d80546001600160a01b039092169350908490811061315b57fe5b906000526020600020906002020160010190506000826001600160a01b031663f7434ea9836040518263ffffffff1660e01b815260040180806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156132185780601f106131ed57610100808354040283529160200191613218565b820191906000526020600020905b8154815290600101906020018083116131fb57829003601f168201915b50509250505060206040518083038186803b15801561323657600080fd5b505afa15801561324a573d6000803e3d6000fd5b505050506040513d602081101561326057600080fd5b505160035490915060009061327c90839063ffffffff61417216565b9050803410156132d3576040805162461bcd60e51b815260206004820181905260248201527f596f75206d7573742066756c6c792066756e642074686520726571756573742e604482015290519081900360640190fd5b8654610100600160881b0319166101006001600160801b0383160217808855600390889060ff19166001830217905550855468ffffffffffffffff0019166101004267ffffffffffffffff16021762ffffff60481b1916600160481b62ffffff871602176bffffffffffffffffffffffff1633600160601b0217808755600190879060ff1916828002179055508654600090613387908c906000196001600160781b03600160881b9092048216011661242f565b6040805182815290519192508c917f73057048557c37c893f346985dc1d461cf12b00f09397bb275613203124c2be19181900360200190a2875460408051600160881b9092046001600160781b039081166000190116825260006020830152818101849052600160608301525133918d9160008051602061496f8339815191529181900360800190a3881561348c57336001600160a01b031681866001600160a01b03167fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c8d8d60405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a45b813411156134b35760405133903484900380156108fc02916000818181858888f150505050505b5050505050505050505050565b600b60209081526000928352604080842090915290825290205481565b6000838152600c6020908152604080832085845290915290206002600182015460ff16600281111561350b57fe5b1461355d576040805162461bcd60e51b815260206004820152601960248201527f52657175657374206d757374206265207265736f6c7665642e00000000000000604482015290519081900360640190fd5b6000828152600282016020526040812060018301549091906000196001600160f01b0362010000909204821601168414156135be57506001600160a01b038616600090815260058201602052604090206002810154600190910154016136f0565b60006001840154610100900460ff1660028111156135d857fe5b141561363957600382015460048301546001600160a01b0389166000908152600585016020526040902060018101546002909101549190920191018161361f576000613630565b81846001015482028161362e57fe5b045b925050506136f0565b6000826002018460010160019054906101000a900460ff16600281111561365c57fe5b6003811061366657fe5b0154116136745760006136ed565b6001830154600283810191610100900460ff169081111561369157fe5b6003811061369b57fe5b01546001838101546001600160a01b038a166000908152600586016020526040902091860154909190610100900460ff1660028111156136d757fe5b600381106136e157fe5b015402816136eb57fe5b045b90505b6001600160a01b038716600090815260058301602052604081206001810182905560020155801561378f576040516001600160a01b0388169082156108fc029083906000818181858888f15050604080518981526020810189905280820186905290518a94506001600160a01b038c1693507f10969cab4d5cb7c0bcdbae29ab82703528538913301c7ecabb369caf6930cb9c92509081900360600190a35b50505050505050565b600d81815481106137a557fe5b600091825260209182902060029182020180546001808301805460408051601f600019958416156101000295909501909216969096049283018790048702810187019095528185526001600160a01b03909216955091939091908301828280156138505780601f1061382557610100808354040283529160200191613850565b820191906000526020600020905b81548152906001019060200180831161383357829003601f168201915b5050505050905082565b60045481565b6001546001600160a01b031633146138ad576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b61378f8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525050604080516020601f8a01819004810282018101909252888152925088915087908190840183828082843760009201919091525061436d92505050565b6001546001600160a01b031633146139a2576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600755565b6001546001600160a01b031633146139f4576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b6040516001600160a01b038216907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a250565b60005460ff1615613a7a576040805162461bcd60e51b815260206004820152601460248201527320b63932b0b23c9034b734ba34b0b634bd32b21760611b604482015290519081900360640190fd5b6040516001600160a01b038b16907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a2600180546001600160a01b0319166001600160a01b03878116919091179091558435600255602080860135600355604080870135600455606087013560055560068690558435600955848201356007558481013560085560008054610100600160a81b03191661010094861694909402939093179092558151601f8e018290048202810182019092528c8252613bd9918f918f908f9081908401838280828437600081840152601f19601f820116905080830192505050505050508b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525061436d92505050565b50506000805460ff191660011790555050505050505050505050565b60025481565b600080600080613c09614761565b6000878152600a602052604081208054829182916060918391600160881b90046001600160781b03168c10613c7f576040805162461bcd60e51b81526020600482015260176024820152762932b8bab2b9ba103237b2b9903737ba1032bc34b9ba1760491b604482015290519081900360640190fd5b60008d8152600a602090815260408083208f845260019081019092529091208054610100810467ffffffffffffffff169b509091600160601b9091046001600160a01b031690899060038110613cd157fe5b6001600160a01b0392831660209190910291909101526001820154166040890152613cfc8e8e614563565b929e50909c5097509550613d108e8e6145c6565b91965094509250613d218e8e6146f2565b985050509295989b9194979a5092959850565b6001546001600160a01b03163314613d81576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600455565b60035481565b60005461010090046001600160a01b031681565b61271081565b6001546001600160a01b03163314613df3576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600555565b6001546001600160a01b03163314613e45576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600a602090815260408083208054600160881b90046001600160781b0390811660001901168085526001820190935292206006548154610100900467ffffffffffffffff16420311613eef5760405162461bcd60e51b815260040180806020018281038252602881526020018061485b6028913960400191505060405180910390fd5b6000848152600c60209081526040808320858452909152812090600182015460ff166002811115613f1c57fe5b14613f585760405162461bcd60e51b81526004018080602001828103825260238152602001806148186023913960400191505060405180910390fd5b6002845460ff166003811115613f6a57fe5b1415613f88578354600190859060ff191682805b0217905550614000565b6003845460ff166003811115613f9a57fe5b1415613fb3578354600090859060ff1916600183613f7e565b6040805162461bcd60e51b815260206004820152601860248201527f5468657265206d757374206265206120726571756573742e0000000000000000604482015290519081900360640190fd5b60408051600081529051869160008051602061483b833981519152919081900360200190a28354610100600160881b03198116855561010090046001600160801b03168015614078578254604051600160601b9091046001600160a01b0316906108fc8315029083906000818181858888f150505050505b505050505050565b6000838152600a602090815260408083208054600160881b90046001600160781b039081166000190116808552600182019093529083208054600d8054939592939091600160481b900462ffffff169081106140d857fe5b90600052602060002090600202019050336001600160a01b03166140fc888561242f565b825460408051602080825281018a90526001600160a01b03909216917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918b918b9181908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a450505050505050565b60008282018381101561418757600019614189565b805b949350505050565b6000826141a057506000612458565b828202828482816141ad57fe5b041461418757600019614189565b6000878152600c60209081526040808320898452825280832088845260029081019092528220919061420390830187600381106141f457fe5b0154849063ffffffff61430816565b90506000808583111561421857859150614220565b508190508085035b6001600160a01b038716600090815260058501602052604090208290896003811061424757fe5b01805490910190558160028501896003811061425f57fe5b018054909101905560018401805483019055801561429d576040516001600160a01b0388169082156108fc029083906000818181858888f150505050505b81156134b357338b60008051602061496f8339815191528c8c868d60028111156142c357fe5b604051808581526020018481526020018381526020018260028111156142e557fe5b60ff16815260200194505050505060405180910390a35050505050505050505050565b60008282111561431a57506000612458565b50808203612458565b60008282016001600160801b038085169082161015614187576001600160801b03614189565b6000826001600160801b0316826001600160801b0316111561431a57506000612458565b600d805490506002027f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d836040518080602001828103825283818151815260200191508051906020019080838360005b838110156143d55781810151838201526020016143bd565b50505050905090810190601f1680156144025780820380516001836020036101000a031916815260200191505b509250505060405180910390a2600d805490506002026001017f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561447a578181015183820152602001614462565b50505050905090810190601f1680156144a75780820380516001836020036101000a031916815260200191505b509250505060405180910390a2604080518082019091526001600160a01b0385811682526020808301868152600d80546001810180835560009290925285517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5600290920291820180546001600160a01b031916919096161785559151805191959493614559937fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb6019291019061477f565b5050505050505050565b6000828152600c60209081526040808320848452909152812081908190819060018082015460ff16600281111561459657fe5b8254600190930154911115989197506201000081046001600160f01b03169650610100900460ff16945092505050565b6000828152600a6020908152604080832084845260010190915281208054600d80546060938593909284929091600160481b900462ffffff1690811061460857fe5b60009182526020909120600290910201805483549192506001600160a01b03169060018084019160ff169081111561463c57fe5b84548254604080516020601f60026000196001871615610100020190951685900490810182900482028301820190935282825262ffffff600160481b909504851693909302909316939093019284918301828280156146dc5780601f106146b1576101008083540402835291602001916146dc565b820191906000526020600020905b8154815290600101906020018083116146bf57829003601f168201915b5050505050915094509450945050509250925092565b6000828152600a602052604081208054600160881b90046001600160781b0316614720576000915050612458565b80546000196001600160781b03600160881b9092048216011683101561474a576001915050612458565b5461010090046001600160801b0316159392505050565b60405180606001604052806003906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106147c057805160ff19168380011785556147ed565b828001600101855582156147ed579182015b828111156147ed5782518255916020019190600101906147d2565b506147f99291506147fd565b5090565b61120491905b808211156147f9576000815560010161480356fe54686520726571756573742073686f756c64206e6f742062652064697370757465642ed768d67a683a3f5110d48ee5af827e22f4f36d017d764d3bfb11982492b1953654696d6520746f206368616c6c656e6765207468652072657175657374206d75737420706173732e436f6e747269627574696f6e73206d757374206265206d6164652077697468696e207468652061707065616c20706572696f642e54686520726571756573742073686f756c64206e6f74206861766520616c7265616479206265656e2064697370757465642e5468652063616c6c6572206d7573742062652074686520676f7665726e6f722e546865206c6f736572206d75737420636f6e7472696275746520647572696e67207468652066697273742068616c66206f66207468652061707065616c20706572696f642e5468652072657175657374206d757374206e6f74206265207265736f6c7665642e0388febb25c47b8b6fc7ecbe1dd210dfab59161d1d25992a642333d0792ab7764f6e6c79207468652061726269747261746f722063616e206769766520612072756c696e674368616c6c656e676573206d757374206f6363757220647572696e6720746865206368616c6c656e676520706572696f642e4974656d206d757374206265207265676973746572656420746f2062652072656d6f7665642e412064697370757465206d7573742068617665206265656e2072616973656420746f2066756e6420616e2061707065616c2e596f75206d7573742066756c6c792066756e6420746865206368616c6c656e67652e546865206974656d206d757374206861766520612070656e64696e6720726571756573742ea265627a7a72315820d119198f8023bf33b49565a63fe55a7cb47024ad8c23b0963ab52651e4a9fc5664736f6c63430005110032", + "deployedBytecode": "0x6080604052600436106102875760003560e01c80638545c6a51161015a578063b4d79539116100c1578063c669439e1161007a578063c669439e14610fb7578063d661dd3114610fcc578063dd78cb5914610fe1578063e4c0aaf41461100b578063e9c241661461103e578063f48a0b311461106857610287565b8063b4d7953914610c9f578063baef48e214610cd2578063bb0b86ff14610e2f578063bfbcff1a14610e44578063c104817d14610f78578063c2f2beea14610fa257610287565b80639c81a827116101135780639c81a827146109fc578063a1c2bf4d14610a35578063a214e71214610a7a578063a37b6ad414610b35578063a43a21a114610b4a578063adc7faba14610c7557610287565b80638545c6a514610799578063873db1a7146108145780638c88c1491461088957806392239dff146108b3578063974121b2146108dd57806397e90e501461098757610287565b806341658341116101fe578063560f7eaf116101b7578063560f7eaf14610706578063626c47e8146107305780636cc6cde1146107455780636cdc090f1461075a578063787471a91461076f5780637b9433831461078457610287565b8063416583411461055057806341e57c061461056557806342d1da941461058f57806348f343f3146105bf5780634aac84e51461062d57806352bc0e601461068957610287565b80631d512085116102505780631d5120851461041a57806327e9f2941461042f5780632baf80ee1461049d578063311a6c56146104c357806333e5d047146104f357806340f1fa651461051d57610287565b806282a36d1461028c57806303f3e206146102b35780630c340a24146103335780630c7ac7b61461036457806312ce3525146103ee575b600080fd5b34801561029857600080fd5b506102a16110ea565b60408051918252519081900360200190f35b3480156102bf57600080fd5b506102e3600480360360408110156102d657600080fd5b50803590602001356110f0565b604051808581526020018460028111156102f957fe5b60ff16815260200183600281111561030d57fe5b60ff1681526001600160f01b039092166020830152506040805191829003019350915050f35b34801561033f57600080fd5b50610348611132565b604080516001600160a01b039092168252519081900360200190f35b34801561037057600080fd5b50610379611141565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103b357818101518382015260200161039b565b50505050905090810190601f1680156103e05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103fa57600080fd5b506104186004803603602081101561041157600080fd5b5035611207565b005b34801561042657600080fd5b506102a1611259565b6104186004803603602081101561044557600080fd5b810190602081018135600160201b81111561045f57600080fd5b82018360208201111561047157600080fd5b803590602001918460018302840111600160201b8311171561049257600080fd5b50909250905061125f565b610418600480360360408110156104b357600080fd5b508035906020013560ff1661173f565b3480156104cf57600080fd5b50610418600480360360408110156104e657600080fd5b5080359060200135611e1b565b3480156104ff57600080fd5b506104186004803603602081101561051657600080fd5b5035612271565b34801561052957600080fd5b506104186004803603602081101561054057600080fd5b50356001600160a01b03166122c3565b34801561055c57600080fd5b506102a1612338565b34801561057157600080fd5b506104186004803603602081101561058857600080fd5b503561233e565b34801561059b57600080fd5b506102a1600480360360408110156105b257600080fd5b508035906020013561242f565b3480156105cb57600080fd5b506105e9600480360360208110156105e257600080fd5b503561245e565b604051808460038111156105f957fe5b60ff1681526001600160801b039093166020840152506001600160781b031660408083019190915251908190036060019150f35b34801561063957600080fd5b506106576004803603602081101561065057600080fd5b5035612494565b6040518084600381111561066757fe5b60ff168152602001838152602001828152602001935050505060405180910390f35b34801561069557600080fd5b506106ce600480360360808110156106ac57600080fd5b50803590602081013590604081013590606001356001600160a01b03166124ca565b6040518082606080838360005b838110156106f35781810151838201526020016106db565b5050505090500191505060405180910390f35b34801561071257600080fd5b506104186004803603602081101561072957600080fd5b5035612543565b34801561073c57600080fd5b506102a1612595565b34801561075157600080fd5b5061034861259a565b34801561076657600080fd5b506102a16125cf565b34801561077b57600080fd5b506102a16125d5565b34801561079057600080fd5b506102a16125db565b3480156107a557600080fd5b50610418600480360360208110156107bc57600080fd5b810190602081018135600160201b8111156107d657600080fd5b8201836020820111156107e857600080fd5b803590602001918460018302840111600160201b8311171561080957600080fd5b5090925090506125e1565b6104186004803603604081101561082a57600080fd5b81359190810190604081016020820135600160201b81111561084b57600080fd5b82018360208201111561085d57600080fd5b803590602001918460018302840111600160201b8311171561087e57600080fd5b5090925090506127aa565b34801561089557600080fd5b50610418600480360360208110156108ac57600080fd5b5035612db5565b3480156108bf57600080fd5b50610418600480360360208110156108d657600080fd5b5035612e07565b3480156108e957600080fd5b506109136004803603606081101561090057600080fd5b5080359060208101359060400135612e59565b60405184151581526020810184606080838360005b83811015610940578181015183820152602001610928565b5050505090500183600360200280838360005b8381101561096b578181015183820152602001610953565b5050505090500182815260200194505050505060405180910390f35b6104186004803603604081101561099d57600080fd5b81359190810190604081016020820135600160201b8111156109be57600080fd5b8201836020820111156109d057600080fd5b803590602001918460018302840111600160201b831117156109f157600080fd5b509092509050613016565b348015610a0857600080fd5b506102a160048036036040811015610a1f57600080fd5b506001600160a01b0381351690602001356134c0565b348015610a4157600080fd5b5061041860048036036080811015610a5857600080fd5b506001600160a01b0381351690602081013590604081013590606001356134dd565b348015610a8657600080fd5b50610aa460048036036020811015610a9d57600080fd5b5035613798565b60405180836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610af9578181015183820152602001610ae1565b50505050905090810190601f168015610b265780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b348015610b4157600080fd5b506102a161385a565b348015610b5657600080fd5b5061041860048036036080811015610b6d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610b9757600080fd5b820183602082011115610ba957600080fd5b803590602001918460018302840111600160201b83111715610bca57600080fd5b919390929091602081019035600160201b811115610be757600080fd5b820183602082011115610bf957600080fd5b803590602001918460018302840111600160201b83111715610c1a57600080fd5b919390929091602081019035600160201b811115610c3757600080fd5b820183602082011115610c4957600080fd5b803590602001918460018302840111600160201b83111715610c6a57600080fd5b509092509050613860565b348015610c8157600080fd5b5061041860048036036020811015610c9857600080fd5b5035613955565b348015610cab57600080fd5b5061041860048036036020811015610cc257600080fd5b50356001600160a01b03166139a7565b348015610cde57600080fd5b5061041860048036036101e0811015610cf657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610d2057600080fd5b820183602082011115610d3257600080fd5b803590602001918460018302840111600160201b83111715610d5357600080fd5b919390926001600160a01b0383351692604081019060200135600160201b811115610d7d57600080fd5b820183602082011115610d8f57600080fd5b803590602001918460018302840111600160201b83111715610db057600080fd5b919390929091602081019035600160201b811115610dcd57600080fd5b820183602082011115610ddf57600080fd5b803590602001918460018302840111600160201b83111715610e0057600080fd5b91935091506001600160a01b038135811691602081019160a08201359160c08101916101209091013516613a2b565b348015610e3b57600080fd5b506102a1613bf5565b348015610e5057600080fd5b50610e7460048036036040811015610e6757600080fd5b5080359060200135613bfb565b604051808b1515151581526020018a81526020018981526020018815151515815260200187600360200280838360005b83811015610ebc578181015183820152602001610ea4565b50505050905001868152602001856002811115610ed557fe5b60ff168152602001846001600160a01b03166001600160a01b0316815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610f34578181015183820152602001610f1c565b50505050905090810190601f168015610f615780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b348015610f8457600080fd5b5061041860048036036020811015610f9b57600080fd5b5035613d34565b348015610fae57600080fd5b506102a1613d86565b348015610fc357600080fd5b50610348613d8c565b348015610fd857600080fd5b506102a1613da0565b348015610fed57600080fd5b506104186004803603602081101561100457600080fd5b5035613da6565b34801561101757600080fd5b506104186004803603602081101561102e57600080fd5b50356001600160a01b0316613df8565b34801561104a57600080fd5b506104186004803603602081101561106157600080fd5b5035613e67565b34801561107457600080fd5b506104186004803603604081101561108b57600080fd5b81359190810190604081016020820135600160201b8111156110ac57600080fd5b8201836020820111156110be57600080fd5b803590602001918460018302840111600160201b831117156110df57600080fd5b509092509050614080565b60065481565b600c6020908152600092835260408084209091529082529020805460019091015460ff808216916101008104909116906201000090046001600160f01b031684565b6001546001600160a01b031681565b600d805460609190600019810190811061115757fe5b90600052602060002090600202016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111fc5780601f106111d1576101008083540402835291602001916111fc565b820191906000526020600020905b8154815290600101906020018083116111df57829003601f168201915b505050505090505b90565b6001546001600160a01b03163314611254576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600955565b60085481565b60008282604051602001808383808284376040805191909301818103601f19018252835280516020918201206000818152600a90925292902080549296509450506001600160781b03600160881b90910481161091506113089050576040805162461bcd60e51b815260206004820152601b60248201527f546f6f206d616e7920726571756573747320666f72206974656d2e0000000000604482015290519081900360640190fd5b6000815460ff16600381111561131a57fe5b1461136c576040805162461bcd60e51b815260206004820181905260248201527f4974656d206d75737420626520616273656e7420746f2062652061646465642e604482015290519081900360640190fd5b8054600160881b90046001600160781b03166113ee576040805160006020820181905282825291810185905283917f93e4d3e9542ddd9eea8962241d920b12b96bce26749667189fd06ed3549019e191879187918060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a25b80546001600160781b03600160881b808304821660018181019093169091026001600160881b039093169290921783556000918252820160205260408120600d805491926000198301929091908390811061144557fe5b60009182526020822060029091020154600d80546001600160a01b039092169350908490811061147157fe5b906000526020600020906002020160010190506000826001600160a01b031663f7434ea9836040518263ffffffff1660e01b8152600401808060200182810382528381815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561152e5780601f106115035761010080835404028352916020019161152e565b820191906000526020600020905b81548152906001019060200180831161151157829003601f168201915b50509250505060206040518083038186803b15801561154c57600080fd5b505afa158015611560573d6000803e3d6000fd5b505050506040513d602081101561157657600080fd5b505160025490915060009061159290839063ffffffff61417216565b9050803410156115e9576040805162461bcd60e51b815260206004820181905260248201527f596f75206d7573742066756c6c792066756e642074686520726571756573742e604482015290519081900360640190fd5b86546002610100600160881b03199091166101006001600160801b03841681029190911760ff1916919091178855865468ffffffffffffffffff19164267ffffffffffffffff169091021762ffffff60481b1916600160481b62ffffff871602176bffffffffffffffffffffffff1633600160601b02178655865488907f73057048557c37c893f346985dc1d461cf12b00f09397bb275613203124c2be1906116aa908390600160881b90046001600160781b03908116600019011661242f565b60408051918252519081900360200190a2865460408051600160881b9092046001600160781b039081166000190116825260006020830152818101839052600160608301525133918a9160008051602061496f8339815191529181900360800190a3803411156117335760405133903483900380156108fc02916000818181858888f150505050505b50505050505050505050565b600081600281111561174d57fe5b1161178f576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21039b4b2329760991b604482015290519081900360640190fd5b6000828152600a602052604090206001815460ff1660038111156117af57fe5b116117eb5760405162461bcd60e51b8152600401808060200182810382526025815260200180614a606025913960400191505060405180910390fd5b80546000196001600160781b03600160881b909204821601166000818152600183810160209081526040808420888552600c835281852086865290925290922090600182015460ff16600281111561183f57fe5b1461187b5760405162461bcd60e51b8152600401808060200182810382526032815260200180614a0c6032913960400191505060405180910390fd5b8154600d8054600092600160481b900462ffffff1690811061189957fe5b60009182526020808320600292830201805460018701546000196001600160f01b03620100009092048216011680865287850190935260409094209094506001600160a01b0390931692909189908111156118f057fe5b815460ff16600281111561190057fe5b1415611953576040805162461bcd60e51b815260206004820152601a60248201527f5369646520616c72656164792066756c6c792066756e6465642e000000000000604482015290519081900360640190fd5b6000806000856001600160a01b031663afe15cfb89600001546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b15801561199f57600080fd5b505afa1580156119b3573d6000803e3d6000fd5b505050506040513d60408110156119c957600080fd5b50805160209091015190925090504282118015906119e657508042105b611a215760405162461bcd60e51b81526004018080602001828103825260348152602001806148836034913960400191505060405180910390fd5b6000866001600160a01b0316631c3db16d8a600001546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611a6b57600080fd5b505afa158015611a7f573d6000803e3d6000fd5b505050506040513d6020811015611a9557600080fd5b50516002811115611aa257fe5b90506000816002811115611ab257fe5b1415611ac2576009549350611b32565b806002811115611ace57fe5b8d6002811115611ada57fe5b1415611aea576007549350611b32565b60085493506002838301044210611b325760405162461bcd60e51b81526004018080602001828103825260458152602001806149096045913960600191505060405180910390fd5b5050506000846001600160a01b031663f23f16e68860000154886001016040518363ffffffff1660e01b81526004018083815260200180602001828103825283818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611bed5780601f10611bc257610100808354040283529160200191611bed565b820191906000526020600020905b815481529060010190602001808311611bd057829003601f168201915b5050935050505060206040518083038186803b158015611c0c57600080fd5b505afa158015611c20573d6000803e3d6000fd5b505050506040513d6020811015611c3657600080fd5b505190506000611c68612710611c52848663ffffffff61419116565b81611c5957fe5b8491900463ffffffff61417216565b9050611c848d8b878f6002811115611c7c57fe5b3334876141bb565b80846002018d6002811115611c9557fe5b60038110611c9f57fe5b015410611e0c576000845460ff166002811115611cb857fe5b1415611ce05783548c90859060ff19166001836002811115611cd657fe5b0217905550611e0c565b835460ff1916845587546040805163093225f160e31b8152600481018381526024820192835260018b8101805460029281161561010002600019011691909104604484018190526001600160a01b038c16956349912f8895899591949290916064019084908015611d925780601f10611d6757610100808354040283529160200191611d92565b820191906000526020600020905b815481529060010190602001808311611d7557829003601f168201915b505093505050506000604051808303818588803b158015611db257600080fd5b505af1158015611dc6573d6000803e3d6000fd5b5050506001808b0180546001600160f01b0362010000808304821685019091160261ffff909116179055860154611e06925090508363ffffffff61430816565b60018501555b50505050505050505050505050565b6002811115611e69576040805162461bcd60e51b815260206004820152601560248201527424b73b30b634b210393ab634b7339037b83a34b7b760591b604482015290519081900360640190fd5b336000908152600b60209081526040808320858452825280832054808452600a835281842080546000196001600160781b03600160881b9092048216011680865260018083018652848720848852600c875285882083895290965293909520919490939092909190600182015460ff166002811115611ee457fe5b14611f205760405162461bcd60e51b815260040180806020018281038252602181526020018061494e6021913960400191505060405180910390fd5b8154600d8054600092600160481b900462ffffff16908110611f3e57fe5b6000918252602090912060029091020180549091506001600160a01b03163314611f995760405162461bcd60e51b815260040180806020018281038252602581526020018061498f6025913960400191505060405180910390fd5b6001808301546000196001600160f01b036201000090920482160116600090815260028401602052604081209091815460ff166002811115611fd757fe5b1415611fe75760015b915061200a565b6002815460ff166002811115611ff957fe5b1415612006576002611fe0565b8891505b6040805183815290518b9133917f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769181900360200190a3600082600281111561204f57fe5b60018601805460ff19166002908117808355929350839261ff0019169061010090849081111561207b57fe5b02179055508754610100600160881b03198116895561010090046001600160801b031660008260028111156120ac57fe5b1415612152576002895460ff1660038111156120c457fe5b146120d05760016120d3565b60005b89548a9060ff191660018360038111156120e957fe5b021790555086546040516002830491600160601b90046001600160a01b0316906108fc8315029083906000818181858888f150505060018a01546040516001600160a01b03909116925083156108fc02915083906000818181858888f19350505050505061223e565b600182600281111561216057fe5b14156121d6576002895460ff16600381111561217857fe5b14612184576000612187565b60015b89548a9060ff1916600183600381111561219d57fe5b02179055508654604051600160601b9091046001600160a01b0316906108fc8315029083906000818181858888f193505050505061223e565b6002895460ff1660038111156121e857fe5b146121f45760016121f7565b60005b89548a9060ff1916600183600381111561220d57fe5b021790555060018701546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b604080516000815290518b9160008051602061483b833981519152919081900360200190a2505050505050505050505050565b6001546001600160a01b031633146122be576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600255565b6001546001600160a01b03163314612310576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60095481565b60005461010090046001600160a01b031633146123a2576040805162461bcd60e51b815260206004820152601d60248201527f5468652063616c6c6572206d757374206265207468652072656c61792e000000604482015290519081900360640190fd5b6000818152600a602052604090206001815460ff1660038111156123c257fe5b146123fe5760405162461bcd60e51b81526004018080602001828103825260268152602001806149e66026913960400191505060405180910390fd5b805460ff1916815560408051600181529051839160008051602061483b833981519152919081900360200190a25050565b604080516020808201859052818301849052825180830384018152606090920190925280519101205b92915050565b600a6020526000908152604090205460ff81169061010081046001600160801b031690600160881b90046001600160781b031683565b6000908152600a602052604090205460ff811691600160881b82046001600160781b03169161010090046001600160801b031690565b6124d2614761565b6000858152600c6020908152604080832087845282528083208684526002810183528184206001600160a01b03871685526005810190935292819020815160608101928390529160039082845b81548152602001906001019080831161251f57505050505092505050949350505050565b6001546001600160a01b03163314612590576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600655565b600281565b600d80546000919060001981019081106125b057fe5b60009182526020909120600290910201546001600160a01b0316905090565b600d5490565b60055481565b60075481565b60005461010090046001600160a01b03163314612645576040805162461bcd60e51b815260206004820152601d60248201527f5468652063616c6c6572206d757374206265207468652072656c61792e000000604482015290519081900360640190fd5b60008282604051602001808383808284376040805191909301818103601f19018252835280516020918201206000818152600a90925292812092965091945090925061268f915050565b815460ff16600381111561269f57fe5b146126f1576040805162461bcd60e51b815260206004820181905260248201527f4974656d206d75737420626520616273656e7420746f2062652061646465642e604482015290519081900360640190fd5b8054600160881b90046001600160781b0316612773576040805160016020820181905282825291810185905283917f93e4d3e9542ddd9eea8962241d920b12b96bce26749667189fd06ed3549019e191879187918060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a25b8054600160ff19909116811782556040805191825251839160008051602061483b833981519152919081900360200190a250505050565b6000838152600a602052604090206001815460ff1660038111156127ca57fe5b116128065760405162461bcd60e51b8152600401808060200182810382526025815260200180614a606025913960400191505060405180910390fd5b8054600160881b90046001600160781b039081166000190116600081815260018301602052604090206006548154610100900467ffffffffffffffff16420311156128825760405162461bcd60e51b81526004018080602001828103825260328152602001806149b46032913960400191505060405180910390fd5b6000868152600c60209081526040808320858452909152812090600182015460ff1660028111156128af57fe5b146128eb5760405162461bcd60e51b81526004018080602001828103825260328152602001806148b76032913960400191505060405180910390fd5b8154600d8054600092600160481b900462ffffff1690811061290957fe5b60009182526020808320600292830201805460405163f7434ea960e01b8152600481019384526001808401805460001992811615610100029290920190911695909504602482018190529296506001600160a01b039091169493859363f7434ea99391929091829160440190849080156129c45780601f10612999576101008083540402835291602001916129c4565b820191906000526020600020905b8154815290600101906020018083116129a757829003601f168201915b50509250505060206040518083038186803b1580156129e257600080fd5b505afa1580156129f6573d6000803e3d6000fd5b505050506040513d6020811015612a0c57600080fd5b505190506000806002895460ff166003811115612a2557fe5b14612a3257600554612a36565b6004545b9050612a48838263ffffffff61417216565b91505080341015612a8a5760405162461bcd60e51b8152600401808060200182810382526022815260200180614a3e6022913960400191505060405180910390fd5b336001600160a01b03168b60008051602061496f83398151915289600085600260405180858152602001848152602001838152602001826002811115612acc57fe5b60ff16815260200194505050505060405180910390a38754612b17908390612b029061010090046001600160801b031684614323565b6001600160801b03169063ffffffff61434916565b8854610100600160881b0319166101006001600160801b0392909216820217895560018781018054336001600160a01b03199091161790556040805163c13517e160e01b81526002600482018181526024830193845289850180549586161590960260001901909416819004604483018190526001600160a01b0389169563c13517e195899593949193909290916064019084908015612bf85780601f10612bcd57610100808354040283529160200191612bf8565b820191906000526020600020905b815481529060010190602001808311612bdb57829003601f168201915b505093505050506020604051808303818588803b158015612c1857600080fd5b505af1158015612c2c573d6000803e3d6000fd5b50505050506040513d6020811015612c4357600080fd5b50518086556001808701805460ff1916821761ffff16620200001790556001600160a01b0385166000908152600b602090815260408083209483529390529182208d9055875460ff1690811115612c9657fe5b8754600262ffffff600160481b909204821602160190506000612cb98d8a61242f565b87546040805185815260208101849052815193945091926001600160a01b038916927f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d92908290030190a38a15612d8057336001600160a01b031681866001600160a01b03167fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c8f8f60405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a45b82341115611e0c5760405133903485900380156108fc02916000818181858888f1505050505050505050505050505050505050565b6001546001600160a01b03163314612e02576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600355565b6001546001600160a01b03163314612e54576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600855565b6000612e63614761565b612e6b614761565b6000868152600a602052604081208054600160881b90046001600160781b03168710612ed8576040805162461bcd60e51b81526020600482015260176024820152762932b8bab2b9ba103237b2b9903737ba1032bc34b9ba1760491b604482015290519081900360640190fd5b6000888152600c602090815260408083208a8452909152902060018101546201000090046001600160f01b03168710612f4f576040805162461bcd60e51b8152602060048201526014602482015273149bdd5b9908191bd95cc81b9bdd08195e1a5cdd60621b604482015290519081900360640190fd5b6000878152600282016020526040902060018201546000196001600160f01b036201000090920482160116881096508680612f9957506001815460ff166002811115612f9757fe5b145b151560208601528680612fbb57506002815460ff166002811115612fb957fe5b145b15156040808701919091526001820154815160608101928390528992600285019289929091849060039082845b815481526020019060010190808311612fe85750505050509250965096509650965050505093509350935093565b6000838152600a6020526040902080546001600160781b03600160881b90910481161061308a576040805162461bcd60e51b815260206004820152601b60248201527f546f6f206d616e7920726571756573747320666f72206974656d2e0000000000604482015290519081900360640190fd5b6001815460ff16600381111561309c57fe5b146130d85760405162461bcd60e51b81526004018080602001828103825260268152602001806149e66026913960400191505060405180910390fd5b80546001600160781b03600160881b808304821660018181019093169091026001600160881b039093169290921783556000918252820160205260408120600d805491926000198301929091908390811061312f57fe5b60009182526020822060029091020154600d80546001600160a01b039092169350908490811061315b57fe5b906000526020600020906002020160010190506000826001600160a01b031663f7434ea9836040518263ffffffff1660e01b815260040180806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156132185780601f106131ed57610100808354040283529160200191613218565b820191906000526020600020905b8154815290600101906020018083116131fb57829003601f168201915b50509250505060206040518083038186803b15801561323657600080fd5b505afa15801561324a573d6000803e3d6000fd5b505050506040513d602081101561326057600080fd5b505160035490915060009061327c90839063ffffffff61417216565b9050803410156132d3576040805162461bcd60e51b815260206004820181905260248201527f596f75206d7573742066756c6c792066756e642074686520726571756573742e604482015290519081900360640190fd5b8654610100600160881b0319166101006001600160801b0383160217808855600390889060ff19166001830217905550855468ffffffffffffffff0019166101004267ffffffffffffffff16021762ffffff60481b1916600160481b62ffffff871602176bffffffffffffffffffffffff1633600160601b0217808755600190879060ff1916828002179055508654600090613387908c906000196001600160781b03600160881b9092048216011661242f565b6040805182815290519192508c917f73057048557c37c893f346985dc1d461cf12b00f09397bb275613203124c2be19181900360200190a2875460408051600160881b9092046001600160781b039081166000190116825260006020830152818101849052600160608301525133918d9160008051602061496f8339815191529181900360800190a3881561348c57336001600160a01b031681866001600160a01b03167fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c8d8d60405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a45b813411156134b35760405133903484900380156108fc02916000818181858888f150505050505b5050505050505050505050565b600b60209081526000928352604080842090915290825290205481565b6000838152600c6020908152604080832085845290915290206002600182015460ff16600281111561350b57fe5b1461355d576040805162461bcd60e51b815260206004820152601960248201527f52657175657374206d757374206265207265736f6c7665642e00000000000000604482015290519081900360640190fd5b6000828152600282016020526040812060018301549091906000196001600160f01b0362010000909204821601168414156135be57506001600160a01b038616600090815260058201602052604090206002810154600190910154016136f0565b60006001840154610100900460ff1660028111156135d857fe5b141561363957600382015460048301546001600160a01b0389166000908152600585016020526040902060018101546002909101549190920191018161361f576000613630565b81846001015482028161362e57fe5b045b925050506136f0565b6000826002018460010160019054906101000a900460ff16600281111561365c57fe5b6003811061366657fe5b0154116136745760006136ed565b6001830154600283810191610100900460ff169081111561369157fe5b6003811061369b57fe5b01546001838101546001600160a01b038a166000908152600586016020526040902091860154909190610100900460ff1660028111156136d757fe5b600381106136e157fe5b015402816136eb57fe5b045b90505b6001600160a01b038716600090815260058301602052604081206001810182905560020155801561378f576040516001600160a01b0388169082156108fc029083906000818181858888f15050604080518981526020810189905280820186905290518a94506001600160a01b038c1693507f10969cab4d5cb7c0bcdbae29ab82703528538913301c7ecabb369caf6930cb9c92509081900360600190a35b50505050505050565b600d81815481106137a557fe5b600091825260209182902060029182020180546001808301805460408051601f600019958416156101000295909501909216969096049283018790048702810187019095528185526001600160a01b03909216955091939091908301828280156138505780601f1061382557610100808354040283529160200191613850565b820191906000526020600020905b81548152906001019060200180831161383357829003601f168201915b5050505050905082565b60045481565b6001546001600160a01b031633146138ad576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b61378f8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525050604080516020601f8a01819004810282018101909252888152925088915087908190840183828082843760009201919091525061436d92505050565b6001546001600160a01b031633146139a2576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600755565b6001546001600160a01b031633146139f4576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b6040516001600160a01b038216907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a250565b60005460ff1615613a7a576040805162461bcd60e51b815260206004820152601460248201527320b63932b0b23c9034b734ba34b0b634bd32b21760611b604482015290519081900360640190fd5b6040516001600160a01b038b16907fc86a04b722cdfef2134355447e1ebddd83d57a81cddda524d682811e222bc25090600090a2600180546001600160a01b0319166001600160a01b03878116919091179091558435600255602080860135600355604080870135600455606087013560055560068690558435600955848201356007558481013560085560008054610100600160a81b03191661010094861694909402939093179092558151601f8e018290048202810182019092528c8252613bd9918f918f908f9081908401838280828437600081840152601f19601f820116905080830192505050505050508b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525061436d92505050565b50506000805460ff191660011790555050505050505050505050565b60025481565b600080600080613c09614761565b6000878152600a602052604081208054829182916060918391600160881b90046001600160781b03168c10613c7f576040805162461bcd60e51b81526020600482015260176024820152762932b8bab2b9ba103237b2b9903737ba1032bc34b9ba1760491b604482015290519081900360640190fd5b60008d8152600a602090815260408083208f845260019081019092529091208054610100810467ffffffffffffffff169b509091600160601b9091046001600160a01b031690899060038110613cd157fe5b6001600160a01b0392831660209190910291909101526001820154166040890152613cfc8e8e614563565b929e50909c5097509550613d108e8e6145c6565b91965094509250613d218e8e6146f2565b985050509295989b9194979a5092959850565b6001546001600160a01b03163314613d81576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600455565b60035481565b60005461010090046001600160a01b031681565b61271081565b6001546001600160a01b03163314613df3576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600555565b6001546001600160a01b03163314613e45576040805162461bcd60e51b815260206004820181905260248201526000805160206148e9833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600a602090815260408083208054600160881b90046001600160781b0390811660001901168085526001820190935292206006548154610100900467ffffffffffffffff16420311613eef5760405162461bcd60e51b815260040180806020018281038252602881526020018061485b6028913960400191505060405180910390fd5b6000848152600c60209081526040808320858452909152812090600182015460ff166002811115613f1c57fe5b14613f585760405162461bcd60e51b81526004018080602001828103825260238152602001806148186023913960400191505060405180910390fd5b6002845460ff166003811115613f6a57fe5b1415613f88578354600190859060ff191682805b0217905550614000565b6003845460ff166003811115613f9a57fe5b1415613fb3578354600090859060ff1916600183613f7e565b6040805162461bcd60e51b815260206004820152601860248201527f5468657265206d757374206265206120726571756573742e0000000000000000604482015290519081900360640190fd5b60408051600081529051869160008051602061483b833981519152919081900360200190a28354610100600160881b03198116855561010090046001600160801b03168015614078578254604051600160601b9091046001600160a01b0316906108fc8315029083906000818181858888f150505050505b505050505050565b6000838152600a602090815260408083208054600160881b90046001600160781b039081166000190116808552600182019093529083208054600d8054939592939091600160481b900462ffffff169081106140d857fe5b90600052602060002090600202019050336001600160a01b03166140fc888561242f565b825460408051602080825281018a90526001600160a01b03909216917fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c918b918b9181908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a450505050505050565b60008282018381101561418757600019614189565b805b949350505050565b6000826141a057506000612458565b828202828482816141ad57fe5b041461418757600019614189565b6000878152600c60209081526040808320898452825280832088845260029081019092528220919061420390830187600381106141f457fe5b0154849063ffffffff61430816565b90506000808583111561421857859150614220565b508190508085035b6001600160a01b038716600090815260058501602052604090208290896003811061424757fe5b01805490910190558160028501896003811061425f57fe5b018054909101905560018401805483019055801561429d576040516001600160a01b0388169082156108fc029083906000818181858888f150505050505b81156134b357338b60008051602061496f8339815191528c8c868d60028111156142c357fe5b604051808581526020018481526020018381526020018260028111156142e557fe5b60ff16815260200194505050505060405180910390a35050505050505050505050565b60008282111561431a57506000612458565b50808203612458565b60008282016001600160801b038085169082161015614187576001600160801b03614189565b6000826001600160801b0316826001600160801b0316111561431a57506000612458565b600d805490506002027f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d836040518080602001828103825283818151815260200191508051906020019080838360005b838110156143d55781810151838201526020016143bd565b50505050905090810190601f1680156144025780820380516001836020036101000a031916815260200191505b509250505060405180910390a2600d805490506002026001017f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561447a578181015183820152602001614462565b50505050905090810190601f1680156144a75780820380516001836020036101000a031916815260200191505b509250505060405180910390a2604080518082019091526001600160a01b0385811682526020808301868152600d80546001810180835560009290925285517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5600290920291820180546001600160a01b031916919096161785559151805191959493614559937fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb6019291019061477f565b5050505050505050565b6000828152600c60209081526040808320848452909152812081908190819060018082015460ff16600281111561459657fe5b8254600190930154911115989197506201000081046001600160f01b03169650610100900460ff16945092505050565b6000828152600a6020908152604080832084845260010190915281208054600d80546060938593909284929091600160481b900462ffffff1690811061460857fe5b60009182526020909120600290910201805483549192506001600160a01b03169060018084019160ff169081111561463c57fe5b84548254604080516020601f60026000196001871615610100020190951685900490810182900482028301820190935282825262ffffff600160481b909504851693909302909316939093019284918301828280156146dc5780601f106146b1576101008083540402835291602001916146dc565b820191906000526020600020905b8154815290600101906020018083116146bf57829003601f168201915b5050505050915094509450945050509250925092565b6000828152600a602052604081208054600160881b90046001600160781b0316614720576000915050612458565b80546000196001600160781b03600160881b9092048216011683101561474a576001915050612458565b5461010090046001600160801b0316159392505050565b60405180606001604052806003906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106147c057805160ff19168380011785556147ed565b828001600101855582156147ed579182015b828111156147ed5782518255916020019190600101906147d2565b506147f99291506147fd565b5090565b61120491905b808211156147f9576000815560010161480356fe54686520726571756573742073686f756c64206e6f742062652064697370757465642ed768d67a683a3f5110d48ee5af827e22f4f36d017d764d3bfb11982492b1953654696d6520746f206368616c6c656e6765207468652072657175657374206d75737420706173732e436f6e747269627574696f6e73206d757374206265206d6164652077697468696e207468652061707065616c20706572696f642e54686520726571756573742073686f756c64206e6f74206861766520616c7265616479206265656e2064697370757465642e5468652063616c6c6572206d7573742062652074686520676f7665726e6f722e546865206c6f736572206d75737420636f6e7472696275746520647572696e67207468652066697273742068616c66206f66207468652061707065616c20706572696f642e5468652072657175657374206d757374206e6f74206265207265736f6c7665642e0388febb25c47b8b6fc7ecbe1dd210dfab59161d1d25992a642333d0792ab7764f6e6c79207468652061726269747261746f722063616e206769766520612072756c696e674368616c6c656e676573206d757374206f6363757220647572696e6720746865206368616c6c656e676520706572696f642e4974656d206d757374206265207265676973746572656420746f2062652072656d6f7665642e412064697370757465206d7573742068617665206265656e2072616973656420746f2066756e6420616e2061707065616c2e596f75206d7573742066756c6c792066756e6420746865206368616c6c656e67652e546865206974656d206d757374206861766520612070656e64696e6720726571756573742ea265627a7a72315820d119198f8023bf33b49565a63fe55a7cb47024ad8c23b0963ab52651e4a9fc5664736f6c63430005110032", + "devdoc": { + "methods": { + "addItem(string)": { + "details": "Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.", + "params": { + "_item": "The URI to the item data." + } + }, + "addItemDirectly(string)": { + "details": "Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.", + "params": { + "_item": "The URI to the item data." + } + }, + "arbitrator()": { + "details": "Gets the latest value in arbitrationParamsChanges.", + "return": "The arbitrator address." + }, + "arbitratorExtraData()": { + "details": "Gets the latest value in arbitrationParamsChanges.", + "return": "The arbitrator extra data." + }, + "challengeRequest(bytes32,string)": { + "details": "Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.", + "params": { + "_evidence": "A link to an evidence using its URI. Ignored if not provided.", + "_itemID": "The ID of the item which request to challenge." + } + }, + "changeArbitrationParams(address,bytes,string,string)": { + "details": "Effectively makes all new items use the new set of params.", + "params": { + "_arbitrator": "Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.", + "_arbitratorExtraData": "Extra data for the trusted arbitrator contract.", + "_clearingMetaEvidence": "The URI of the meta evidence object for clearing requests.", + "_registrationMetaEvidence": "The URI of the meta evidence object for registration requests." + } + }, + "changeChallengePeriodDuration(uint256)": { + "details": "Change the duration of the challenge period.", + "params": { + "_challengePeriodDuration": "The new duration of the challenge period." + } + }, + "changeConnectedTCR(address)": { + "details": "Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.", + "params": { + "_connectedTCR": "The address of the connectedTCR contract to use." + } + }, + "changeGovernor(address)": { + "details": "Change the governor of the curated registry.", + "params": { + "_governor": "The address of the new governor." + } + }, + "changeLoserStakeMultiplier(uint256)": { + "details": "Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.", + "params": { + "_loserStakeMultiplier": "Multiplier of arbitration fees that must be paid as fee stake. In basis points." + } + }, + "changeRelayerContract(address)": { + "details": "Change the address of the relay contract.", + "params": { + "_relayerContract": "The new address of the relay contract." + } + }, + "changeRemovalBaseDeposit(uint256)": { + "details": "Change the base amount required as a deposit to remove an item.", + "params": { + "_removalBaseDeposit": "The new base amount of wei required to remove an item." + } + }, + "changeRemovalChallengeBaseDeposit(uint256)": { + "details": "Change the base amount required as a deposit to challenge a removal request.", + "params": { + "_removalChallengeBaseDeposit": "The new base amount of wei required to challenge a removal request." + } + }, + "changeSharedStakeMultiplier(uint256)": { + "details": "Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.", + "params": { + "_sharedStakeMultiplier": "Multiplier of arbitration fees that must be paid as fee stake. In basis points." + } + }, + "changeSubmissionBaseDeposit(uint256)": { + "details": "Change the base amount required as a deposit to submit an item.", + "params": { + "_submissionBaseDeposit": "The new base amount of wei required to submit an item." + } + }, + "changeSubmissionChallengeBaseDeposit(uint256)": { + "details": "Change the base amount required as a deposit to challenge a submission.", + "params": { + "_submissionChallengeBaseDeposit": "The new base amount of wei required to challenge a submission." + } + }, + "changeWinnerStakeMultiplier(uint256)": { + "details": "Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.", + "params": { + "_winnerStakeMultiplier": "Multiplier of arbitration fees that must be paid as fee stake. In basis points." + } + }, + "executeRequest(bytes32)": { + "details": "Executes an unchallenged request if the challenge period has passed.", + "params": { + "_itemID": "The ID of the item to execute." + } + }, + "fundAppeal(bytes32,uint8)": { + "details": "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.", + "params": { + "_itemID": "The ID of the item which request to fund.", + "_side": "The recipient of the contribution." + } + }, + "getContributions(bytes32,uint256,uint256,address)": { + "details": "Gets the contributions made by a party for a given round of a request.", + "params": { + "_contributor": "The address of the contributor.", + "_itemID": "The ID of the item.", + "_requestID": "The request to query.", + "_roundID": "The round to query." + }, + "return": "contributions The contributions." + }, + "getEvidenceGroupID(bytes32,uint256)": { + "details": "Gets the evidengeGroupID for a given item and request.", + "params": { + "_itemID": "The ID of the item.", + "_requestID": "The ID of the request." + }, + "return": "The evidenceGroupID" + }, + "getItemInfo(bytes32)": { + "details": "Returns item's information. Includes the total number of requests for the item", + "params": { + "_itemID": "The ID of the queried item." + }, + "return": "status The current status of the item.numberOfRequests Total number of requests for the item.sumDeposit The total deposit made by the requester and the challenger (if any)" + }, + "getRequestInfo(bytes32,uint256)": { + "details": "Gets information on a request made for the item.", + "params": { + "_itemID": "The ID of the queried item.", + "_requestID": "The request to be queried." + }, + "return": "disputed True if a dispute was raised.disputeID ID of the dispute, if any.submissionTime Time when the request was made.resolved True if the request was executed and/or any raised disputes were resolved.parties Address of requester and challenger, if any.numberOfRounds Number of rounds of dispute.ruling The final ruling given, if any.arbitrator The arbitrator trusted to solve disputes for this request.arbitratorExtraData The extra data for the trusted arbitrator of this request.metaEvidenceID The meta evidence to be used in a dispute for this case." + }, + "getRoundInfo(bytes32,uint256,uint256)": { + "details": "Gets the information of a round of a request.", + "params": { + "_itemID": "The ID of the queried item.", + "_requestID": "The request to be queried.", + "_roundID": "The round to be queried." + }, + "return": "appealed Whether appealed or not.amountPaid Tracks the sum paid for each Party in this round.hasPaid True if the Party has fully paid its fee in this round.feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute." + }, + "initialize(address,bytes,address,string,string,address,uint256[4],uint256,uint256[3],address)": { + "details": "Initialize the arbitrable curated registry.", + "params": { + "_arbitrator": "Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.", + "_arbitratorExtraData": "Extra data for the trusted arbitrator contract.", + "_baseDeposits": "The base deposits for requests/challenges as follows: - The base deposit to submit an item. - The base deposit to remove an item. - The base deposit to challenge a submission. - The base deposit to challenge a removal request.", + "_challengePeriodDuration": "The time in seconds parties have to challenge a request.", + "_clearingMetaEvidence": "The URI of the meta evidence object for clearing requests.", + "_connectedTCR": "The address of the TCR that stores related TCR addresses. This parameter can be left empty.", + "_governor": "The trusted governor of this contract.", + "_registrationMetaEvidence": "The URI of the meta evidence object for registration requests.", + "_relayerContract": "The address of the relay contract to add/remove items directly.", + "_stakeMultipliers": "Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows: - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate). - The multiplier applied to the winner's fee stake for the subsequent round. - The multiplier applied to the loser's fee stake for the subsequent round." + } + }, + "metaEvidenceUpdates()": { + "details": "Gets the number of times MetaEvidence was updated.", + "return": "The number of times MetaEvidence was updated." + }, + "removeItem(bytes32,string)": { + "details": "Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.", + "params": { + "_evidence": "A link to an evidence using its URI. Ignored if not provided.", + "_itemID": "The ID of the item to remove." + } + }, + "removeItemDirectly(bytes32)": { + "details": "Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.", + "params": { + "_itemID": "The ID of the item to remove." + } + }, + "rule(uint256,uint256)": { + "details": "Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED. Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.", + "params": { + "_disputeID": "ID of the dispute in the arbitrator contract.", + "_ruling": "Ruling given by the arbitrator. Note that 0 is reserved for \"Refused to arbitrate\"." + } + }, + "submitEvidence(bytes32,string)": { + "details": "Submit a reference to evidence. EVENT.", + "params": { + "_evidence": "A link to an evidence using its URI.", + "_itemID": "The ID of the item which the evidence is related to." + } + }, + "withdrawFeesAndRewards(address,bytes32,uint256,uint256)": { + "details": "If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.", + "params": { + "_beneficiary": "The address that made contributions to a request.", + "_itemID": "The ID of the item submission to withdraw from.", + "_requestID": "The request from which to withdraw from.", + "_roundID": "The round from which to withdraw from." + } + } + }, + "title": "LightGeneralizedTCR This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding. The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns." + }, + "userdoc": { + "methods": { + "arbitrator()": { + "notice": "Gets the arbitrator for new requests." + }, + "arbitratorExtraData()": { + "notice": "Gets the arbitratorExtraData for new requests." + }, + "changeArbitrationParams(address,bytes,string,string)": { + "notice": "Changes the params related to arbitration." + } + } + }, + "storageLayout": { + "storage": [ + { + "astId": 3052, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 3054, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "relayerContract", + "offset": 1, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3056, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 3058, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "submissionBaseDeposit", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 3060, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "removalBaseDeposit", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 3062, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "submissionChallengeBaseDeposit", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 3064, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "removalChallengeBaseDeposit", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 3066, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "challengePeriodDuration", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 3068, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "winnerStakeMultiplier", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 3070, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "loserStakeMultiplier", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 3072, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "sharedStakeMultiplier", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 3079, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "items", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_bytes32,t_struct(Item)3000_storage)" + }, + { + "astId": 3085, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "arbitratorDisputeIDToItemID", + "offset": 0, + "slot": "11", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_bytes32))" + }, + { + "astId": 3091, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "requestsDisputeData", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_bytes32,t_mapping(t_uint256,t_struct(DisputeData)3024_storage))" + }, + { + "astId": 3094, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "arbitrationParamsChanges", + "offset": 0, + "slot": "13", + "type": "t_array(t_struct(ArbitrationParams)3044_storage)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_struct(ArbitrationParams)3044_storage)dyn_storage": { + "base": "t_struct(ArbitrationParams)3044_storage", + "encoding": "dynamic_array", + "label": "struct LightGeneralizedTCR.ArbitrationParams[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)3_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[3]", + "numberOfBytes": "96" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitrator)99": { + "encoding": "inplace", + "label": "contract IArbitrator", + "numberOfBytes": "20" + }, + "t_enum(DisputeStatus)2989": { + "encoding": "inplace", + "label": "enum LightGeneralizedTCR.DisputeStatus", + "numberOfBytes": "1" + }, + "t_enum(Party)2982": { + "encoding": "inplace", + "label": "enum LightGeneralizedTCR.Party", + "numberOfBytes": "1" + }, + "t_enum(RequestType)2985": { + "encoding": "inplace", + "label": "enum LightGeneralizedTCR.RequestType", + "numberOfBytes": "1" + }, + "t_enum(Status)2978": { + "encoding": "inplace", + "label": "enum LightGeneralizedTCR.Status", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_array(t_uint256)3_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256[3])", + "numberOfBytes": "32", + "value": "t_array(t_uint256)3_storage" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_bytes32))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => bytes32))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_bytes32)" + }, + "t_mapping(t_bytes32,t_mapping(t_uint256,t_struct(DisputeData)3024_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint256 => struct LightGeneralizedTCR.DisputeData))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(DisputeData)3024_storage)" + }, + "t_mapping(t_bytes32,t_struct(Item)3000_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct LightGeneralizedTCR.Item)", + "numberOfBytes": "32", + "value": "t_struct(Item)3000_storage" + }, + "t_mapping(t_uint256,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(DisputeData)3024_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct LightGeneralizedTCR.DisputeData)", + "numberOfBytes": "32", + "value": "t_struct(DisputeData)3024_storage" + }, + "t_mapping(t_uint256,t_struct(Request)3011_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct LightGeneralizedTCR.Request)", + "numberOfBytes": "32", + "value": "t_struct(Request)3011_storage" + }, + "t_mapping(t_uint256,t_struct(Round)3039_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct LightGeneralizedTCR.Round)", + "numberOfBytes": "32", + "value": "t_struct(Round)3039_storage" + }, + "t_struct(ArbitrationParams)3044_storage": { + "encoding": "inplace", + "label": "struct LightGeneralizedTCR.ArbitrationParams", + "members": [ + { + "astId": 3041, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "arbitrator", + "offset": 0, + "slot": "0", + "type": "t_contract(IArbitrator)99" + }, + { + "astId": 3043, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(DisputeData)3024_storage": { + "encoding": "inplace", + "label": "struct LightGeneralizedTCR.DisputeData", + "members": [ + { + "astId": 3013, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "disputeID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 3015, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "status", + "offset": 0, + "slot": "1", + "type": "t_enum(DisputeStatus)2989" + }, + { + "astId": 3017, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "ruling", + "offset": 1, + "slot": "1", + "type": "t_enum(Party)2982" + }, + { + "astId": 3019, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "roundCount", + "offset": 2, + "slot": "1", + "type": "t_uint240" + }, + { + "astId": 3023, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "rounds", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_struct(Round)3039_storage)" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Item)3000_storage": { + "encoding": "inplace", + "label": "struct LightGeneralizedTCR.Item", + "members": [ + { + "astId": 2991, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "status", + "offset": 0, + "slot": "0", + "type": "t_enum(Status)2978" + }, + { + "astId": 2993, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "sumDeposit", + "offset": 1, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 2995, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "requestCount", + "offset": 17, + "slot": "0", + "type": "t_uint120" + }, + { + "astId": 2999, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "requests", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_struct(Request)3011_storage)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Request)3011_storage": { + "encoding": "inplace", + "label": "struct LightGeneralizedTCR.Request", + "members": [ + { + "astId": 3002, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "requestType", + "offset": 0, + "slot": "0", + "type": "t_enum(RequestType)2985" + }, + { + "astId": 3004, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "submissionTime", + "offset": 1, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 3006, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "arbitrationParamsIndex", + "offset": 9, + "slot": "0", + "type": "t_uint24" + }, + { + "astId": 3008, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "requester", + "offset": 12, + "slot": "0", + "type": "t_address_payable" + }, + { + "astId": 3010, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "challenger", + "offset": 0, + "slot": "1", + "type": "t_address_payable" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Round)3039_storage": { + "encoding": "inplace", + "label": "struct LightGeneralizedTCR.Round", + "members": [ + { + "astId": 3026, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "sideFunded", + "offset": 0, + "slot": "0", + "type": "t_enum(Party)2982" + }, + { + "astId": 3028, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "feeRewards", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 3032, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "amountPaid", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)3_storage" + }, + { + "astId": 3038, + "contract": "contracts/LightGeneralizedTCR.sol:LightGeneralizedTCR", + "label": "contributions", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_array(t_uint256)3_storage)" + } + ], + "numberOfBytes": "192" + }, + "t_uint120": { + "encoding": "inplace", + "label": "uint120", + "numberOfBytes": "15" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint24": { + "encoding": "inplace", + "label": "uint24", + "numberOfBytes": "3" + }, + "t_uint240": { + "encoding": "inplace", + "label": "uint240", + "numberOfBytes": "30" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} diff --git a/deployments/sepolia/LightGeneralizedTCRView.json b/deployments/sepolia/LightGeneralizedTCRView.json new file mode 100644 index 0000000..f2c1302 --- /dev/null +++ b/deployments/sepolia/LightGeneralizedTCRView.json @@ -0,0 +1,670 @@ +{ + "address": "0x87f58F0dCF3c99BA2F3eB0604e5c335893e2EAf9", + "abi": [ + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_contributor", + "type": "address" + } + ], + "name": "availableRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "rewards", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "fetchArbitrable", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "submissionBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "removalBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionChallengeBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "removalChallengeBaseDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "challengePeriodDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "metaEvidenceUpdates", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "winnerStakeMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loserStakeMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharedStakeMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "MULTIPLIER_DIVISOR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "arbitrationCost", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.ArbitrableData", + "name": "result", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItem", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "ID", + "type": "bytes32" + }, + { + "internalType": "enum LightGeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealCost", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "appealStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealEnd", + "type": "uint256" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "challenger", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "currentRuling", + "type": "uint8" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "enum IArbitrator.DisputeStatus", + "name": "disputeStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.QueryResult", + "name": "result", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItemData", + "outputs": [ + { + "components": [ + { + "internalType": "enum LightGeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.ItemData", + "name": "item", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getItemRequests", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "challenger", + "type": "address" + }, + { + "internalType": "address", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "metaEvidenceID", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.ItemRequest[]", + "name": "requests", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getLatestRequestData", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "enum LightGeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.ItemData", + "name": "item", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address payable[3]", + "name": "parties", + "type": "address[3]" + }, + { + "internalType": "uint256", + "name": "numberOfRounds", + "type": "uint256" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "contract IArbitrator", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + } + ], + "internalType": "struct LightGeneralizedTCRView.RequestData", + "name": "request", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "getLatestRoundRequestData", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "enum LightGeneralizedTCR.Status", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "numberOfRequests", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.ItemData", + "name": "item", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "disputed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "submissionTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "resolved", + "type": "bool" + }, + { + "internalType": "address payable[3]", + "name": "parties", + "type": "address[3]" + }, + { + "internalType": "uint256", + "name": "numberOfRounds", + "type": "uint256" + }, + { + "internalType": "enum LightGeneralizedTCR.Party", + "name": "ruling", + "type": "uint8" + }, + { + "internalType": "contract IArbitrator", + "name": "arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + } + ], + "internalType": "struct LightGeneralizedTCRView.RequestData", + "name": "request", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "appealed", + "type": "bool" + }, + { + "internalType": "uint256[3]", + "name": "amountPaid", + "type": "uint256[3]" + }, + { + "internalType": "bool[3]", + "name": "hasPaid", + "type": "bool[3]" + }, + { + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + } + ], + "internalType": "struct LightGeneralizedTCRView.RoundData", + "name": "round", + "type": "tuple" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xe5ee32c4b0da0a3e17c32163469ed820e0343bcf9bfde68e6db816f9ef0daca9", + "receipt": { + "to": null, + "from": "0x0efFC4A996045aff0489774051f94f42F2D6dfc9", + "contractAddress": "0x87f58F0dCF3c99BA2F3eB0604e5c335893e2EAf9", + "transactionIndex": 22, + "gasUsed": "2270046", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf874e743b3a953caafe3260c3c96b56705ab9b13663bee73f8ca136706e8c0a8", + "transactionHash": "0xe5ee32c4b0da0a3e17c32163469ed820e0343bcf9bfde68e6db816f9ef0daca9", + "logs": [], + "blockNumber": 4048364, + "cumulativeGasUsed": "18844927", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"}],\"name\":\"availableRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rewards\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"fetchArbitrable\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"submissionBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"removalBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionChallengeBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"removalChallengeBaseDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"challengePeriodDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"metaEvidenceUpdates\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winnerStakeMultiplier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"loserStakeMultiplier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sharedStakeMultiplier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"MULTIPLIER_DIVISOR\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arbitrationCost\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.ArbitrableData\",\"name\":\"result\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItem\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"ID\",\"type\":\"bytes32\"},{\"internalType\":\"enum LightGeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealCost\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"appealStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"appealEnd\",\"type\":\"uint256\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"currentRuling\",\"type\":\"uint8\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"enum IArbitrator.DisputeStatus\",\"name\":\"disputeStatus\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.QueryResult\",\"name\":\"result\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItemData\",\"outputs\":[{\"components\":[{\"internalType\":\"enum LightGeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.ItemData\",\"name\":\"item\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getItemRequests\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"metaEvidenceID\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.ItemRequest[]\",\"name\":\"requests\",\"type\":\"tuple[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getLatestRequestData\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enum LightGeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.ItemData\",\"name\":\"item\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address payable[3]\",\"name\":\"parties\",\"type\":\"address[3]\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRounds\",\"type\":\"uint256\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"}],\"internalType\":\"struct LightGeneralizedTCRView.RequestData\",\"name\":\"request\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"getLatestRoundRequestData\",\"outputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"enum LightGeneralizedTCR.Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRequests\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.ItemData\",\"name\":\"item\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"disputed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"submissionTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"},{\"internalType\":\"address payable[3]\",\"name\":\"parties\",\"type\":\"address[3]\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRounds\",\"type\":\"uint256\"},{\"internalType\":\"enum LightGeneralizedTCR.Party\",\"name\":\"ruling\",\"type\":\"uint8\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"}],\"internalType\":\"struct LightGeneralizedTCRView.RequestData\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"appealed\",\"type\":\"bool\"},{\"internalType\":\"uint256[3]\",\"name\":\"amountPaid\",\"type\":\"uint256[3]\"},{\"internalType\":\"bool[3]\",\"name\":\"hasPaid\",\"type\":\"bool[3]\"},{\"internalType\":\"uint256\",\"name\":\"feeRewards\",\"type\":\"uint256\"}],\"internalType\":\"struct LightGeneralizedTCRView.RoundData\",\"name\":\"round\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"availableRewards(address,bytes32,address)\":{\"details\":\"Return the withdrawable rewards for a contributor.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\",\"_contributor\":\"The address of the contributor.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The amount withdrawable per round per request.\"},\"fetchArbitrable(address)\":{\"details\":\"Fetch arbitrable TCR data in a single call.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\"},\"return\":\"The latest data on an arbitrable TCR contract.\"},\"getItem(address,bytes32)\":{\"details\":\"Fetch the latest data on an item in a single call.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The item data.\"},\"getItemData(address,bytes32)\":{\"details\":\"Fetch data of the an item and return a struct.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The round data.\"},\"getItemRequests(address,bytes32)\":{\"details\":\"Fetch all requests for an item.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The items requests.\"},\"getLatestRequestData(address,bytes32)\":{\"details\":\"Fetch the latest request of item.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The round data.\"},\"getLatestRoundRequestData(address,bytes32)\":{\"details\":\"Fetch the latest round of the latest request of an item.\",\"params\":{\"_address\":\"The address of the LightGeneralized TCR to query.\",\"_itemID\":\"The ID of the item to query.\"},\"return\":\"The round data.\"}},\"title\":\"LightGeneralizedTCRView A view contract to fetch, batch, parse and return GTCR contract data efficiently. This contract includes functions that can halt execution due to out-of-gas exceptions. Because of this it should never be relied upon by other contracts.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/view/LightGeneralizedTCRView.sol\":\"LightGeneralizedTCRView\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/LightGeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1*, @mtsalenc*, @hbarcelos*]\\n * @reviewers: [@fnanni-0*, @greenlucid, @shalzz]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\n\\nimport {IArbitrable, IArbitrator} from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport {IEvidence} from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport {CappedMath} from \\\"./utils/CappedMath.sol\\\";\\nimport {CappedMath128} from \\\"./utils/CappedMath128.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */\\n// It is the user responsibility to accept ETH.\\n\\n/**\\n * @title LightGeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n * The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns.\\n */\\ncontract LightGeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint256;\\n using CappedMath128 for uint128;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n enum RequestType {\\n Registration, // Identifies a request to register an item to the registry.\\n Clearing // Identifies a request to remove an item from the registry.\\n }\\n\\n enum DisputeStatus {\\n None, // No dispute was created.\\n AwaitingRuling, // Dispute was created, but the final ruling was not given yet.\\n Resolved // Dispute was ruled.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n Status status; // The current status of the item.\\n uint128 sumDeposit; // The total deposit made by the requester and the challenger (if any).\\n uint120 requestCount; // The number of requests.\\n mapping(uint256 => Request) requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n RequestType requestType;\\n uint64 submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n uint24 arbitrationParamsIndex; // The index for the arbitration params for the request.\\n address payable requester; // Address of the requester.\\n // Pack the requester together with the other parameters, as they are written in the same request.\\n address payable challenger; // Address of the challenger, if any.\\n }\\n\\n struct DisputeData {\\n uint256 disputeID; // The ID of the dispute on the arbitrator.\\n DisputeStatus status; // The current status of the dispute.\\n Party ruling; // The ruling given to a dispute. Only set after it has been resolved.\\n uint240 roundCount; // The number of rounds.\\n mapping(uint256 => Round) rounds; // Data of the different dispute rounds. rounds[roundId].\\n }\\n\\n struct Round {\\n Party sideFunded; // Stores the side that successfully paid the appeal fees in the latest round. Note that if both sides have paid a new round is created.\\n uint256 feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n uint256[3] amountPaid; // Tracks the sum paid for each Party in this round.\\n mapping(address => uint256[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n struct ArbitrationParams {\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n }\\n\\n /* Constants */\\n\\n uint256 public constant RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n uint256 private constant RESERVED_ROUND_ID = 0; // For compatibility with GeneralizedTCR consider the request/challenge cycle the first round (index 0).\\n\\n /* Storage */\\n\\n bool private initialized;\\n\\n address public relayerContract; // The contract that is used to add or remove items directly to speed up the interchain communication.\\n address public governor; // The address that can make changes to the parameters of the contract.\\n\\n uint256 public submissionBaseDeposit; // The base deposit to submit an item.\\n uint256 public removalBaseDeposit; // The base deposit to remove an item.\\n uint256 public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint256 public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint256 public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n\\n // Multipliers are in basis points.\\n uint256 public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint256 public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint256 public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint256 public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint256 => bytes32)) public arbitratorDisputeIDToItemID; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItemID[arbitrator][disputeID].\\n mapping(bytes32 => mapping(uint256 => DisputeData)) public requestsDisputeData; // Maps an item and a request to the data of the dispute related to them. requestsDisputeData[itemID][requestIndex]\\n ArbitrationParams[] public arbitrationParamsChanges;\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor() {\\n require(msg.sender == governor, \\\"The caller must be the governor.\\\");\\n _;\\n }\\n\\n modifier onlyRelayer() {\\n require(msg.sender == relayerContract, \\\"The caller must be the relay.\\\");\\n _;\\n }\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _updatedDirectly Whether this was emitted in either `addItemDirectly` or `removeItemDirectly`. This is used in the subgraph.\\n */\\n event ItemStatusChange(bytes32 indexed _itemID, bool _updatedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _data The item data URI.\\n * @param _addedDirectly Whether the item was added via `addItemDirectly`.\\n */\\n event NewItem(bytes32 indexed _itemID, string _data, bool _addedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n */\\n event RequestSubmitted(bytes32 indexed _itemID, uint256 _evidenceGroupID);\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal. The roundID assumes the initial request and challenge deposits are the first round. This is done so indexers can know more information about the contribution without using call handlers.\\n * @param _itemID The ID of the item.\\n * @param _requestID The index of the request that received the contribution.\\n * @param _roundID The index of the round that received the contribution.\\n * @param _contributor The address making the contribution.\\n * @param _contribution How much of the contribution was accepted.\\n * @param _side The party receiving the contribution.\\n */\\n event Contribution(\\n bytes32 indexed _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address indexed _contributor,\\n uint256 _contribution,\\n Party _side\\n );\\n\\n /**\\n * @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Emitted when someone withdraws more than 0 rewards.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw.\\n * @param _round The round from which to withdraw.\\n * @param _reward The amount withdrawn.\\n */\\n event RewardWithdrawn(\\n address indexed _beneficiary,\\n bytes32 indexed _itemID,\\n uint256 _request,\\n uint256 _round,\\n uint256 _reward\\n );\\n\\n /**\\n * @dev Initialize the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _baseDeposits The base deposits for requests/challenges as follows:\\n * - The base deposit to submit an item.\\n * - The base deposit to remove an item.\\n * - The base deposit to challenge a submission.\\n * - The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n * @param _relayerContract The address of the relay contract to add/remove items directly.\\n */\\n function initialize(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n address _connectedTCR,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence,\\n address _governor,\\n uint256[4] calldata _baseDeposits,\\n uint256 _challengePeriodDuration,\\n uint256[3] calldata _stakeMultipliers,\\n address _relayerContract\\n ) external {\\n require(!initialized, \\\"Already initialized.\\\");\\n\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n governor = _governor;\\n submissionBaseDeposit = _baseDeposits[0];\\n removalBaseDeposit = _baseDeposits[1];\\n submissionChallengeBaseDeposit = _baseDeposits[2];\\n removalChallengeBaseDeposit = _baseDeposits[3];\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n relayerContract = _relayerContract;\\n\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n\\n initialized = true;\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /**\\n * @dev Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _item The URI to the item data.\\n */\\n function addItemDirectly(string calldata _item) external onlyRelayer {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item is added directly once, the next time it is added it will emit this event again.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, true);\\n }\\n\\n item.status = Status.Registered;\\n\\n emit ItemStatusChange(itemID, true);\\n }\\n\\n /**\\n * @dev Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _itemID The ID of the item to remove.\\n */\\n function removeItemDirectly(bytes32 _itemID) external onlyRelayer {\\n Item storage item = items[_itemID];\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n item.status = Status.Absent;\\n\\n emit ItemStatusChange(_itemID, true);\\n }\\n\\n /**\\n * @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The URI to the item data.\\n */\\n function addItem(string calldata _item) external payable {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item was added previously using `addItemDirectly`, the event will be emitted again here.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, false);\\n }\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(submissionBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.RegistrationRequested;\\n\\n request.requestType = RequestType.Registration;\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n\\n emit RequestSubmitted(itemID, getEvidenceGroupID(itemID, item.requestCount - 1));\\n\\n emit Contribution(itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(removalBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.ClearingRequested;\\n\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n request.requestType = RequestType.Clearing;\\n\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, item.requestCount - 1);\\n\\n emit RequestSubmitted(_itemID, evidenceGroupID);\\n\\n emit Contribution(_itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime <= challengePeriodDuration,\\n \\\"Challenges must occur during the challenge period.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not have already been disputed.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitrationParams.arbitratorExtraData);\\n uint256 totalCost;\\n {\\n uint256 challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n }\\n require(msg.value >= totalCost, \\\"You must fully fund the challenge.\\\");\\n\\n emit Contribution(_itemID, lastRequestIndex, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Challenger);\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = item.sumDeposit.addCap(uint128(totalCost)).subCap(uint128(arbitrationCost));\\n\\n request.challenger = msg.sender;\\n\\n // Raise a dispute.\\n disputeData.disputeID = arbitrator.createDispute.value(arbitrationCost)(\\n RULING_OPTIONS,\\n arbitrationParams.arbitratorExtraData\\n );\\n disputeData.status = DisputeStatus.AwaitingRuling;\\n // For compatibility with GeneralizedTCR consider the request/challenge cycle\\n // the first round (index 0), so we need to make the next round index 1.\\n disputeData.roundCount = 2;\\n\\n arbitratorDisputeIDToItemID[address(arbitrator)][disputeData.disputeID] = _itemID;\\n\\n uint256 metaEvidenceID = 2 * request.arbitrationParamsIndex + uint256(request.requestType);\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, lastRequestIndex);\\n emit Dispute(arbitrator, disputeData.disputeID, metaEvidenceID, evidenceGroupID);\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side > Party.None, \\\"Invalid side.\\\");\\n\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(\\n disputeData.status == DisputeStatus.AwaitingRuling,\\n \\\"A dispute must have been raised to fund an appeal.\\\"\\n );\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 lastRoundIndex = disputeData.roundCount - 1;\\n Round storage round = disputeData.rounds[lastRoundIndex];\\n require(round.sideFunded != _side, \\\"Side already fully funded.\\\");\\n\\n uint256 multiplier;\\n {\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = arbitrator.appealPeriod(disputeData.disputeID);\\n require(\\n block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n Party winner = Party(arbitrator.currentRuling(disputeData.disputeID));\\n if (winner == Party.None) {\\n multiplier = sharedStakeMultiplier;\\n } else if (_side == winner) {\\n multiplier = winnerStakeMultiplier;\\n } else {\\n multiplier = loserStakeMultiplier;\\n require(\\n block.timestamp < (appealPeriodStart + appealPeriodEnd) / 2,\\n \\\"The loser must contribute during the first half of the appeal period.\\\"\\n );\\n }\\n }\\n\\n uint256 appealCost = arbitrator.appealCost(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n uint256 totalCost = appealCost.addCap(appealCost.mulCap(multiplier) / MULTIPLIER_DIVISOR);\\n contribute(_itemID, lastRequestIndex, lastRoundIndex, uint256(_side), msg.sender, msg.value, totalCost);\\n\\n if (round.amountPaid[uint256(_side)] >= totalCost) {\\n if (round.sideFunded == Party.None) {\\n round.sideFunded = _side;\\n } else {\\n // Resets the value because both sides are funded.\\n round.sideFunded = Party.None;\\n\\n // Raise appeal if both sides are fully funded.\\n arbitrator.appeal.value(appealCost)(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n disputeData.roundCount++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n }\\n\\n /**\\n * @dev If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _requestID The request from which to withdraw from.\\n * @param _roundID The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(\\n address payable _beneficiary,\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n ) external {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n require(disputeData.status == DisputeStatus.Resolved, \\\"Request must be resolved.\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n\\n uint256 reward;\\n if (_roundID == disputeData.roundCount - 1) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward =\\n round.contributions[_beneficiary][uint256(Party.Requester)] +\\n round.contributions[_beneficiary][uint256(Party.Challenger)];\\n } else if (disputeData.ruling == Party.None) {\\n uint256 totalFeesInRound = round.amountPaid[uint256(Party.Challenger)] +\\n round.amountPaid[uint256(Party.Requester)];\\n uint256 claimableFees = round.contributions[_beneficiary][uint256(Party.Challenger)] +\\n round.contributions[_beneficiary][uint256(Party.Requester)];\\n reward = totalFeesInRound > 0 ? (claimableFees * round.feeRewards) / totalFeesInRound : 0;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint256(disputeData.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint256(disputeData.ruling)] * round.feeRewards) /\\n round.amountPaid[uint256(disputeData.ruling)]\\n : 0;\\n }\\n round.contributions[_beneficiary][uint256(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint256(Party.Challenger)] = 0;\\n\\n if (reward > 0) {\\n _beneficiary.send(reward);\\n emit RewardWithdrawn(_beneficiary, _itemID, _requestID, _roundID, reward);\\n }\\n }\\n\\n /**\\n * @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = items[_itemID].requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested) {\\n item.status = Status.Registered;\\n } else if (item.status == Status.ClearingRequested) {\\n item.status = Status.Absent;\\n } else {\\n revert(\\\"There must be a request.\\\");\\n }\\n\\n emit ItemStatusChange(_itemID, false);\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (sumDeposit > 0) {\\n // reimburse the requester\\n request.requester.send(sumDeposit);\\n }\\n }\\n\\n /**\\n * @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n\\n bytes32 itemID = arbitratorDisputeIDToItemID[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n uint256 lastRequestIndex = items[itemID].requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.AwaitingRuling, \\\"The request must not be resolved.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n require(address(arbitrationParams.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n\\n uint256 finalRuling;\\n Round storage round = disputeData.rounds[disputeData.roundCount - 1];\\n\\n // If one side paid its fees, the ruling is in its favor.\\n // Note that if the other side had also paid, sideFudned would have been reset\\n // and an appeal would have been created.\\n if (round.sideFunded == Party.Requester) {\\n finalRuling = uint256(Party.Requester);\\n } else if (round.sideFunded == Party.Challenger) {\\n finalRuling = uint256(Party.Challenger);\\n } else {\\n finalRuling = _ruling;\\n }\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, finalRuling);\\n\\n Party winner = Party(finalRuling);\\n\\n disputeData.status = DisputeStatus.Resolved;\\n disputeData.ruling = winner;\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (winner == Party.None) {\\n // If the arbitrator refuse to rule, then the item status should be the same it was before the request.\\n // Regarding item.status this is equivalent to the challenger winning the dispute.\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n // Since nobody has won, then we reimburse both parties equally.\\n // If item.sumDeposit is odd, 1 wei will remain in the contract balance.\\n uint256 halfSumDeposit = sumDeposit / 2;\\n\\n request.requester.send(halfSumDeposit);\\n request.challenger.send(halfSumDeposit);\\n } else if (winner == Party.Requester) {\\n item.status = item.status == Status.RegistrationRequested ? Status.Registered : Status.Absent;\\n\\n request.requester.send(sumDeposit);\\n } else {\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n request.challenger.send(sumDeposit);\\n }\\n\\n emit ItemStatusChange(itemID, false);\\n }\\n\\n /**\\n * @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = item.requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n emit Evidence(\\n arbitrationParams.arbitrator,\\n getEvidenceGroupID(_itemID, lastRequestIndex),\\n msg.sender,\\n _evidence\\n );\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeChallengePeriodDuration(uint256 _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint256 _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint256 _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint256 _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint256 _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint256 _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint256 _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint256 _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /**\\n * @dev Change the address of the relay contract.\\n * @param _relayerContract The new address of the relay contract.\\n */\\n function changeRelayerContract(address _relayerContract) external onlyGovernor {\\n relayerContract = _relayerContract;\\n }\\n\\n /**\\n * @notice Changes the params related to arbitration.\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function changeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence\\n ) external onlyGovernor {\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function _doChangeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence\\n ) internal {\\n emit MetaEvidence(2 * arbitrationParamsChanges.length, _registrationMetaEvidence);\\n emit MetaEvidence(2 * arbitrationParamsChanges.length + 1, _clearingMetaEvidence);\\n\\n arbitrationParamsChanges.push(\\n ArbitrationParams({arbitrator: _arbitrator, arbitratorExtraData: _arbitratorExtraData})\\n );\\n }\\n\\n /**\\n * @notice Make a fee contribution.\\n * @dev It cannot be inlined in fundAppeal because of the stack limit.\\n * @param _itemID The item receiving the contribution.\\n * @param _requestID The request to contribute.\\n * @param _roundID The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n uint256 _side,\\n address payable _contributor,\\n uint256 _amount,\\n uint256 _totalRequired\\n ) internal {\\n Round storage round = requestsDisputeData[_itemID][_requestID].rounds[_roundID];\\n uint256 pendingAmount = _totalRequired.subCap(round.amountPaid[_side]);\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution; // Amount contributed.\\n uint256 remainingETH; // Remaining ETH to send back.\\n if (pendingAmount > _amount) {\\n contribution = _amount;\\n } else {\\n contribution = pendingAmount;\\n remainingETH = _amount - pendingAmount;\\n }\\n\\n round.contributions[_contributor][_side] += contribution;\\n round.amountPaid[_side] += contribution;\\n round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n if (remainingETH > 0) {\\n // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n _contributor.send(remainingETH);\\n }\\n\\n if (contribution > 0) {\\n emit Contribution(_itemID, _requestID, _roundID, msg.sender, contribution, Party(_side));\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /**\\n * @dev Gets the evidengeGroupID for a given item and request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The ID of the request.\\n * @return The evidenceGroupID\\n */\\n function getEvidenceGroupID(bytes32 _itemID, uint256 _requestID) public pure returns (uint256) {\\n return uint256(keccak256(abi.encodePacked(_itemID, _requestID)));\\n }\\n\\n /**\\n * @notice Gets the arbitrator for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator address.\\n */\\n function arbitrator() external view returns (IArbitrator) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitrator;\\n }\\n\\n /**\\n * @notice Gets the arbitratorExtraData for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator extra data.\\n */\\n function arbitratorExtraData() external view returns (bytes memory) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitratorExtraData;\\n }\\n\\n /**\\n * @dev Gets the number of times MetaEvidence was updated.\\n * @return The number of times MetaEvidence was updated.\\n */\\n function metaEvidenceUpdates() external view returns (uint256) {\\n return arbitrationParamsChanges.length;\\n }\\n\\n /**\\n * @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The request to query.\\n * @param _roundID The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address _contributor\\n ) external view returns (uint256[3] memory contributions) {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n Round storage round = disputeData.rounds[_roundID];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /**\\n * @dev Returns item's information. Includes the total number of requests for the item\\n * @param _itemID The ID of the queried item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Total number of requests for the item.\\n * @return sumDeposit The total deposit made by the requester and the challenger (if any)\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n Status status,\\n uint256 numberOfRequests,\\n uint256 sumDeposit\\n )\\n {\\n Item storage item = items[_itemID];\\n return (item.status, item.requestCount, item.sumDeposit);\\n }\\n\\n /**\\n * @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint256 _requestID)\\n external\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint256 numberOfRounds,\\n Party ruling,\\n IArbitrator requestArbitrator,\\n bytes memory requestArbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n Request storage request = items[_itemID].requests[_requestID];\\n\\n submissionTime = request.submissionTime;\\n parties[uint256(Party.Requester)] = request.requester;\\n parties[uint256(Party.Challenger)] = request.challenger;\\n\\n (disputed, disputeID, numberOfRounds, ruling) = getRequestDisputeData(_itemID, _requestID);\\n\\n (requestArbitrator, requestArbitratorExtraData, metaEvidenceID) = getRequestArbitrationParams(\\n _itemID,\\n _requestID\\n );\\n resolved = getRequestResolvedStatus(_itemID, _requestID);\\n }\\n\\n /**\\n * @dev Gets the dispute data relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return ruling The final ruling given, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n */\\n function getRequestDisputeData(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 numberOfRounds,\\n Party ruling\\n )\\n {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n return (\\n disputeData.status >= DisputeStatus.AwaitingRuling,\\n disputeData.disputeID,\\n disputeData.roundCount,\\n disputeData.ruling\\n );\\n }\\n\\n /**\\n * @dev Gets the arbitration params relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestArbitrationParams(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_requestID];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n return (\\n arbitrationParams.arbitrator,\\n arbitrationParams.arbitratorExtraData,\\n 2 * request.arbitrationParamsIndex + uint256(request.requestType)\\n );\\n }\\n\\n /**\\n * @dev Gets the resovled status of a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n */\\n function getRequestResolvedStatus(bytes32 _itemID, uint256 _requestID) internal view returns (bool resolved) {\\n Item storage item = items[_itemID];\\n\\n if (item.requestCount == 0) {\\n return false;\\n }\\n\\n if (_requestID < item.requestCount - 1) {\\n // It was resolved because it is not the last request.\\n return true;\\n }\\n\\n return item.sumDeposit == 0;\\n }\\n\\n /**\\n * @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @param _roundID The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n )\\n external\\n view\\n returns (\\n bool appealed,\\n uint256[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint256 feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n require(disputeData.roundCount > _roundID, \\\"Round does not exist\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n appealed = _roundID < disputeData.roundCount - 1;\\n\\n hasPaid[uint256(Party.Requester)] = appealed || round.sideFunded == Party.Requester;\\n hasPaid[uint256(Party.Challenger)] = appealed || round.sideFunded == Party.Challenger;\\n\\n return (appealed, round.amountPaid, hasPaid, round.feeRewards);\\n }\\n}\\n\",\"keccak256\":\"0x3a77a9cd5142744e9dec8d1f74e198b38b53c579e08cb306caa1b84c4c8d0935\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"},\"contracts/utils/CappedMath128.sol\":{\"content\":\"/**\\n * @authors: [@hbarcelos]\\n * @reviewers: [@fnanni-0]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath128 {\\n uint128 private constant UINT128_MAX = 2**128 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function addCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n uint128 c = _a + _b;\\n return c >= _a ? c : UINT128_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function mulCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_a == 0) return 0;\\n\\n uint128 c = _a * _b;\\n return c / _a == _b ? c : UINT128_MAX;\\n }\\n}\\n\",\"keccak256\":\"0xaa86df80a3608032b85628f172d6e4b59c7f8a360a0e661959e865765322375c\"},\"contracts/view/LightGeneralizedTCRView.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\npragma experimental ABIEncoderV2;\\n\\nimport {LightGeneralizedTCR, IArbitrator} from \\\"../LightGeneralizedTCR.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */\\n// It is the user responsibility to accept ETH.\\n\\n/**\\n * @title LightGeneralizedTCRView\\n * A view contract to fetch, batch, parse and return GTCR contract data efficiently.\\n * This contract includes functions that can halt execution due to out-of-gas exceptions. Because of this it should never be relied upon by other contracts.\\n */\\ncontract LightGeneralizedTCRView {\\n struct QueryResult {\\n bytes32 ID;\\n LightGeneralizedTCR.Status status;\\n bool disputed;\\n bool resolved;\\n uint256 disputeID;\\n uint256 appealCost;\\n bool appealed;\\n uint256 appealStart;\\n uint256 appealEnd;\\n LightGeneralizedTCR.Party ruling;\\n address requester;\\n address challenger;\\n address arbitrator;\\n bytes arbitratorExtraData;\\n LightGeneralizedTCR.Party currentRuling;\\n bool[3] hasPaid;\\n uint256 feeRewards;\\n uint256 submissionTime;\\n uint256[3] amountPaid;\\n IArbitrator.DisputeStatus disputeStatus;\\n uint256 numberOfRequests;\\n }\\n\\n struct ArbitrableData {\\n address governor;\\n address arbitrator;\\n bytes arbitratorExtraData;\\n uint256 submissionBaseDeposit;\\n uint256 removalBaseDeposit;\\n uint256 submissionChallengeBaseDeposit;\\n uint256 removalChallengeBaseDeposit;\\n uint256 challengePeriodDuration;\\n uint256 metaEvidenceUpdates;\\n uint256 winnerStakeMultiplier;\\n uint256 loserStakeMultiplier;\\n uint256 sharedStakeMultiplier;\\n uint256 MULTIPLIER_DIVISOR;\\n uint256 arbitrationCost;\\n }\\n\\n /** @dev Fetch arbitrable TCR data in a single call.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @return The latest data on an arbitrable TCR contract.\\n */\\n function fetchArbitrable(address _address) external view returns (ArbitrableData memory result) {\\n LightGeneralizedTCR tcr = LightGeneralizedTCR(_address);\\n result.governor = tcr.governor();\\n result.arbitrator = address(tcr.arbitrator());\\n result.arbitratorExtraData = tcr.arbitratorExtraData();\\n result.submissionBaseDeposit = tcr.submissionBaseDeposit();\\n result.removalBaseDeposit = tcr.removalBaseDeposit();\\n result.submissionChallengeBaseDeposit = tcr.submissionChallengeBaseDeposit();\\n result.removalChallengeBaseDeposit = tcr.removalChallengeBaseDeposit();\\n result.challengePeriodDuration = tcr.challengePeriodDuration();\\n result.metaEvidenceUpdates = tcr.metaEvidenceUpdates();\\n result.winnerStakeMultiplier = tcr.winnerStakeMultiplier();\\n result.loserStakeMultiplier = tcr.loserStakeMultiplier();\\n result.sharedStakeMultiplier = tcr.sharedStakeMultiplier();\\n result.MULTIPLIER_DIVISOR = tcr.MULTIPLIER_DIVISOR();\\n result.arbitrationCost = IArbitrator(result.arbitrator).arbitrationCost(result.arbitratorExtraData);\\n }\\n\\n /** @dev Fetch the latest data on an item in a single call.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The item data.\\n */\\n function getItem(address _address, bytes32 _itemID) public view returns (QueryResult memory result) {\\n RoundData memory round = getLatestRoundRequestData(_address, _itemID);\\n result = QueryResult({\\n ID: _itemID,\\n status: round.request.item.status,\\n disputed: round.request.disputed,\\n resolved: round.request.resolved,\\n disputeID: round.request.disputeID,\\n appealCost: 0,\\n appealed: round.appealed,\\n appealStart: 0,\\n appealEnd: 0,\\n ruling: round.request.ruling,\\n requester: round.request.parties[uint256(LightGeneralizedTCR.Party.Requester)],\\n challenger: round.request.parties[uint256(LightGeneralizedTCR.Party.Challenger)],\\n arbitrator: address(round.request.arbitrator),\\n arbitratorExtraData: round.request.arbitratorExtraData,\\n currentRuling: LightGeneralizedTCR.Party.None,\\n hasPaid: round.hasPaid,\\n feeRewards: round.feeRewards,\\n submissionTime: round.request.submissionTime,\\n amountPaid: round.amountPaid,\\n disputeStatus: IArbitrator.DisputeStatus.Waiting,\\n numberOfRequests: round.request.item.numberOfRequests\\n });\\n if (\\n round.request.disputed &&\\n round.request.arbitrator.disputeStatus(result.disputeID) == IArbitrator.DisputeStatus.Appealable\\n ) {\\n result.currentRuling = LightGeneralizedTCR.Party(round.request.arbitrator.currentRuling(result.disputeID));\\n result.disputeStatus = round.request.arbitrator.disputeStatus(result.disputeID);\\n (result.appealStart, result.appealEnd) = round.request.arbitrator.appealPeriod(result.disputeID);\\n result.appealCost = round.request.arbitrator.appealCost(result.disputeID, result.arbitratorExtraData);\\n }\\n }\\n\\n struct ItemRequest {\\n bool disputed;\\n uint256 disputeID;\\n uint256 submissionTime;\\n bool resolved;\\n address requester;\\n address challenger;\\n address arbitrator;\\n bytes arbitratorExtraData;\\n uint256 metaEvidenceID;\\n }\\n\\n /** @dev Fetch all requests for an item.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The items requests.\\n */\\n function getItemRequests(address _address, bytes32 _itemID) external view returns (ItemRequest[] memory requests) {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n ItemData memory itemData = getItemData(_address, _itemID);\\n requests = new ItemRequest[](itemData.numberOfRequests);\\n for (uint256 i = 0; i < itemData.numberOfRequests; i++) {\\n (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n ,\\n ,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint256 metaEvidenceID\\n ) = gtcr.getRequestInfo(_itemID, i);\\n\\n // Sort requests by newest first.\\n requests[itemData.numberOfRequests - i - 1] = ItemRequest({\\n disputed: disputed,\\n disputeID: disputeID,\\n submissionTime: submissionTime,\\n resolved: resolved,\\n requester: parties[uint256(LightGeneralizedTCR.Party.Requester)],\\n challenger: parties[uint256(LightGeneralizedTCR.Party.Challenger)],\\n arbitrator: address(arbitrator),\\n arbitratorExtraData: arbitratorExtraData,\\n metaEvidenceID: metaEvidenceID\\n });\\n }\\n }\\n\\n /** @dev Return the withdrawable rewards for a contributor.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @param _contributor The address of the contributor.\\n * @return The amount withdrawable per round per request.\\n */\\n function availableRewards(\\n address _address,\\n bytes32 _itemID,\\n address _contributor\\n ) external view returns (uint256 rewards) {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n\\n // Using arrays to avoid stack limit.\\n uint256[2] memory requestRoundCount = [uint256(0), uint256(0)];\\n uint256[2] memory indexes = [uint256(0), uint256(0)]; // Request index and round index.\\n\\n (, requestRoundCount[0], ) = gtcr.getItemInfo(_itemID);\\n for (indexes[0]; indexes[0] < requestRoundCount[0]; indexes[0]++) {\\n LightGeneralizedTCR.Party ruling;\\n bool resolved;\\n (, , , resolved, , requestRoundCount[1], ruling, , , ) = gtcr.getRequestInfo(_itemID, indexes[0]);\\n if (!resolved) continue;\\n for (indexes[1]; indexes[1] < requestRoundCount[1]; indexes[1]++) {\\n (, uint256[3] memory amountPaid, bool[3] memory hasPaid, uint256 feeRewards) = gtcr.getRoundInfo(\\n _itemID,\\n indexes[0],\\n indexes[1]\\n );\\n\\n uint256[3] memory roundContributions = gtcr.getContributions(\\n _itemID,\\n indexes[0],\\n indexes[1],\\n _contributor\\n );\\n if (\\n !hasPaid[uint256(LightGeneralizedTCR.Party.Requester)] ||\\n !hasPaid[uint256(LightGeneralizedTCR.Party.Challenger)]\\n ) {\\n // Amount reimbursable if not enough fees were raised to appeal the ruling.\\n rewards +=\\n roundContributions[uint256(LightGeneralizedTCR.Party.Requester)] +\\n roundContributions[uint256(LightGeneralizedTCR.Party.Challenger)];\\n } else if (ruling == LightGeneralizedTCR.Party.None) {\\n // Reimbursable fees proportional if there aren't a winner and loser.\\n rewards += amountPaid[uint256(LightGeneralizedTCR.Party.Requester)] > 0\\n ? (roundContributions[uint256(LightGeneralizedTCR.Party.Requester)] * feeRewards) /\\n (amountPaid[uint256(LightGeneralizedTCR.Party.Challenger)] +\\n amountPaid[uint256(LightGeneralizedTCR.Party.Requester)])\\n : 0;\\n rewards += amountPaid[uint256(LightGeneralizedTCR.Party.Challenger)] > 0\\n ? (roundContributions[uint256(LightGeneralizedTCR.Party.Challenger)] * feeRewards) /\\n (amountPaid[uint256(LightGeneralizedTCR.Party.Challenger)] +\\n amountPaid[uint256(LightGeneralizedTCR.Party.Requester)])\\n : 0;\\n } else {\\n // Contributors to the winner take the rewards.\\n rewards += amountPaid[uint256(ruling)] > 0\\n ? (roundContributions[uint256(ruling)] * feeRewards) / amountPaid[uint256(ruling)]\\n : 0;\\n }\\n }\\n indexes[1] = 0;\\n }\\n }\\n\\n // Functions and structs below used mainly to avoid stack limit.\\n struct ItemData {\\n LightGeneralizedTCR.Status status;\\n uint256 numberOfRequests;\\n }\\n\\n struct RequestData {\\n ItemData item;\\n bool disputed;\\n uint256 disputeID;\\n uint256 submissionTime;\\n bool resolved;\\n address payable[3] parties;\\n uint256 numberOfRounds;\\n LightGeneralizedTCR.Party ruling;\\n IArbitrator arbitrator;\\n bytes arbitratorExtraData;\\n }\\n\\n struct RoundData {\\n RequestData request;\\n bool appealed;\\n uint256[3] amountPaid;\\n bool[3] hasPaid;\\n uint256 feeRewards;\\n }\\n\\n /** @dev Fetch data of the an item and return a struct.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The round data.\\n */\\n function getItemData(address _address, bytes32 _itemID) public view returns (ItemData memory item) {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n (LightGeneralizedTCR.Status status, uint256 numberOfRequests, ) = gtcr.getItemInfo(_itemID);\\n item = ItemData(status, numberOfRequests);\\n }\\n\\n /** @dev Fetch the latest request of item.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The round data.\\n */\\n function getLatestRequestData(address _address, bytes32 _itemID) public view returns (RequestData memory request) {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n ItemData memory item = getItemData(_address, _itemID);\\n (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint256 numberOfRounds,\\n LightGeneralizedTCR.Party ruling,\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n\\n ) = gtcr.getRequestInfo(_itemID, item.numberOfRequests - 1);\\n request = RequestData(\\n item,\\n disputed,\\n disputeID,\\n submissionTime,\\n resolved,\\n parties,\\n numberOfRounds,\\n ruling,\\n arbitrator,\\n arbitratorExtraData\\n );\\n }\\n\\n /** @dev Fetch the latest round of the latest request of an item.\\n * @param _address The address of the LightGeneralized TCR to query.\\n * @param _itemID The ID of the item to query.\\n * @return The round data.\\n */\\n function getLatestRoundRequestData(address _address, bytes32 _itemID) public view returns (RoundData memory round) {\\n LightGeneralizedTCR gtcr = LightGeneralizedTCR(_address);\\n (, , uint256 sumDeposit) = gtcr.getItemInfo(_itemID);\\n RequestData memory request = getLatestRequestData(_address, _itemID);\\n\\n if (request.disputed) {\\n (bool appealed, uint256[3] memory amountPaid, bool[3] memory hasPaid, uint256 feeRewards) = gtcr\\n .getRoundInfo(_itemID, request.item.numberOfRequests - 1, request.numberOfRounds - 1);\\n\\n round = RoundData(request, appealed, amountPaid, hasPaid, feeRewards);\\n } else {\\n round = RoundData(request, false, [0, sumDeposit, 0], [false, true, false], sumDeposit);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c7279595ab361a2ae34df3f824f4b15e5fd2349de239184c2a305cb54d9664c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061281a806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80637d1d8cc21161005b5780637d1d8cc2146100eb57806387ef093a1461010b578063cefded2e1461012b578063f2af29891461014b5761007d565b80630f4d1e731461008257806311b750c3146100ab5780633f869479146100cb575b600080fd5b610095610090366004611b06565b61016b565b6040516100a291906125f0565b60405180910390f35b6100be6100b9366004611b4a565b610857565b6040516100a29190612631565b6100de6100d9366004611b4a565b610a44565b6040516100a2919061260f565b6100fe6100f9366004611b4a565b610ecf565b6040516100a29190612620565b61011e610119366004611b4a565b61100b565b6040516100a29190612548565b61013e610139366004611b4a565b6111e5565b6040516100a29190612601565b61015e610159366004611b84565b61129e565b6040516100a29190612559565b6101736116c6565b6000829050806001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156101b157600080fd5b505afa1580156101c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101e99190810190611b2c565b6001600160a01b03908116835260408051636cc6cde160e01b8152905191831691636cc6cde191600480820192602092909190829003018186803b15801561023057600080fd5b505afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102689190810190611d79565b82602001906001600160a01b031690816001600160a01b031681525050806001600160a01b0316630c7ac7b66040518163ffffffff1660e01b815260040160006040518083038186803b1580156102be57600080fd5b505afa1580156102d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102fa9190810190611d44565b8260400181905250806001600160a01b031663bb0b86ff6040518163ffffffff1660e01b815260040160206040518083038186803b15801561033b57600080fd5b505afa15801561034f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103739190810190611df8565b826060018181525050806001600160a01b031663c2f2beea6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b557600080fd5b505afa1580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103ed9190810190611df8565b826080018181525050806001600160a01b031663a37b6ad46040518163ffffffff1660e01b815260040160206040518083038186803b15801561042f57600080fd5b505afa158015610443573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104679190810190611df8565b8260a0018181525050806001600160a01b031663787471a96040518163ffffffff1660e01b815260040160206040518083038186803b1580156104a957600080fd5b505afa1580156104bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104e19190810190611df8565b8260c0018181525050806001600160a01b03166282a36d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052257600080fd5b505afa158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061055a9190810190611df8565b8260e0018181525050806001600160a01b0316636cdc090f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561059c57600080fd5b505afa1580156105b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105d49190810190611df8565b82610100018181525050806001600160a01b0316637b9433836040518163ffffffff1660e01b815260040160206040518083038186803b15801561061757600080fd5b505afa15801561062b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061064f9190810190611df8565b82610120018181525050806001600160a01b0316631d5120856040518163ffffffff1660e01b815260040160206040518083038186803b15801561069257600080fd5b505afa1580156106a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106ca9190810190611df8565b82610140018181525050806001600160a01b031663416583416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070d57600080fd5b505afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107459190810190611df8565b82610160018181525050806001600160a01b031663d661dd316040518163ffffffff1660e01b815260040160206040518083038186803b15801561078857600080fd5b505afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107c09190810190611df8565b6101808301526020820151604080840151905163f7434ea960e01b81526001600160a01b039092169163f7434ea9916107fb916004016125df565b60206040518083038186803b15801561081357600080fd5b505afa158015610827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061084b9190810190611df8565b6101a083015250919050565b61085f611747565b604051634aac84e560e01b815283906000906001600160a01b03831690634aac84e590610890908790600401612559565b60606040518083038186803b1580156108a857600080fd5b505afa1580156108bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108e09190810190611db5565b925050506108ec611788565b6108f68686610ecf565b90508060200151156109da57600061090c6117f2565b6109146117f2565b83516020015160c0850151604051634ba090d960e11b81526000926001600160a01b038a169263974121b292610958928e9260001991820192910190600401612582565b6101006040518083038186803b15801561097157600080fd5b505afa158015610985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109a99190810190611bef565b6040805160a0810182528a81529415156020860152840192909252606083015260808201529750610a3b9350505050565b6040805160a08101825282815260006020808301829052835160608082018652838252818301889052818601849052848601919091528451808201865283815260019281019290925293810191909152918101919091526080810183905293505b50505092915050565b610a4c611810565b610a54611747565b610a5e8484610857565b604080516102a08101909152848152815151519192509060208201906003811115610a8557fe5b815260200182600001516020015115158152602001826000015160800151151581526020018260000151604001518152602001600081526020018260200151151581526020016000815260200160008152602001826000015160e001516002811115610aed57fe5b8152825160a0908101516020908101516001600160a01b031690830152835101516040909101906002602090810291909101516001600160a01b03908116835284516101000151169082015282516101200151604082015260600160008152602001826060015181526020018260800151815260200182600001516060015181526020018260400151815260200160006002811115610b8857fe5b815282515160209081015191810191909152825101519092508015610c3e5750600181516101000151608084015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e891610be191600401612559565b60206040518083038186803b158015610bf957600080fd5b505afa158015610c0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c319190810190611d97565b6002811115610c3c57fe5b145b15610ec857805161010001516080830151604051631c3db16d60e01b81526001600160a01b0390921691631c3db16d91610c7a91600401612559565b60206040518083038186803b158015610c9257600080fd5b505afa158015610ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610cca9190810190611df8565b6002811115610cd557fe5b826101c001906002811115610ce657fe5b90816002811115610cf357fe5b90525080516101000151608083015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e891610d2d91600401612559565b60206040518083038186803b158015610d4557600080fd5b505afa158015610d59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d7d9190810190611d97565b8261026001906002811115610d8e57fe5b90816002811115610d9b57fe5b90525080516101000151608083015160405163afe15cfb60e01b81526001600160a01b039092169163afe15cfb91610dd591600401612559565b604080518083038186803b158015610dec57600080fd5b505afa158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e249190810190611e16565b6101008085019190915260e08401919091528151015160808301516101a084015160405163791f8b7360e11b81526001600160a01b039093169263f23f16e692610e72929091600401612642565b60206040518083038186803b158015610e8a57600080fd5b505afa158015610e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ec29190810190611df8565b60a08301525b5092915050565b610ed7611788565b82610ee06118b5565b610eea85856111e5565b9050600080600080610efa6117f2565b600080600060608a6001600160a01b031663bfbcff1a8e60018d60200151036040518363ffffffff1660e01b8152600401610f36929190612567565b60006040518083038186803b158015610f4e57600080fd5b505afa158015610f62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f8a9190810190611c51565b509850985098509850985098509850985098506040518061014001604052808b81526020018a151581526020018981526020018881526020018715158152602001868152602001858152602001846002811115610fe357fe5b81526001600160a01b0390931660208401526040909201529c9b505050505050505050505050565b6060826110166118b5565b61102085856111e5565b9050806020015160405190808252806020026020018201604052801561106057816020015b61104d6118c7565b8152602001906001900390816110455790505b50925060005b8160200151811015610a3b576000806000806110806117f2565b6000606060008a6001600160a01b031663bfbcff1a8e8b6040518363ffffffff1660e01b81526004016110b4929190612567565b60006040518083038186803b1580156110cc57600080fd5b505afa1580156110e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111089190810190611c51565b99509950995050509750975097509750975060405180610120016040528089151581526020018881526020018781526020018615158152602001856001600281111561115057fe5b6003811061115a57fe5b60200201516001600160a01b031681526020018560028081111561117a57fe5b6003811061118457fe5b60200201516001600160a01b03168152602001846001600160a01b03168152602001838152602001828152508c60018b8d602001510303815181106111c557fe5b602002602001018190525050505050505050508080600101915050611066565b6111ed6118b5565b604051634aac84e560e01b8152839060009081906001600160a01b03841690634aac84e590611220908890600401612559565b60606040518083038186803b15801561123857600080fd5b505afa15801561124c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112709190810190611db5565b5091509150604051806040016040528083600381111561128c57fe5b81526020019190915295945050505050565b6000836112a9611912565b5060408051808201909152600080825260208201526112c6611912565b50604080518082018252600080825260208201529051634aac84e560e01b81526001600160a01b03841690634aac84e590611305908990600401612559565b60606040518083038186803b15801561131d57600080fd5b505afa158015611331573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113559190810190611db5565b508352505b8151815110156116bc578051604051635fde7f8d60e11b815260009182916001600160a01b0387169163bfbcff1a91611397918c91600401612567565b60006040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113eb9190810190611c51565b509497509195509350899250600191506114029050565b6020020191909152925090508061141a5750506116b0565b6020808501519084015110156116a6576114326117f2565b61143a6117f2565b60006001600160a01b03881663974121b28c8884602002015189600160200201516040518463ffffffff1660e01b815260040161147993929190612582565b6101006040518083038186803b15801561149257600080fd5b505afa1580156114a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114ca9190810190611bef565b935093509350506114d96117f2565b6001600160a01b0389166352bc0e608d89600060200201518a600160200201518f6040518563ffffffff1660e01b815260040161151994939291906125aa565b60606040518083038186803b15801561153157600080fd5b505afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115699190810190611bd1565b6020840151909150158061157f57506040830151155b156115995760408101516020820151019990990198611685565b60008660028111156115a757fe5b14156116135760208401516115bd5760006115da565b6020808501516040860151918301519101908302816115d857fe5b045b60408501519a01996115ed57600061160a565b60208401516040808601519083015191019083028161160857fe5b045b8a019950611685565b60008487600281111561162257fe5b6003811061162c57fe5b60200201511161163d576000611680565b8386600281111561164a57fe5b6003811061165457fe5b6020020151828288600281111561166757fe5b6003811061167157fe5b6020020151028161167e57fe5b045b8a0199505b505050508260016002811061169657fe5b602002018051600101905261141a565b5050600060208201525b8051600101815261135a565b5050509392505050565b604051806101c0016040528060006001600160a01b0316815260200160006001600160a01b031681526020016060815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060a0016040528061175a611788565b81526000602082015260400161176e6117f2565b815260200161177b6117f2565b8152602001600081525090565b60405180610140016040528061179c6118b5565b81526000602082018190526040820181905260608201819052608082015260a0016117c56117f2565b815260200160008152602001600060028111156117de57fe5b815260006020820152606060409091015290565b60405180606001604052806003906020820280388339509192915050565b604080516102a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052906101208201908152600060208201819052604082018190526060808301829052608083015260a082015260c00161188e6117f2565b815260200160008152602001600081526020016118a96117f2565b8152602001600061177b565b6040805180820190915280600061177b565b604080516101208101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082015261010081019190915290565b60405180604001604052806002906020820280388339509192915050565b803561193b8161278e565b92915050565b805161193b8161278e565b600082601f83011261195d57600080fd5b600361197061196b82612689565b612662565b9150818385602084028201111561198657600080fd5b60005b838110156119b2578161199c8882611941565b8452506020928301929190910190600101611989565b5050505092915050565b600082601f8301126119cd57600080fd5b60036119db61196b82612689565b915081838560208402820111156119f157600080fd5b60005b838110156119b25781611a078882611a7e565b84525060209283019291909101906001016119f4565b600082601f830112611a2e57600080fd5b6003611a3c61196b82612689565b91508183856020840282011115611a5257600080fd5b60005b838110156119b25781611a688882611afb565b8452506020928301929190910190600101611a55565b805161193b816127a2565b803561193b816127ab565b600082601f830112611aa557600080fd5b8151611ab361196b826126a7565b91508082526020830160208301858383011115611acf57600080fd5b610a3b838284612741565b805161193b816127b4565b805161193b816127bd565b805161193b816127ca565b805161193b816127ab565b600060208284031215611b1857600080fd5b6000611b248484611930565b949350505050565b600060208284031215611b3e57600080fd5b6000611b248484611941565b60008060408385031215611b5d57600080fd5b6000611b698585611930565b9250506020611b7a85828601611a89565b9150509250929050565b600080600060608486031215611b9957600080fd5b6000611ba58686611930565b9350506020611bb686828701611a89565b9250506040611bc786828701611930565b9150509250925092565b600060608284031215611be357600080fd5b6000611b248484611a1d565b6000806000806101008587031215611c0657600080fd5b6000611c128787611a7e565b9450506020611c2387828801611a1d565b9350506080611c34878288016119bc565b92505060e0611c4587828801611afb565b91505092959194509250565b6000806000806000806000806000806101808b8d031215611c7157600080fd5b6000611c7d8d8d611a7e565b9a50506020611c8e8d828e01611afb565b9950506040611c9f8d828e01611afb565b9850506060611cb08d828e01611a7e565b9750506080611cc18d828e0161194c565b96505060e0611cd28d828e01611afb565b955050610100611ce48d828e01611ae5565b945050610120611cf68d828e01611ada565b9350506101408b015167ffffffffffffffff811115611d1457600080fd5b611d208d828e01611a94565b925050610160611d328d828e01611afb565b9150509295989b9194979a5092959850565b600060208284031215611d5657600080fd5b815167ffffffffffffffff811115611d6d57600080fd5b611b2484828501611a94565b600060208284031215611d8b57600080fd5b6000611b248484611ada565b600060208284031215611da957600080fd5b6000611b248484611ae5565b600080600060608486031215611dca57600080fd5b6000611dd68686611af0565b9350506020611de786828701611afb565b9250506040611bc786828701611afb565b600060208284031215611e0a57600080fd5b6000611b248484611afb565b60008060408385031215611e2957600080fd5b6000611e358585611afb565b9250506020611b7a85828601611afb565b6000611e528383611e85565b505060200190565b6000611e528383611fee565b6000611e7283836121a4565b9392505050565b6000611e528383611ff7565b611e8e816126f0565b82525050565b611e9d816126d8565b611ea781846126e2565b9250611eb2826126cf565b8060005b83811015611ee0578151611eca8782611e46565b9650611ed5836126d2565b925050600101611eb6565b505050505050565b611ef1816126d8565b611efb81846126e2565b9250611f06826126cf565b8060005b83811015611ee0578151611f1e8782611e5a565b9650611f29836126d2565b925050600101611f0a565b6000611f3f826126de565b611f4981856126e7565b935083602082028501611f5b856126d2565b8060005b85811015611f955784840389528151611f788582611e66565b9450611f83836126d2565b60209a909a0199925050600101611f5f565b5091979650505050505050565b611fab816126d8565b611fb581846126e2565b9250611fc0826126cf565b8060005b83811015611ee0578151611fd88782611e79565b9650611fe3836126d2565b925050600101611fc4565b611e8e816126fb565b611e8e816126cf565b600061200b826126de565b61201581856126e7565b9350612025818560208601612741565b61202e8161276d565b9093019392505050565b611e8e81612700565b611e8e8161272b565b611e8e81612736565b80516000906101c08401906120688582611e85565b50602083015161207b6020860182611e85565b50604083015184820360408601526120938282612000565b91505060608301516120a86060860182611ff7565b5060808301516120bb6080860182611ff7565b5060a08301516120ce60a0860182611ff7565b5060c08301516120e160c0860182611ff7565b5060e08301516120f460e0860182611ff7565b50610100830151612109610100860182611ff7565b5061012083015161211e610120860182611ff7565b50610140830151612133610140860182611ff7565b50610160830151612148610160860182611ff7565b5061018083015161215d610180860182611ff7565b506101a08301516121726101a0860182611ff7565b509392505050565b8051604083019061218b848261204a565b50602082015161219e6020850182611ff7565b50505050565b80516000906101208401906121b98582611fee565b5060208301516121cc6020860182611ff7565b5060408301516121df6040860182611ff7565b5060608301516121f26060860182611fee565b5060808301516122056080860182611e85565b5060a083015161221860a0860182611e85565b5060c083015161222b60c0860182611e85565b5060e083015184820360e08601526122438282612000565b915050610100830151612172610100860182611ff7565b805160009061032084019061226f8582611ff7565b506020830151612282602086018261204a565b5060408301516122956040860182611fee565b5060608301516122a86060860182611fee565b5060808301516122bb6080860182611ff7565b5060a08301516122ce60a0860182611ff7565b5060c08301516122e160c0860182611fee565b5060e08301516122f460e0860182611ff7565b50610100830151612309610100860182611ff7565b5061012083015161231e610120860182612041565b50610140830151612333610140860182611e85565b50610160830151612348610160860182611e85565b5061018083015161235d610180860182611e85565b506101a08301518482036101a08601526123778282612000565b9150506101c083015161238e6101c0860182612041565b506101e08301516123a36101e0860182611ee8565b506102008301516123b8610240860182611ff7565b506102208301516123cd610260860182611ff7565b506102408301516123e2610280860182611fa2565b506102608301516123f76102e0860182612041565b50610280830151612172610300860182611ff7565b80516000906101a0840190612421858261217a565b5060208301516124346040860182611fee565b5060408301516124476060860182611ff7565b50606083015161245a6080860182611ff7565b50608083015161246d60a0860182611fee565b5060a083015161248060c0860182611e94565b5060c0830151612494610120860182611ff7565b5060e08301516124a8610140860182612041565b506101008301516124bd610160860182612038565b506101208301518482036101808601526124d78282612000565b95945050505050565b8051610120808452600091908401906124f9828261240c565b915050602083015161250e6020860182611fee565b5060408301516125216040860182611fa2565b50606083015161253460a0860182611ee8565b506080830151612172610100860182611ff7565b60208082528101611e728184611f34565b6020810161193b8284611ff7565b604081016125758285611ff7565b611e726020830184611ff7565b606081016125908286611ff7565b61259d6020830185611ff7565b611b246040830184611ff7565b608081016125b88287611ff7565b6125c56020830186611ff7565b6125d26040830185611ff7565b6124d76060830184611e85565b60208082528101611e728184612000565b60208082528101611e728184612053565b6040810161193b828461217a565b60208082528101611e72818461225a565b60208082528101611e72818461240c565b60208082528101611e7281846124e0565b604081016126508285611ff7565b8181036020830152611b248184612000565b60405181810167ffffffffffffffff8111828210171561268157600080fd5b604052919050565b600067ffffffffffffffff8211156126a057600080fd5b5060200290565b600067ffffffffffffffff8211156126be57600080fd5b506020601f91909101601f19160190565b90565b60200190565b50600390565b5190565b919050565b90815260200190565b600061193b8261271f565b151590565b600061193b826126f0565b806126e281612777565b806126e281612784565b6001600160a01b031690565b600061193b8261270b565b600061193b82612715565b60005b8381101561275c578181015183820152602001612744565b8381111561219e5750506000910152565b601f01601f191690565b6003811061278157fe5b50565b6004811061278157fe5b612797816126f0565b811461278157600080fd5b612797816126fb565b612797816126cf565b61279781612700565b6003811061278157600080fd5b6004811061278157600080fdfea365627a7a723158203d29bb5cb92cddf540f38531efdefadb5899e513a4026f6a49cd2e87935a146f6c6578706572696d656e74616cf564736f6c63430005110040", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80637d1d8cc21161005b5780637d1d8cc2146100eb57806387ef093a1461010b578063cefded2e1461012b578063f2af29891461014b5761007d565b80630f4d1e731461008257806311b750c3146100ab5780633f869479146100cb575b600080fd5b610095610090366004611b06565b61016b565b6040516100a291906125f0565b60405180910390f35b6100be6100b9366004611b4a565b610857565b6040516100a29190612631565b6100de6100d9366004611b4a565b610a44565b6040516100a2919061260f565b6100fe6100f9366004611b4a565b610ecf565b6040516100a29190612620565b61011e610119366004611b4a565b61100b565b6040516100a29190612548565b61013e610139366004611b4a565b6111e5565b6040516100a29190612601565b61015e610159366004611b84565b61129e565b6040516100a29190612559565b6101736116c6565b6000829050806001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156101b157600080fd5b505afa1580156101c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101e99190810190611b2c565b6001600160a01b03908116835260408051636cc6cde160e01b8152905191831691636cc6cde191600480820192602092909190829003018186803b15801561023057600080fd5b505afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102689190810190611d79565b82602001906001600160a01b031690816001600160a01b031681525050806001600160a01b0316630c7ac7b66040518163ffffffff1660e01b815260040160006040518083038186803b1580156102be57600080fd5b505afa1580156102d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102fa9190810190611d44565b8260400181905250806001600160a01b031663bb0b86ff6040518163ffffffff1660e01b815260040160206040518083038186803b15801561033b57600080fd5b505afa15801561034f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103739190810190611df8565b826060018181525050806001600160a01b031663c2f2beea6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b557600080fd5b505afa1580156103c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103ed9190810190611df8565b826080018181525050806001600160a01b031663a37b6ad46040518163ffffffff1660e01b815260040160206040518083038186803b15801561042f57600080fd5b505afa158015610443573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104679190810190611df8565b8260a0018181525050806001600160a01b031663787471a96040518163ffffffff1660e01b815260040160206040518083038186803b1580156104a957600080fd5b505afa1580156104bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104e19190810190611df8565b8260c0018181525050806001600160a01b03166282a36d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052257600080fd5b505afa158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061055a9190810190611df8565b8260e0018181525050806001600160a01b0316636cdc090f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561059c57600080fd5b505afa1580156105b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105d49190810190611df8565b82610100018181525050806001600160a01b0316637b9433836040518163ffffffff1660e01b815260040160206040518083038186803b15801561061757600080fd5b505afa15801561062b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061064f9190810190611df8565b82610120018181525050806001600160a01b0316631d5120856040518163ffffffff1660e01b815260040160206040518083038186803b15801561069257600080fd5b505afa1580156106a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106ca9190810190611df8565b82610140018181525050806001600160a01b031663416583416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070d57600080fd5b505afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107459190810190611df8565b82610160018181525050806001600160a01b031663d661dd316040518163ffffffff1660e01b815260040160206040518083038186803b15801561078857600080fd5b505afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107c09190810190611df8565b6101808301526020820151604080840151905163f7434ea960e01b81526001600160a01b039092169163f7434ea9916107fb916004016125df565b60206040518083038186803b15801561081357600080fd5b505afa158015610827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061084b9190810190611df8565b6101a083015250919050565b61085f611747565b604051634aac84e560e01b815283906000906001600160a01b03831690634aac84e590610890908790600401612559565b60606040518083038186803b1580156108a857600080fd5b505afa1580156108bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108e09190810190611db5565b925050506108ec611788565b6108f68686610ecf565b90508060200151156109da57600061090c6117f2565b6109146117f2565b83516020015160c0850151604051634ba090d960e11b81526000926001600160a01b038a169263974121b292610958928e9260001991820192910190600401612582565b6101006040518083038186803b15801561097157600080fd5b505afa158015610985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109a99190810190611bef565b6040805160a0810182528a81529415156020860152840192909252606083015260808201529750610a3b9350505050565b6040805160a08101825282815260006020808301829052835160608082018652838252818301889052818601849052848601919091528451808201865283815260019281019290925293810191909152918101919091526080810183905293505b50505092915050565b610a4c611810565b610a54611747565b610a5e8484610857565b604080516102a08101909152848152815151519192509060208201906003811115610a8557fe5b815260200182600001516020015115158152602001826000015160800151151581526020018260000151604001518152602001600081526020018260200151151581526020016000815260200160008152602001826000015160e001516002811115610aed57fe5b8152825160a0908101516020908101516001600160a01b031690830152835101516040909101906002602090810291909101516001600160a01b03908116835284516101000151169082015282516101200151604082015260600160008152602001826060015181526020018260800151815260200182600001516060015181526020018260400151815260200160006002811115610b8857fe5b815282515160209081015191810191909152825101519092508015610c3e5750600181516101000151608084015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e891610be191600401612559565b60206040518083038186803b158015610bf957600080fd5b505afa158015610c0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c319190810190611d97565b6002811115610c3c57fe5b145b15610ec857805161010001516080830151604051631c3db16d60e01b81526001600160a01b0390921691631c3db16d91610c7a91600401612559565b60206040518083038186803b158015610c9257600080fd5b505afa158015610ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610cca9190810190611df8565b6002811115610cd557fe5b826101c001906002811115610ce657fe5b90816002811115610cf357fe5b90525080516101000151608083015160405163021e2d3d60e31b81526001600160a01b03909216916310f169e891610d2d91600401612559565b60206040518083038186803b158015610d4557600080fd5b505afa158015610d59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d7d9190810190611d97565b8261026001906002811115610d8e57fe5b90816002811115610d9b57fe5b90525080516101000151608083015160405163afe15cfb60e01b81526001600160a01b039092169163afe15cfb91610dd591600401612559565b604080518083038186803b158015610dec57600080fd5b505afa158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e249190810190611e16565b6101008085019190915260e08401919091528151015160808301516101a084015160405163791f8b7360e11b81526001600160a01b039093169263f23f16e692610e72929091600401612642565b60206040518083038186803b158015610e8a57600080fd5b505afa158015610e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ec29190810190611df8565b60a08301525b5092915050565b610ed7611788565b82610ee06118b5565b610eea85856111e5565b9050600080600080610efa6117f2565b600080600060608a6001600160a01b031663bfbcff1a8e60018d60200151036040518363ffffffff1660e01b8152600401610f36929190612567565b60006040518083038186803b158015610f4e57600080fd5b505afa158015610f62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f8a9190810190611c51565b509850985098509850985098509850985098506040518061014001604052808b81526020018a151581526020018981526020018881526020018715158152602001868152602001858152602001846002811115610fe357fe5b81526001600160a01b0390931660208401526040909201529c9b505050505050505050505050565b6060826110166118b5565b61102085856111e5565b9050806020015160405190808252806020026020018201604052801561106057816020015b61104d6118c7565b8152602001906001900390816110455790505b50925060005b8160200151811015610a3b576000806000806110806117f2565b6000606060008a6001600160a01b031663bfbcff1a8e8b6040518363ffffffff1660e01b81526004016110b4929190612567565b60006040518083038186803b1580156110cc57600080fd5b505afa1580156110e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111089190810190611c51565b99509950995050509750975097509750975060405180610120016040528089151581526020018881526020018781526020018615158152602001856001600281111561115057fe5b6003811061115a57fe5b60200201516001600160a01b031681526020018560028081111561117a57fe5b6003811061118457fe5b60200201516001600160a01b03168152602001846001600160a01b03168152602001838152602001828152508c60018b8d602001510303815181106111c557fe5b602002602001018190525050505050505050508080600101915050611066565b6111ed6118b5565b604051634aac84e560e01b8152839060009081906001600160a01b03841690634aac84e590611220908890600401612559565b60606040518083038186803b15801561123857600080fd5b505afa15801561124c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112709190810190611db5565b5091509150604051806040016040528083600381111561128c57fe5b81526020019190915295945050505050565b6000836112a9611912565b5060408051808201909152600080825260208201526112c6611912565b50604080518082018252600080825260208201529051634aac84e560e01b81526001600160a01b03841690634aac84e590611305908990600401612559565b60606040518083038186803b15801561131d57600080fd5b505afa158015611331573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113559190810190611db5565b508352505b8151815110156116bc578051604051635fde7f8d60e11b815260009182916001600160a01b0387169163bfbcff1a91611397918c91600401612567565b60006040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113eb9190810190611c51565b509497509195509350899250600191506114029050565b6020020191909152925090508061141a5750506116b0565b6020808501519084015110156116a6576114326117f2565b61143a6117f2565b60006001600160a01b03881663974121b28c8884602002015189600160200201516040518463ffffffff1660e01b815260040161147993929190612582565b6101006040518083038186803b15801561149257600080fd5b505afa1580156114a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114ca9190810190611bef565b935093509350506114d96117f2565b6001600160a01b0389166352bc0e608d89600060200201518a600160200201518f6040518563ffffffff1660e01b815260040161151994939291906125aa565b60606040518083038186803b15801561153157600080fd5b505afa158015611545573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115699190810190611bd1565b6020840151909150158061157f57506040830151155b156115995760408101516020820151019990990198611685565b60008660028111156115a757fe5b14156116135760208401516115bd5760006115da565b6020808501516040860151918301519101908302816115d857fe5b045b60408501519a01996115ed57600061160a565b60208401516040808601519083015191019083028161160857fe5b045b8a019950611685565b60008487600281111561162257fe5b6003811061162c57fe5b60200201511161163d576000611680565b8386600281111561164a57fe5b6003811061165457fe5b6020020151828288600281111561166757fe5b6003811061167157fe5b6020020151028161167e57fe5b045b8a0199505b505050508260016002811061169657fe5b602002018051600101905261141a565b5050600060208201525b8051600101815261135a565b5050509392505050565b604051806101c0016040528060006001600160a01b0316815260200160006001600160a01b031681526020016060815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060a0016040528061175a611788565b81526000602082015260400161176e6117f2565b815260200161177b6117f2565b8152602001600081525090565b60405180610140016040528061179c6118b5565b81526000602082018190526040820181905260608201819052608082015260a0016117c56117f2565b815260200160008152602001600060028111156117de57fe5b815260006020820152606060409091015290565b60405180606001604052806003906020820280388339509192915050565b604080516102a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052906101208201908152600060208201819052604082018190526060808301829052608083015260a082015260c00161188e6117f2565b815260200160008152602001600081526020016118a96117f2565b8152602001600061177b565b6040805180820190915280600061177b565b604080516101208101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e082015261010081019190915290565b60405180604001604052806002906020820280388339509192915050565b803561193b8161278e565b92915050565b805161193b8161278e565b600082601f83011261195d57600080fd5b600361197061196b82612689565b612662565b9150818385602084028201111561198657600080fd5b60005b838110156119b2578161199c8882611941565b8452506020928301929190910190600101611989565b5050505092915050565b600082601f8301126119cd57600080fd5b60036119db61196b82612689565b915081838560208402820111156119f157600080fd5b60005b838110156119b25781611a078882611a7e565b84525060209283019291909101906001016119f4565b600082601f830112611a2e57600080fd5b6003611a3c61196b82612689565b91508183856020840282011115611a5257600080fd5b60005b838110156119b25781611a688882611afb565b8452506020928301929190910190600101611a55565b805161193b816127a2565b803561193b816127ab565b600082601f830112611aa557600080fd5b8151611ab361196b826126a7565b91508082526020830160208301858383011115611acf57600080fd5b610a3b838284612741565b805161193b816127b4565b805161193b816127bd565b805161193b816127ca565b805161193b816127ab565b600060208284031215611b1857600080fd5b6000611b248484611930565b949350505050565b600060208284031215611b3e57600080fd5b6000611b248484611941565b60008060408385031215611b5d57600080fd5b6000611b698585611930565b9250506020611b7a85828601611a89565b9150509250929050565b600080600060608486031215611b9957600080fd5b6000611ba58686611930565b9350506020611bb686828701611a89565b9250506040611bc786828701611930565b9150509250925092565b600060608284031215611be357600080fd5b6000611b248484611a1d565b6000806000806101008587031215611c0657600080fd5b6000611c128787611a7e565b9450506020611c2387828801611a1d565b9350506080611c34878288016119bc565b92505060e0611c4587828801611afb565b91505092959194509250565b6000806000806000806000806000806101808b8d031215611c7157600080fd5b6000611c7d8d8d611a7e565b9a50506020611c8e8d828e01611afb565b9950506040611c9f8d828e01611afb565b9850506060611cb08d828e01611a7e565b9750506080611cc18d828e0161194c565b96505060e0611cd28d828e01611afb565b955050610100611ce48d828e01611ae5565b945050610120611cf68d828e01611ada565b9350506101408b015167ffffffffffffffff811115611d1457600080fd5b611d208d828e01611a94565b925050610160611d328d828e01611afb565b9150509295989b9194979a5092959850565b600060208284031215611d5657600080fd5b815167ffffffffffffffff811115611d6d57600080fd5b611b2484828501611a94565b600060208284031215611d8b57600080fd5b6000611b248484611ada565b600060208284031215611da957600080fd5b6000611b248484611ae5565b600080600060608486031215611dca57600080fd5b6000611dd68686611af0565b9350506020611de786828701611afb565b9250506040611bc786828701611afb565b600060208284031215611e0a57600080fd5b6000611b248484611afb565b60008060408385031215611e2957600080fd5b6000611e358585611afb565b9250506020611b7a85828601611afb565b6000611e528383611e85565b505060200190565b6000611e528383611fee565b6000611e7283836121a4565b9392505050565b6000611e528383611ff7565b611e8e816126f0565b82525050565b611e9d816126d8565b611ea781846126e2565b9250611eb2826126cf565b8060005b83811015611ee0578151611eca8782611e46565b9650611ed5836126d2565b925050600101611eb6565b505050505050565b611ef1816126d8565b611efb81846126e2565b9250611f06826126cf565b8060005b83811015611ee0578151611f1e8782611e5a565b9650611f29836126d2565b925050600101611f0a565b6000611f3f826126de565b611f4981856126e7565b935083602082028501611f5b856126d2565b8060005b85811015611f955784840389528151611f788582611e66565b9450611f83836126d2565b60209a909a0199925050600101611f5f565b5091979650505050505050565b611fab816126d8565b611fb581846126e2565b9250611fc0826126cf565b8060005b83811015611ee0578151611fd88782611e79565b9650611fe3836126d2565b925050600101611fc4565b611e8e816126fb565b611e8e816126cf565b600061200b826126de565b61201581856126e7565b9350612025818560208601612741565b61202e8161276d565b9093019392505050565b611e8e81612700565b611e8e8161272b565b611e8e81612736565b80516000906101c08401906120688582611e85565b50602083015161207b6020860182611e85565b50604083015184820360408601526120938282612000565b91505060608301516120a86060860182611ff7565b5060808301516120bb6080860182611ff7565b5060a08301516120ce60a0860182611ff7565b5060c08301516120e160c0860182611ff7565b5060e08301516120f460e0860182611ff7565b50610100830151612109610100860182611ff7565b5061012083015161211e610120860182611ff7565b50610140830151612133610140860182611ff7565b50610160830151612148610160860182611ff7565b5061018083015161215d610180860182611ff7565b506101a08301516121726101a0860182611ff7565b509392505050565b8051604083019061218b848261204a565b50602082015161219e6020850182611ff7565b50505050565b80516000906101208401906121b98582611fee565b5060208301516121cc6020860182611ff7565b5060408301516121df6040860182611ff7565b5060608301516121f26060860182611fee565b5060808301516122056080860182611e85565b5060a083015161221860a0860182611e85565b5060c083015161222b60c0860182611e85565b5060e083015184820360e08601526122438282612000565b915050610100830151612172610100860182611ff7565b805160009061032084019061226f8582611ff7565b506020830151612282602086018261204a565b5060408301516122956040860182611fee565b5060608301516122a86060860182611fee565b5060808301516122bb6080860182611ff7565b5060a08301516122ce60a0860182611ff7565b5060c08301516122e160c0860182611fee565b5060e08301516122f460e0860182611ff7565b50610100830151612309610100860182611ff7565b5061012083015161231e610120860182612041565b50610140830151612333610140860182611e85565b50610160830151612348610160860182611e85565b5061018083015161235d610180860182611e85565b506101a08301518482036101a08601526123778282612000565b9150506101c083015161238e6101c0860182612041565b506101e08301516123a36101e0860182611ee8565b506102008301516123b8610240860182611ff7565b506102208301516123cd610260860182611ff7565b506102408301516123e2610280860182611fa2565b506102608301516123f76102e0860182612041565b50610280830151612172610300860182611ff7565b80516000906101a0840190612421858261217a565b5060208301516124346040860182611fee565b5060408301516124476060860182611ff7565b50606083015161245a6080860182611ff7565b50608083015161246d60a0860182611fee565b5060a083015161248060c0860182611e94565b5060c0830151612494610120860182611ff7565b5060e08301516124a8610140860182612041565b506101008301516124bd610160860182612038565b506101208301518482036101808601526124d78282612000565b95945050505050565b8051610120808452600091908401906124f9828261240c565b915050602083015161250e6020860182611fee565b5060408301516125216040860182611fa2565b50606083015161253460a0860182611ee8565b506080830151612172610100860182611ff7565b60208082528101611e728184611f34565b6020810161193b8284611ff7565b604081016125758285611ff7565b611e726020830184611ff7565b606081016125908286611ff7565b61259d6020830185611ff7565b611b246040830184611ff7565b608081016125b88287611ff7565b6125c56020830186611ff7565b6125d26040830185611ff7565b6124d76060830184611e85565b60208082528101611e728184612000565b60208082528101611e728184612053565b6040810161193b828461217a565b60208082528101611e72818461225a565b60208082528101611e72818461240c565b60208082528101611e7281846124e0565b604081016126508285611ff7565b8181036020830152611b248184612000565b60405181810167ffffffffffffffff8111828210171561268157600080fd5b604052919050565b600067ffffffffffffffff8211156126a057600080fd5b5060200290565b600067ffffffffffffffff8211156126be57600080fd5b506020601f91909101601f19160190565b90565b60200190565b50600390565b5190565b919050565b90815260200190565b600061193b8261271f565b151590565b600061193b826126f0565b806126e281612777565b806126e281612784565b6001600160a01b031690565b600061193b8261270b565b600061193b82612715565b60005b8381101561275c578181015183820152602001612744565b8381111561219e5750506000910152565b601f01601f191690565b6003811061278157fe5b50565b6004811061278157fe5b612797816126f0565b811461278157600080fd5b612797816126fb565b612797816126cf565b61279781612700565b6003811061278157600080fd5b6004811061278157600080fdfea365627a7a723158203d29bb5cb92cddf540f38531efdefadb5899e513a4026f6a49cd2e87935a146f6c6578706572696d656e74616cf564736f6c63430005110040", + "devdoc": { + "methods": { + "availableRewards(address,bytes32,address)": { + "details": "Return the withdrawable rewards for a contributor.", + "params": { + "_address": "The address of the LightGeneralized TCR to query.", + "_contributor": "The address of the contributor.", + "_itemID": "The ID of the item to query." + }, + "return": "The amount withdrawable per round per request." + }, + "fetchArbitrable(address)": { + "details": "Fetch arbitrable TCR data in a single call.", + "params": { + "_address": "The address of the LightGeneralized TCR to query." + }, + "return": "The latest data on an arbitrable TCR contract." + }, + "getItem(address,bytes32)": { + "details": "Fetch the latest data on an item in a single call.", + "params": { + "_address": "The address of the LightGeneralized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The item data." + }, + "getItemData(address,bytes32)": { + "details": "Fetch data of the an item and return a struct.", + "params": { + "_address": "The address of the LightGeneralized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The round data." + }, + "getItemRequests(address,bytes32)": { + "details": "Fetch all requests for an item.", + "params": { + "_address": "The address of the LightGeneralized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The items requests." + }, + "getLatestRequestData(address,bytes32)": { + "details": "Fetch the latest request of item.", + "params": { + "_address": "The address of the LightGeneralized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The round data." + }, + "getLatestRoundRequestData(address,bytes32)": { + "details": "Fetch the latest round of the latest request of an item.", + "params": { + "_address": "The address of the LightGeneralized TCR to query.", + "_itemID": "The ID of the item to query." + }, + "return": "The round data." + } + }, + "title": "LightGeneralizedTCRView A view contract to fetch, batch, parse and return GTCR contract data efficiently. This contract includes functions that can halt execution due to out-of-gas exceptions. Because of this it should never be relied upon by other contracts." + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/sepolia/RelayMock.json b/deployments/sepolia/RelayMock.json new file mode 100644 index 0000000..7bbfbad --- /dev/null +++ b/deployments/sepolia/RelayMock.json @@ -0,0 +1,76 @@ +{ + "address": "0x122d6b4197531bf4e9314fd00259b1dc1db7954d", + "abi": [ + { + "constant": false, + "inputs": [ + { + "internalType": "contract LightGeneralizedTCR", + "name": "_gtcr", + "type": "address" + }, + { + "internalType": "string", + "name": "_itemData", + "type": "string" + } + ], + "name": "add", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract LightGeneralizedTCR", + "name": "_gtcr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_itemID", + "type": "bytes32" + } + ], + "name": "remove", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xaf4a307819dead4bae7683b783125994ffa73f56e9cb196dd963e340ade7e265", + "receipt": { + "to": null, + "from": "0x0effc4a996045aff0489774051f94f42f2d6dfc9", + "contractAddress": "0x122d6b4197531bf4e9314fd00259b1dc1db7954d", + "transactionIndex": "0x11", + "gasUsed": "0x28de9", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x85b5805d49fedc7f4a851ac8a827f7062f4f2207d36801a16a3cb793e064df88", + "transactionHash": "0x57dccefa3fccfeeb69b1ab407628b3b32e2429f8317ef4ea9cfc70d609aa5124", + "logs": [], + "blockNumber": "0x3dc5e8", + "cumulativeGasUsed": "0x30e92a", + "status": "0x1" + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8e68fa05bce2d1098c0738035c7962ed", + "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"contract LightGeneralizedTCR\",\"name\":\"_gtcr\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_itemData\",\"type\":\"string\"}],\"name\":\"add\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract LightGeneralizedTCR\",\"name\":\"_gtcr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_itemID\",\"type\":\"bytes32\"}],\"name\":\"remove\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/test-purposes/RelayMock.sol\":\"RelayMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@kleros/erc-792/contracts/IArbitrable.sol\":{\"content\":\"/**\\n * @title IArbitrable\\n * @author Enrique Piqueras - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/** @title IArbitrable\\n * Arbitrable interface.\\n * When developing arbitrable contracts, we need to:\\n * -Define the action taken when a ruling is received by the contract.\\n * -Allow dispute creation. For this a function must call arbitrator.createDispute.value(_fee)(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n\\n /** @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _ruling);\\n\\n /** @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint _disputeID, uint _ruling) external;\\n}\\n\",\"keccak256\":\"0x68e90a06a982dfa968f3aa76ac519126b090707a07e6e984a69ccbc06b6c7cc0\"},\"@kleros/erc-792/contracts/IArbitrator.sol\":{\"content\":\"/**\\n * @title Arbitrator\\n * @author Cl\\u00e9ment Lesaege - \\n */\\n\\npragma solidity ^0.5;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/** @title Arbitrator\\n * Arbitrator abstract contract.\\n * When developing arbitrator contracts we need to:\\n * -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, may nbDisputes).\\n * -Define the functions for cost display (arbitrationCost and appealCost).\\n * -Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n\\n enum DisputeStatus {Waiting, Appealable, Solved}\\n\\n\\n /** @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when a dispute can be appealed.\\n * @param _disputeID ID of the dispute.\\n */\\n event AppealPossible(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev To be emitted when the current ruling is appealed.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event AppealDecision(uint indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /** @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must be paid at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint _choices, bytes calldata _extraData) external payable returns(uint disputeID);\\n\\n /** @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.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Appeal a ruling. Note that it has to be called before the arbitrator contract calls rule.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give extra info on the appeal.\\n */\\n function appeal(uint _disputeID, bytes calldata _extraData) external payable;\\n\\n /** @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.\\n * @param _disputeID ID of the dispute to be appealed.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Amount to be paid.\\n */\\n function appealCost(uint _disputeID, bytes calldata _extraData) external view returns(uint cost);\\n\\n /** @dev Compute the start and end of the dispute's current or next appeal period, if possible. If not known or appeal is impossible: should return (0, 0).\\n * @param _disputeID ID of the dispute.\\n * @return The start and end of the period.\\n */\\n function appealPeriod(uint _disputeID) external view returns(uint start, uint end);\\n\\n /** @dev Return the status of a dispute.\\n * @param _disputeID ID of the dispute to rule.\\n * @return status The status of the dispute.\\n */\\n function disputeStatus(uint _disputeID) external view returns(DisputeStatus status);\\n\\n /** @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal.\\n * @param _disputeID ID of the dispute.\\n * @return ruling The ruling which has been given or the one which will be given if there is no appeal.\\n */\\n function currentRuling(uint _disputeID) external view returns(uint ruling);\\n\\n}\\n\",\"keccak256\":\"0x98e3799e61a5e1cc8c01426a56927ec23a8ff8f807751d5c5cc111da683b3f50\"},\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\":{\"content\":\"pragma solidity ^0.5;\\n\\nimport \\\"../IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n\\n /** @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence A link to the meta-evidence JSON.\\n */\\n event MetaEvidence(uint indexed _metaEvidenceID, string _evidence);\\n\\n /** @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence A URI to the evidence JSON file whose name should be its keccak256 hash followed by .json.\\n */\\n event Evidence(IArbitrator indexed _arbitrator, uint indexed _evidenceGroupID, address indexed _party, string _evidence);\\n\\n /** @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(IArbitrator indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID, uint _evidenceGroupID);\\n\\n}\\n\",\"keccak256\":\"0x15893e6624ef81491a1b25b915fd9d68d0ce20c6d7aa6ec4b58411717a23a5fe\"},\"contracts/LightGeneralizedTCR.sol\":{\"content\":\"/**\\n * @authors: [@unknownunknown1*, @mtsalenc*, @hbarcelos*]\\n * @reviewers: [@fnanni-0*, @greenlucid, @shalzz]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity 0.5.17;\\n\\nimport {IArbitrable, IArbitrator} from \\\"@kleros/erc-792/contracts/IArbitrator.sol\\\";\\nimport {IEvidence} from \\\"@kleros/erc-792/contracts/erc-1497/IEvidence.sol\\\";\\nimport {CappedMath} from \\\"./utils/CappedMath.sol\\\";\\nimport {CappedMath128} from \\\"./utils/CappedMath128.sol\\\";\\n\\n/* solium-disable max-len */\\n/* solium-disable security/no-block-members */\\n/* solium-disable security/no-send */\\n// It is the user responsibility to accept ETH.\\n\\n/**\\n * @title LightGeneralizedTCR\\n * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding.\\n * The difference between LightGeneralizedTCR and GeneralizedTCR is that instead of storing item data in storage and event logs, LightCurate only stores the URI of item in the logs. This makes it considerably cheaper to use and allows more flexibility with the item columns.\\n */\\ncontract LightGeneralizedTCR is IArbitrable, IEvidence {\\n using CappedMath for uint256;\\n using CappedMath128 for uint128;\\n\\n /* Enums */\\n\\n enum Status {\\n Absent, // The item is not in the registry.\\n Registered, // The item is in the registry.\\n RegistrationRequested, // The item has a request to be added to the registry.\\n ClearingRequested // The item has a request to be removed from the registry.\\n }\\n\\n enum Party {\\n None, // Party per default when there is no challenger or requester. Also used for unconclusive ruling.\\n Requester, // Party that made the request to change a status.\\n Challenger // Party that challenges the request to change a status.\\n }\\n\\n enum RequestType {\\n Registration, // Identifies a request to register an item to the registry.\\n Clearing // Identifies a request to remove an item from the registry.\\n }\\n\\n enum DisputeStatus {\\n None, // No dispute was created.\\n AwaitingRuling, // Dispute was created, but the final ruling was not given yet.\\n Resolved // Dispute was ruled.\\n }\\n\\n /* Structs */\\n\\n struct Item {\\n Status status; // The current status of the item.\\n uint128 sumDeposit; // The total deposit made by the requester and the challenger (if any).\\n uint120 requestCount; // The number of requests.\\n mapping(uint256 => Request) requests; // List of status change requests made for the item in the form requests[requestID].\\n }\\n\\n // Arrays with 3 elements map with the Party enum for better readability:\\n // - 0: is unused, matches `Party.None`.\\n // - 1: for `Party.Requester`.\\n // - 2: for `Party.Challenger`.\\n struct Request {\\n RequestType requestType;\\n uint64 submissionTime; // Time when the request was made. Used to track when the challenge period ends.\\n uint24 arbitrationParamsIndex; // The index for the arbitration params for the request.\\n address payable requester; // Address of the requester.\\n // Pack the requester together with the other parameters, as they are written in the same request.\\n address payable challenger; // Address of the challenger, if any.\\n }\\n\\n struct DisputeData {\\n uint256 disputeID; // The ID of the dispute on the arbitrator.\\n DisputeStatus status; // The current status of the dispute.\\n Party ruling; // The ruling given to a dispute. Only set after it has been resolved.\\n uint240 roundCount; // The number of rounds.\\n mapping(uint256 => Round) rounds; // Data of the different dispute rounds. rounds[roundId].\\n }\\n\\n struct Round {\\n Party sideFunded; // Stores the side that successfully paid the appeal fees in the latest round. Note that if both sides have paid a new round is created.\\n uint256 feeRewards; // Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n uint256[3] amountPaid; // Tracks the sum paid for each Party in this round.\\n mapping(address => uint256[3]) contributions; // Maps contributors to their contributions for each side in the form contributions[address][party].\\n }\\n\\n struct ArbitrationParams {\\n IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.\\n bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.\\n }\\n\\n /* Constants */\\n\\n uint256 public constant RULING_OPTIONS = 2; // The amount of non 0 choices the arbitrator can give.\\n uint256 private constant RESERVED_ROUND_ID = 0; // For compatibility with GeneralizedTCR consider the request/challenge cycle the first round (index 0).\\n\\n /* Storage */\\n\\n bool private initialized;\\n\\n address public relayerContract; // The contract that is used to add or remove items directly to speed up the interchain communication.\\n address public governor; // The address that can make changes to the parameters of the contract.\\n\\n uint256 public submissionBaseDeposit; // The base deposit to submit an item.\\n uint256 public removalBaseDeposit; // The base deposit to remove an item.\\n uint256 public submissionChallengeBaseDeposit; // The base deposit to challenge a submission.\\n uint256 public removalChallengeBaseDeposit; // The base deposit to challenge a removal request.\\n uint256 public challengePeriodDuration; // The time after which a request becomes executable if not challenged.\\n\\n // Multipliers are in basis points.\\n uint256 public winnerStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that won the previous round.\\n uint256 public loserStakeMultiplier; // Multiplier for calculating the fee stake paid by the party that lost the previous round.\\n uint256 public sharedStakeMultiplier; // Multiplier for calculating the fee stake that must be paid in the case where arbitrator refused to arbitrate.\\n uint256 public constant MULTIPLIER_DIVISOR = 10000; // Divisor parameter for multipliers.\\n\\n mapping(bytes32 => Item) public items; // Maps the item ID to its data in the form items[_itemID].\\n mapping(address => mapping(uint256 => bytes32)) public arbitratorDisputeIDToItemID; // Maps a dispute ID to the ID of the item with the disputed request in the form arbitratorDisputeIDToItemID[arbitrator][disputeID].\\n mapping(bytes32 => mapping(uint256 => DisputeData)) public requestsDisputeData; // Maps an item and a request to the data of the dispute related to them. requestsDisputeData[itemID][requestIndex]\\n ArbitrationParams[] public arbitrationParamsChanges;\\n\\n /* Modifiers */\\n\\n modifier onlyGovernor() {\\n require(msg.sender == governor, \\\"The caller must be the governor.\\\");\\n _;\\n }\\n\\n modifier onlyRelayer() {\\n require(msg.sender == relayerContract, \\\"The caller must be the relay.\\\");\\n _;\\n }\\n\\n /* Events */\\n\\n /**\\n * @dev Emitted when a party makes a request, raises a dispute or when a request is resolved.\\n * @param _itemID The ID of the affected item.\\n * @param _updatedDirectly Whether this was emitted in either `addItemDirectly` or `removeItemDirectly`. This is used in the subgraph.\\n */\\n event ItemStatusChange(bytes32 indexed _itemID, bool _updatedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits an item for the first time.\\n * @param _itemID The ID of the new item.\\n * @param _data The item data URI.\\n * @param _addedDirectly Whether the item was added via `addItemDirectly`.\\n */\\n event NewItem(bytes32 indexed _itemID, string _data, bool _addedDirectly);\\n\\n /**\\n * @dev Emitted when someone submits a request.\\n * @param _itemID The ID of the affected item.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n */\\n event RequestSubmitted(bytes32 indexed _itemID, uint256 _evidenceGroupID);\\n\\n /**\\n * @dev Emitted when a party contributes to an appeal. The roundID assumes the initial request and challenge deposits are the first round. This is done so indexers can know more information about the contribution without using call handlers.\\n * @param _itemID The ID of the item.\\n * @param _requestID The index of the request that received the contribution.\\n * @param _roundID The index of the round that received the contribution.\\n * @param _contributor The address making the contribution.\\n * @param _contribution How much of the contribution was accepted.\\n * @param _side The party receiving the contribution.\\n */\\n event Contribution(\\n bytes32 indexed _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address indexed _contributor,\\n uint256 _contribution,\\n Party _side\\n );\\n\\n /**\\n * @dev Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one.\\n * @param _connectedTCR The address of the connected TCR.\\n */\\n event ConnectedTCRSet(address indexed _connectedTCR);\\n\\n /**\\n * @dev Emitted when someone withdraws more than 0 rewards.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _request The request from which to withdraw.\\n * @param _round The round from which to withdraw.\\n * @param _reward The amount withdrawn.\\n */\\n event RewardWithdrawn(\\n address indexed _beneficiary,\\n bytes32 indexed _itemID,\\n uint256 _request,\\n uint256 _round,\\n uint256 _reward\\n );\\n\\n /**\\n * @dev Initialize the arbitrable curated registry.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _connectedTCR The address of the TCR that stores related TCR addresses. This parameter can be left empty.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n * @param _governor The trusted governor of this contract.\\n * @param _baseDeposits The base deposits for requests/challenges as follows:\\n * - The base deposit to submit an item.\\n * - The base deposit to remove an item.\\n * - The base deposit to challenge a submission.\\n * - The base deposit to challenge a removal request.\\n * @param _challengePeriodDuration The time in seconds parties have to challenge a request.\\n * @param _stakeMultipliers Multipliers of the arbitration cost in basis points (see MULTIPLIER_DIVISOR) as follows:\\n * - The multiplier applied to each party's fee stake for a round when there is no winner/loser in the previous round (e.g. when the arbitrator refused to arbitrate).\\n * - The multiplier applied to the winner's fee stake for the subsequent round.\\n * - The multiplier applied to the loser's fee stake for the subsequent round.\\n * @param _relayerContract The address of the relay contract to add/remove items directly.\\n */\\n function initialize(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n address _connectedTCR,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence,\\n address _governor,\\n uint256[4] calldata _baseDeposits,\\n uint256 _challengePeriodDuration,\\n uint256[3] calldata _stakeMultipliers,\\n address _relayerContract\\n ) external {\\n require(!initialized, \\\"Already initialized.\\\");\\n\\n emit ConnectedTCRSet(_connectedTCR);\\n\\n governor = _governor;\\n submissionBaseDeposit = _baseDeposits[0];\\n removalBaseDeposit = _baseDeposits[1];\\n submissionChallengeBaseDeposit = _baseDeposits[2];\\n removalChallengeBaseDeposit = _baseDeposits[3];\\n challengePeriodDuration = _challengePeriodDuration;\\n sharedStakeMultiplier = _stakeMultipliers[0];\\n winnerStakeMultiplier = _stakeMultipliers[1];\\n loserStakeMultiplier = _stakeMultipliers[2];\\n relayerContract = _relayerContract;\\n\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n\\n initialized = true;\\n }\\n\\n /* External and Public */\\n\\n // ************************ //\\n // * Requests * //\\n // ************************ //\\n\\n /**\\n * @dev Directly add an item to the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _item The URI to the item data.\\n */\\n function addItemDirectly(string calldata _item) external onlyRelayer {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item is added directly once, the next time it is added it will emit this event again.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, true);\\n }\\n\\n item.status = Status.Registered;\\n\\n emit ItemStatusChange(itemID, true);\\n }\\n\\n /**\\n * @dev Directly remove an item from the list bypassing request-challenge. Can only be used by the relay contract.\\n * @param _itemID The ID of the item to remove.\\n */\\n function removeItemDirectly(bytes32 _itemID) external onlyRelayer {\\n Item storage item = items[_itemID];\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n item.status = Status.Absent;\\n\\n emit ItemStatusChange(_itemID, true);\\n }\\n\\n /**\\n * @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _item The URI to the item data.\\n */\\n function addItem(string calldata _item) external payable {\\n bytes32 itemID = keccak256(abi.encodePacked(_item));\\n Item storage item = items[itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Absent, \\\"Item must be absent to be added.\\\");\\n\\n // Note that if the item was added previously using `addItemDirectly`, the event will be emitted again here.\\n if (item.requestCount == 0) {\\n emit NewItem(itemID, _item, false);\\n }\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(submissionBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.RegistrationRequested;\\n\\n request.requestType = RequestType.Registration;\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n\\n emit RequestSubmitted(itemID, getEvidenceGroupID(itemID, item.requestCount - 1));\\n\\n emit Contribution(itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Submit a request to remove an item from the list. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item to remove.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function removeItem(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n\\n // Extremely unlikely, but we check that for correctness sake.\\n require(item.requestCount < uint120(-1), \\\"Too many requests for item.\\\");\\n require(item.status == Status.Registered, \\\"Item must be registered to be removed.\\\");\\n\\n Request storage request = item.requests[item.requestCount++];\\n uint256 arbitrationParamsIndex = arbitrationParamsChanges.length - 1;\\n IArbitrator arbitrator = arbitrationParamsChanges[arbitrationParamsIndex].arbitrator;\\n bytes storage arbitratorExtraData = arbitrationParamsChanges[arbitrationParamsIndex].arbitratorExtraData;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n uint256 totalCost = arbitrationCost.addCap(removalBaseDeposit);\\n require(msg.value >= totalCost, \\\"You must fully fund the request.\\\");\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = uint128(totalCost);\\n item.status = Status.ClearingRequested;\\n\\n request.submissionTime = uint64(block.timestamp);\\n request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);\\n request.requester = msg.sender;\\n request.requestType = RequestType.Clearing;\\n\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, item.requestCount - 1);\\n\\n emit RequestSubmitted(_itemID, evidenceGroupID);\\n\\n emit Contribution(_itemID, item.requestCount - 1, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Requester);\\n\\n // Emit evidence if it was provided.\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @dev Challenges the request of the item. Accepts enough ETH to cover the deposit, reimburses the rest.\\n * @param _itemID The ID of the item which request to challenge.\\n * @param _evidence A link to an evidence using its URI. Ignored if not provided.\\n */\\n function challengeRequest(bytes32 _itemID, string calldata _evidence) external payable {\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime <= challengePeriodDuration,\\n \\\"Challenges must occur during the challenge period.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not have already been disputed.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitrationParams.arbitratorExtraData);\\n uint256 totalCost;\\n {\\n uint256 challengerBaseDeposit = item.status == Status.RegistrationRequested\\n ? submissionChallengeBaseDeposit\\n : removalChallengeBaseDeposit;\\n totalCost = arbitrationCost.addCap(challengerBaseDeposit);\\n }\\n require(msg.value >= totalCost, \\\"You must fully fund the challenge.\\\");\\n\\n emit Contribution(_itemID, lastRequestIndex, RESERVED_ROUND_ID, msg.sender, totalCost, Party.Challenger);\\n\\n // Casting is safe here because this line will never be executed in case\\n // totalCost > type(uint128).max, since it would be an unpayable value.\\n item.sumDeposit = item.sumDeposit.addCap(uint128(totalCost)).subCap(uint128(arbitrationCost));\\n\\n request.challenger = msg.sender;\\n\\n // Raise a dispute.\\n disputeData.disputeID = arbitrator.createDispute.value(arbitrationCost)(\\n RULING_OPTIONS,\\n arbitrationParams.arbitratorExtraData\\n );\\n disputeData.status = DisputeStatus.AwaitingRuling;\\n // For compatibility with GeneralizedTCR consider the request/challenge cycle\\n // the first round (index 0), so we need to make the next round index 1.\\n disputeData.roundCount = 2;\\n\\n arbitratorDisputeIDToItemID[address(arbitrator)][disputeData.disputeID] = _itemID;\\n\\n uint256 metaEvidenceID = 2 * request.arbitrationParamsIndex + uint256(request.requestType);\\n uint256 evidenceGroupID = getEvidenceGroupID(_itemID, lastRequestIndex);\\n emit Dispute(arbitrator, disputeData.disputeID, metaEvidenceID, evidenceGroupID);\\n\\n if (bytes(_evidence).length > 0) {\\n emit Evidence(arbitrator, evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n if (msg.value > totalCost) {\\n msg.sender.send(msg.value - totalCost);\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _itemID The ID of the item which request to fund.\\n * @param _side The recipient of the contribution.\\n */\\n function fundAppeal(bytes32 _itemID, Party _side) external payable {\\n require(_side > Party.None, \\\"Invalid side.\\\");\\n\\n Item storage item = items[_itemID];\\n require(item.status > Status.Registered, \\\"The item must have a pending request.\\\");\\n\\n uint256 lastRequestIndex = item.requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(\\n disputeData.status == DisputeStatus.AwaitingRuling,\\n \\\"A dispute must have been raised to fund an appeal.\\\"\\n );\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n IArbitrator arbitrator = arbitrationParams.arbitrator;\\n\\n uint256 lastRoundIndex = disputeData.roundCount - 1;\\n Round storage round = disputeData.rounds[lastRoundIndex];\\n require(round.sideFunded != _side, \\\"Side already fully funded.\\\");\\n\\n uint256 multiplier;\\n {\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = arbitrator.appealPeriod(disputeData.disputeID);\\n require(\\n block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd,\\n \\\"Contributions must be made within the appeal period.\\\"\\n );\\n\\n Party winner = Party(arbitrator.currentRuling(disputeData.disputeID));\\n if (winner == Party.None) {\\n multiplier = sharedStakeMultiplier;\\n } else if (_side == winner) {\\n multiplier = winnerStakeMultiplier;\\n } else {\\n multiplier = loserStakeMultiplier;\\n require(\\n block.timestamp < (appealPeriodStart + appealPeriodEnd) / 2,\\n \\\"The loser must contribute during the first half of the appeal period.\\\"\\n );\\n }\\n }\\n\\n uint256 appealCost = arbitrator.appealCost(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n uint256 totalCost = appealCost.addCap(appealCost.mulCap(multiplier) / MULTIPLIER_DIVISOR);\\n contribute(_itemID, lastRequestIndex, lastRoundIndex, uint256(_side), msg.sender, msg.value, totalCost);\\n\\n if (round.amountPaid[uint256(_side)] >= totalCost) {\\n if (round.sideFunded == Party.None) {\\n round.sideFunded = _side;\\n } else {\\n // Resets the value because both sides are funded.\\n round.sideFunded = Party.None;\\n\\n // Raise appeal if both sides are fully funded.\\n arbitrator.appeal.value(appealCost)(disputeData.disputeID, arbitrationParams.arbitratorExtraData);\\n disputeData.roundCount++;\\n round.feeRewards = round.feeRewards.subCap(appealCost);\\n }\\n }\\n }\\n\\n /**\\n * @dev If a dispute was raised, sends the fee stake rewards and reimbursements proportionally to the contributions made to the winner of a dispute.\\n * @param _beneficiary The address that made contributions to a request.\\n * @param _itemID The ID of the item submission to withdraw from.\\n * @param _requestID The request from which to withdraw from.\\n * @param _roundID The round from which to withdraw from.\\n */\\n function withdrawFeesAndRewards(\\n address payable _beneficiary,\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n ) external {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n require(disputeData.status == DisputeStatus.Resolved, \\\"Request must be resolved.\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n\\n uint256 reward;\\n if (_roundID == disputeData.roundCount - 1) {\\n // Reimburse if not enough fees were raised to appeal the ruling.\\n reward =\\n round.contributions[_beneficiary][uint256(Party.Requester)] +\\n round.contributions[_beneficiary][uint256(Party.Challenger)];\\n } else if (disputeData.ruling == Party.None) {\\n uint256 totalFeesInRound = round.amountPaid[uint256(Party.Challenger)] +\\n round.amountPaid[uint256(Party.Requester)];\\n uint256 claimableFees = round.contributions[_beneficiary][uint256(Party.Challenger)] +\\n round.contributions[_beneficiary][uint256(Party.Requester)];\\n reward = totalFeesInRound > 0 ? (claimableFees * round.feeRewards) / totalFeesInRound : 0;\\n } else {\\n // Reward the winner.\\n reward = round.amountPaid[uint256(disputeData.ruling)] > 0\\n ? (round.contributions[_beneficiary][uint256(disputeData.ruling)] * round.feeRewards) /\\n round.amountPaid[uint256(disputeData.ruling)]\\n : 0;\\n }\\n round.contributions[_beneficiary][uint256(Party.Requester)] = 0;\\n round.contributions[_beneficiary][uint256(Party.Challenger)] = 0;\\n\\n if (reward > 0) {\\n _beneficiary.send(reward);\\n emit RewardWithdrawn(_beneficiary, _itemID, _requestID, _roundID, reward);\\n }\\n }\\n\\n /**\\n * @dev Executes an unchallenged request if the challenge period has passed.\\n * @param _itemID The ID of the item to execute.\\n */\\n function executeRequest(bytes32 _itemID) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = items[_itemID].requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n require(\\n block.timestamp - request.submissionTime > challengePeriodDuration,\\n \\\"Time to challenge the request must pass.\\\"\\n );\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.None, \\\"The request should not be disputed.\\\");\\n\\n if (item.status == Status.RegistrationRequested) {\\n item.status = Status.Registered;\\n } else if (item.status == Status.ClearingRequested) {\\n item.status = Status.Absent;\\n } else {\\n revert(\\\"There must be a request.\\\");\\n }\\n\\n emit ItemStatusChange(_itemID, false);\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (sumDeposit > 0) {\\n // reimburse the requester\\n request.requester.send(sumDeposit);\\n }\\n }\\n\\n /**\\n * @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED.\\n * Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.\\n * @param _disputeID ID of the dispute in the arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refused to arbitrate\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(_ruling <= RULING_OPTIONS, \\\"Invalid ruling option\\\");\\n\\n bytes32 itemID = arbitratorDisputeIDToItemID[msg.sender][_disputeID];\\n Item storage item = items[itemID];\\n uint256 lastRequestIndex = items[itemID].requestCount - 1;\\n Request storage request = item.requests[lastRequestIndex];\\n\\n DisputeData storage disputeData = requestsDisputeData[itemID][lastRequestIndex];\\n require(disputeData.status == DisputeStatus.AwaitingRuling, \\\"The request must not be resolved.\\\");\\n\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n require(address(arbitrationParams.arbitrator) == msg.sender, \\\"Only the arbitrator can give a ruling\\\");\\n\\n uint256 finalRuling;\\n Round storage round = disputeData.rounds[disputeData.roundCount - 1];\\n\\n // If one side paid its fees, the ruling is in its favor.\\n // Note that if the other side had also paid, sideFudned would have been reset\\n // and an appeal would have been created.\\n if (round.sideFunded == Party.Requester) {\\n finalRuling = uint256(Party.Requester);\\n } else if (round.sideFunded == Party.Challenger) {\\n finalRuling = uint256(Party.Challenger);\\n } else {\\n finalRuling = _ruling;\\n }\\n\\n emit Ruling(IArbitrator(msg.sender), _disputeID, finalRuling);\\n\\n Party winner = Party(finalRuling);\\n\\n disputeData.status = DisputeStatus.Resolved;\\n disputeData.ruling = winner;\\n\\n uint256 sumDeposit = item.sumDeposit;\\n item.sumDeposit = 0;\\n\\n if (winner == Party.None) {\\n // If the arbitrator refuse to rule, then the item status should be the same it was before the request.\\n // Regarding item.status this is equivalent to the challenger winning the dispute.\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n // Since nobody has won, then we reimburse both parties equally.\\n // If item.sumDeposit is odd, 1 wei will remain in the contract balance.\\n uint256 halfSumDeposit = sumDeposit / 2;\\n\\n request.requester.send(halfSumDeposit);\\n request.challenger.send(halfSumDeposit);\\n } else if (winner == Party.Requester) {\\n item.status = item.status == Status.RegistrationRequested ? Status.Registered : Status.Absent;\\n\\n request.requester.send(sumDeposit);\\n } else {\\n item.status = item.status == Status.RegistrationRequested ? Status.Absent : Status.Registered;\\n\\n request.challenger.send(sumDeposit);\\n }\\n\\n emit ItemStatusChange(itemID, false);\\n }\\n\\n /**\\n * @dev Submit a reference to evidence. EVENT.\\n * @param _itemID The ID of the item which the evidence is related to.\\n * @param _evidence A link to an evidence using its URI.\\n */\\n function submitEvidence(bytes32 _itemID, string calldata _evidence) external {\\n Item storage item = items[_itemID];\\n uint256 lastRequestIndex = item.requestCount - 1;\\n\\n Request storage request = item.requests[lastRequestIndex];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n emit Evidence(\\n arbitrationParams.arbitrator,\\n getEvidenceGroupID(_itemID, lastRequestIndex),\\n msg.sender,\\n _evidence\\n );\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Change the duration of the challenge period.\\n * @param _challengePeriodDuration The new duration of the challenge period.\\n */\\n function changeChallengePeriodDuration(uint256 _challengePeriodDuration) external onlyGovernor {\\n challengePeriodDuration = _challengePeriodDuration;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to submit an item.\\n * @param _submissionBaseDeposit The new base amount of wei required to submit an item.\\n */\\n function changeSubmissionBaseDeposit(uint256 _submissionBaseDeposit) external onlyGovernor {\\n submissionBaseDeposit = _submissionBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to remove an item.\\n * @param _removalBaseDeposit The new base amount of wei required to remove an item.\\n */\\n function changeRemovalBaseDeposit(uint256 _removalBaseDeposit) external onlyGovernor {\\n removalBaseDeposit = _removalBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a submission.\\n * @param _submissionChallengeBaseDeposit The new base amount of wei required to challenge a submission.\\n */\\n function changeSubmissionChallengeBaseDeposit(uint256 _submissionChallengeBaseDeposit) external onlyGovernor {\\n submissionChallengeBaseDeposit = _submissionChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the base amount required as a deposit to challenge a removal request.\\n * @param _removalChallengeBaseDeposit The new base amount of wei required to challenge a removal request.\\n */\\n function changeRemovalChallengeBaseDeposit(uint256 _removalChallengeBaseDeposit) external onlyGovernor {\\n removalChallengeBaseDeposit = _removalChallengeBaseDeposit;\\n }\\n\\n /**\\n * @dev Change the governor of the curated registry.\\n * @param _governor The address of the new governor.\\n */\\n function changeGovernor(address _governor) external onlyGovernor {\\n governor = _governor;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by parties when there is no winner or loser.\\n * @param _sharedStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeSharedStakeMultiplier(uint256 _sharedStakeMultiplier) external onlyGovernor {\\n sharedStakeMultiplier = _sharedStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the winner of the previous round.\\n * @param _winnerStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeWinnerStakeMultiplier(uint256 _winnerStakeMultiplier) external onlyGovernor {\\n winnerStakeMultiplier = _winnerStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the proportion of arbitration fees that must be paid as fee stake by the party that lost the previous round.\\n * @param _loserStakeMultiplier Multiplier of arbitration fees that must be paid as fee stake. In basis points.\\n */\\n function changeLoserStakeMultiplier(uint256 _loserStakeMultiplier) external onlyGovernor {\\n loserStakeMultiplier = _loserStakeMultiplier;\\n }\\n\\n /**\\n * @dev Change the address of connectedTCR, the Generalized TCR instance that stores addresses of TCRs related to this one.\\n * @param _connectedTCR The address of the connectedTCR contract to use.\\n */\\n function changeConnectedTCR(address _connectedTCR) external onlyGovernor {\\n emit ConnectedTCRSet(_connectedTCR);\\n }\\n\\n /**\\n * @dev Change the address of the relay contract.\\n * @param _relayerContract The new address of the relay contract.\\n */\\n function changeRelayerContract(address _relayerContract) external onlyGovernor {\\n relayerContract = _relayerContract;\\n }\\n\\n /**\\n * @notice Changes the params related to arbitration.\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function changeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes calldata _arbitratorExtraData,\\n string calldata _registrationMetaEvidence,\\n string calldata _clearingMetaEvidence\\n ) external onlyGovernor {\\n _doChangeArbitrationParams(_arbitrator, _arbitratorExtraData, _registrationMetaEvidence, _clearingMetaEvidence);\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Effectively makes all new items use the new set of params.\\n * @param _arbitrator Arbitrator to resolve potential disputes. The arbitrator is trusted to support appeal periods and not reenter.\\n * @param _arbitratorExtraData Extra data for the trusted arbitrator contract.\\n * @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.\\n * @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.\\n */\\n function _doChangeArbitrationParams(\\n IArbitrator _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _registrationMetaEvidence,\\n string memory _clearingMetaEvidence\\n ) internal {\\n emit MetaEvidence(2 * arbitrationParamsChanges.length, _registrationMetaEvidence);\\n emit MetaEvidence(2 * arbitrationParamsChanges.length + 1, _clearingMetaEvidence);\\n\\n arbitrationParamsChanges.push(\\n ArbitrationParams({arbitrator: _arbitrator, arbitratorExtraData: _arbitratorExtraData})\\n );\\n }\\n\\n /**\\n * @notice Make a fee contribution.\\n * @dev It cannot be inlined in fundAppeal because of the stack limit.\\n * @param _itemID The item receiving the contribution.\\n * @param _requestID The request to contribute.\\n * @param _roundID The round to contribute.\\n * @param _side The side for which to contribute.\\n * @param _contributor The contributor.\\n * @param _amount The amount contributed.\\n * @param _totalRequired The total amount required for this side.\\n * @return The amount of appeal fees contributed.\\n */\\n function contribute(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n uint256 _side,\\n address payable _contributor,\\n uint256 _amount,\\n uint256 _totalRequired\\n ) internal {\\n Round storage round = requestsDisputeData[_itemID][_requestID].rounds[_roundID];\\n uint256 pendingAmount = _totalRequired.subCap(round.amountPaid[_side]);\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution; // Amount contributed.\\n uint256 remainingETH; // Remaining ETH to send back.\\n if (pendingAmount > _amount) {\\n contribution = _amount;\\n } else {\\n contribution = pendingAmount;\\n remainingETH = _amount - pendingAmount;\\n }\\n\\n round.contributions[_contributor][_side] += contribution;\\n round.amountPaid[_side] += contribution;\\n round.feeRewards += contribution;\\n\\n // Reimburse leftover ETH.\\n if (remainingETH > 0) {\\n // Deliberate use of send in order to not block the contract in case of reverting fallback.\\n _contributor.send(remainingETH);\\n }\\n\\n if (contribution > 0) {\\n emit Contribution(_itemID, _requestID, _roundID, msg.sender, contribution, Party(_side));\\n }\\n }\\n\\n // ************************ //\\n // * Getters * //\\n // ************************ //\\n\\n /**\\n * @dev Gets the evidengeGroupID for a given item and request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The ID of the request.\\n * @return The evidenceGroupID\\n */\\n function getEvidenceGroupID(bytes32 _itemID, uint256 _requestID) public pure returns (uint256) {\\n return uint256(keccak256(abi.encodePacked(_itemID, _requestID)));\\n }\\n\\n /**\\n * @notice Gets the arbitrator for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator address.\\n */\\n function arbitrator() external view returns (IArbitrator) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitrator;\\n }\\n\\n /**\\n * @notice Gets the arbitratorExtraData for new requests.\\n * @dev Gets the latest value in arbitrationParamsChanges.\\n * @return The arbitrator extra data.\\n */\\n function arbitratorExtraData() external view returns (bytes memory) {\\n return arbitrationParamsChanges[arbitrationParamsChanges.length - 1].arbitratorExtraData;\\n }\\n\\n /**\\n * @dev Gets the number of times MetaEvidence was updated.\\n * @return The number of times MetaEvidence was updated.\\n */\\n function metaEvidenceUpdates() external view returns (uint256) {\\n return arbitrationParamsChanges.length;\\n }\\n\\n /**\\n * @dev Gets the contributions made by a party for a given round of a request.\\n * @param _itemID The ID of the item.\\n * @param _requestID The request to query.\\n * @param _roundID The round to query.\\n * @param _contributor The address of the contributor.\\n * @return contributions The contributions.\\n */\\n function getContributions(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID,\\n address _contributor\\n ) external view returns (uint256[3] memory contributions) {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n Round storage round = disputeData.rounds[_roundID];\\n contributions = round.contributions[_contributor];\\n }\\n\\n /**\\n * @dev Returns item's information. Includes the total number of requests for the item\\n * @param _itemID The ID of the queried item.\\n * @return status The current status of the item.\\n * @return numberOfRequests Total number of requests for the item.\\n * @return sumDeposit The total deposit made by the requester and the challenger (if any)\\n */\\n function getItemInfo(bytes32 _itemID)\\n external\\n view\\n returns (\\n Status status,\\n uint256 numberOfRequests,\\n uint256 sumDeposit\\n )\\n {\\n Item storage item = items[_itemID];\\n return (item.status, item.requestCount, item.sumDeposit);\\n }\\n\\n /**\\n * @dev Gets information on a request made for the item.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return submissionTime Time when the request was made.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n * @return parties Address of requester and challenger, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n * @return ruling The final ruling given, if any.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestInfo(bytes32 _itemID, uint256 _requestID)\\n external\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 submissionTime,\\n bool resolved,\\n address payable[3] memory parties,\\n uint256 numberOfRounds,\\n Party ruling,\\n IArbitrator requestArbitrator,\\n bytes memory requestArbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n Request storage request = items[_itemID].requests[_requestID];\\n\\n submissionTime = request.submissionTime;\\n parties[uint256(Party.Requester)] = request.requester;\\n parties[uint256(Party.Challenger)] = request.challenger;\\n\\n (disputed, disputeID, numberOfRounds, ruling) = getRequestDisputeData(_itemID, _requestID);\\n\\n (requestArbitrator, requestArbitratorExtraData, metaEvidenceID) = getRequestArbitrationParams(\\n _itemID,\\n _requestID\\n );\\n resolved = getRequestResolvedStatus(_itemID, _requestID);\\n }\\n\\n /**\\n * @dev Gets the dispute data relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return disputed True if a dispute was raised.\\n * @return disputeID ID of the dispute, if any.\\n * @return ruling The final ruling given, if any.\\n * @return numberOfRounds Number of rounds of dispute.\\n */\\n function getRequestDisputeData(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n bool disputed,\\n uint256 disputeID,\\n uint256 numberOfRounds,\\n Party ruling\\n )\\n {\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n\\n return (\\n disputeData.status >= DisputeStatus.AwaitingRuling,\\n disputeData.disputeID,\\n disputeData.roundCount,\\n disputeData.ruling\\n );\\n }\\n\\n /**\\n * @dev Gets the arbitration params relative to a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return arbitrator The arbitrator trusted to solve disputes for this request.\\n * @return arbitratorExtraData The extra data for the trusted arbitrator of this request.\\n * @return metaEvidenceID The meta evidence to be used in a dispute for this case.\\n */\\n function getRequestArbitrationParams(bytes32 _itemID, uint256 _requestID)\\n internal\\n view\\n returns (\\n IArbitrator arbitrator,\\n bytes memory arbitratorExtraData,\\n uint256 metaEvidenceID\\n )\\n {\\n Request storage request = items[_itemID].requests[_requestID];\\n ArbitrationParams storage arbitrationParams = arbitrationParamsChanges[request.arbitrationParamsIndex];\\n\\n return (\\n arbitrationParams.arbitrator,\\n arbitrationParams.arbitratorExtraData,\\n 2 * request.arbitrationParamsIndex + uint256(request.requestType)\\n );\\n }\\n\\n /**\\n * @dev Gets the resovled status of a given item request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @return resolved True if the request was executed and/or any raised disputes were resolved.\\n */\\n function getRequestResolvedStatus(bytes32 _itemID, uint256 _requestID) internal view returns (bool resolved) {\\n Item storage item = items[_itemID];\\n\\n if (item.requestCount == 0) {\\n return false;\\n }\\n\\n if (_requestID < item.requestCount - 1) {\\n // It was resolved because it is not the last request.\\n return true;\\n }\\n\\n return item.sumDeposit == 0;\\n }\\n\\n /**\\n * @dev Gets the information of a round of a request.\\n * @param _itemID The ID of the queried item.\\n * @param _requestID The request to be queried.\\n * @param _roundID The round to be queried.\\n * @return appealed Whether appealed or not.\\n * @return amountPaid Tracks the sum paid for each Party in this round.\\n * @return hasPaid True if the Party has fully paid its fee in this round.\\n * @return feeRewards Sum of reimbursable fees and stake rewards available to the parties that made contributions to the side that ultimately wins a dispute.\\n */\\n function getRoundInfo(\\n bytes32 _itemID,\\n uint256 _requestID,\\n uint256 _roundID\\n )\\n external\\n view\\n returns (\\n bool appealed,\\n uint256[3] memory amountPaid,\\n bool[3] memory hasPaid,\\n uint256 feeRewards\\n )\\n {\\n Item storage item = items[_itemID];\\n require(item.requestCount > _requestID, \\\"Request does not exist.\\\");\\n\\n DisputeData storage disputeData = requestsDisputeData[_itemID][_requestID];\\n require(disputeData.roundCount > _roundID, \\\"Round does not exist\\\");\\n\\n Round storage round = disputeData.rounds[_roundID];\\n appealed = _roundID < disputeData.roundCount - 1;\\n\\n hasPaid[uint256(Party.Requester)] = appealed || round.sideFunded == Party.Requester;\\n hasPaid[uint256(Party.Challenger)] = appealed || round.sideFunded == Party.Challenger;\\n\\n return (appealed, round.amountPaid, hasPaid, round.feeRewards);\\n }\\n}\\n\",\"keccak256\":\"0x3a77a9cd5142744e9dec8d1f74e198b38b53c579e08cb306caa1b84c4c8d0935\"},\"contracts/test-purposes/RelayMock.sol\":{\"content\":\"pragma solidity ^0.5.16;\\n\\nimport \\\"../LightGeneralizedTCR.sol\\\";\\n\\ncontract RelayMock {\\n function add(LightGeneralizedTCR _gtcr, string calldata _itemData)\\n external\\n {\\n _gtcr.addItemDirectly(_itemData);\\n }\\n\\n function remove(LightGeneralizedTCR _gtcr, bytes32 _itemID) external {\\n _gtcr.removeItemDirectly(_itemID);\\n }\\n}\\n\",\"keccak256\":\"0x78aebc282e8b495ea9fc5805e96cecd656e9238c83b411232aa1c5dea9dab5e7\"},\"contracts/utils/CappedMath.sol\":{\"content\":\"/**\\n * @authors: [@mtsalenc*]\\n * @reviewers: [@clesaege*]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath {\\n uint256 private constant UINT_MAX = 2**256 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n uint256 c = _a + _b;\\n return c >= _a ? c : UINT_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^256 - 1 on overflow.\\n */\\n function mulCap(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring '_a' not being zero, but the\\n // benefit is lost if '_b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) return 0;\\n\\n uint256 c = _a * _b;\\n return c / _a == _b ? c : UINT_MAX;\\n }\\n}\\n\",\"keccak256\":\"0x7ceea624e5b345b4d7729040720f8a3872ec249420f639a1e1cc654bfd5d7dee\"},\"contracts/utils/CappedMath128.sol\":{\"content\":\"/**\\n * @authors: [@hbarcelos]\\n * @reviewers: [@fnanni-0]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity ^0.5.16;\\n\\n/**\\n * @title CappedMath\\n * @dev Math operations with caps for under and overflow.\\n */\\nlibrary CappedMath128 {\\n uint128 private constant UINT128_MAX = 2**128 - 1;\\n\\n /**\\n * @dev Adds two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function addCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n uint128 c = _a + _b;\\n return c >= _a ? c : UINT128_MAX;\\n }\\n\\n /**\\n * @dev Subtracts two integers, returns 0 on underflow.\\n */\\n function subCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_b > _a) return 0;\\n else return _a - _b;\\n }\\n\\n /**\\n * @dev Multiplies two unsigned integers, returns 2^128 - 1 on overflow.\\n */\\n function mulCap(uint128 _a, uint128 _b) internal pure returns (uint128) {\\n if (_a == 0) return 0;\\n\\n uint128 c = _a * _b;\\n return c / _a == _b ? c : UINT128_MAX;\\n }\\n}\\n\",\"keccak256\":\"0xaa86df80a3608032b85628f172d6e4b59c7f8a360a0e661959e865765322375c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610211806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806336d6da551461003b57806364afab72146100bd575b600080fd5b6100bb6004803603604081101561005157600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561007c57600080fd5b82018360208201111561008e57600080fd5b803590602001918460018302840111640100000000831117156100b057600080fd5b5090925090506100e9565b005b6100bb600480360360408110156100d357600080fd5b506001600160a01b03813516906020013561017a565b604051638545c6a560e01b8152602060048201908152602482018390526001600160a01b03851691638545c6a59185918591908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561015d57600080fd5b505af1158015610171573d6000803e3d6000fd5b50505050505050565b816001600160a01b03166341e57c06826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101c057600080fd5b505af11580156101d4573d6000803e3d6000fd5b50505050505056fea265627a7a72315820c211bacc8f19fee4ab51234a02108ae9c4e3feb8b7af2c355b4930d49470e05864736f6c63430005110032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806336d6da551461003b57806364afab72146100bd575b600080fd5b6100bb6004803603604081101561005157600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561007c57600080fd5b82018360208201111561008e57600080fd5b803590602001918460018302840111640100000000831117156100b057600080fd5b5090925090506100e9565b005b6100bb600480360360408110156100d357600080fd5b506001600160a01b03813516906020013561017a565b604051638545c6a560e01b8152602060048201908152602482018390526001600160a01b03851691638545c6a59185918591908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561015d57600080fd5b505af1158015610171573d6000803e3d6000fd5b50505050505050565b816001600160a01b03166341e57c06826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101c057600080fd5b505af11580156101d4573d6000803e3d6000fd5b50505050505056fea265627a7a72315820c211bacc8f19fee4ab51234a02108ae9c4e3feb8b7af2c355b4930d49470e05864736f6c63430005110032", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/hardhat.config.js b/hardhat.config.js index 22f9628..ad04e69 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -3,6 +3,10 @@ require("@nomiclabs/hardhat-web3"); require("hardhat-gas-reporter"); require("@nomiclabs/hardhat-ethers"); require("hardhat-deploy"); +const dotenv = require("dotenv"); + +dotenv.config(); + module.exports = { solidity: { version: "0.5.17", @@ -50,6 +54,20 @@ module.exports = { live: true, saveDeployments: true, tags: ["staging", "foreign", "layer1"], + etherscan: { + apiKey: process.env.ETHERSCAN_API_KEY, + }, + }, + sepolia: { + chainId: 11155111, + url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`, + accounts: + process.env.PRIVATE_KEY_GOVERNOR !== undefined && process.env.PRIVATE_KEY_DEPLOYER !== undefined + ? [process.env.PRIVATE_KEY_GOVERNOR, process.env.PRIVATE_KEY_DEPLOYER] + : [], + live: true, + saveDeployments: true, + tags: ["staging", "foreign", "layer1"], }, mainnet: { chainId: 1, diff --git a/package.json b/package.json index 055c8ce..fba00f5 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,9 @@ }, "dependencies": { "@kleros/erc-792": "3.0.0", + "@nomiclabs/hardhat-etherscan": "^3.1.7", "bn.js": "^5.2.1", + "dotenv": "^16.3.1", "hardhat-deploy": "^0.11.20", "solidity-bytes-utils": "^0.0.8", "solidity-rlp": "^2.0.1"