From 97bafdd7910e053dbf17ba513f95499b3fb1a2a8 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 27 Jan 2023 16:13:40 +0000 Subject: [PATCH 01/29] feat: interfaces for the arbitrator, arbitrables and evidence v2 --- contracts/src/arbitration/IArbitrableV2.sol | 44 +++++++++++++++++ contracts/src/arbitration/IArbitratorV2.sol | 54 +++++++++++++++++++++ contracts/src/evidence/IEvidenceV2.sol | 24 +++++++++ 3 files changed, 122 insertions(+) create mode 100644 contracts/src/arbitration/IArbitrableV2.sol create mode 100644 contracts/src/arbitration/IArbitratorV2.sol create mode 100644 contracts/src/evidence/IEvidenceV2.sol diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol new file mode 100644 index 000000000..943b5e89d --- /dev/null +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import "./IArbitratorV2.sol"; + +/** + * @title IArbitrableV2 + * Arbitrable interface. + * When developing arbitrable contracts, we need to: + * - Define the action taken when a ruling is received by the contract. + * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); + */ +interface IArbitrableV2 { + /** + * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. + * @param _arbitrator The arbitrator of the contract. + * @param _disputeID ID of the dispute in the Arbitrator contract. + * @param _externalDisputeID Unique identifier from the dispute creator that is linked to this dispute. + * @param _disputeContextUri IPFS path to dispute context, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/disputecontext.json' + */ + event Dispute( + IArbitrableV2 indexed _arbitrator, + uint256 indexed _disputeID, + uint256 _externalDisputeID, + string _disputeContextUri + ); + + /** + * @dev To be raised when a ruling is given. + * @param _arbitrator The arbitrator giving the ruling. + * @param _disputeID ID of the dispute in the Arbitrator contract. + * @param _ruling The ruling which was given. + */ + event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling); + + /** + * @dev Give a ruling for a dispute. Must be called by the arbitrator. + * The purpose of this function is to ensure that the address calling it has the right to rule on the contract. + * @param _disputeID ID of the dispute in the Arbitrator contract. + * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision". + */ + function rule(uint256 _disputeID, uint256 _ruling) external; +} diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/IArbitratorV2.sol new file mode 100644 index 000000000..87d075906 --- /dev/null +++ b/contracts/src/arbitration/IArbitratorV2.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import "./IArbitrableV2.sol"; + +/** + * @title Arbitrator + * Arbitrator interface that implements the new arbitration standard. + * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most. + * When developing arbitrator contracts we need to: + * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes). + * - Define the functions for cost display (arbitrationCost). + * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling). + */ +interface IArbitratorV2 { + /** + * @dev To be emitted when a dispute is created. + * @param _disputeID Identifier of the dispute. + * @param _arbitrable The contract which created the dispute. + */ + event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); + + /** + * @dev To be raised when a ruling is given. + * @param _arbitrable The arbitrable receiving the ruling. + * @param _disputeID Identifier of the dispute in the Arbitrator contract. + * @param _ruling The ruling which was given. + */ + event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); + + /** + * @dev Create a dispute. Must be called by the arbitrable contract. + * Must pay at least arbitrationCost(_extraData). + * @param _choices Amount of choices the arbitrator can make in this dispute. + * @param _extraData Can be used to give additional info on the dispute to be created. + * @return disputeID Identifier of the dispute created. + */ + function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID); + + /** + * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. + * @param _extraData Can be used to give additional info on the dispute to be created. + * @return cost Required cost of arbitration. + */ + function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost); + + /** + * @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal. + * @param _disputeID ID of the dispute. + * @return ruling The ruling which has been given or the one which will be given if there is no appeal. + */ + function currentRuling(uint _disputeID) external view returns (uint ruling); +} diff --git a/contracts/src/evidence/IEvidenceV2.sol b/contracts/src/evidence/IEvidenceV2.sol new file mode 100644 index 000000000..729f367ff --- /dev/null +++ b/contracts/src/evidence/IEvidenceV2.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "../arbitration/IArbitratorV2.sol"; + +/** @title IEvidence + * ERC-1497: Evidence Standard + */ +interface IEvidenceV2 { + /** + * @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). + * @param _arbitrator The arbitrator of the contract. + * @param _externalDisputeID Unique identifier from the dispute creator that is linked to this dispute. + * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party. + * @param _evidenceUri IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json' + */ + event Evidence( + IArbitratorV2 indexed _arbitrator, + uint256 indexed _externalDisputeID, + address indexed _party, + string _evidenceUri + ); +} From bdc43e46d7f14d24d3fa5192598504a1712aaef1 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Mon, 17 Apr 2023 22:24:47 +0100 Subject: [PATCH 02/29] docs: examples of metaevidence and dispute templates --- {kleros-ts => kleros-sdk}/README.md | 2 +- kleros-sdk/config/v1-metaevidence/escrow.json | 38 +++++++++++ .../config/v1-metaevidence/escrow2.json | 39 +++++++++++ kleros-sdk/config/v1-metaevidence/lgtcr1.json | 50 ++++++++++++++ kleros-sdk/config/v1-metaevidence/lgtcr2.json | 50 ++++++++++++++ kleros-sdk/config/v1-metaevidence/lgtcr3.json | 66 +++++++++++++++++++ kleros-sdk/config/v1-metaevidence/lgtcr4.json | 66 +++++++++++++++++++ .../linguo-meta-evidence1.json | 44 +++++++++++++ .../linguo-meta-evidence2.json | 44 +++++++++++++ kleros-sdk/config/v1-metaevidence/omen1.json | 43 ++++++++++++ kleros-sdk/config/v1-metaevidence/omen2.json | 43 ++++++++++++ kleros-sdk/config/v1-metaevidence/omen3.json | 43 ++++++++++++ kleros-sdk/config/v1-metaevidence/omen4.json | 43 ++++++++++++ kleros-sdk/config/v1-metaevidence/omen5.json | 43 ++++++++++++ kleros-sdk/config/v1-metaevidence/poh1.json | 19 ++++++ kleros-sdk/config/v1-metaevidence/poh2.json | 19 ++++++ .../config/v1-metaevidence/reality.json | 8 +++ .../realityWithAppeals-gnosis-moderate.json | 21 ++++++ .../realityWithAppeals-gnosis.json | 21 ++++++ .../v1-metaevidence/realityWithAppeals.json | 21 ++++++ .../config/v1-metaevidence/resolver.json | 20 ++++++ .../v1-metaevidence/tokens-ethfinex1.json | 28 ++++++++ .../v1-metaevidence/tokens-ethfinex2.json | 28 ++++++++ .../config/v1-metaevidence/tokens1.json | 21 ++++++ .../config/v1-metaevidence/tokens2.json | 21 ++++++ .../config/v1-metaevidence/unslashed.json | 19 ++++++ .../disputetemplate-reality-final1.txt | 48 ++++++++++++++ .../disputetemplate-reality-final2.txt | 57 ++++++++++++++++ .../disputetemplate-reality-inputs1.txt | 6 ++ .../disputetemplate-reality-inputs2.txt | 6 ++ .../disputetemplate-reality.jsonc | 27 ++++++++ package.json | 2 +- 32 files changed, 1004 insertions(+), 2 deletions(-) rename {kleros-ts => kleros-sdk}/README.md (59%) create mode 100644 kleros-sdk/config/v1-metaevidence/escrow.json create mode 100644 kleros-sdk/config/v1-metaevidence/escrow2.json create mode 100644 kleros-sdk/config/v1-metaevidence/lgtcr1.json create mode 100644 kleros-sdk/config/v1-metaevidence/lgtcr2.json create mode 100644 kleros-sdk/config/v1-metaevidence/lgtcr3.json create mode 100644 kleros-sdk/config/v1-metaevidence/lgtcr4.json create mode 100644 kleros-sdk/config/v1-metaevidence/linguo-meta-evidence1.json create mode 100644 kleros-sdk/config/v1-metaevidence/linguo-meta-evidence2.json create mode 100644 kleros-sdk/config/v1-metaevidence/omen1.json create mode 100644 kleros-sdk/config/v1-metaevidence/omen2.json create mode 100644 kleros-sdk/config/v1-metaevidence/omen3.json create mode 100644 kleros-sdk/config/v1-metaevidence/omen4.json create mode 100644 kleros-sdk/config/v1-metaevidence/omen5.json create mode 100644 kleros-sdk/config/v1-metaevidence/poh1.json create mode 100644 kleros-sdk/config/v1-metaevidence/poh2.json create mode 100644 kleros-sdk/config/v1-metaevidence/reality.json create mode 100644 kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis-moderate.json create mode 100644 kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis.json create mode 100644 kleros-sdk/config/v1-metaevidence/realityWithAppeals.json create mode 100644 kleros-sdk/config/v1-metaevidence/resolver.json create mode 100644 kleros-sdk/config/v1-metaevidence/tokens-ethfinex1.json create mode 100644 kleros-sdk/config/v1-metaevidence/tokens-ethfinex2.json create mode 100644 kleros-sdk/config/v1-metaevidence/tokens1.json create mode 100644 kleros-sdk/config/v1-metaevidence/tokens2.json create mode 100644 kleros-sdk/config/v1-metaevidence/unslashed.json create mode 100644 kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs1.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs2.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc diff --git a/kleros-ts/README.md b/kleros-sdk/README.md similarity index 59% rename from kleros-ts/README.md rename to kleros-sdk/README.md index 11fd1e0ed..247be318a 100644 --- a/kleros-ts/README.md +++ b/kleros-sdk/README.md @@ -1,4 +1,4 @@ -# @kleros/kleros-v2-klerosjs +# @kleros/kleros-v2-sdk _Archon's successor_ diff --git a/kleros-sdk/config/v1-metaevidence/escrow.json b/kleros-sdk/config/v1-metaevidence/escrow.json new file mode 100644 index 000000000..f2b0e7c93 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/escrow.json @@ -0,0 +1,38 @@ +{ + "subCategory": "General Service", + "arbitrableAddress": "0x0d67440946949fe293b45c52efd8a9b3d51e2522", + "title": "Jenkins the Valet Yacht Licensing Contract", + "description": "Agreement between Bostonbob (bb) and AC (ac). \n\nbb will pay a one time yacht leasing fee of 4 eth to ac.\n\nIn return, ac will lease his yacht to bb by submitting bb’s MAYC and his back story in the Jenkins the valet author portal. Ac’s WAGMI Yacht #1047 will be attached to bb’s MAYC #1353, casting 1353 for a role in the book. \n\nIn addition, a royalty split will be put into place between the two parties. 80% for ac/20% for bb (managed and paid out by Jenkins team at a later date)\n\n*All names in contract are Twitter profile names as of 12/8.", + "sender": "0x45E6564631809F5531fd008f4829f1C5B0c29A7f", + "receiver": "0x45E6564631809F5531fd008f4829f1C5B0c29A7f", + "amount": "4", + "timeout": 8640000000000000, + "token": { + "name": "Ethereum", + "ticker": "ETH", + "symbolURI": "/static/media/eth.33901ab6.png", + "address": null, + "decimals": 18 + }, + "extraData": { + "Contract Information": "Agreement between Bostonbob (bb) and AC (ac). \n\nbb will pay a one time yacht leasing fee of 4 eth to ac.\n\nIn return, ac will lease his yacht to bb by submitting bb’s MAYC and his back story in the Jenkins the valet author portal. Ac’s WAGMI Yacht #1047 will be attached to bb’s MAYC #1353, casting 1353 for a role in the book. \n\nIn addition, a royalty split will be put into place between the two parties. 80% for ac/20% for bb (managed and paid out by Jenkins team at a later date)\n\n*All names in contract are Twitter profile names as of 12/8." + }, + "invoice": true, + "category": "Escrow", + "question": "Which party abided by terms of the contract?", + "rulingOptions": { + "type": "single-select", + "titles": [ + "Refund Sender", + "Pay Receiver" + ], + "descriptions": [ + "Select to return funds to the Sender", + "Select to release funds to the Receiver" + ] + }, + "evidenceDisplayInterfaceURI": "/ipfs/QmfPnVdcCjApHdiCC8wAmyg5iR246JvVuQGQjQYgtF8gZU/index.html", + "aliases": { + "0x45E6564631809F5531fd008f4829f1C5B0c29A7f": "receiver" + } +} diff --git a/kleros-sdk/config/v1-metaevidence/escrow2.json b/kleros-sdk/config/v1-metaevidence/escrow2.json new file mode 100644 index 000000000..fcc13d4ff --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/escrow2.json @@ -0,0 +1,39 @@ +{ + "subCategory": "General Service", + "arbitrableAddress": "0x0d67440946949fe293b45c52efd8a9b3d51e2522", + "title": "Mente Vs Cooperative Kleros", + "description": "\n\nThe challenger believes due to a UI bug they were not able to challenge case 164 and this dispute is against the cooperative for potential lost winnings.\n\n", + "sender": "0x96559b33D6A9042b1C34b3e8978Ca922146cB79a", + "receiver": "0xa07f5Ffd166Ca3Ff7567e96a0430F1496cdb470a", + "amount": "5", + "timeout": 8640000000000000, + "token": { + "name": "Ethereum", + "ticker": "ETH", + "symbolURI": "/static/media/eth.33901ab6.png", + "address": null, + "decimals": 18 + }, + "extraData": { + "Contract Information": "\n\nThe challenger believes due to a UI bug they were not able to challenge case 164 and this dispute is against the cooperative for potential lost winnings.\n\n" + }, + "invoice": false, + "category": "Escrow", + "question": "Which party abided by terms of the contract?", + "rulingOptions": { + "type": "single-select", + "titles": [ + "Refund Sender", + "Pay Receiver" + ], + "descriptions": [ + "Select to return funds to the Sender", + "Select to release funds to the Receiver" + ] + }, + "evidenceDisplayInterfaceURI": "/ipfs/QmfPnVdcCjApHdiCC8wAmyg5iR246JvVuQGQjQYgtF8gZU/index.html", + "aliases": { + "0x96559b33D6A9042b1C34b3e8978Ca922146cB79a": "sender", + "0xa07f5Ffd166Ca3Ff7567e96a0430F1496cdb470a": "receiver" + } +} diff --git a/kleros-sdk/config/v1-metaevidence/lgtcr1.json b/kleros-sdk/config/v1-metaevidence/lgtcr1.json new file mode 100644 index 000000000..08fb21ffa --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/lgtcr1.json @@ -0,0 +1,50 @@ +{ + "title": "Add a list to Consensus Layer Withdrawal Protection enabled badges", + "description": "Someone requested to add a list to Consensus Layer Withdrawal Protection enabled badges.", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the list complies with the required criteria and should be added.", + "Select this if you think the list does not comply with the required criteria and should not be added." + ] + }, + "category": "Curated Lists", + "question": "Does the list comply with the required criteria?", + "fileURI": "/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html", + "metadata": { + "tcrTitle": "Consensus Layer Withdrawal Protection enabled badges", + "tcrDescription": "A List of lists related to Consensus Layer Withdrawal Protection", + "columns": [ + { + "label": "Address", + "description": "The Badges list address", + "type": "GTCR address", + "isIdentifier": true + }, + { + "label": "Match File URI", + "description": "The URI to the JSON file for matching columns for each list.", + "type": "text" + } + ], + "itemName": "list", + "itemNamePlural": "lists", + "isConnectedTCR": true, + "requireRemovalEvidence": true, + "isTCRofTCRs": true, + "parentTCRAddress": "0x479083b5343aB89bb39608e3176D750c8A6957B5", + "relTcrDisabled": true + }, + "_v": "1.0.0", + "evidenceDisplayInterfaceRequiredParams": [ + "disputeID", + "arbitrableContractAddress", + "arbitratorContractAddress", + "arbitrableChainID", + "arbitrableJsonRpcUrl" + ] +} diff --git a/kleros-sdk/config/v1-metaevidence/lgtcr2.json b/kleros-sdk/config/v1-metaevidence/lgtcr2.json new file mode 100644 index 000000000..8aa949743 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/lgtcr2.json @@ -0,0 +1,50 @@ +{ + "title": "Remove a list from Consensus Layer Withdrawal Protection enabled badges", + "description": "Someone requested to remove a list from Consensus Layer Withdrawal Protection enabled badges.", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Don't Remove It" + ], + "descriptions": [ + "Select this if you think the list does not comply with the required criteria and should be removed.", + "Select this if you think the list complies with the required criteria and should not be removed." + ] + }, + "category": "Curated Lists", + "question": "Does the list comply with the required criteria?", + "fileURI": "/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html", + "metadata": { + "tcrTitle": "Consensus Layer Withdrawal Protection enabled badges", + "tcrDescription": "A List of lists related to Consensus Layer Withdrawal Protection", + "columns": [ + { + "label": "Address", + "description": "The Badges list address", + "type": "GTCR address", + "isIdentifier": true + }, + { + "label": "Match File URI", + "description": "The URI to the JSON file for matching columns for each list.", + "type": "text" + } + ], + "itemName": "list", + "itemNamePlural": "lists", + "isConnectedTCR": true, + "requireRemovalEvidence": true, + "isTCRofTCRs": true, + "parentTCRAddress": "0x479083b5343aB89bb39608e3176D750c8A6957B5", + "relTcrDisabled": true + }, + "_v": "1.0.0", + "evidenceDisplayInterfaceRequiredParams": [ + "disputeID", + "arbitrableContractAddress", + "arbitratorContractAddress", + "arbitrableChainID", + "arbitrableJsonRpcUrl" + ] +} diff --git a/kleros-sdk/config/v1-metaevidence/lgtcr3.json b/kleros-sdk/config/v1-metaevidence/lgtcr3.json new file mode 100644 index 000000000..80d174641 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/lgtcr3.json @@ -0,0 +1,66 @@ +{ + "title": "Add a validator to Consensus Layer Withdrawal Protection", + "description": "Someone requested to add a validator to Consensus Layer Withdrawal Protection", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the validator complies with the required criteria and should be added.", + "Select this if you think the validator does not comply with the required criteria and should not be added." + ] + }, + "category": "Curated Lists", + "question": "Does the validator comply with the required criteria?", + "fileURI": "/ipfs/QmPtXtFKfVc3w5aGVNYrmBZWEHBLpk2XMLkYCnEioxwy43/clwp-acceptance-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html", + "metadata": { + "tcrTitle": "Consensus Layer Withdrawal Protection", + "tcrDescription": "Ethereum validators using CLWP to set their withdrawal address", + "columns": [ + { + "label": "validator_index", + "description": "The validator in question (integer) [required]", + "type": "number", + "isIdentifier": true + }, + { + "label": "from_bls_pubkey", + "description": "The public key of the validator withdrawal key (string) [required]", + "type": "text", + "isIdentifier": true + }, + { + "label": "to_execution_address", + "description": "An Ethereum execution layer withdrawal address (address) [required]", + "type": "address", + "isIdentifier": true + }, + { + "label": "CLWP File", + "description": "A text file which is named as the validator_index.json (file) [required]", + "type": "file", + "allowedFileTypes": "json" + }, + { + "label": "Item to supersede", + "description": "In case there is already an entry on the list for the same validator_index, this field needs to be populated with the ItemID of the other item in this Kleros Curate registry that this entry is meant to supersede. (string) [optional]", + "type": "text", + "isIdentifier": true + }, + { + "label": "Additional Information", + "description": "A .pdf file containing any evidence and proof to prove that you are the rightful owner of the validator node. (file) [optional]", + "type": "file", + "allowedFileTypes": "pdf" + } + ], + "itemName": "validator", + "itemNamePlural": "validators", + "logoURI": "/ipfs/QmXkGcS9Nw7jqaSaZZoKh3UQo8pwE8LWsdoUtjx1zTFLmJ/clwp-100-100-px-.svg", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/lgtcr4.json b/kleros-sdk/config/v1-metaevidence/lgtcr4.json new file mode 100644 index 000000000..aec3e12b9 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/lgtcr4.json @@ -0,0 +1,66 @@ +{ + "title": "Remove a validator from Consensus Layer Withdrawal Protection", + "description": "Someone requested to remove a validator from Consensus Layer Withdrawal Protection", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Don't Remove It" + ], + "descriptions": [ + "Select this if you think the validator does not comply with the required criteria and should be removed.", + "Select this if you think the validator complies with the required criteria and should not be removed." + ] + }, + "category": "Curated Lists", + "question": "Does the validator comply with the required criteria?", + "fileURI": "/ipfs/QmPtXtFKfVc3w5aGVNYrmBZWEHBLpk2XMLkYCnEioxwy43/clwp-acceptance-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmQjJio59WkrQDzPC5kSP3EiGaqrWxjGfkvhmD2mWwm41M/index.html", + "metadata": { + "tcrTitle": "Consensus Layer Withdrawal Protection", + "tcrDescription": "Ethereum validators using CLWP to set their withdrawal address", + "columns": [ + { + "label": "validator_index", + "description": "The validator in question (integer) [required]", + "type": "number", + "isIdentifier": true + }, + { + "label": "from_bls_pubkey", + "description": "The public key of the validator withdrawal key (string) [required]", + "type": "text", + "isIdentifier": true + }, + { + "label": "to_execution_address", + "description": "An Ethereum execution layer withdrawal address (address) [required]", + "type": "address", + "isIdentifier": true + }, + { + "label": "CLWP File", + "description": "A text file which is named as the validator_index.json (file) [required]", + "type": "file", + "allowedFileTypes": "json" + }, + { + "label": "Item to supersede", + "description": "In case there is already an entry on the list for the same validator_index, this field needs to be populated with the ItemID of the other item in this Kleros Curate registry that this entry is meant to supersede. (string) [optional]", + "type": "text", + "isIdentifier": true + }, + { + "label": "Additional Information", + "description": "A .pdf file containing any evidence and proof to prove that you are the rightful owner of the validator node. (file) [optional]", + "type": "file", + "allowedFileTypes": "pdf" + } + ], + "itemName": "validator", + "itemNamePlural": "validators", + "logoURI": "/ipfs/QmXkGcS9Nw7jqaSaZZoKh3UQo8pwE8LWsdoUtjx1zTFLmJ/clwp-100-100-px-.svg", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/linguo-meta-evidence1.json b/kleros-sdk/config/v1-metaevidence/linguo-meta-evidence1.json new file mode 100644 index 000000000..f26134ee9 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/linguo-meta-evidence1.json @@ -0,0 +1,44 @@ +{ + "title": "Review a translation from Linguo", + "description": "Someone challenged a translation", + "rulingOptions": { + "titles": [ + "Yes, the translation should be accepted", + "No, the translation should not be accepted" + ], + "descriptions": [ + "Select this if you think the translation complies with the required criteria.", + "Select this if you think the translation does not comply with the required criteria." + ] + }, + "aliases": { + "0xc3600bfC9Ec2c20E4c7d22c9235b6ddE63BA99a8": "Requester" + }, + "category": "Translation", + "question": "Does the translation comply with the required criteria?", + "fileURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/Qmb5n6PgbshktJqGpwMAxP1moXEPaqq7ZvRufeXXhSPXxW/linguo-evidence-display/index.html", + "dynamicScriptURI": "/ipfs/QmPAHCRtSU844fdjNoEws8AgTpzzwsYwMF2wydtpvXAcoZ/linguo-script.js", + "dynamicScriptRequiredParams": [ + "disputeID", + "arbitrableContractAddress", + "arbitratorContractAddress", + "chainID", + "jsonRpcUrl" + ], + "metadata": { + "deadline": 1680307199, + "minPrice": "0", + "maxPrice": "500000000000000000000", + "sourceLanguage": "en-us", + "targetLanguage": "es", + "expectedQuality": "professional", + "title": "What do I think about network states?", + "wordCount": 7900, + "originalTextUrl": "https://vitalik.ca/general/2022/07/13/networkstates.html", + "originalTextFile": "/ipfs/QmY16SsM1uk7i2TLxGhUZR8iW74w4Luphry3SJeN6XyCTf/What do I think about network states.docx", + "__v": "1" + }, + "arbitrableChainID": 100, + "_v": "1.0.0" +} diff --git a/kleros-sdk/config/v1-metaevidence/linguo-meta-evidence2.json b/kleros-sdk/config/v1-metaevidence/linguo-meta-evidence2.json new file mode 100644 index 000000000..a16247f43 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/linguo-meta-evidence2.json @@ -0,0 +1,44 @@ +{ + "title": "Review a translation from Linguo", + "description": "Someone challenged a translation", + "rulingOptions": { + "titles": [ + "Yes, the translation should be accepted", + "No, the translation should not be accepted" + ], + "descriptions": [ + "Select this if you think the translation complies with the required criteria.", + "Select this if you think the translation does not comply with the required criteria." + ] + }, + "aliases": { + "0xc3600bfC9Ec2c20E4c7d22c9235b6ddE63BA99a8": "Requester" + }, + "category": "Translation", + "question": "Does the translation comply with the required criteria?", + "fileURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/Qmb5n6PgbshktJqGpwMAxP1moXEPaqq7ZvRufeXXhSPXxW/linguo-evidence-display/index.html", + "dynamicScriptURI": "/ipfs/QmPAHCRtSU844fdjNoEws8AgTpzzwsYwMF2wydtpvXAcoZ/linguo-script.js", + "dynamicScriptRequiredParams": [ + "disputeID", + "arbitrableContractAddress", + "arbitratorContractAddress", + "chainID", + "jsonRpcUrl" + ], + "metadata": { + "deadline": 1704067199, + "minPrice": "0", + "maxPrice": "500000000000000000000", + "sourceLanguage": "en-us", + "targetLanguage": "es", + "expectedQuality": "professional", + "title": "Moving beyond coin voting governance", + "wordCount": 5100, + "originalTextUrl": "https://vitalik.ca/general/2021/08/16/voting3.html", + "originalTextFile": "/ipfs/Qmaq181thsnUyUknbnbQfJUHYRTFvA8z83f9BKY68t5pnf/Moving beyond coin voting governance.docx", + "__v": "1" + }, + "arbitrableChainID": 100, + "_v": "1.0.0" +} diff --git a/kleros-sdk/config/v1-metaevidence/omen1.json b/kleros-sdk/config/v1-metaevidence/omen1.json new file mode 100644 index 000000000..a8ad1643a --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/omen1.json @@ -0,0 +1,43 @@ +{ + "title": "Add a list to Omen Verified Market enabled badges", + "description": "Someone requested to add a list to Omen Verified Market enabled badges.", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the list complies with the required criteria and should be added.", + "Select this if you think the list does not comply with the required criteria and should not be added." + ] + }, + "category": "Curated Lists", + "question": "Does the list comply with the required criteria?", + "fileURI": "/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmUbBGRTCH3zxTFSNJ1asUFtpwvyXasrzhzLxYVMoEW8Nc/index.html", + "evidenceDisplayInterfaceHash": "Bcd2grgxgJ1i88wpbF6iD4kaGkjp4gZfcsYxKJVMELZQLGurwLXQMPMJiNmn5Q6ctUbgwDUpXXwLspTTaWQWEoceE5", + "metadata": { + "tcrTitle": "Omen Verified Market enabled badges", + "tcrDescription": "A List of lists related to Omen Verified Market", + "columns": [ + { + "label": "Address", + "description": "The Badges list address", + "type": "GTCR address", + "isIdentifier": true + }, + { + "label": "Match File URI", + "description": "The URI to the JSON file for matching columns for each list.", + "type": "text" + } + ], + "itemName": "list", + "itemNamePlural": "lists", + "isConnectedTCR": true, + "requireRemovalEvidence": true, + "isTCRofTCRs": true, + "parentTCRAddress": "0xb72103eE8819F2480c25d306eEAb7c3382fBA612", + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/omen2.json b/kleros-sdk/config/v1-metaevidence/omen2.json new file mode 100644 index 000000000..851954c68 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/omen2.json @@ -0,0 +1,43 @@ +{ + "title": "Remove a list from Omen Verified Market enabled badges", + "description": "Someone requested to remove a list from Omen Verified Market enabled badges.", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Don't Remove It" + ], + "descriptions": [ + "Select this if you think the list does not comply with the required criteria and should be removed.", + "Select this if you think the list complies with the required criteria and should not be removed." + ] + }, + "category": "Curated Lists", + "question": "Does the list comply with the required criteria?", + "fileURI": "/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmUbBGRTCH3zxTFSNJ1asUFtpwvyXasrzhzLxYVMoEW8Nc/index.html", + "evidenceDisplayInterfaceHash": "Bcd2grgxgJ1i88wpbF6iD4kaGkjp4gZfcsYxKJVMELZQLGurwLXQMPMJiNmn5Q6ctUbgwDUpXXwLspTTaWQWEoceE5", + "metadata": { + "tcrTitle": "Omen Verified Market enabled badges", + "tcrDescription": "A List of lists related to Omen Verified Market", + "columns": [ + { + "label": "Address", + "description": "The Badges list address", + "type": "GTCR address", + "isIdentifier": true + }, + { + "label": "Match File URI", + "description": "The URI to the JSON file for matching columns for each list.", + "type": "text" + } + ], + "itemName": "list", + "itemNamePlural": "lists", + "isConnectedTCR": true, + "requireRemovalEvidence": true, + "isTCRofTCRs": true, + "parentTCRAddress": "0xb72103eE8819F2480c25d306eEAb7c3382fBA612", + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/omen3.json b/kleros-sdk/config/v1-metaevidence/omen3.json new file mode 100644 index 000000000..f47dd55e9 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/omen3.json @@ -0,0 +1,43 @@ +{ + "title": "Add a market to Omen Verified Market", + "description": "Someone requested to add a market to Omen Verified Market", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the market complies with the required criteria and should be added.", + "Select this if you think the market does not comply with the required criteria and should not be added." + ] + }, + "category": "Curated Lists", + "question": "Does the market comply with the required criteria?", + "fileURI": "/ipfs/QmPhEBstumEP84eSftx9MwBmSXBCGRFJMPZauKVa9gBizh/omen-verified-market.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmUbBGRTCH3zxTFSNJ1asUFtpwvyXasrzhzLxYVMoEW8Nc/index.html", + "evidenceDisplayInterfaceHash": "Bcd2grgxgJ1i88wpbF6iD4kaGkjp4gZfcsYxKJVMELZQLGurwLXQMPMJiNmn5Q6ctUbgwDUpXXwLspTTaWQWEoceE5", + "metadata": { + "tcrTitle": "Omen Verified Market", + "tcrDescription": "Safe Omen markets which are unlikely to be considered invalid and are not tricky", + "columns": [ + { + "label": "Question", + "description": "The question of the market", + "type": "text", + "isIdentifier": true + }, + { + "label": "Market URL", + "description": "Link to the Omen market in the form https://omen.eth.link/#/MARKET_ADDRESS", + "type": "link", + "isIdentifier": true + } + ], + "itemName": "market", + "itemNamePlural": "markets", + "logoURI": "/ipfs/QmSvhGvYvwzWVeBPSvTmttAyFU3PLHczRtMMexVcSmfbbh/omen-badge-tcr-.png", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/omen4.json b/kleros-sdk/config/v1-metaevidence/omen4.json new file mode 100644 index 000000000..c2665fec0 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/omen4.json @@ -0,0 +1,43 @@ +{ + "title": "Remove a market from Omen Verified Market", + "description": "Someone requested to remove a market from Omen Verified Market", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Don't Remove It" + ], + "descriptions": [ + "Select this if you think the market does not comply with the required criteria and should be removed.", + "Select this if you think the market complies with the required criteria and should not be removed." + ] + }, + "category": "Curated Lists", + "question": "Does the market comply with the required criteria?", + "fileURI": "/ipfs/QmPhEBstumEP84eSftx9MwBmSXBCGRFJMPZauKVa9gBizh/omen-verified-market.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmUbBGRTCH3zxTFSNJ1asUFtpwvyXasrzhzLxYVMoEW8Nc/index.html", + "evidenceDisplayInterfaceHash": "Bcd2grgxgJ1i88wpbF6iD4kaGkjp4gZfcsYxKJVMELZQLGurwLXQMPMJiNmn5Q6ctUbgwDUpXXwLspTTaWQWEoceE5", + "metadata": { + "tcrTitle": "Omen Verified Market", + "tcrDescription": "Safe Omen markets which are unlikely to be considered invalid and are not tricky", + "columns": [ + { + "label": "Question", + "description": "The question of the market", + "type": "text", + "isIdentifier": true + }, + { + "label": "Market URL", + "description": "Link to the Omen market in the form https://omen.eth.link/#/MARKET_ADDRESS", + "type": "link", + "isIdentifier": true + } + ], + "itemName": "market", + "itemNamePlural": "markets", + "logoURI": "/ipfs/QmSvhGvYvwzWVeBPSvTmttAyFU3PLHczRtMMexVcSmfbbh/omen-badge-tcr-.png", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/omen5.json b/kleros-sdk/config/v1-metaevidence/omen5.json new file mode 100644 index 000000000..8b6329f2b --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/omen5.json @@ -0,0 +1,43 @@ +{ + "title": "Add a list to The Registry enabled badges", + "description": "Someone requested to add a list to The Registry enabled badges.", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the list complies with the required criteria and should be added.", + "Select this if you think the list does not comply with the required criteria and should not be added." + ] + }, + "category": "Curated Lists", + "question": "Does the list comply with the required criteria?", + "fileURI": "/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmWYu43qp5VTH9LFaUfFv7qDRfkSr7ZLNXZNxYqdpww3ts/index.html", + "evidenceDisplayInterfaceHash": "Bccx364PTgwmxVLmpoWgQMNMJLSAscbp7gbYf6aA9guUDW2wkzQHapcZNrgDcuxFVhngv8U8NAjrFUXfucSPUQ1b1W", + "metadata": { + "tcrTitle": "The Registry enabled badges", + "tcrDescription": "A List of lists related to The Registry", + "columns": [ + { + "label": "Address", + "description": "The Badges list address", + "type": "GTCR address", + "isIdentifier": true + }, + { + "label": "Match File URI", + "description": "The URI to the JSON file for matching columns for each list.", + "type": "text" + } + ], + "itemName": "list", + "itemNamePlural": "lists", + "isConnectedTCR": true, + "requireRemovalEvidence": true, + "isTCRofTCRs": true, + "parentTCRAddress": "0xbA0304273a54dfeC1Fc7f4BCCbf4b15519AEcF15", + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/poh1.json b/kleros-sdk/config/v1-metaevidence/poh1.json new file mode 100644 index 000000000..868e4dfd4 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/poh1.json @@ -0,0 +1,19 @@ +{ + "category": "Curated List", + "title": "Proof of Humanity Registration Request", + "description": "A request to register the specified entry to a list of provable humans.", + "question": "Should the request to register be accepted?", + "fileURI": "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmSL8d82dMhcThwERWaF4LtmCa4hgV7TyPjAo4fKCzPVkv/index.html", + "rulingOptions": { + "type": "single-select", + "titles": [ + "Yes", + "No" + ], + "descriptions": [ + "Accept the request to register the entry.", + "Deny the request." + ] + } +} diff --git a/kleros-sdk/config/v1-metaevidence/poh2.json b/kleros-sdk/config/v1-metaevidence/poh2.json new file mode 100644 index 000000000..a3dcd1efe --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/poh2.json @@ -0,0 +1,19 @@ +{ + "category": "Curated List", + "title": "Proof of Humanity Clearing Request", + "description": "A request to remove the specified entry from a list of provable humans.", + "question": "Should the request to remove be accepted?", + "fileURI": "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmSL8d82dMhcThwERWaF4LtmCa4hgV7TyPjAo4fKCzPVkv/index.html", + "rulingOptions": { + "type": "single-select", + "titles": [ + "Yes", + "No" + ], + "descriptions": [ + "Accept the request to remove the entry.", + "Deny the request." + ] + } +} diff --git a/kleros-sdk/config/v1-metaevidence/reality.json b/kleros-sdk/config/v1-metaevidence/reality.json new file mode 100644 index 000000000..3be4c7834 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/reality.json @@ -0,0 +1,8 @@ +{ + "category": "Oracle", + "title": "Realitio Question", + "description": "A Realitio question has been raised to arbitration.", + "question": "Give the answer to the question.", + "evidenceDisplayInterfaceURI": "/ipfs/QmQTnGNbRFpsS8zevPZTZA2ZioBKWM6u1HVCf9vLWkRuEH/index.html", + "dynamicScriptURI": "/ipfs/QmNhs2mo7t8pydn7gg6ycrtT4mhfvhARLEoyMYgs9SDkH2" +} diff --git a/kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis-moderate.json b/kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis-moderate.json new file mode 100644 index 000000000..3c2dbcd71 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis-moderate.json @@ -0,0 +1,21 @@ +{ + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "Give an answer to the question.", + "evidenceDisplayInterfaceURI": "/ipfs/QmVXEiTexPd4EcQTjrxbFa88ZNFkBB8kT8BQUxtVn8fZJB/index.html", + "dynamicScriptURI": "/ipfs/QmWWsDmvjhR9UVRgkcG75vAKzfK3vB85EkZzudnaxwfAWr/bundle.js", + "fileURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "arbitrableChainID": "100", + "arbitratorChainID": "100", + "dynamicScriptRequiredParams": [ + "arbitrableChainID", + "arbitrableJsonRpcUrl", + "arbitrableContractAddress" + ], + "evidenceDisplayInterfaceRequiredParams": [ + "arbitrableChainID", + "arbitrableJsonRpcUrl", + "arbitrableContractAddress" + ] +} diff --git a/kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis.json b/kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis.json new file mode 100644 index 000000000..ff785421f --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/realityWithAppeals-gnosis.json @@ -0,0 +1,21 @@ +{ + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "Give an answer to the question.", + "evidenceDisplayInterfaceURI": "/ipfs/QmVXEiTexPd4EcQTjrxbFa88ZNFkBB8kT8BQUxtVn8fZJB/index.html", + "dynamicScriptURI": "/ipfs/QmceDSKpVa9o3ycQ1GD2mTTkAZ4AjPncucV4BcMdV4pazv/bundle.js", + "fileURI": "/ipfs/QmaUr6hnSVxYD899xdcn2GUVtXVjXoSXKZbce3zFtGWw4H/Question_Resolution_Policy.pdf", + "arbitrableChainID": "100", + "arbitratorChainID": "100", + "dynamicScriptRequiredParams": [ + "arbitrableChainID", + "arbitrableJsonRpcUrl", + "arbitrableContractAddress" + ], + "evidenceDisplayInterfaceRequiredParams": [ + "arbitrableChainID", + "arbitrableJsonRpcUrl", + "arbitrableContractAddress" + ] +} diff --git a/kleros-sdk/config/v1-metaevidence/realityWithAppeals.json b/kleros-sdk/config/v1-metaevidence/realityWithAppeals.json new file mode 100644 index 000000000..70ba17c44 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/realityWithAppeals.json @@ -0,0 +1,21 @@ +{ + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "Give an answer to the question.", + "evidenceDisplayInterfaceURI": "/ipfs/QmWCmzMB4zbzii8HV9HFGa8Evgt5i63GyveJtw2umxRrcX/reality-evidence-display-4/index.html", + "dynamicScriptURI": "/ipfs/QmWWsDmvjhR9UVRgkcG75vAKzfK3vB85EkZzudnaxwfAWr/bundle.js", + "fileURI": "/ipfs/QmaUr6hnSVxYD899xdcn2GUVtXVjXoSXKZbce3zFtGWw4H/Question_Resolution_Policy.pdf", + "arbitrableChainID": "1", + "arbitratorChainID": "1", + "dynamicScriptRequiredParams": [ + "arbitrableChainID", + "arbitrableJsonRpcUrl", + "arbitrableContractAddress" + ], + "evidenceDisplayInterfaceRequiredParams": [ + "arbitrableChainID", + "arbitrableJsonRpcUrl", + "arbitrableContractAddress" + ] +} diff --git a/kleros-sdk/config/v1-metaevidence/resolver.json b/kleros-sdk/config/v1-metaevidence/resolver.json new file mode 100644 index 000000000..660c5bb3e --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/resolver.json @@ -0,0 +1,20 @@ +{ + "title": "The Assassination Plot: The Case of Draco Malfoy vs. Albus Dumbledore", + "category": "Fictional", + "description": "In the Harry Potter and the Half-Blood Prince movie, there is a dispute between Albus Dumbledore and Draco Malfoy over the attempted assassination of Dumbledore.\n\n#Background: \nDraco Malfoy, a student at Hogwarts School of Witchcraft and Wizardry and a member of the pure-blood Malfoy family, is entrusted with the task of assassinating Dumbledore by Lord Voldemort. Dumbledore becomes aware of the plot and confronts Malfoy, offering him a chance to back out and revealing the true extent of the danger and moral implications of his actions. However, Malfoy ultimately decides to go through with the assassination attempt, leading to a confrontation between Dumbledore and Malfoy.\n\nAfter considering all the evidence, the jurors would have to decide whether Malfoy was guilty of attempted murder or if he was acting under duress. The Kleros Court's decision would be final and binding, bringing a resolution to the dispute.", + "aliases": {}, + "question": "Was Draco Malfoy guilty of attempted murder in the assassination plot against Albus Dumbledore?", + "rulingOptions": { + "type": "single-select", + "titles": [ + "Yes", + "No" + ], + "descriptions": [ + "Draco Malfoy is guilty of attempted murder in the assassination plot against Albus Dumbledore.", + "Draco Malfoy is not guilty of attempted murder in the assassination plot against Albus Dumbledore." + ] + }, + "fileURI": "", + "dynamicScriptURI": "/ipfs/QmZZHwVaXWtvChdFPG4UeXStKaC9aHamwQkNTEAfRmT2Fj" +} diff --git a/kleros-sdk/config/v1-metaevidence/tokens-ethfinex1.json b/kleros-sdk/config/v1-metaevidence/tokens-ethfinex1.json new file mode 100644 index 000000000..689ec2e79 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/tokens-ethfinex1.json @@ -0,0 +1,28 @@ +{ + "category": "Curated Lists", + "title": "Add Ethfinex Badge to Token", + "description": "Someone requested to add the the Ethfinex badge to a token.\n\nDescription\n\nTokens with the Ethfinex badge can participate in the Ethfinex Community Vote to become traded on the Ethfinex platform. To be eligible to receive the badge, the project and it's associated token must comply with the minimum set of criteria defined in the criteria document.", + "aliases": { + "0x988b3a538b618c7a603e1c11ab82cd16dbe28069": "Arbitrator" + }, + "question": "Should the badge be added to the token?", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the token and project comply with the required criteria and the badge should be added.", + "Select this if you think the token and/or project do(es) not comply with the required criteria and the badge should not be added." + ] + }, + "fileURI": "/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf", + "evidenceDisplayInterfaceURL": "https://badge-evidence.netlify.com", + "evidenceDisplayInterfaceHash": "Bccx3a2NSSihnHisifP6H67uYw7BeECZkXKYnBB8Vb9zbACNwzLWFyBbyudkJuGZMtNphEnyuwq5zup8ewdAyEmhjb", + "variables": { + "title": "Ethfinex Listing", + "symbolURI": "/ipfs/QmW3JLmpHnf7qNT4FYaguAF1Awma8adk81jUTuFWY1HVge/ethfinex.svg", + "description": "Tokens compliant with the Ethfinex Listing Criteria are eligible to participate in the Ethfinex Community Vote and become traded on the Ethfinex platform.", + "criteriaDescription": "To be eligible to receive the badge, the project and it's associated token must comply with the Ethfinex Listing Criteria." + } +} diff --git a/kleros-sdk/config/v1-metaevidence/tokens-ethfinex2.json b/kleros-sdk/config/v1-metaevidence/tokens-ethfinex2.json new file mode 100644 index 000000000..c5261f96f --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/tokens-ethfinex2.json @@ -0,0 +1,28 @@ +{ + "category": "Curated Lists", + "title": "Remove Ethfinex Badge From Token", + "description": "Someone requested to remove the the Ethfinex badge from a token.\n\nDescription\n\nTokens with the Ethfinex badge can participate in the Ethfinex Community Vote to become traded on the Ethfinex platform. To be eligible to receive the badge, the project and it's associated token must comply with the minimum set of criteria defined in the criteria document.", + "aliases": { + "0x988b3a538b618c7a603e1c11ab82cd16dbe28069": "Arbitrator" + }, + "question": "Should the badge be removed from the token?", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Don't Remove It" + ], + "descriptions": [ + "Select this if you think the token and/or project do(es) not comply with the required criteria and the badge should be removed.", + "Select this if you think the token and project comply with the required criteria and the badge should be kept." + ] + }, + "fileURI": "/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf", + "evidenceDisplayInterfaceURL": "https://badge-evidence.netlify.com", + "evidenceDisplayInterfaceHash": "Bccx3a2NSSihnHisifP6H67uYw7BeECZkXKYnBB8Vb9zbACNwzLWFyBbyudkJuGZMtNphEnyuwq5zup8ewdAyEmhjb", + "variables": { + "title": "Ethfinex Listing", + "symbolURI": "/ipfs/QmW3JLmpHnf7qNT4FYaguAF1Awma8adk81jUTuFWY1HVge/ethfinex.svg", + "description": "Tokens compliant with the Ethfinex Listing Criteria are eligible to participate in the Ethfinex Community Vote and become traded on the Ethfinex platform.", + "criteriaDescription": "To be eligible to receive the badge, the project and it's associated token must comply with the Ethfinex Listing Criteria." + } +} diff --git a/kleros-sdk/config/v1-metaevidence/tokens1.json b/kleros-sdk/config/v1-metaevidence/tokens1.json new file mode 100644 index 000000000..737e2381e --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/tokens1.json @@ -0,0 +1,21 @@ +{ + "category": "Curated Lists", + "title": "Add Token to Registry", + "description": "Someone requested to add a token to the token curated registry of tokens.", + "aliases": { + "0x988b3a538b618c7a603e1c11ab82cd16dbe28069": "Arbitrator" + }, + "question": "Should the token be added to the registry?", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the token information is correct and the token should be added to the registry.", + "Select this if you think the token information is incorrect and the token should be not be added to the registry." + ] + }, + "fileURI": "/ipfs/QmTL1SCKpRcr7NRbVpXW6z9QoQXRHJT5cQr6PEge5qoLwU/t2cr-primary-document.pdf", + "evidenceDisplayInterfaceURL": "https://ipfs.kleros.io/ipfs/QmYs17mAJTaQwYeXNTb6n4idoQXmRcAjREeUdjJShNSeKh/index.html" +} diff --git a/kleros-sdk/config/v1-metaevidence/tokens2.json b/kleros-sdk/config/v1-metaevidence/tokens2.json new file mode 100644 index 000000000..63793dedc --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/tokens2.json @@ -0,0 +1,21 @@ +{ + "category": "Curated Lists", + "title": "Remove Token from Registry", + "description": "Someone requested to remove a token from a token curated registry of tokens.", + "aliases": { + "0x988b3a538b618c7a603e1c11ab82cd16dbe28069": "Arbitrator" + }, + "question": "Should the token be removed from the registry?", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Keep It" + ], + "descriptions": [ + "Select this if you think the token information is incorrect and the token should be removed from the registry.", + "Select this if you think the token information is correct and the token should not be removed from the registry." + ] + }, + "fileURI": "/ipfs/QmTL1SCKpRcr7NRbVpXW6z9QoQXRHJT5cQr6PEge5qoLwU/t2cr-primary-document.pdf", + "evidenceDisplayInterfaceURL": "https://ipfs.kleros.io/ipfs/QmYs17mAJTaQwYeXNTb6n4idoQXmRcAjREeUdjJShNSeKh/index.html" +} diff --git a/kleros-sdk/config/v1-metaevidence/unslashed.json b/kleros-sdk/config/v1-metaevidence/unslashed.json new file mode 100644 index 000000000..5745cda90 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/unslashed.json @@ -0,0 +1,19 @@ +{ + "category": "Insurance", + "title": "Unslashed insurance claim", + "description": "The claimant requested a compensation for damages covered by Unslashed insurance in the provided amount.", + "question": "Should their claim be paid out?", + "rulingOptions": { + "type": "single-select", + "titles": [ + "Accept the claim", + "Reject the claim" + ], + "descriptions": [ + "Accept the claim if the claimant 1) incurred the alleged damages, 2) is covered by a relevant policy, 3) the damages and their cover are at least the claimed amount at the moment when the claim was filled.", + "Reject the claim if any of the acceptance criteria do not hold." + ] + }, + "fileURI": "/ipfs/QmeTBY7jZe2ut5WjifNASADo3E4zBxkMd62WwBpXtwP9pg", + "evidenceDisplayInterfaceURI": "https://app.unslashed.finance/embed/claims" +} diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt new file mode 100644 index 000000000..e3a685c0a --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt @@ -0,0 +1,48 @@ +{ + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?", + "type": "single-select", + "answers": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + }, + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "reserved": false + } + ], + "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it + "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "arbitrableChainID": "100", + "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "specification": "KIP99", + "metadata": { + "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "realityTemplateID": "76", + "realityQuestionID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", + "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", + "realityCategory": "content moderation", + "realityLang": "en_US", + "realityTimeout": "86400", + "realityOpeningTime": "1681263978", + "realityCreationTime": "1681263995", + "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + } +} diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt new file mode 100644 index 000000000..3cf41fb31 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt @@ -0,0 +1,57 @@ +{ + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ?", + "type": "single-select", + "answers": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + }, + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Max VERSTAPPEN", + "reserved": false + }, + { + "id": "0x02", + "title": "Sergio PEREZ", + "reserved": false + }, + { + "id": "0x03", + "title": "Fernando ALONSO", + "reserved": false + } + ], + "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it + "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "arbitrableChainID": "100", + "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "specification": "KIP99", + "metadata": { + "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "realityTemplateID": "2", + "realityQuestionID": "0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42", + "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", + "realityCategory": "sport", + "realityLang": "en_US", + "realityTimeout": "86400", + "realityOpeningTime": "1681263978", + "realityCreationTime": "1681263995", + "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + }, + "disputeTemplateID": "42", + "disputeTemplateHash": "", + "disputeTemplateInputsHash": "" + } + \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs1.txt b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs1.txt new file mode 100644 index 000000000..a63b1f5b9 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs1.txt @@ -0,0 +1,6 @@ +␟ +# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)? +single-select +/* not necessary for single-select */ +76 +0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs2.txt b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs2.txt new file mode 100644 index 000000000..9013cf597 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs2.txt @@ -0,0 +1,6 @@ +␟ +Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ? +single-select +,{"title": "Max VERSTAPPEN"},{"title": "Sergio PEREZ"},{"title": "Fernando ALONSO"} +2 +0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc new file mode 100644 index 000000000..6a8f86423 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc @@ -0,0 +1,27 @@ +{ + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "%s", + "type": "%s", + "answers": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + } + %s // for custom answers + ], + "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it + "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "arbitrableChainID": "100", + "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "specification": "KIP99", + "metadata": { + "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "realityTemplateID": "%s", + "realityQuestionID": "%s" + } +} diff --git a/package.json b/package.json index ac0761513..e17977efb 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "contracts", "dynamic-script", "evidence-display", - "kleros-ts", + "kleros-sdk", "subgraph", "web", "eslint-config", From 15308447dfea69e2bda7a251641315ee551e904e Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 18 Apr 2023 13:04:33 +0100 Subject: [PATCH 03/29] docs: wip specs --- .../disputetemplate-reality-final2.txt | 57 --- .../linguo/dispute-details.linguo.jsonc | 55 +++ .../linguo/dispute-template-inputs.linguo.txt | 0 .../linguo/dispute-template.linguo.jsonc | 27 ++ .../dispute-details.reality.schema.json | 339 ++++++++++++++++++ .../dispute-details.reality1.jsonc} | 11 +- .../reality/dispute-details.reality2.jsonc | 60 ++++ .../dispute-template-inputs.reality1.txt} | 0 .../dispute-template-inputs.reality2.txt} | 0 .../dispute-template.reality.jsonc} | 1 + .../dispute-template.reality.schema.json | 221 ++++++++++++ .../v2-disputetemplate/reality/kip-99.md | 120 +++++++ .../reality/kip-template.md | 40 +++ 13 files changed, 872 insertions(+), 59 deletions(-) delete mode 100644 kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/linguo/dispute-template-inputs.linguo.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json rename kleros-sdk/config/v2-disputetemplate/{disputetemplate-reality-final1.txt => reality/dispute-details.reality1.jsonc} (88%) create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc rename kleros-sdk/config/v2-disputetemplate/{disputetemplate-reality-inputs1.txt => reality/dispute-template-inputs.reality1.txt} (100%) rename kleros-sdk/config/v2-disputetemplate/{disputetemplate-reality-inputs2.txt => reality/dispute-template-inputs.reality2.txt} (100%) rename kleros-sdk/config/v2-disputetemplate/{disputetemplate-reality.jsonc => reality/dispute-template.reality.jsonc} (95%) create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/kip-99.md create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/kip-template.md diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt b/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt deleted file mode 100644 index 3cf41fb31..000000000 --- a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final2.txt +++ /dev/null @@ -1,57 +0,0 @@ -{ - "category": "Oracle", - "title": "A reality.eth question", - "description": "A reality.eth question has been raised to arbitration.", - "question": "Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ?", - "type": "single-select", - "answers": [ - { - "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "title": "Answered Too Soon", - "reserved": true - }, - { - "id": "0x00", - "title": "Invalid/Refuse to Arbitrate", - "reserved": true - }, - { - "id": "0x01", - "title": "Max VERSTAPPEN", - "reserved": false - }, - { - "id": "0x02", - "title": "Sergio PEREZ", - "reserved": false - }, - { - "id": "0x03", - "title": "Fernando ALONSO", - "reserved": false - } - ], - "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it - "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", - "arbitrableChainID": "100", - "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals - "arbitratorChainID": "421613", - "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore - "specification": "KIP99", - "metadata": { - "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", - "realityTemplateID": "2", - "realityQuestionID": "0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42", - "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", - "realityCategory": "sport", - "realityLang": "en_US", - "realityTimeout": "86400", - "realityOpeningTime": "1681263978", - "realityCreationTime": "1681263995", - "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" - }, - "disputeTemplateID": "42", - "disputeTemplateHash": "", - "disputeTemplateInputsHash": "" - } - \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc new file mode 100644 index 000000000..e5e68e750 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc @@ -0,0 +1,55 @@ +{ + "$schema": "./dispute-details.linguo.schema.json", + "category": "Translation", + "title": "Review a translation from Linguo", + "description": "Someone challenged a translation", + "question": "Does the translation comply with the required criteria?", + "type": "single-select", + "answers": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes, the translation should be accepted", + "description": "Select this if you think the translation complies with the required criteria.", + "reserved": false + }, + { + "id": "0x02", + "title": "No, the translation should not be accepted", + "description": "Select this if you think the translation does not comply with the required criteria.", + "reserved": false + } + ], + "frontendUrl": "https://linguo.kleros.io/translation/", // SDK should not change it + "policyURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "arbitrableChainID": "100", + "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "specification": "KIP999", + "metadata": { + "linguoAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "linguoTranslationID": "76", + "linguoDeadline": "1680307199", + "linguoSourceLanguage": "en-us", + "linguoTargetLanguage": "es", + "linguoExpectedQuality": "professional", + "linguoTitle": "What do I think about network states?", + "linguoWordCount": "7900", + "linguoOriginalTextUrl": "https://vitalik.ca/general/2022/07/13/networkstates.html", + "linguoOriginalTextFile": "/ipfs/QmY16SsM1uk7i2TLxGhUZR8iW74w4Luphry3SJeN6XyCTf/What do I think about network states.docx", + "linguoAssignedPrice": "81670000000000000000", + "linguoMinimumPrice": "0", + "linguoMaximumPrice": "500000000000000000000", + + // https://github.com/kleros/linguo-script/blob/master/src/index.js#L31-L44 + "linguoRequester": "0xabc996a233895be74a66f451f1019ca97342aaaa", + "linguoTranslator": "0xbcd996a233895be74a66f451f1019ca97342bbbb", + "linguoChallenger": "0xcde996a233895be74a66f451f1019ca97342cccc", + "linguoFrontendUrl": "https://linguo.kleros.io/translation/0x0B928165A67df8254412483ae8C3b8cc7F2b4D36/35", + } +} diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template-inputs.linguo.txt b/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template-inputs.linguo.txt new file mode 100644 index 000000000..e69de29bb diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc new file mode 100644 index 000000000..3f55a7fcd --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc @@ -0,0 +1,27 @@ +{ + "$schema": "./dispute-template.linguo.schema.json", + "category": "Translation", + "title": "Review a translation from Linguo", + "description": "Someone challenged a translation", + "question": "Does the translation comply with the required criteria?", + "type": "single-select", + "answers": [ + { + "title": "Yes, the translation should be accepted", + "description": "Select this if you think the translation complies with the required criteria.", + "reserved": false + }, + { + "title": "No, the translation should not be accepted", + "description": "Select this if you think the translation does not comply with the required criteria.", + "reserved": false + } + ], + "frontendUrl": "https://linguo.kleros.io/translation/", // SDK should not change it + "policyURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "arbitrableChainID": "100", + "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "specification": "KIP999" +} diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json b/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json new file mode 100644 index 000000000..4ffb3bb09 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json @@ -0,0 +1,339 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "dispute-details.schema.json", + "title": "Root Schema", + "description": "The root schema is the schema that comprises the entire JSON document.", + "type": "object", + "default": {}, + "required": [ + "category", + "title", + "description", + "question", + "type", + "answers", + "frontendUrl", + "policyURI", + "arbitrableChainID", + "arbitrableAddress", + "arbitratorChainID", + "arbitratorAddress", + "specification", + "metadata" + ], + "additionalProperties": true, + "properties": { + "category": { + "title": "The category Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "Oracle" + ] + }, + "title": { + "title": "The title Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "A reality.eth question" + ] + }, + "description": { + "title": "The description Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "A reality.eth question has been raised to arbitration." + ] + }, + "question": { + "title": "The question Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?" + ] + }, + "type": { + "title": "The type Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "single-select" + ], + "enum": [ + "bool", + "uint", + "single-select", + "multiple-select" + ] + }, + "answers": { + "title": "The answers Schema", + "description": "An explanation about the purpose of this instance.", + "type": "array", + "default": [], + "additionalItems": true, + "items": { + "title": "A Schema", + "description": "An explanation about the purpose of this instance.", + "type": "object", + "required": [ + "id", + "title", + "reserved" + ], + "additionalProperties": true, + "properties": { + "id": { + "title": "The id Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "examples": [ + "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "0x00", + "0x01", + "0x02" + ] + }, + "title": { + "title": "The title Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "examples": [ + "Answered Too Soon", + "Invalid/Refuse to Arbitrate", + "Yes", + "No" + ] + }, + "reserved": { + "title": "The reserved Schema", + "description": "An explanation about the purpose of this instance.", + "type": "boolean", + "examples": [ + true, + false + ] + } + }, + "examples": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + }, + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "reserved": false + } + ] + } + }, + "frontendUrl": { + "title": "The frontendUrl Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "https://reality.eth.link/app/#!/question/" + ] + }, + "policyURI": { + "title": "The policyURI Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf" + ] + }, + "arbitrableChainID": { + "title": "The arbitrableChainID Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "100" + ] + }, + "arbitrableAddress": { + "title": "The arbitrableAddress Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "0x2e39b8f43d0870ba896f516f78f57cde773cf805" + ] + }, + "arbitratorChainID": { + "title": "The arbitratorChainID Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "421613" + ] + }, + "arbitratorAddress": { + "title": "The arbitratorAddress Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "0xD08Ab99480d02bf9C092828043f611BcDFEA917b" + ] + }, + "specification": { + "title": "The specification Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "KIP99" + ] + }, + "metadata": { + "title": "The metadata Schema", + "description": "An explanation about the purpose of this instance.", + "type": "object", + "default": {}, + "required": [ + "realityAddress", + "realityTemplateID", + "realityQuestionID", + "realityUser", + "realityCategory", + "realityLang", + "realityTimeout", + "realityOpeningTime", + "realityCreationTime", + "realityFrontendUrl" + ], + "additionalProperties": true, + "properties": { + "realityAddress": { + "title": "The realityAddress Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "0xe78996a233895be74a66f451f1019ca9734205cc" + ] + }, + "realityTemplateID": { + "title": "The realityTemplateID Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "76" + ] + }, + "realityQuestionID": { + "title": "The realityQuestionID Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + ] + }, + "realityUser": { + "title": "The realityUser Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "0xe0441ecf50205d3548456b29fde2a3010f9a61f3" + ] + }, + "realityCategory": { + "title": "The realityCategory Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "content moderation" + ] + }, + "realityLang": { + "title": "The realityLang Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "en_US" + ] + }, + "realityTimeout": { + "title": "The realityTimeout Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "86400" + ] + }, + "realityOpeningTime": { + "title": "The realityOpeningTime Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "1681263978" + ] + }, + "realityCreationTime": { + "title": "The realityCreationTime Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "1681263995" + ] + }, + "realityFrontendUrl": { + "title": "The realityFrontendUrl Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "", + "examples": [ + "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + ] + } + }, + "examples": [ + { + "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "realityTemplateID": "76", + "realityQuestionID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", + "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", + "realityCategory": "content moderation", + "realityLang": "en_US", + "realityTimeout": "86400", + "realityOpeningTime": "1681263978", + "realityCreationTime": "1681263995", + "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + } + ] + } + } +} diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt b/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality1.jsonc similarity index 88% rename from kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt rename to kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality1.jsonc index e3a685c0a..48e94b470 100644 --- a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-final1.txt +++ b/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality1.jsonc @@ -1,4 +1,5 @@ { + "$schema": "./dispute-details.reality.schema.json", "category": "Oracle", "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", @@ -24,7 +25,7 @@ "id": "0x02", "title": "No", "reserved": false - } + }, ], "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", @@ -44,5 +45,11 @@ "realityOpeningTime": "1681263978", "realityCreationTime": "1681263995", "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" - } + }, + "externalDisputeID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", + "arbitrableDisputeID": "23", + "arbitratorDisputeID": "4563", + "disputeTemplateID": "42", + "disputeTemplateHash": "", + "disputeTemplateInputsHash": "" } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc new file mode 100644 index 000000000..13de41439 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc @@ -0,0 +1,60 @@ +{ + "$schema": "./dispute-details.reality.schema.json", + "category": "Oracle", + "title": "A reality.eth question", + "description": "A reality.eth question has been raised to arbitration.", + "question": "Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ?", + "type": "single-select", + "answers": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + }, + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Max VERSTAPPEN", + "reserved": false + }, + { + "id": "0x02", + "title": "Sergio PEREZ", + "reserved": false + }, + { + "id": "0x03", + "title": "Fernando ALONSO", + "reserved": false + } + ], + "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it + "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "arbitrableChainID": "100", + "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "specification": "KIP99", + "metadata": { + "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "realityTemplateID": "2", + "realityQuestionID": "0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42", + "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", + "realityCategory": "sport", + "realityLang": "en_US", + "realityTimeout": "86400", + "realityOpeningTime": "1681263978", + "realityCreationTime": "1681263995", + "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + }, + "externalDisputeID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", + "arbitrableDisputeID": "9", + "arbitratorDisputeID": "4565", + "disputeTemplateID": "42", + "disputeTemplateHash": "", + "disputeTemplateInputsHash": "" +} diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs1.txt b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality1.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs1.txt rename to kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality1.txt diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs2.txt b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality2.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/disputetemplate-reality-inputs2.txt rename to kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality2.txt diff --git a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.jsonc similarity index 95% rename from kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.jsonc index 6a8f86423..0c9b03f28 100644 --- a/kleros-sdk/config/v2-disputetemplate/disputetemplate-reality.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.jsonc @@ -1,4 +1,5 @@ { + "$schema": "./dispute-template.reality.schema.json", "category": "Oracle", "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json new file mode 100644 index 000000000..e4acb4ccf --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json @@ -0,0 +1,221 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "dispute-template.reality.schema.json", + "type": "object", + "default": {}, + "title": "Root Schema", + "required": [ + "$schema", + "category", + "title", + "description", + "question", + "type", + "answers", + "frontendUrl", + "policyURI", + "arbitrableChainID", + "arbitrableAddress", + "arbitratorChainID", + "arbitratorAddress", + "specification", + "metadata" + ], + "properties": { + "$schema": { + "type": "string", + "default": "", + "title": "The $schema Schema", + "examples": [ + "./dispute-template.reality.schema.json" + ] + }, + "category": { + "type": "string", + "default": "", + "title": "The category Schema", + "examples": [ + "Oracle" + ] + }, + "title": { + "type": "string", + "default": "", + "title": "The title Schema", + "examples": [ + "A reality.eth question" + ] + }, + "description": { + "type": "string", + "default": "", + "title": "The description Schema", + "examples": [ + "A reality.eth question has been raised to arbitration." + ] + }, + "question": { + "type": "string", + "default": "", + "title": "The question Schema", + "examples": [ + "%s" + ] + }, + "type": { + "type": "string", + "default": "", + "title": "The type Schema", + "examples": [ + "%s" + ] + }, + "answers": { + "type": "array", + "default": [], + "title": "The answers Schema", + "items": { + "type": "object", + "default": {}, + "title": "A Schema", + "required": [ + "id", + "title", + "reserved" + ], + "properties": { + "id": { + "type": "string", + "default": "", + "title": "The id Schema", + "examples": [ + "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + ] + }, + "title": { + "type": "string", + "default": "", + "title": "The title Schema", + "examples": [ + "Answered Too Soon" + ] + }, + "reserved": { + "type": "boolean", + "default": false, + "title": "The reserved Schema", + "examples": [ + true + ] + } + }, + "examples": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + } + ] + } + }, + "frontendUrl": { + "type": "string", + "default": "", + "title": "The frontendUrl Schema", + "examples": [ + "https://reality.eth.link/app/#!/question/" + ] + }, + "policyURI": { + "type": "string", + "default": "", + "title": "The policyURI Schema", + "examples": [ + "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf" + ] + }, + "arbitrableChainID": { + "type": "string", + "default": "", + "title": "The arbitrableChainID Schema", + "examples": [ + "100" + ] + }, + "arbitrableAddress": { + "type": "string", + "default": "", + "title": "The arbitrableAddress Schema", + "examples": [ + "0x2e39b8f43d0870ba896f516f78f57cde773cf805" + ] + }, + "arbitratorChainID": { + "type": "string", + "default": "", + "title": "The arbitratorChainID Schema", + "examples": [ + "421613" + ] + }, + "arbitratorAddress": { + "type": "string", + "default": "", + "title": "The arbitratorAddress Schema", + "examples": [ + "0xD08Ab99480d02bf9C092828043f611BcDFEA917b" + ] + }, + "specification": { + "type": "string", + "default": "", + "title": "The specification Schema", + "examples": [ + "KIP99" + ] + }, + "metadata": { + "type": "object", + "default": {}, + "title": "The metadata Schema", + "required": [ + "realityAddress", + "realityTemplateID", + "realityQuestionID" + ], + "properties": { + "realityAddress": { + "type": "string", + "default": "", + "title": "The realityAddress Schema", + "examples": [ + "0xe78996a233895be74a66f451f1019ca9734205cc" + ] + }, + "realityTemplateID": { + "type": "string", + "default": "", + "title": "The realityTemplateID Schema", + "examples": [ + "%s" + ] + }, + "realityQuestionID": { + "type": "string", + "default": "", + "title": "The realityQuestionID Schema", + "examples": [ + "%s" + ] + } + }, + "examples": [ + { + "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", + "realityTemplateID": "%s", + "realityQuestionID": "%s" + } + ] + } + } +} diff --git a/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md b/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md new file mode 100644 index 000000000..0c9b9f309 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md @@ -0,0 +1,120 @@ +--- +kip: KIP-99 +title: Reality.eth v2.1 as an arbitrable +author: @jaybuidl +discussions-to: https://forum.kleros.io/c/proposal/<#> +status: Draft +type: Arbitrable +created: 2023-04-08 +--- + +## Summary + +This proposal intends to provide an explicit specification describing how the Kleros protocol handles arbitration requests originating from the Reality.eth v2.1 protocol. + +## Motivation + +The Reality protocol is the most complex integration of the Kleros protocol so far. Prior to this proposal, there has been a lack of a comprehensive specification. + +Contributing to the complexity of this integration are: the dynamic nature of the questions and possible answers, an extra reserved answer ("answered too soon"), and a different encoding of the "invalid/refused to arbitrate" answer. + +## Technical Specification + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. + +### Supported functionalities + +#### Question types + +| Reality | Kleros | +| --------------- | -------------------------- | +| bool | ✅ maps to `single-select` | +| uint | TBC | +| single-select | ✅ | +| multiple-select | ❌ | + +### Dispute details document + +#### New reserved answer + +The answers must include: + +```json +{ + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true +} +``` + +#### External dispute identifier + +``` +externalDisputeID = realityQuestionID +``` + +#### Metadata + +##### Population of the Reality template + +1. Retrieve the Reality contract address: it is the address calling into `arbitrable.requestArbitration()` +1. Querying the event `LogNewQuestion` for the requested `realityQuestionID` on the Reality contract. +1. Retrieve the reality template by querying the event `LogNewTemplate` for `template_id` on the Reality contract. +1. Execute the template: + +```typescript +rc_question = require("@reality.eth/reality-eth-lib/formatters/question.js"); +rc_question.populatedJSONForTemplate(LogNewTemplate.question_text, LogNewQuestion.question); +``` + +##### Metadata object + +```typescript +{ + realityAddress = callerOf(arbitrable.requestArbitration()); + realityTemplateID = LogNewQuestion.template_id; + realityQuestionID = LogNewQuestion.question_id; + realityUser = LogNewQuestion.user; + realityType = populatedJSONForTemplate.type; + realityCategory = populatedJSONForTemplate.category; + realityLang = populatedJSONForTemplate.lang; + realityFormat = populatedJSONForTemplate.format; + realityTimeout = LogNewQuestion.timeout; + realityOpeningTime = LogNewQuestion.opening_ts; + realityCreationTime = LogNewQuestion.created; + realityNonce = LogNewQuestion.nonce; + realityFrontendUrl = frontendUrl + metadata.realityAddress + "-" + metadata.realityQuestionID; +} +``` + +### Arbitrable contract requirements + +#### Answer encoding + +```typescript +realityRuling = bytes32(klerosRuling - 1); +``` + +#### Interaction sequence + +[TODO](https://github.com/RealityETH/reality-eth-monorepo/blob/5565f55d19f627179f04d79a577ed6906ba78462/packages/docs/arbitrators.rst#creating-and-using-an-arbitration-contract) + +#### Views + +[TODO](https://github.com/RealityETH/reality-eth-monorepo/blob/5565f55d19f627179f04d79a577ed6906ba78462/packages/docs/arbitrators.rst#getting-information-about-the-arbitrator): `realitio()` pointing to Reality, metadata indicating template restrictions, terms of services, cross-chain arbitration. + +## Rationale + +TODO: the rationale should flesh out the specification by describing what motivated the design and why particular design decisions were made, as well as any alternative designs that were considered. + +## Implementation + +TODO: an implementation must be completed before any KIP proceeds to “Last Call” status. + +## Backwards Compatibility + +TODO + +## Security considerations + +All KIPs must include a discussion of the security implications/considerations relevant to the proposed change as well as proposed mitigations. A KIP cannot proceed to “Final” status without a sufficient security review from the core team. diff --git a/kleros-sdk/config/v2-disputetemplate/reality/kip-template.md b/kleros-sdk/config/v2-disputetemplate/reality/kip-template.md new file mode 100644 index 000000000..bb1f58f77 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/kip-template.md @@ -0,0 +1,40 @@ +--- +kip: <#> +title: +author: <a comma separated list of the author's or authors' name + GitHub username (in parenthesis), or name and email (in angle brackets). Example, FirstName LastName (@GitHubUsername), FirstName LastName <foo@bar.com>, FirstName (@GitHubUsername) and GitHubUsername (@GitHubUsername)> +discussions-to: https://forum.kleros.io/c/proposal/<#> +status: <Draft, Last Call, Approved, Final, Abandoned, Rejected> +type: <Core, Parameter, Arbitrable> +created: <yyyy-mm-dd> +requires: <KIP number(s)> # Only required when you reference an KIP in the `Specification` section. Otherwise, remove this field. +--- + +## Summary + +2-5 sentences providing a simplified and layman-accessible explanation of the issue. + +## Motivation + +The motivation is critical to change the KIP protocol. +It should clearly explain why the existing protocol specification is inadequate with respect to the issue raised. + +## Technical Specification + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. + +The technical specification should describe the syntax and semantics of the proposed solution for the issue raised. +If a suggestion is proposed, provide sufficient details so that an implementation would be possible (Proof of Concepts are acceptable). + +## Rationale + +The rationale should flesh out the specification by describing what motivated the design and why particular design decisions were made, as well as any alternative designs that were considered. + +## Implementation + +An implementation must be completed before any KIP proceeds to “Last Call” status. + +## Backwards Compatibility + +## Security considerations + +All KIPs must include a discussion of the security implications/considerations relevant to the proposed change as well as proposed mitigations. A KIP cannot proceed to “Final” status without a sufficient security review from the core team. From cff4a41ada7cfced6332a0a883bc986a0e0423f6 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 18 Apr 2023 15:15:56 +0100 Subject: [PATCH 04/29] docs: interfaces docs update --- .../{reality => }/kip-template.md | 0 ...nguo.jsonc => DisputeDetails.linguo.jsonc} | 12 +- .../linguo/DisputeTemplateInputs.linguo.txt | 2 + .../linguo/NewDispute.linguo.jsonc | 5 + ....jsonc => NewDisputeTemplate.linguo.jsonc} | 9 +- .../linguo/dispute-template-inputs.linguo.txt | 0 ...son => DisputeDetails.reality.schema.json} | 122 +++++++++++++----- ...y1.jsonc => DisputeDetails.reality1.jsonc} | 18 +-- ...y2.jsonc => DisputeDetails.reality2.jsonc} | 19 ++- ...txt => DisputeTemplateInputs.reality1.txt} | 5 +- .../DisputeTemplateInputs.reality2.txt | 5 + .../reality/NewDispute.reality1.jsonc | 5 + .../reality/NewDispute.reality2.jsonc | 5 + ...jsonc => NewDisputeTemplate.reality.jsonc} | 14 +- ...=> NewDisputeTemplate.reality.schema.json} | 30 ++++- .../dispute-template-inputs.reality2.txt | 6 - .../v2-disputetemplate/reality/kip-99.md | 2 +- 17 files changed, 182 insertions(+), 77 deletions(-) rename kleros-sdk/config/v2-disputetemplate/{reality => }/kip-template.md (100%) rename kleros-sdk/config/v2-disputetemplate/linguo/{dispute-details.linguo.jsonc => DisputeDetails.linguo.jsonc} (88%) create mode 100644 kleros-sdk/config/v2-disputetemplate/linguo/DisputeTemplateInputs.linguo.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/linguo/NewDispute.linguo.jsonc rename kleros-sdk/config/v2-disputetemplate/linguo/{dispute-template.linguo.jsonc => NewDisputeTemplate.linguo.jsonc} (83%) delete mode 100644 kleros-sdk/config/v2-disputetemplate/linguo/dispute-template-inputs.linguo.txt rename kleros-sdk/config/v2-disputetemplate/reality/{dispute-details.reality.schema.json => DisputeDetails.reality.schema.json} (82%) rename kleros-sdk/config/v2-disputetemplate/reality/{dispute-details.reality1.jsonc => DisputeDetails.reality1.jsonc} (84%) rename kleros-sdk/config/v2-disputetemplate/reality/{dispute-details.reality2.jsonc => DisputeDetails.reality2.jsonc} (81%) rename kleros-sdk/config/v2-disputetemplate/reality/{dispute-template-inputs.reality1.txt => DisputeTemplateInputs.reality1.txt} (74%) create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality1.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality2.jsonc rename kleros-sdk/config/v2-disputetemplate/reality/{dispute-template.reality.jsonc => NewDisputeTemplate.reality.jsonc} (72%) rename kleros-sdk/config/v2-disputetemplate/reality/{dispute-template.reality.schema.json => NewDisputeTemplate.reality.schema.json} (89%) delete mode 100644 kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality2.txt diff --git a/kleros-sdk/config/v2-disputetemplate/reality/kip-template.md b/kleros-sdk/config/v2-disputetemplate/kip-template.md similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/kip-template.md rename to kleros-sdk/config/v2-disputetemplate/kip-template.md diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc similarity index 88% rename from kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc rename to kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc index e5e68e750..30ca47577 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-details.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc @@ -1,6 +1,5 @@ { "$schema": "./dispute-details.linguo.schema.json", - "category": "Translation", "title": "Review a translation from Linguo", "description": "Someone challenged a translation", "question": "Does the translation comply with the required criteria?", @@ -24,12 +23,14 @@ "reserved": false } ], - "frontendUrl": "https://linguo.kleros.io/translation/", // SDK should not change it "policyURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "frontendUrl": "https://linguo.kleros.io/translation/0xe78996a233895be74a66f451f1019ca9734205cc/13", "arbitrableChainID": "100", "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Translation", + "lang": "en_US", "specification": "KIP999", "metadata": { "linguoAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", @@ -51,5 +52,10 @@ "linguoTranslator": "0xbcd996a233895be74a66f451f1019ca97342bbbb", "linguoChallenger": "0xcde996a233895be74a66f451f1019ca97342cccc", "linguoFrontendUrl": "https://linguo.kleros.io/translation/0x0B928165A67df8254412483ae8C3b8cc7F2b4D36/35", - } + }, + "externalDisputeID": "13", // taskID + "arbitrableDisputeID": "7", + "arbitratorDisputeID": "4564", + "disputeTemplateID": "43", + "disputeTemplateHash": "0xD1u9...2254" } diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeTemplateInputs.linguo.txt b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeTemplateInputs.linguo.txt new file mode 100644 index 000000000..a4f8f13ce --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeTemplateInputs.linguo.txt @@ -0,0 +1,2 @@ +0xe78996a233895be74a66f451f1019ca9734205cc +13 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/NewDispute.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/NewDispute.linguo.jsonc new file mode 100644 index 000000000..d113123a1 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/linguo/NewDispute.linguo.jsonc @@ -0,0 +1,5 @@ +{ + "externalDisputeID": "13", // taskID + "arbitrableDisputeID": "7", + "templateID": "43" +} diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc similarity index 83% rename from kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc rename to kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc index 3f55a7fcd..9e2545f5a 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc @@ -1,6 +1,5 @@ { - "$schema": "./dispute-template.linguo.schema.json", - "category": "Translation", + "$schema": "./NewDisputeTemplate.linguo.schema.json", "title": "Review a translation from Linguo", "description": "Someone challenged a translation", "question": "Does the translation comply with the required criteria?", @@ -9,19 +8,19 @@ { "title": "Yes, the translation should be accepted", "description": "Select this if you think the translation complies with the required criteria.", - "reserved": false }, { "title": "No, the translation should not be accepted", "description": "Select this if you think the translation does not comply with the required criteria.", - "reserved": false } ], - "frontendUrl": "https://linguo.kleros.io/translation/", // SDK should not change it "policyURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "frontendUrl": "https://linguo.kleros.io/translation/%s/%s", "arbitrableChainID": "100", "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "lang": "en_US", + "category": "Translation", "specification": "KIP999" } diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template-inputs.linguo.txt b/kleros-sdk/config/v2-disputetemplate/linguo/dispute-template-inputs.linguo.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json similarity index 82% rename from kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json rename to kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json index 4ffb3bb09..dbb93163b 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality.schema.json +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json @@ -1,12 +1,13 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "dispute-details.schema.json", + "$id": "DisputeDetails.reality.schema.json", "title": "Root Schema", "description": "The root schema is the schema that comprises the entire JSON document.", "type": "object", "default": {}, "required": [ "category", + "lang", "title", "description", "question", @@ -19,9 +20,14 @@ "arbitratorChainID", "arbitratorAddress", "specification", - "metadata" + "metadata", + "externalDisputeID", + "arbitrableDisputeID", + "arbitratorDisputeID", + "disputeTemplateID", + "disputeTemplateHash" ], - "additionalProperties": true, + "additionalProperties": false, "properties": { "category": { "title": "The category Schema", @@ -32,6 +38,14 @@ "Oracle" ] }, + "lang": { + "type": "string", + "default": "", + "title": "The lang Schema", + "examples": [ + "en_US" + ] + }, "title": { "title": "The title Schema", "description": "An explanation about the purpose of this instance.", @@ -211,112 +225,118 @@ ] }, "metadata": { - "title": "The metadata Schema", - "description": "An explanation about the purpose of this instance.", "type": "object", "default": {}, + "title": "The metadata Schema", "required": [ "realityAddress", "realityTemplateID", "realityQuestionID", "realityUser", + "realityType", "realityCategory", "realityLang", + "realityFormat", "realityTimeout", "realityOpeningTime", "realityCreationTime", - "realityFrontendUrl" + "realityNonce" ], - "additionalProperties": true, "properties": { "realityAddress": { - "title": "The realityAddress Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityAddress Schema", "examples": [ "0xe78996a233895be74a66f451f1019ca9734205cc" ] }, "realityTemplateID": { - "title": "The realityTemplateID Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityTemplateID Schema", "examples": [ "76" ] }, "realityQuestionID": { - "title": "The realityQuestionID Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityQuestionID Schema", "examples": [ "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" ] }, "realityUser": { - "title": "The realityUser Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityUser Schema", "examples": [ "0xe0441ecf50205d3548456b29fde2a3010f9a61f3" ] }, + "realityType": { + "type": "string", + "default": "", + "title": "The realityType Schema", + "examples": [ + "bool" + ] + }, "realityCategory": { - "title": "The realityCategory Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityCategory Schema", "examples": [ "content moderation" ] }, "realityLang": { - "title": "The realityLang Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityLang Schema", "examples": [ "en_US" ] }, + "realityFormat": { + "type": "string", + "default": "", + "title": "The realityFormat Schema", + "examples": [ + "text/markdown" + ] + }, "realityTimeout": { - "title": "The realityTimeout Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityTimeout Schema", "examples": [ "86400" ] }, "realityOpeningTime": { - "title": "The realityOpeningTime Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityOpeningTime Schema", "examples": [ "1681263978" ] }, "realityCreationTime": { - "title": "The realityCreationTime Schema", - "description": "An explanation about the purpose of this instance.", "type": "string", "default": "", + "title": "The realityCreationTime Schema", "examples": [ "1681263995" ] }, - "realityFrontendUrl": { - "title": "The realityFrontendUrl Schema", - "description": "An explanation about the purpose of this instance.", + "realityNonce": { "type": "string", "default": "", + "title": "The realityNonce Schema", "examples": [ - "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + "3" ] } }, @@ -326,14 +346,56 @@ "realityTemplateID": "76", "realityQuestionID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", + "realityType": "bool", "realityCategory": "content moderation", "realityLang": "en_US", + "realityFormat": "text/markdown", "realityTimeout": "86400", "realityOpeningTime": "1681263978", "realityCreationTime": "1681263995", - "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + "realityNonce": "3" } ] + }, + "externalDisputeID": { + "type": "string", + "default": "", + "title": "The externalDisputeID Schema", + "examples": [ + "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + ] + }, + "arbitrableDisputeID": { + "type": "string", + "default": "", + "title": "The arbitrableDisputeID Schema", + "examples": [ + "245" + ] + }, + "arbitratorDisputeID": { + "type": "string", + "default": "", + "title": "The arbitratorDisputeID Schema", + "examples": [ + "4563" + ] + }, + "disputeTemplateID": { + "type": "string", + "default": "", + "title": "The disputeTemplateID Schema", + "examples": [ + "42" + ] + }, + "disputeTemplateHash": { + "type": "string", + "default": "", + "title": "The disputeTemplateHash Schema", + "examples": [ + "0xB5u9...2240" + ] } } } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality1.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc similarity index 84% rename from kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality1.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc index 48e94b470..1eaab177d 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality1.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc @@ -1,6 +1,5 @@ { - "$schema": "./dispute-details.reality.schema.json", - "category": "Oracle", + "$schema": "./DisputeDetails.reality.schema.json", "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", "question": "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?", @@ -25,31 +24,34 @@ "id": "0x02", "title": "No", "reserved": false - }, + } ], - "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "frontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", "arbitrableChainID": "100", "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Oracle", + "lang": "en_US", "specification": "KIP99", "metadata": { "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", "realityTemplateID": "76", "realityQuestionID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", "realityUser": "0xe0441ecf50205d3548456b29fde2a3010f9a61f3", + "realityType": "bool", "realityCategory": "content moderation", "realityLang": "en_US", + "realityFormat": "text/markdown", "realityTimeout": "86400", "realityOpeningTime": "1681263978", "realityCreationTime": "1681263995", - "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + "realityNonce": "3" }, "externalDisputeID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", - "arbitrableDisputeID": "23", + "arbitrableDisputeID": "245", "arbitratorDisputeID": "4563", "disputeTemplateID": "42", - "disputeTemplateHash": "", - "disputeTemplateInputsHash": "" + "disputeTemplateHash": "0xB5u9...2240" } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality2.jsonc similarity index 81% rename from kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality2.jsonc index 13de41439..669c28d1e 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-details.reality2.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality2.jsonc @@ -1,6 +1,5 @@ { - "$schema": "./dispute-details.reality.schema.json", - "category": "Oracle", + "$schema": "./DisputeDetails.reality.schema.json", "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", "question": "Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ?", @@ -32,12 +31,14 @@ "reserved": false } ], - "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it "arbitrableChainID": "100", "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Oracle", + "lang": "en_US", "specification": "KIP99", "metadata": { "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", @@ -48,13 +49,11 @@ "realityLang": "en_US", "realityTimeout": "86400", "realityOpeningTime": "1681263978", - "realityCreationTime": "1681263995", - "realityFrontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39" + "realityCreationTime": "1681263995" }, "externalDisputeID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", - "arbitrableDisputeID": "9", - "arbitratorDisputeID": "4565", - "disputeTemplateID": "42", - "disputeTemplateHash": "", - "disputeTemplateInputsHash": "" + "arbitrableDisputeID": "246", + "arbitratorDisputeID": "4564", + "disputeTemplateID": "2", + "disputeTemplateHash": "0xC5u9...2283" } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality1.txt b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt similarity index 74% rename from kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality1.txt rename to kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt index a63b1f5b9..8798f050f 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality1.txt +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt @@ -1,6 +1,5 @@ -␟ # [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)? single-select -/* not necessary for single-select */ -76 +{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false} +0xe78996a233895be74a66f451f1019ca9734205cc 0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt new file mode 100644 index 000000000..443a208c9 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt @@ -0,0 +1,5 @@ +Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ? +single-select +{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Max VERSTAPPEN","reserved":false},{"id":"0x02","title":"Sergio PEREZ","reserved":false},{"id":"0x03","title":"Fernando ALONSO","reserved":false} +0xe78996a233895be74a66f451f1019ca9734205cc +0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality1.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality1.jsonc new file mode 100644 index 000000000..95fb762f2 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality1.jsonc @@ -0,0 +1,5 @@ +{ + "externalDisputeID": "0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", // questionID + "arbitrableDisputeID": "245", + "templateID": "42" +} diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality2.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality2.jsonc new file mode 100644 index 000000000..21c23d34e --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality2.jsonc @@ -0,0 +1,5 @@ +{ + "externalDisputeID": "0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42", // questionID + "arbitrableDisputeID": "246", + "templateID": "2" +} diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc similarity index 72% rename from kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc index 0c9b03f28..d7c10d239 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc @@ -1,6 +1,5 @@ { - "$schema": "./dispute-template.reality.schema.json", - "category": "Oracle", + "$schema": "./NewDisputeTemplate.reality.schema.json", "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", "question": "%s", @@ -13,16 +12,13 @@ } %s // for custom answers ], - "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it "policyURI": "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "frontendUrl": "https://reality.eth.link/app/#!/question/%s-%s", "arbitrableChainID": "100", "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore - "specification": "KIP99", - "metadata": { - "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", - "realityTemplateID": "%s", - "realityQuestionID": "%s" - } + "category": "Oracle", + "lang": "en_US", + "specification": "KIP99" } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json similarity index 89% rename from kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json rename to kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json index e4acb4ccf..12df4cb07 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template.reality.schema.json +++ b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json @@ -1,12 +1,13 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "dispute-template.reality.schema.json", + "$id": "NewDisputeTemplate.reality.schema.json", "type": "object", "default": {}, "title": "Root Schema", "required": [ "$schema", "category", + "lang", "title", "description", "question", @@ -21,6 +22,7 @@ "specification", "metadata" ], + "additionalProperties": false, "properties": { "$schema": { "type": "string", @@ -38,6 +40,14 @@ "Oracle" ] }, + "lang": { + "type": "string", + "default": "", + "title": "The lang Schema", + "examples": [ + "en_US" + ] + }, "title": { "type": "string", "default": "", @@ -72,7 +82,23 @@ }, "answers": { "type": "array", - "default": [], + "default": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "reserved": false + } + ], "title": "The answers Schema", "items": { "type": "object", diff --git a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality2.txt b/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality2.txt deleted file mode 100644 index 9013cf597..000000000 --- a/kleros-sdk/config/v2-disputetemplate/reality/dispute-template-inputs.reality2.txt +++ /dev/null @@ -1,6 +0,0 @@ -␟ -Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ? -single-select -,{"title": "Max VERSTAPPEN"},{"title": "Sergio PEREZ"},{"title": "Fernando ALONSO"} -2 -0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md b/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md index 0c9b9f309..e4ad587cb 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md +++ b/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md @@ -1,7 +1,7 @@ --- kip: KIP-99 title: Reality.eth v2.1 as an arbitrable -author: @jaybuidl +author: Jaybuidl (@jaybuidl) discussions-to: https://forum.kleros.io/c/proposal/<#> status: Draft type: Arbitrable From aca496dd03b3c8f31bd1a90dd07676c043fd21f5 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 18 Apr 2023 21:19:08 +0100 Subject: [PATCH 05/29] docs: added curate, improved the schema --- kleros-sdk/config/v1-metaevidence/lgtcr5.json | 48 +++ kleros-sdk/config/v1-metaevidence/lgtcr6.json | 48 +++ .../DisputeDetails.default.jsonc | 23 ++ .../NewDisputeTemplate.schema.json | 293 ++++++++++++++++++ .../curate/DisputeDetails.curate.jsonc | 70 +++++ .../curate/DisputeTemplateInputs.curate.txt | 3 + .../curate/NewDispute.curate.jsonc | 11 + .../curate/NewDisputeTemplate.curate.jsonc | 25 ++ .../linguo/DisputeDetails.linguo.jsonc | 2 +- .../linguo/NewDisputeTemplate.linguo.jsonc | 3 +- .../DisputeDetails.reality.schema.json | 196 ++---------- .../reality/DisputeDetails.reality1.jsonc | 1 - .../reality/NewDisputeTemplate.reality.jsonc | 3 +- .../NewDisputeTemplate.reality.schema.json | 247 --------------- 14 files changed, 545 insertions(+), 428 deletions(-) create mode 100644 kleros-sdk/config/v1-metaevidence/lgtcr5.json create mode 100644 kleros-sdk/config/v1-metaevidence/lgtcr6.json create mode 100644 kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json create mode 100644 kleros-sdk/config/v2-disputetemplate/curate/DisputeDetails.curate.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/curate/DisputeTemplateInputs.curate.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc delete mode 100644 kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json diff --git a/kleros-sdk/config/v1-metaevidence/lgtcr5.json b/kleros-sdk/config/v1-metaevidence/lgtcr5.json new file mode 100644 index 000000000..66e7424b8 --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/lgtcr5.json @@ -0,0 +1,48 @@ +{ + "title": "Add an entry to Ledger Contract Domain Name registry v2", + "description": "Someone requested to add an entry to Ledger Contract Domain Name registry v2", + "rulingOptions": { + "titles": [ + "Yes, Add It", + "No, Don't Add It" + ], + "descriptions": [ + "Select this if you think the entry complies with the required criteria and should be added.", + "Select this if you think the entry does not comply with the required criteria and should not be added." + ] + }, + "category": "Curated Lists", + "question": "Does the entry comply with the required criteria?", + "fileURI": "/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmNhJXtMrxeJu4fpchPruGrL93bm2M4VmDZ8pj4x6FqnHJ/index.html", + "metadata": { + "tcrTitle": "Ledger Contract Domain Name registry v2", + "tcrDescription": "A list of contract addresses and the domain names they are meant to be used from .", + "columns": [ + { + "label": "Contract address", + "description": "The address of the contract in question. Case-sensitive only if required by the blockchain that the address pertains to (e.g. Solana). ", + "type": "rich address", + "isIdentifier": true + }, + { + "label": "Domain name", + "description": "The specific (sub)domain name of the dApp where this contract is meant to be accessed from. Wildcards (*) are acceptable as part of this field if proof can be shown that the contract is intended to be used across multiple domains.", + "type": "text", + "isIdentifier": true + }, + { + "label": "Visual proof", + "description": "If the domain is a specific root or subdomain, this must be a screenshot of the exact page and setup where this particular address can be interacted from.", + "type": "image", + "isIdentifier": false + } + ], + "itemName": "entry", + "itemNamePlural": "entries", + "logoURI": "/ipfs/QmNNSDkpyDX1wB4NNFdAzaHsJihpvgNVV89zCH8FH9CVAz/ledger-white.png", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v1-metaevidence/lgtcr6.json b/kleros-sdk/config/v1-metaevidence/lgtcr6.json new file mode 100644 index 000000000..1dca32efa --- /dev/null +++ b/kleros-sdk/config/v1-metaevidence/lgtcr6.json @@ -0,0 +1,48 @@ +{ + "title": "Remove an entry from Ledger Contract Domain Name registry v2", + "description": "Someone requested to remove an entry from Ledger Contract Domain Name registry v2", + "rulingOptions": { + "titles": [ + "Yes, Remove It", + "No, Don't Remove It" + ], + "descriptions": [ + "Select this if you think the entry does not comply with the required criteria and should be removed.", + "Select this if you think the entry complies with the required criteria and should not be removed." + ] + }, + "category": "Curated Lists", + "question": "Does the entry comply with the required criteria?", + "fileURI": "/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf", + "evidenceDisplayInterfaceURI": "/ipfs/QmNhJXtMrxeJu4fpchPruGrL93bm2M4VmDZ8pj4x6FqnHJ/index.html", + "metadata": { + "tcrTitle": "Ledger Contract Domain Name registry v2", + "tcrDescription": "A list of contract addresses and the domain names they are meant to be used from .", + "columns": [ + { + "label": "Contract address", + "description": "The address of the contract in question. Case-sensitive only if required by the blockchain that the address pertains to (e.g. Solana). ", + "type": "rich address", + "isIdentifier": true + }, + { + "label": "Domain name", + "description": "The specific (sub)domain name of the dApp where this contract is meant to be accessed from. Wildcards (*) are acceptable as part of this field if proof can be shown that the contract is intended to be used across multiple domains.", + "type": "text", + "isIdentifier": true + }, + { + "label": "Visual proof", + "description": "If the domain is a specific root or subdomain, this must be a screenshot of the exact page and setup where this particular address can be interacted from.", + "type": "image", + "isIdentifier": false + } + ], + "itemName": "entry", + "itemNamePlural": "entries", + "logoURI": "/ipfs/QmNNSDkpyDX1wB4NNFdAzaHsJihpvgNVV89zCH8FH9CVAz/ledger-white.png", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + } +} diff --git a/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc b/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc new file mode 100644 index 000000000..32decb39f --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc @@ -0,0 +1,23 @@ +{ + // Sensible defaults which are not expected to be specified by the arbitrable. + "type": "single-select", + "answers": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "reserved": false + }, + { + "id": "0x02", + "reserved": false + } + ], + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "lang": "en_US", + "specification": "KIP000" +} diff --git a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json new file mode 100644 index 000000000..15311fee1 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json @@ -0,0 +1,293 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "NewDisputeTemplate.schema.json", + "type": "object", + "default": {}, + "title": "Root Schema", + "required": [ + "title", + "description", + "question", + "frontendUrl", + "policyURI", + "arbitrableChainID", + "arbitrableAddress", + "arbitratorChainID", + "arbitratorAddress" + ], + "additionalProperties": false, + "properties": { + "category": { + "type": "string", + "default": "", + "title": "The category Schema", + "examples": [ + "Oracle" + ] + }, + "lang": { + "type": "string", + "default": "", + "title": "The lang Schema", + "examples": [ + "en_US" + ] + }, + "title": { + "type": "string", + "default": "", + "title": "The title Schema", + "examples": [ + "A reality.eth question", + "Add Ethfinex Badge to Token", + "Add Token to Registry", + "Add a list to Consensus Layer Withdrawal Protection enabled badges", + "Add a list to Omen Verified Market enabled badges", + "Add a list to The Registry enabled badges", + "Add a market to Omen Verified Market", + "Add a validator to Consensus Layer Withdrawal Protection", + "Add an entry to Ledger Contract Domain Name registry v2", + "Proof of Humanity Clearing Request", + "Proof of Humanity Registration Request", + "Realitio Question", + "Remove Ethfinex Badge From Token", + "Remove Token from Registry", + "Remove a list from Consensus Layer Withdrawal Protection enabled badges", + "Remove a list from Omen Verified Market enabled badges", + "Remove a market from Omen Verified Market", + "Remove a validator from Consensus Layer Withdrawal Protection", + "Remove an entry from Ledger Contract Domain Name registry v2", + "Review a translation from Linguo", + "Unslashed insurance claim" + ] + }, + "description": { + "type": "string", + "default": "", + "title": "The description Schema", + "examples": [ + "A Reality.eth question has been raised to arbitration.", + "A request to register the specified entry to a list of provable humans.", + "A request to remove the specified entry from a list of provable humans.", + "Someone challenged a translation", + "Someone requested to add a list to Consensus Layer Withdrawal Protection enabled badges.", + "Someone requested to add a list to Omen Verified Market enabled badges.", + "Someone requested to add a list to The Registry enabled badges.", + "Someone requested to add a market to Omen Verified Market", + "Someone requested to add a token to the token curated registry of tokens.", + "Someone requested to add a validator to Consensus Layer Withdrawal Protection", + "Someone requested to add an entry to Ledger Contract Domain Name registry v2", + "Someone requested to add the the Ethfinex badge to a token.\n\nDescription\n\nTokens with the Ethfinex badge can participate in the Ethfinex Community Vote to become traded on the Ethfinex platform. To be eligible to receive the badge, the project and it's associated token must comply with the minimum set of criteria defined in the criteria document.", + "Someone requested to remove a list from Consensus Layer Withdrawal Protection enabled badges.", + "Someone requested to remove a list from Omen Verified Market enabled badges.", + "Someone requested to remove a market from Omen Verified Market", + "Someone requested to remove a token from a token curated registry of tokens.", + "Someone requested to remove a validator from Consensus Layer Withdrawal Protection", + "Someone requested to remove an entry from Ledger Contract Domain Name registry v2", + "Someone requested to remove the the Ethfinex badge from a token.\n\nDescription\n\nTokens with the Ethfinex badge can participate in the Ethfinex Community Vote to become traded on the Ethfinex platform. To be eligible to receive the badge, the project and it's associated token must comply with the minimum set of criteria defined in the criteria document.", + "The claimant requested a compensation for damages covered by Unslashed insurance in the provided amount." + ] + }, + "question": { + "type": "string", + "default": "", + "title": "The question Schema", + "examples": [ + "Does the entry comply with the required criteria?", + "Does the list comply with the required criteria?", + "Does the market comply with the required criteria?", + "Does the translation comply with the required criteria?", + "Does the validator comply with the required criteria?", + "Give the answer to the question.", + "Should the badge be added to the token?", + "Should the badge be removed from the token?", + "Should the request to register be accepted?", + "Should the request to remove be accepted?", + "Should the token be added to the registry?", + "Should the token be removed from the registry?", + "Should their claim be paid out?", + "Which party abided by terms of the contract?" + ] + }, + "type": { + "title": "The type Schema", + "description": "An explanation about the purpose of this instance.", + "type": "string", + "default": "single-select", + "examples": [ + "single-select" + ], + "enum": [ + "bool", + "uint", + "single-select", + "multiple-select" + ] + }, + "answers": { + "type": "array", + "default": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "reserved": false + } + ], + "title": "The answers Schema", + "items": { + "type": "object", + "default": {}, + "title": "A Schema", + "required": [ + "id", + "title", + "reserved" + ], + "properties": { + "id": { + "type": "string", + "default": "", + "title": "The id Schema", + "examples": [ + "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "title": { + "type": "string", + "default": "", + "title": "The title Schema", + "examples": [ + "Accept the claim", + "No", + "No, Don't Add It", + "No, Don't Remove It", + "No, Keep It", + "No, the translation should not be accepted", + "Pay Receiver", + "Refund Sender", + "Reject the claim", + "Yes", + "Yes, Add It", + "Yes, Remove It", + "Yes, the translation should be accepted", + "Answered Too Soon", + "Invalid/Refuse to Arbitrate" + ] + }, + "reserved": { + "type": "boolean", + "default": false, + "title": "The reserved Schema", + "examples": [ + true, + false + ] + } + }, + "examples": [ + { + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", + "reserved": true + }, + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "reserved": false + } + ] + } + }, + "frontendUrl": { + "type": "string", + "default": "", + "title": "The frontendUrl Schema", + "examples": [ + "https://curate.kleros.io/tcr/1/0x0000000000000000000000000000000000000000/0x0000000000000000000000000000000000000000000000000000000000000000", + "https://reality.eth.link/app/#!/question/0x0000000000000000000000000000000000000000000000000000000000000000/0" + ] + }, + "policyURI": { + "type": "string", + "default": "", + "title": "The policyURI Schema", + "examples": [ + "/ipfs/QmPhEBstumEP84eSftx9MwBmSXBCGRFJMPZauKVa9gBizh/omen-verified-market.pdf", + "/ipfs/QmPtXtFKfVc3w5aGVNYrmBZWEHBLpk2XMLkYCnEioxwy43/clwp-acceptance-policy.pdf", + "/ipfs/QmTL1SCKpRcr7NRbVpXW6z9QoQXRHJT5cQr6PEge5qoLwU/t2cr-primary-document.pdf", + "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", + "/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf", + "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf", + "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "/ipfs/QmZ7RVU7re1g8nXDbAFMHV99pyie3dn4cY7Ga2X4h8mDpV/reject-all-policy.pdf", + "/ipfs/QmaUr6hnSVxYD899xdcn2GUVtXVjXoSXKZbce3zFtGWw4H/Question_Resolution_Policy.pdf", + "/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf", + "/ipfs/QmeTBY7jZe2ut5WjifNASADo3E4zBxkMd62WwBpXtwP9pg" + ] + }, + "arbitrableChainID": { + "type": "string", + "default": "", + "title": "The arbitrableChainID Schema", + "examples": [ + "1", + "100" + ] + }, + "arbitrableAddress": { + "type": "string", + "default": "", + "title": "The arbitrableAddress Schema", + "examples": [ + "0x2e39b8f43d0870ba896f516f78f57cde773cf805" + ] + }, + "arbitratorChainID": { + "type": "string", + "default": "", + "title": "The arbitratorChainID Schema", + "examples": [ + "421613" + ] + }, + "arbitratorAddress": { + "type": "string", + "default": "", + "title": "The arbitratorAddress Schema", + "examples": [ + "0xD08Ab99480d02bf9C092828043f611BcDFEA917b" + ] + }, + "specification": { + "type": "string", + "default": "", + "title": "The specification Schema", + "examples": [ + "KIP00", + "KIP99" + ] + } + } +} diff --git a/kleros-sdk/config/v2-disputetemplate/curate/DisputeDetails.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/DisputeDetails.curate.jsonc new file mode 100644 index 000000000..e00b87af4 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/curate/DisputeDetails.curate.jsonc @@ -0,0 +1,70 @@ +{ + "$schema": "./DisputeDetails.curate.schema.json", + "title": "Add an entry to Ledger Contract Domain Name registry v2", + "description": "Someone requested to add an entry to Ledger Contract Domain Name registry v2", + "question": "Does the entry comply with the required criteria?", + "type": "single-select", + "answers": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes, Add It", + "description": "Select this if you think the entry complies with the required criteria and should be added.", + "reserved": false + }, + { + "id": "0x02", + "title": "No, Don't Add It", + "description": "Select this if you think the entry does not comply with the required criteria and should not be added.", + "reserved": false + } + ], + "policyURI": "/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf", + "frontendUrl": "https://curate.kleros.io/tcr/100/0x957A53A994860BE4750810131d9c876b2f52d6E1/0xc2c1aa705632f53051f22a9f65967c0944370020a7489aba608bd0d755ca1234", + "arbitrableChainID": "100", + "arbitrableAddress": "0x957A53A994860BE4750810131d9c876b2f52d6E1", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Curated Lists", + "lang": "en_US", + "specification": "KIP88", + "metadata": { + "tcrTitle": "Ledger Contract Domain Name registry v2", + "tcrDescription": "A list of contract addresses and the domain names they are meant to be used from .", + "columns": [ + { + "label": "Contract address", + "description": "The address of the contract in question. Case-sensitive only if required by the blockchain that the address pertains to (e.g. Solana). ", + "type": "rich address", + "isIdentifier": true + }, + { + "label": "Domain name", + "description": "The specific (sub)domain name of the dApp where this contract is meant to be accessed from. Wildcards (*) are acceptable as part of this field if proof can be shown that the contract is intended to be used across multiple domains.", + "type": "text", + "isIdentifier": true + }, + { + "label": "Visual proof", + "description": "If the domain is a specific root or subdomain, this must be a screenshot of the exact page and setup where this particular address can be interacted from.", + "type": "image", + "isIdentifier": false + } + ], + "itemName": "entry", + "itemNamePlural": "entries", + "logoURI": "/ipfs/QmNNSDkpyDX1wB4NNFdAzaHsJihpvgNVV89zCH8FH9CVAz/ledger-white.png", + "requireRemovalEvidence": true, + "isTCRofTCRs": false, + "relTcrDisabled": true + }, + "externalDisputeID": "0x32554266108048001186322211785477470843107987690258181975452540727388224860514", // hash(itemID, requestID) + "arbitrableDisputeID": "91", + "arbitratorDisputeID": "4565", + "disputeTemplateID": "44", + "disputeTemplateHash": "0xD1u9...2254" +} diff --git a/kleros-sdk/config/v2-disputetemplate/curate/DisputeTemplateInputs.curate.txt b/kleros-sdk/config/v2-disputetemplate/curate/DisputeTemplateInputs.curate.txt new file mode 100644 index 000000000..186ef2be9 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/curate/DisputeTemplateInputs.curate.txt @@ -0,0 +1,3 @@ +100 +0x957A53A994860BE4750810131d9c876b2f52d6E1 +0xc2c1aa705632f53051f22a9f65967c0944370020a7489aba608bd0d755ca1234 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc new file mode 100644 index 000000000..9054d6371 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc @@ -0,0 +1,11 @@ +{ + "externalDisputeID": "32554266108048001186322211785477470843107987690258181975452540727388224860514", // hash(itemID, requestID) + "arbitrableDisputeID": "91", + "templateID": "44" +} + +/* +Contribution._itemID = 0xC2C1AA705632F53051F22A9F65967C0944370020A7489ABA608BD0D755CA1234 +Contribution._requestID = 0 +Contribution._evidenceGroupID = hash(itemID, requestID) = 0x32554266108048001186322211785477470843107987690258181975452540727388224860514 +*/ \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc new file mode 100644 index 000000000..a73e449a1 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc @@ -0,0 +1,25 @@ +{ + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Add an entry to Ledger Contract Domain Name registry v2", + "description": "Someone requested to add an entry to Ledger Contract Domain Name registry v2", + "question": "Does the entry comply with the required criteria?", + "type": "single-select", + "answers": [ + { + "title": "Yes, Add It", + "description": "Select this if you think the entry complies with the required criteria and should be added.", + }, + { + "title": "No, Don't Add It", + "description": "Select this if you think the entry does not comply with the required criteria and should not be added.", + } + ], + "policyURI": "/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf", + "frontendUrl": "https://curate.kleros.io/tcr/%s/%s/%s", + "arbitrableChainID": "100", + "arbitrableAddress": "0x957A53A994860BE4750810131d9c876b2f52d6E1", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Curated Lists", + "specification": "KIP88" +} diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc index 30ca47577..f5ec222bb 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc @@ -1,5 +1,5 @@ { - "$schema": "./dispute-details.linguo.schema.json", + "$schema": "./DisputeDetails.linguo.schema.json", "title": "Review a translation from Linguo", "description": "Someone challenged a translation", "question": "Does the translation comply with the required criteria?", diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc index 9e2545f5a..54d4446e6 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc @@ -1,5 +1,5 @@ { - "$schema": "./NewDisputeTemplate.linguo.schema.json", + "$schema": "../NewDisputeTemplate.schema.json", "title": "Review a translation from Linguo", "description": "Someone challenged a translation", "question": "Does the translation comply with the required criteria?", @@ -20,7 +20,6 @@ "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore - "lang": "en_US", "category": "Translation", "specification": "KIP999" } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json index dbb93163b..9eff1c055 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality.schema.json @@ -4,10 +4,7 @@ "title": "Root Schema", "description": "The root schema is the schema that comprises the entire JSON document.", "type": "object", - "default": {}, "required": [ - "category", - "lang", "title", "description", "question", @@ -19,6 +16,8 @@ "arbitrableAddress", "arbitratorChainID", "arbitratorAddress", + "category", + "lang", "specification", "metadata", "externalDisputeID", @@ -29,200 +28,47 @@ ], "additionalProperties": false, "properties": { - "category": { - "title": "The category Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "Oracle" - ] - }, - "lang": { - "type": "string", - "default": "", - "title": "The lang Schema", - "examples": [ - "en_US" - ] - }, "title": { - "title": "The title Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "A reality.eth question" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/title" }, "description": { - "title": "The description Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "A reality.eth question has been raised to arbitration." - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/description" }, "question": { - "title": "The question Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/question" }, "type": { - "title": "The type Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "single-select" - ], - "enum": [ - "bool", - "uint", - "single-select", - "multiple-select" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/type" }, "answers": { - "title": "The answers Schema", - "description": "An explanation about the purpose of this instance.", - "type": "array", - "default": [], - "additionalItems": true, - "items": { - "title": "A Schema", - "description": "An explanation about the purpose of this instance.", - "type": "object", - "required": [ - "id", - "title", - "reserved" - ], - "additionalProperties": true, - "properties": { - "id": { - "title": "The id Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "examples": [ - "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "0x00", - "0x01", - "0x02" - ] - }, - "title": { - "title": "The title Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "examples": [ - "Answered Too Soon", - "Invalid/Refuse to Arbitrate", - "Yes", - "No" - ] - }, - "reserved": { - "title": "The reserved Schema", - "description": "An explanation about the purpose of this instance.", - "type": "boolean", - "examples": [ - true, - false - ] - } - }, - "examples": [ - { - "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "title": "Answered Too Soon", - "reserved": true - }, - { - "id": "0x00", - "title": "Invalid/Refuse to Arbitrate", - "reserved": true - }, - { - "id": "0x01", - "title": "Yes", - "reserved": false - }, - { - "id": "0x02", - "title": "No", - "reserved": false - } - ] - } + "$ref": "../NewDisputeTemplate.schema.json#/properties/answers" }, "frontendUrl": { - "title": "The frontendUrl Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "https://reality.eth.link/app/#!/question/" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/frontendUrl" }, "policyURI": { - "title": "The policyURI Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/policyURI" }, "arbitrableChainID": { - "title": "The arbitrableChainID Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "100" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/arbitrableChainID" }, "arbitrableAddress": { - "title": "The arbitrableAddress Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "0x2e39b8f43d0870ba896f516f78f57cde773cf805" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/arbitrableAddress" }, "arbitratorChainID": { - "title": "The arbitratorChainID Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "421613" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/arbitratorChainID" }, "arbitratorAddress": { - "title": "The arbitratorAddress Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "0xD08Ab99480d02bf9C092828043f611BcDFEA917b" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/arbitratorAddress" + }, + "category": { + "$ref": "../NewDisputeTemplate.schema.json#/properties/category" + }, + "lang": { + "$ref": "../NewDisputeTemplate.schema.json#/properties/lang" }, "specification": { - "title": "The specification Schema", - "description": "An explanation about the purpose of this instance.", - "type": "string", - "default": "", - "examples": [ - "KIP99" - ] + "$ref": "../NewDisputeTemplate.schema.json#/properties/specification" }, "metadata": { "type": "object", @@ -394,7 +240,7 @@ "default": "", "title": "The disputeTemplateHash Schema", "examples": [ - "0xB5u9...2240" + "0xffbbbd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b82" ] } } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc index 1eaab177d..a70e1e928 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc @@ -3,7 +3,6 @@ "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", "question": "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?", - "type": "single-select", "answers": [ { "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc index d7c10d239..ac9495234 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc @@ -1,5 +1,5 @@ { - "$schema": "./NewDisputeTemplate.reality.schema.json", + "$schema": "../NewDisputeTemplate.schema.json", "title": "A reality.eth question", "description": "A reality.eth question has been raised to arbitration.", "question": "%s", @@ -19,6 +19,5 @@ "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Oracle", - "lang": "en_US", "specification": "KIP99" } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json deleted file mode 100644 index 12df4cb07..000000000 --- a/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.schema.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "NewDisputeTemplate.reality.schema.json", - "type": "object", - "default": {}, - "title": "Root Schema", - "required": [ - "$schema", - "category", - "lang", - "title", - "description", - "question", - "type", - "answers", - "frontendUrl", - "policyURI", - "arbitrableChainID", - "arbitrableAddress", - "arbitratorChainID", - "arbitratorAddress", - "specification", - "metadata" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "default": "", - "title": "The $schema Schema", - "examples": [ - "./dispute-template.reality.schema.json" - ] - }, - "category": { - "type": "string", - "default": "", - "title": "The category Schema", - "examples": [ - "Oracle" - ] - }, - "lang": { - "type": "string", - "default": "", - "title": "The lang Schema", - "examples": [ - "en_US" - ] - }, - "title": { - "type": "string", - "default": "", - "title": "The title Schema", - "examples": [ - "A reality.eth question" - ] - }, - "description": { - "type": "string", - "default": "", - "title": "The description Schema", - "examples": [ - "A reality.eth question has been raised to arbitration." - ] - }, - "question": { - "type": "string", - "default": "", - "title": "The question Schema", - "examples": [ - "%s" - ] - }, - "type": { - "type": "string", - "default": "", - "title": "The type Schema", - "examples": [ - "%s" - ] - }, - "answers": { - "type": "array", - "default": [ - { - "id": "0x00", - "title": "Invalid/Refuse to Arbitrate", - "reserved": true - }, - { - "id": "0x01", - "title": "Yes", - "reserved": false - }, - { - "id": "0x02", - "title": "No", - "reserved": false - } - ], - "title": "The answers Schema", - "items": { - "type": "object", - "default": {}, - "title": "A Schema", - "required": [ - "id", - "title", - "reserved" - ], - "properties": { - "id": { - "type": "string", - "default": "", - "title": "The id Schema", - "examples": [ - "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - ] - }, - "title": { - "type": "string", - "default": "", - "title": "The title Schema", - "examples": [ - "Answered Too Soon" - ] - }, - "reserved": { - "type": "boolean", - "default": false, - "title": "The reserved Schema", - "examples": [ - true - ] - } - }, - "examples": [ - { - "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "title": "Answered Too Soon", - "reserved": true - } - ] - } - }, - "frontendUrl": { - "type": "string", - "default": "", - "title": "The frontendUrl Schema", - "examples": [ - "https://reality.eth.link/app/#!/question/" - ] - }, - "policyURI": { - "type": "string", - "default": "", - "title": "The policyURI Schema", - "examples": [ - "/ipfs/QmW4zDA8X95cyfAsW9Nq1t7XNTyP3sMQAWNRFoQhMpgAv7/Kleros%2520Moderate%2520x%2520Reality.eth%2520Oracle%2520-%2520Telegram%2520Content%2520Moderation%2520Question%2520Resolution%2520Policy.pdf" - ] - }, - "arbitrableChainID": { - "type": "string", - "default": "", - "title": "The arbitrableChainID Schema", - "examples": [ - "100" - ] - }, - "arbitrableAddress": { - "type": "string", - "default": "", - "title": "The arbitrableAddress Schema", - "examples": [ - "0x2e39b8f43d0870ba896f516f78f57cde773cf805" - ] - }, - "arbitratorChainID": { - "type": "string", - "default": "", - "title": "The arbitratorChainID Schema", - "examples": [ - "421613" - ] - }, - "arbitratorAddress": { - "type": "string", - "default": "", - "title": "The arbitratorAddress Schema", - "examples": [ - "0xD08Ab99480d02bf9C092828043f611BcDFEA917b" - ] - }, - "specification": { - "type": "string", - "default": "", - "title": "The specification Schema", - "examples": [ - "KIP99" - ] - }, - "metadata": { - "type": "object", - "default": {}, - "title": "The metadata Schema", - "required": [ - "realityAddress", - "realityTemplateID", - "realityQuestionID" - ], - "properties": { - "realityAddress": { - "type": "string", - "default": "", - "title": "The realityAddress Schema", - "examples": [ - "0xe78996a233895be74a66f451f1019ca9734205cc" - ] - }, - "realityTemplateID": { - "type": "string", - "default": "", - "title": "The realityTemplateID Schema", - "examples": [ - "%s" - ] - }, - "realityQuestionID": { - "type": "string", - "default": "", - "title": "The realityQuestionID Schema", - "examples": [ - "%s" - ] - } - }, - "examples": [ - { - "realityAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", - "realityTemplateID": "%s", - "realityQuestionID": "%s" - } - ] - } - } -} From 4a6ca5dfd56702078c159b10eab02fce24f9cc80 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 18 Apr 2023 21:48:38 +0100 Subject: [PATCH 06/29] docs: added poh, removed type to rely on default --- .../curate/NewDispute.curate.jsonc | 10 ++--- .../curate/NewDisputeTemplate.curate.jsonc | 1 - .../linguo/NewDisputeTemplate.linguo.jsonc | 1 - .../poh/DisputeDetails.poh1.jsonc | 42 +++++++++++++++++++ .../poh/DisputeDetails.poh2.jsonc | 42 +++++++++++++++++++ .../poh/DisputeTemplateInputs.poh1.txt | 1 + .../poh/DisputeTemplateInputs.poh2.txt | 1 + .../poh/NewDispute.poh1.jsonc | 11 +++++ .../poh/NewDispute.poh2.jsonc | 11 +++++ .../poh/NewDisputeTemplate.poh1.jsonc | 24 +++++++++++ .../poh/NewDisputeTemplate.poh2.jsonc | 24 +++++++++++ 11 files changed, 161 insertions(+), 7 deletions(-) create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh1.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh2.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh1.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh2.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh1.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh2.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc index 9054d6371..f1535733b 100644 --- a/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc @@ -4,8 +4,8 @@ "templateID": "44" } -/* -Contribution._itemID = 0xC2C1AA705632F53051F22A9F65967C0944370020A7489ABA608BD0D755CA1234 -Contribution._requestID = 0 -Contribution._evidenceGroupID = hash(itemID, requestID) = 0x32554266108048001186322211785477470843107987690258181975452540727388224860514 -*/ \ No newline at end of file +/** + Contribution._itemID = 0xC2C1AA705632F53051F22A9F65967C0944370020A7489ABA608BD0D755CA1234 + Contribution._requestID = 0 + Dispute._evidenceGroupID = hash(itemID, requestID) = 0x32554266108048001186322211785477470843107987690258181975452540727388224860514 +**/ \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc index a73e449a1..b0febaee6 100644 --- a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc @@ -3,7 +3,6 @@ "title": "Add an entry to Ledger Contract Domain Name registry v2", "description": "Someone requested to add an entry to Ledger Contract Domain Name registry v2", "question": "Does the entry comply with the required criteria?", - "type": "single-select", "answers": [ { "title": "Yes, Add It", diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc index 54d4446e6..7322bd6df 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc @@ -3,7 +3,6 @@ "title": "Review a translation from Linguo", "description": "Someone challenged a translation", "question": "Does the translation comply with the required criteria?", - "type": "single-select", "answers": [ { "title": "Yes, the translation should be accepted", diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh1.jsonc new file mode 100644 index 000000000..373f72556 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh1.jsonc @@ -0,0 +1,42 @@ +{ + "$schema": "./DisputeDetails.poh.schema.json", + "title": "Proof of Humanity Registration Request", + "description": "A request to register the specified entry to a list of provable humans.", + "question": "Should the request to register be accepted?", + "type": "single-select", + "answers": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "description": "Accept the request to register the entry.", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "description": "Deny the request.", + "reserved": false + } + ], + "policyURI": "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "frontendUrl": "https://app.proofofhumanity.id/profile/0x35998E80B3fa93cFD957D616e6f09cd830e9787c", + "arbitrableChainID": "1", + "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Curated Lists", + "lang": "en_US", + "specification": "KIP77", + "metadata": { + }, + "externalDisputeID": "0x306000938609016839401998194416306598562578921596", // hash(itemID, requestID) + "arbitrableDisputeID": "1556", + "arbitratorDisputeID": "4568", + "disputeTemplateID": "46", + "disputeTemplateHash": "0x51u9...2226" +} diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh2.jsonc new file mode 100644 index 000000000..d60c90757 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh2.jsonc @@ -0,0 +1,42 @@ +{ + "$schema": "./DisputeDetails.poh.schema.json", + "title": "Proof of Humanity Clearing Request", + "description": "A request to remove the specified entry from a list of provable humans.", + "question": "Should the request to remove be accepted?", + "type": "single-select", + "answers": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "description": "Accept the request to remove the entry.", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "description": "Deny the request.", + "reserved": false + } + ], + "policyURI": "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "frontendUrl": "https://app.proofofhumanity.id/profile/0x35998E80B3fa93cFD957D616e6f09cd830e9787c", + "arbitrableChainID": "1", + "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Curated Lists", + "lang": "en_US", + "specification": "KIP77", + "metadata": { + }, + "externalDisputeID": "0x2f0c53ed326eb88ef6a01ff83df458c1cebe5b9ee5e8509525189d9422e28983", // hash(itemID, requestID) + "arbitrableDisputeID": "1557", + "arbitratorDisputeID": "4569", + "disputeTemplateID": "47", + "disputeTemplateHash": "0x31u9...5550" +} diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh1.txt b/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh1.txt new file mode 100644 index 000000000..ac0129395 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh1.txt @@ -0,0 +1 @@ +0x35998E80B3fa93cFD957D616e6f09cd830e9787c \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh2.txt b/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh2.txt new file mode 100644 index 000000000..ac0129395 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh2.txt @@ -0,0 +1 @@ +0x35998E80B3fa93cFD957D616e6f09cd830e9787c \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh1.jsonc new file mode 100644 index 000000000..7733da305 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh1.jsonc @@ -0,0 +1,11 @@ +{ + "externalDisputeID": "0x306000938609016839401998194416306598562578921596", // hash(itemID, requestID) + "arbitrableDisputeID": "1556", + "templateID": "46" +} + +/** + SubmissionChallenged._submissionID = 0x35998E80B3fa93cFD957D616e6f09cd830e9787c + SubmissionChallenged._requestID = 0 + Dispute._evidenceGroupID = hash(_submissionID, _requestID) = 0x306000938609016839401998194416306598562578921596 +**/ \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh2.jsonc new file mode 100644 index 000000000..f313a7bbb --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh2.jsonc @@ -0,0 +1,11 @@ +{ + "externalDisputeID": "0x2f0c53ed326eb88ef6a01ff83df458c1cebe5b9ee5e8509525189d9422e28983", // hash(itemID, requestID) + "arbitrableDisputeID": "1557", + "templateID": "47" +} + +/** + SubmissionChallenged._submissionID = 0x35998E80B3fa93cFD957D616e6f09cd830e9787c + SubmissionChallenged._requestID = 1 + Dispute._evidenceGroupID = hash(_submissionID, _requestID) = 0x2f0c53ed326eb88ef6a01ff83df458c1cebe5b9ee5e8509525189d9422e28983 +**/ \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc new file mode 100644 index 000000000..aa644fb1e --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc @@ -0,0 +1,24 @@ +{ + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Proof of Humanity Registration Request", + "description": "A request to register the specified entry to a list of provable humans.", + "question": "Should the request to register be accepted?", + "answers": [ + { + "title": "Yes", + "description": "Accept the request to register the entry." + }, + { + "title": "No", + "description": "Deny the request." + } + ], + "policyURI": "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "frontendUrl": "https://app.proofofhumanity.id/profile/%s", + "arbitrableChainID": "1", + "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Curated Lists", + "specification": "KIP88" +} diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc new file mode 100644 index 000000000..f9225b917 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc @@ -0,0 +1,24 @@ +{ + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Proof of Humanity Clearing Request", + "description": "A request to remove the specified entry from a list of provable humans.", + "question": "Should the request to remove be accepted?", + "answers": [ + { + "title": "Yes", + "description": "Accept the request to register the entry." + }, + { + "title": "No", + "description": "Deny the request." + } + ], + "policyURI": "/ipfs/QmXDiiBAizCPoLqHvcfTzuMT7uvFEe1j3s4TgoWWd4k5np/proof-of-humanity-registry-policy-v1.3.pdf", + "frontendUrl": "https://app.proofofhumanity.id/profile/%s", + "arbitrableChainID": "1", + "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Curated Lists", + "specification": "KIP88" +} From 75b2e61fb331820061a97fa32ee4fae526994312 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 18 Apr 2023 22:29:08 +0100 Subject: [PATCH 07/29] docs: new dispute template schema improvement --- .../NewDisputeTemplate.schema.json | 79 +++++++++++++++++-- 1 file changed, 71 insertions(+), 8 deletions(-) diff --git a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json index 15311fee1..4df0d793b 100644 --- a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json +++ b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json @@ -17,6 +17,11 @@ ], "additionalProperties": false, "properties": { + "$schema": { + "description": "JSON Schema URI (used by some editors)", + "type": "string", + "default": "NewDisputeTemplate.schema.json" + }, "category": { "type": "string", "default": "", @@ -135,11 +140,13 @@ { "id": "0x01", "title": "Yes", + "description": "Accept the request.", "reserved": false }, { "id": "0x02", "title": "No", + "description": "Refuse the request.", "reserved": false } ], @@ -149,10 +156,30 @@ "default": {}, "title": "A Schema", "required": [ - "id", - "title", - "reserved" + "title" ], + "dependentSchemas": { + "id": { + "properties": { + "reserved": { + "const": true + } + } + } + }, + "if": { + "properties": { + "reserved": { + "const": true + } + } + }, + "then": { + "dependentRequired": { + "id": true + } + }, + "additionalProperties": false, "properties": { "id": { "type": "string", @@ -186,6 +213,45 @@ "Invalid/Refuse to Arbitrate" ] }, + "description": { + "type": "string", + "default": "", + "title": "The description Schema", + "examples": [ + "Accept the request to register the entry.", + "Accept the request to remove the entry.", + "Deny the request.", + "Reject the claim if any of the acceptance criteria do not hold.", + "Select this if you think the entry complies with the required criteria and should be added.", + "Select this if you think the entry complies with the required criteria and should not be removed.", + "Select this if you think the entry does not comply with the required criteria and should be removed.", + "Select this if you think the entry does not comply with the required criteria and should not be added.", + "Select this if you think the list complies with the required criteria and should be added.", + "Select this if you think the list complies with the required criteria and should not be removed.", + "Select this if you think the list does not comply with the required criteria and should be removed.", + "Select this if you think the list does not comply with the required criteria and should not be added.", + "Select this if you think the market complies with the required criteria and should be added.", + "Select this if you think the market complies with the required criteria and should not be removed.", + "Select this if you think the market does not comply with the required criteria and should be removed.", + "Select this if you think the market does not comply with the required criteria and should not be added.", + "Select this if you think the token and project comply with the required criteria and the badge should be added.", + "Select this if you think the token and project comply with the required criteria and the badge should be kept.", + "Select this if you think the token and/or project do(es) not comply with the required criteria and the badge should be removed.", + "Select this if you think the token and/or project do(es) not comply with the required criteria and the badge should not be added.", + "Select this if you think the token information is correct and the token should be added to the registry.", + "Select this if you think the token information is correct and the token should not be removed from the registry.", + "Select this if you think the token information is incorrect and the token should be not be added to the registry.", + "Select this if you think the token information is incorrect and the token should be removed from the registry.", + "Select this if you think the translation complies with the required criteria.", + "Select this if you think the translation does not comply with the required criteria.", + "Select this if you think the validator complies with the required criteria and should be added.", + "Select this if you think the validator complies with the required criteria and should not be removed.", + "Select this if you think the validator does not comply with the required criteria and should be removed.", + "Select this if you think the validator does not comply with the required criteria and should not be added.", + "Select to release funds to the Receiver", + "Select to return funds to the Sender" + ] + }, "reserved": { "type": "boolean", "default": false, @@ -202,19 +268,16 @@ "title": "Answered Too Soon", "reserved": true }, - { - "id": "0x00", - "title": "Invalid/Refuse to Arbitrate", - "reserved": true - }, { "id": "0x01", "title": "Yes", + "description": "Accept the request.", "reserved": false }, { "id": "0x02", "title": "No", + "description": "Refuse the request.", "reserved": false } ] From f07a99e60c22e33cb2203ddec84e991488634d0f Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Wed, 19 Apr 2023 19:09:00 +0100 Subject: [PATCH 08/29] docs: added the datetime type --- .../NewDisputeTemplate.schema.json | 16 ++++------------ .../reality/DisputeTemplateInputs.reality1.txt | 2 +- .../reality/DisputeTemplateInputs.reality2.txt | 2 +- .../config/v2-disputetemplate/reality/kip-99.md | 7 ++++--- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json index 4df0d793b..bb94f67b2 100644 --- a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json +++ b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json @@ -126,7 +126,8 @@ "bool", "uint", "single-select", - "multiple-select" + "multiple-select", + "datetime" ] }, "answers": { @@ -264,21 +265,12 @@ }, "examples": [ { - "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "title": "Answered Too Soon", - "reserved": true - }, - { - "id": "0x01", "title": "Yes", - "description": "Accept the request.", - "reserved": false + "description": "Accept the request." }, { - "id": "0x02", "title": "No", - "description": "Refuse the request.", - "reserved": false + "description": "Refuse the request." } ] } diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt index 8798f050f..eda71b8f2 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt @@ -1,5 +1,5 @@ # [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)? single-select -{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false} +,{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false} 0xe78996a233895be74a66f451f1019ca9734205cc 0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt index 443a208c9..330b28da3 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt +++ b/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt @@ -1,5 +1,5 @@ Who will win the FORMULA 1 AWS GRAN PREMIO DE ESPAÑA 2023 ? single-select -{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Max VERSTAPPEN","reserved":false},{"id":"0x02","title":"Sergio PEREZ","reserved":false},{"id":"0x03","title":"Fernando ALONSO","reserved":false} +,{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Max VERSTAPPEN","reserved":false},{"id":"0x02","title":"Sergio PEREZ","reserved":false},{"id":"0x03","title":"Fernando ALONSO","reserved":false} 0xe78996a233895be74a66f451f1019ca9734205cc 0xc2a52d38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b42 \ No newline at end of file diff --git a/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md b/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md index e4ad587cb..be6903267 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md +++ b/kleros-sdk/config/v2-disputetemplate/reality/kip-99.md @@ -31,7 +31,8 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S | bool | ✅ maps to `single-select` | | uint | TBC | | single-select | ✅ | -| multiple-select | ❌ | +| multiple-select | TBC | +| datetime | TBC | ### Dispute details document @@ -41,8 +42,8 @@ The answers must include: ```json { - "id": "0x00", - "title": "Invalid/Refuse to Arbitrate", + "id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "title": "Answered Too Soon", "reserved": true } ``` From 76eabb7a024d519f0cc91b8a230953d0de963389 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 13 Jun 2023 15:42:32 +0100 Subject: [PATCH 09/29] feat: interfaces wip --- contracts/src/arbitration/IArbitrableV2.sol | 26 +++++++--- contracts/src/arbitration/IArbitratorV2.sol | 2 +- .../dispute-kits/DisputeKitClassic.sol | 8 +-- .../dispute-kits/DisputeKitSybilResistant.sol | 8 +-- contracts/src/evidence/IEvidence.sol | 4 +- contracts/src/evidence/IEvidenceV2.sol | 24 --------- .../config/v2-disputetemplate/README.md | 51 +++++++++++++++++++ .../linguo/DisputeDetails.linguo.jsonc | 2 +- .../linguo/NewDisputeTemplate.linguo.jsonc | 4 +- .../v2-disputetemplate/reality/README.md | 18 +++++++ .../DisputeDetails.reality1.jsonc | 0 .../DisputeTemplateInputs.reality1.txt | 0 .../{ => example1}/NewDispute.reality1.jsonc | 0 .../DisputeDetails.reality2.jsonc | 0 .../DisputeTemplateInputs.reality2.txt | 0 .../{ => example2}/NewDispute.reality2.jsonc | 0 16 files changed, 103 insertions(+), 44 deletions(-) delete mode 100644 contracts/src/evidence/IEvidenceV2.sol create mode 100644 kleros-sdk/config/v2-disputetemplate/README.md create mode 100644 kleros-sdk/config/v2-disputetemplate/reality/README.md rename kleros-sdk/config/v2-disputetemplate/reality/{ => example1}/DisputeDetails.reality1.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/reality/{ => example1}/DisputeTemplateInputs.reality1.txt (100%) rename kleros-sdk/config/v2-disputetemplate/reality/{ => example1}/NewDispute.reality1.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/reality/{ => example2}/DisputeDetails.reality2.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/reality/{ => example2}/DisputeTemplateInputs.reality2.txt (100%) rename kleros-sdk/config/v2-disputetemplate/reality/{ => example2}/NewDispute.reality2.jsonc (100%) diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index 943b5e89d..cb3fae450 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -12,18 +12,32 @@ import "./IArbitratorV2.sol"; * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); */ interface IArbitrableV2 { + /** + * @dev To be emitted when a new dispute template is created. + * @param _templateId The ID of the dispute template. + * @param _templateTag An optional tag for the dispute template, such as "registration" or "removal". + * @param data The template data. + */ + event NewDisputeTemplate( + uint256 indexed _templateId, + string indexed _templateTag, + string data + ); + /** * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. * @param _arbitrator The arbitrator of the contract. - * @param _disputeID ID of the dispute in the Arbitrator contract. - * @param _externalDisputeID Unique identifier from the dispute creator that is linked to this dispute. - * @param _disputeContextUri IPFS path to dispute context, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/disputecontext.json' + * @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. + * @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. + * @param _templateId The ID of the dispute template. Should not be used with _templateUri. + * @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. */ - event Dispute( + event NewDisputeRequest( IArbitrableV2 indexed _arbitrator, - uint256 indexed _disputeID, + uint256 indexed _arbitrableDisputeID, uint256 _externalDisputeID, - string _disputeContextUri + uint256 _templateId, + string _templateUri ); /** diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/IArbitratorV2.sol index 87d075906..44e8e35b4 100644 --- a/contracts/src/arbitration/IArbitratorV2.sol +++ b/contracts/src/arbitration/IArbitratorV2.sol @@ -7,7 +7,7 @@ import "./IArbitrableV2.sol"; /** * @title Arbitrator * Arbitrator interface that implements the new arbitration standard. - * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most. + * Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most. * When developing arbitrator contracts we need to: * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes). * - Define the functions for cost display (arbitrationCost). diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol index 02e88a4d1..c870b1f21 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol @@ -375,11 +375,11 @@ contract DisputeKitClassic is BaseDisputeKit, IEvidence { } } - /// @dev Submits evidence. - /// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID. + /// @dev Submits evidence for a dispute. + /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID. /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'. - function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external { - emit Evidence(_evidenceGroupID, msg.sender, _evidence); + function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external { + emit Evidence(_externalDisputeID, msg.sender, _evidence); } // ************************************* // diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol index b22f2331a..16583c2f9 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol @@ -395,11 +395,11 @@ contract DisputeKitSybilResistant is BaseDisputeKit, IEvidence { } } - /// @dev Submits evidence. - /// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID. + /// @dev Submits evidence for a dispute. + /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID. /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'. - function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external { - emit Evidence(_evidenceGroupID, msg.sender, _evidence); + function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external { + emit Evidence(_externalDisputeID, msg.sender, _evidence); } // ************************************* // diff --git a/contracts/src/evidence/IEvidence.sol b/contracts/src/evidence/IEvidence.sol index 808396b62..c45ced642 100644 --- a/contracts/src/evidence/IEvidence.sol +++ b/contracts/src/evidence/IEvidence.sol @@ -7,8 +7,8 @@ import "../arbitration/IArbitrator.sol"; /// @title IEvidence interface IEvidence { /// @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). - /// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. + /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID. /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party. /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json' - event Evidence(uint256 indexed _evidenceGroupID, address indexed _party, string _evidence); + event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence); } diff --git a/contracts/src/evidence/IEvidenceV2.sol b/contracts/src/evidence/IEvidenceV2.sol deleted file mode 100644 index 729f367ff..000000000 --- a/contracts/src/evidence/IEvidenceV2.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import "../arbitration/IArbitratorV2.sol"; - -/** @title IEvidence - * ERC-1497: Evidence Standard - */ -interface IEvidenceV2 { - /** - * @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). - * @param _arbitrator The arbitrator of the contract. - * @param _externalDisputeID Unique identifier from the dispute creator that is linked to this dispute. - * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party. - * @param _evidenceUri IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json' - */ - event Evidence( - IArbitratorV2 indexed _arbitrator, - uint256 indexed _externalDisputeID, - address indexed _party, - string _evidenceUri - ); -} diff --git a/kleros-sdk/config/v2-disputetemplate/README.md b/kleros-sdk/config/v2-disputetemplate/README.md new file mode 100644 index 000000000..1122f0315 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/README.md @@ -0,0 +1,51 @@ +# V2 BREAKING CHANGES + +## Onchain changes + +### IArbitrator + +#### The appeal events and functions have been removed + +The appeal concerns are deemed implementation-specific so they have been removed from the Arbitrator interface. + +The following have been removed from the Arbitrator interface but are available directly on KlerosCore: + +```solidity +function appealCost(uint256 _disputeID) external view returns (uint256 cost); + +function appealPeriod(uint256 _disputeID) external view returns (uint256 start, uint256 end); +``` + +The following have been removed entirely: + +```solidity +event AppealPossible(uint256 indexed _disputeID, IArbitrableV1 indexed _arbitrable); +event AppealDecision(uint256 indexed _disputeID, IArbitrableV1 indexed _arbitrable); +function appeal(uint256 _disputeID, bytes calldata _extraData) external payable; +``` + +The appeal requests are now the responsibility of the DisputeKit implementation. For example in the DisputeKitClassic there is now: + +```solidity +// DisputeKitClassic.sol +function fundAppeal(uint256 _coreDisputeID, uint256 _choice) payable; + +function getFundedChoices(uint256 _coreDisputeID) view returns (uint256[] memory fundedChoices); +``` + +#### `DisputeStatus` has been removed + +It was deemed redundant. An equivalent behavior can be emulated as follow: + +```solidity +// for a particular disputeID +(,,IArbitrator.Period period,,) = arbitrator.disputes(disputeID); + +if (period < IArbitratorV2.Period.appeal) + // Do DisputeStatus.Waiting stuffs +else if (_period < IArbitratorV2.Period.execution) + // Do DisputeStatus.Appealable stuffs +else + // Do DisputeStatus.Solved stuffs +} +``` diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc index f5ec222bb..e8119f2d8 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc @@ -51,7 +51,7 @@ "linguoRequester": "0xabc996a233895be74a66f451f1019ca97342aaaa", "linguoTranslator": "0xbcd996a233895be74a66f451f1019ca97342bbbb", "linguoChallenger": "0xcde996a233895be74a66f451f1019ca97342cccc", - "linguoFrontendUrl": "https://linguo.kleros.io/translation/0x0B928165A67df8254412483ae8C3b8cc7F2b4D36/35", + "linguoFrontendUrl": "https://linguo.kleros.io/translation/0x0B928165A67df8254412483ae8C3b8cc7F2b4D36/35" }, "externalDisputeID": "13", // taskID "arbitrableDisputeID": "7", diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc index 7322bd6df..e97ee3b0b 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc @@ -6,11 +6,11 @@ "answers": [ { "title": "Yes, the translation should be accepted", - "description": "Select this if you think the translation complies with the required criteria.", + "description": "Select this if you think the translation complies with the required criteria." }, { "title": "No, the translation should not be accepted", - "description": "Select this if you think the translation does not comply with the required criteria.", + "description": "Select this if you think the translation does not comply with the required criteria." } ], "policyURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf", diff --git a/kleros-sdk/config/v2-disputetemplate/reality/README.md b/kleros-sdk/config/v2-disputetemplate/reality/README.md new file mode 100644 index 000000000..b06de559c --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/reality/README.md @@ -0,0 +1,18 @@ +# Dispute Standard for Reality.eth + +[Specs](./kip-99.md) +[New dispute template](./NewDisputeTemplate.reality.jsonc) +[Dispute details schema](./DisputeDetails.reality.schema.json) (optional) +SDK implementation (TODO) + +## Example 1: Kleros Moderate Question + +[New dispute parameters](./example1/NewDispute.reality1.jsonc) +[Inputs for the dispute template](./example1/DisputeTemplateInputs.reality1.txt) +[Dispute details output](./example1/DisputeDetails.reality1.jsonc) + +## Example 2: Formula1 Question + +[New dispute parameters](./example2/NewDispute.reality2.jsonc) +[Inputs for the dispute template](./example2/DisputeTemplateInputs.reality2.txt) +[Dispute details output](./example2/DisputeDetails.reality2.jsonc) diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeDetails.reality1.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality1.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeDetails.reality1.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt b/kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeTemplateInputs.reality1.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality1.txt rename to kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeTemplateInputs.reality1.txt diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality1.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/example1/NewDispute.reality1.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality1.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/example1/NewDispute.reality1.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality2.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeDetails.reality2.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/DisputeDetails.reality2.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeDetails.reality2.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt b/kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeTemplateInputs.reality2.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/DisputeTemplateInputs.reality2.txt rename to kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeTemplateInputs.reality2.txt diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality2.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/example2/NewDispute.reality2.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/reality/NewDispute.reality2.jsonc rename to kleros-sdk/config/v2-disputetemplate/reality/example2/NewDispute.reality2.jsonc From 8072a957f8ce03bd4f2ff4742134773555276e79 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 13 Jun 2023 17:11:02 +0200 Subject: [PATCH 10/29] docs: CrossChainDisputeRequest event --- contracts/src/arbitration/IArbitrableV2.sol | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index cb3fae450..7def9c9e1 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -32,8 +32,18 @@ interface IArbitrableV2 { * @param _templateId The ID of the dispute template. Should not be used with _templateUri. * @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. */ - event NewDisputeRequest( - IArbitrableV2 indexed _arbitrator, + event DisputeRequest( + IArbitrorV2 indexed _arbitrator, + uint256 indexed _arbitrableDisputeID, + uint256 _externalDisputeID, + uint256 _templateId, + string _templateUri + ); + + event CrossChainDisputeRequest( + IArbitrorV2 indexed _arbitrator, + uint256 indexed _arbitrableChainId, + address indexed _arbitrable, uint256 indexed _arbitrableDisputeID, uint256 _externalDisputeID, uint256 _templateId, From 6a18a7a53d6467053e3786f66fb44cafe1cb3885 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 13 Jun 2023 19:48:41 +0100 Subject: [PATCH 11/29] refactor: example folder --- contracts/src/arbitration/IArbitrableV2.sol | 16 +++++++++++++--- .../{ => example}/DisputeDetails.curate.jsonc | 0 .../DisputeTemplateInputs.curate.txt | 0 .../curate/{ => example}/NewDispute.curate.jsonc | 0 .../{ => example}/DisputeDetails.linguo.jsonc | 0 .../DisputeTemplateInputs.linguo.txt | 0 .../linguo/{ => example}/NewDispute.linguo.jsonc | 0 .../DisputeDetails.poh1.jsonc | 0 .../DisputeTemplateInputs.poh1.txt | 0 .../NewDispute.poh1.jsonc | 0 .../DisputeDetails.poh2.jsonc | 0 .../DisputeTemplateInputs.poh2.txt | 0 .../{ => example2-removal}/NewDispute.poh2.jsonc | 0 13 files changed, 13 insertions(+), 3 deletions(-) rename kleros-sdk/config/v2-disputetemplate/curate/{ => example}/DisputeDetails.curate.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/curate/{ => example}/DisputeTemplateInputs.curate.txt (100%) rename kleros-sdk/config/v2-disputetemplate/curate/{ => example}/NewDispute.curate.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/linguo/{ => example}/DisputeDetails.linguo.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/linguo/{ => example}/DisputeTemplateInputs.linguo.txt (100%) rename kleros-sdk/config/v2-disputetemplate/linguo/{ => example}/NewDispute.linguo.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/poh/{ => example1-registration}/DisputeDetails.poh1.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/poh/{ => example1-registration}/DisputeTemplateInputs.poh1.txt (100%) rename kleros-sdk/config/v2-disputetemplate/poh/{ => example1-registration}/NewDispute.poh1.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/poh/{ => example2-removal}/DisputeDetails.poh2.jsonc (100%) rename kleros-sdk/config/v2-disputetemplate/poh/{ => example2-removal}/DisputeTemplateInputs.poh2.txt (100%) rename kleros-sdk/config/v2-disputetemplate/poh/{ => example2-removal}/NewDispute.poh2.jsonc (100%) diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index 7def9c9e1..b48eadb7e 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -33,16 +33,26 @@ interface IArbitrableV2 { * @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. */ event DisputeRequest( - IArbitrorV2 indexed _arbitrator, + IArbitratorV2 indexed _arbitrator, uint256 indexed _arbitrableDisputeID, uint256 _externalDisputeID, uint256 _templateId, string _templateUri ); + /** + * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. + * @param _arbitrator The arbitrator of the contract. + * @param _arbitrableChainId The chain ID of the Arbitrable contract. + * @param _arbitrable The address of the Arbitrable contract. + * @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. + * @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. + * @param _templateId The ID of the dispute template. Should not be used with _templateUri. + * @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. + */ event CrossChainDisputeRequest( - IArbitrorV2 indexed _arbitrator, - uint256 indexed _arbitrableChainId, + IArbitratorV2 indexed _arbitrator, + uint256 _arbitrableChainId, address indexed _arbitrable, uint256 indexed _arbitrableDisputeID, uint256 _externalDisputeID, diff --git a/kleros-sdk/config/v2-disputetemplate/curate/DisputeDetails.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/example/DisputeDetails.curate.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/curate/DisputeDetails.curate.jsonc rename to kleros-sdk/config/v2-disputetemplate/curate/example/DisputeDetails.curate.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/curate/DisputeTemplateInputs.curate.txt b/kleros-sdk/config/v2-disputetemplate/curate/example/DisputeTemplateInputs.curate.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/curate/DisputeTemplateInputs.curate.txt rename to kleros-sdk/config/v2-disputetemplate/curate/example/DisputeTemplateInputs.curate.txt diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/example/NewDispute.curate.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/curate/NewDispute.curate.jsonc rename to kleros-sdk/config/v2-disputetemplate/curate/example/NewDispute.curate.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeDetails.linguo.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc rename to kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeDetails.linguo.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/DisputeTemplateInputs.linguo.txt b/kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeTemplateInputs.linguo.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/linguo/DisputeTemplateInputs.linguo.txt rename to kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeTemplateInputs.linguo.txt diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/NewDispute.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/example/NewDispute.linguo.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/linguo/NewDispute.linguo.jsonc rename to kleros-sdk/config/v2-disputetemplate/linguo/example/NewDispute.linguo.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeDetails.poh1.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh1.jsonc rename to kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeDetails.poh1.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh1.txt b/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeTemplateInputs.poh1.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh1.txt rename to kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeTemplateInputs.poh1.txt diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/NewDispute.poh1.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh1.jsonc rename to kleros-sdk/config/v2-disputetemplate/poh/example1-registration/NewDispute.poh1.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeDetails.poh2.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/poh/DisputeDetails.poh2.jsonc rename to kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeDetails.poh2.jsonc diff --git a/kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh2.txt b/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeTemplateInputs.poh2.txt similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/poh/DisputeTemplateInputs.poh2.txt rename to kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeTemplateInputs.poh2.txt diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/NewDispute.poh2.jsonc similarity index 100% rename from kleros-sdk/config/v2-disputetemplate/poh/NewDispute.poh2.jsonc rename to kleros-sdk/config/v2-disputetemplate/poh/example2-removal/NewDispute.poh2.jsonc From 6089177b51ee6f1f1d88240b93ac7579f1c7f984 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 13 Jun 2023 20:03:13 +0100 Subject: [PATCH 12/29] fix: natspec --- contracts/src/arbitration/IArbitrableV2.sol | 88 +++++++++------------ contracts/src/arbitration/IArbitratorV2.sol | 65 +++++++-------- 2 files changed, 65 insertions(+), 88 deletions(-) diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index b48eadb7e..ca3aa1c7e 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -4,34 +4,24 @@ pragma solidity ^0.8; import "./IArbitratorV2.sol"; -/** - * @title IArbitrableV2 - * Arbitrable interface. - * When developing arbitrable contracts, we need to: - * - Define the action taken when a ruling is received by the contract. - * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); - */ +/// @title IArbitrableV2 +/// @notice Arbitrable interface. +/// When developing arbitrable contracts, we need to: +/// - Define the action taken when a ruling is received by the contract. +/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); interface IArbitrableV2 { - /** - * @dev To be emitted when a new dispute template is created. - * @param _templateId The ID of the dispute template. - * @param _templateTag An optional tag for the dispute template, such as "registration" or "removal". - * @param data The template data. - */ - event NewDisputeTemplate( - uint256 indexed _templateId, - string indexed _templateTag, - string data - ); + /// @dev To be emitted when a new dispute template is created. + /// @param _templateId The ID of the dispute template. + /// @param _templateTag An optional tag for the dispute template, such as "registration" or "removal". + /// @param data The template data. + event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data); - /** - * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. - * @param _arbitrator The arbitrator of the contract. - * @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. - * @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. - * @param _templateId The ID of the dispute template. Should not be used with _templateUri. - * @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. - */ + /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. + /// @param _arbitrator The arbitrator of the contract. + /// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. + /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. + /// @param _templateId The ID of the dispute template. Should not be used with _templateUri. + /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. event DisputeRequest( IArbitratorV2 indexed _arbitrator, uint256 indexed _arbitrableDisputeID, @@ -39,40 +29,36 @@ interface IArbitrableV2 { uint256 _templateId, string _templateUri ); - - /** - * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. - * @param _arbitrator The arbitrator of the contract. - * @param _arbitrableChainId The chain ID of the Arbitrable contract. - * @param _arbitrable The address of the Arbitrable contract. - * @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. - * @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. - * @param _templateId The ID of the dispute template. Should not be used with _templateUri. - * @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. - */ + + /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. + /// @param _arbitrator The arbitrator of the contract. + /// @param _arbitrableChainId The chain ID of the Arbitrable contract. + /// @param _arbitrable The address of the Arbitrable contract. + /// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. + /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. + /// @param _templateId The ID of the dispute template. Should not be used with _templateUri. + /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. event CrossChainDisputeRequest( - IArbitratorV2 indexed _arbitrator, + IArbitratorV2 indexed _arbitrator, uint256 _arbitrableChainId, - address indexed _arbitrable, + address indexed _arbitrable, uint256 indexed _arbitrableDisputeID, uint256 _externalDisputeID, uint256 _templateId, string _templateUri ); - /** - * @dev To be raised when a ruling is given. - * @param _arbitrator The arbitrator giving the ruling. - * @param _disputeID ID of the dispute in the Arbitrator contract. - * @param _ruling The ruling which was given. - */ + /// @dev To be raised when a ruling is given. + /// @param _arbitrator The arbitrator giving the ruling. + /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _ruling The ruling which was given. event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling); - /** - * @dev Give a ruling for a dispute. Must be called by the arbitrator. - * The purpose of this function is to ensure that the address calling it has the right to rule on the contract. - * @param _disputeID ID of the dispute in the Arbitrator contract. - * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision". - */ + /// @dev Give a ruling for a dispute. + /// Must be called by the arbitrator. + /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. + /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _ruling Ruling given by the arbitrator. + /// Note that 0 is reserved for "Not able/wanting to make a decision". function rule(uint256 _disputeID, uint256 _ruling) external; } diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/IArbitratorV2.sol index 44e8e35b4..4887781ca 100644 --- a/contracts/src/arbitration/IArbitratorV2.sol +++ b/contracts/src/arbitration/IArbitratorV2.sol @@ -4,51 +4,42 @@ pragma solidity ^0.8; import "./IArbitrableV2.sol"; -/** - * @title Arbitrator - * Arbitrator interface that implements the new arbitration standard. - * Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most. - * When developing arbitrator contracts we need to: - * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes). - * - Define the functions for cost display (arbitrationCost). - * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling). - */ +/// @title Arbitrator +/// Arbitrator interface that implements the new arbitration standard. +/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most. +/// When developing arbitrator contracts we need to: +/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes). +/// - Define the functions for cost display (arbitrationCost). +/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling). interface IArbitratorV2 { - /** - * @dev To be emitted when a dispute is created. - * @param _disputeID Identifier of the dispute. - * @param _arbitrable The contract which created the dispute. - */ + /// @dev To be emitted when a dispute is created. + /// @param _disputeID Identifier of the dispute. + /// @param _arbitrable The contract which created the dispute. event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); - /** - * @dev To be raised when a ruling is given. - * @param _arbitrable The arbitrable receiving the ruling. - * @param _disputeID Identifier of the dispute in the Arbitrator contract. - * @param _ruling The ruling which was given. - */ + /// @dev To be raised when a ruling is given. + /// @param _arbitrable The arbitrable receiving the ruling. + /// @param _disputeID Identifier of the dispute in the Arbitrator contract. + /// @param _ruling The ruling which was given. event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); - /** - * @dev Create a dispute. Must be called by the arbitrable contract. - * Must pay at least arbitrationCost(_extraData). - * @param _choices Amount of choices the arbitrator can make in this dispute. - * @param _extraData Can be used to give additional info on the dispute to be created. - * @return disputeID Identifier of the dispute created. - */ + /// @dev Create a dispute. + /// Must be called by the arbitrable contract. + /// Must pay at least arbitrationCost(_extraData). + /// @param _choices Amount of choices the arbitrator can make in this dispute. + /// @param _extraData Can be used to give additional info on the dispute to be created. + /// @return disputeID Identifier of the dispute created. function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID); - /** - * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. - * @param _extraData Can be used to give additional info on the dispute to be created. - * @return cost Required cost of arbitration. - */ + /// @dev Compute the cost of arbitration. + /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. + /// @param _extraData Can be used to give additional info on the dispute to be created. + /// @return cost Required cost of arbitration. function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost); - /** - * @dev Return the current ruling of a dispute. This is useful for parties to know if they should appeal. - * @param _disputeID ID of the dispute. - * @return ruling The ruling which has been given or the one which will be given if there is no appeal. - */ + /// @dev Return the current ruling of a dispute. + /// This is useful for parties to know if they should appeal. + /// @param _disputeID ID of the dispute. + /// @return ruling The ruling which has been given or the one which will be given if there is no appeal. function currentRuling(uint _disputeID) external view returns (uint ruling); } From 3f13fecc36aace5dabd04dc0d53c5818de6e18cc Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 13 Jun 2023 20:18:58 +0100 Subject: [PATCH 13/29] feat: migrated DisputeResolver --- .../arbitrables/DisputeResolver.sol | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/contracts/src/arbitration/arbitrables/DisputeResolver.sol b/contracts/src/arbitration/arbitrables/DisputeResolver.sol index 92171199e..c49f10386 100644 --- a/contracts/src/arbitration/arbitrables/DisputeResolver.sol +++ b/contracts/src/arbitration/arbitrables/DisputeResolver.sol @@ -1,18 +1,17 @@ // SPDX-License-Identifier: MIT -/// @custom:authors: [@ferittuncer, @unknownunknown1] +/// @custom:authors: [@ferittuncer, @unknownunknown1,@jaybuidl] /// @custom:reviewers: [] /// @custom:auditors: [] /// @custom:bounties: [] -import "../IArbitrable.sol"; -import "../../evidence/IMetaEvidence.sol"; +import "../IArbitrableV2.sol"; pragma solidity 0.8.18; /// @title DisputeResolver /// DisputeResolver contract adapted for V2 https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol. -contract DisputeResolver is IArbitrable, IMetaEvidence { +contract DisputeResolver is IArbitrableV2 { struct DisputeStruct { bytes arbitratorExtraData; // Extra data for the dispute. bool isRuled; // True if the dispute has been ruled. @@ -20,26 +19,26 @@ contract DisputeResolver is IArbitrable, IMetaEvidence { uint256 numberOfRulingOptions; // The number of choices the arbitrator can give. } - IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed. + IArbitratorV2 public immutable arbitrator; // Arbitrator is set in constructor and never changed. DisputeStruct[] public disputes; // Local disputes. - mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. + mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. /// @dev Constructor /// @param _arbitrator Target global arbitrator for any disputes. - constructor(IArbitrator _arbitrator) { + constructor(IArbitratorV2 _arbitrator) { arbitrator = _arbitrator; } /// @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute. - /// @param _metaevidenceURI Link to metaevidence of the dispute. + /// @param _template Dispute template. /// @param _numberOfRulingOptions Number of ruling options. /// @return disputeID Dispute id (on arbitrator side) of the created dispute. function createDispute( bytes calldata _arbitratorExtraData, - string calldata _metaevidenceURI, + string calldata _template, uint256 _numberOfRulingOptions ) external payable returns (uint256 disputeID) { require(_numberOfRulingOptions > 1, "Should be at least 2 ruling options."); @@ -55,17 +54,16 @@ contract DisputeResolver is IArbitrable, IMetaEvidence { }) ); - externalIDtoLocalID[disputeID] = localDisputeID; - - emit MetaEvidence(localDisputeID, _metaevidenceURI); - emit Dispute(arbitrator, disputeID, localDisputeID, localDisputeID); + arbitratorDisputeIDToLocalID[disputeID] = localDisputeID; + emit DisputeTemplate(localDisputeID, "", _template); + emit DisputeRequest(arbitrator, disputeID, localDisputeID, localDisputeID, ""); } /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling. /// @param _externalDisputeID ID of the dispute in arbitrator contract. /// @param _ruling The ruling choice of the arbitration. function rule(uint256 _externalDisputeID, uint256 _ruling) external override { - uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID]; + uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID]; DisputeStruct storage dispute = disputes[localDisputeID]; require(msg.sender == address(arbitrator), "Only the arbitrator can execute this."); require(_ruling <= dispute.numberOfRulingOptions, "Invalid ruling."); @@ -74,6 +72,6 @@ contract DisputeResolver is IArbitrable, IMetaEvidence { dispute.isRuled = true; dispute.ruling = _ruling; - emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling); + emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling); } } From 15b69ee43e505efdcd977d67e28daacfc6e424eb Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 13 Jun 2023 20:21:20 +0100 Subject: [PATCH 14/29] docs: removed comments --- contracts/src/arbitration/CentralizedArbitrator.sol | 2 +- contracts/src/arbitration/KlerosCore.sol | 2 +- contracts/src/arbitration/KlerosGovernor.sol | 4 ++-- contracts/src/arbitration/arbitrables/ArbitrableExample.sol | 2 +- contracts/src/arbitration/arbitrables/DisputeResolver.sol | 2 +- .../src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/src/arbitration/CentralizedArbitrator.sol b/contracts/src/arbitration/CentralizedArbitrator.sol index b4b00845f..c55553a88 100644 --- a/contracts/src/arbitration/CentralizedArbitrator.sol +++ b/contracts/src/arbitration/CentralizedArbitrator.sol @@ -188,7 +188,7 @@ contract CentralizedArbitrator is IArbitrator { revert("Not supported"); } - /// @dev TRUSTED. Manages contributions, and appeals a dispute if at least two choices are fully funded. This function allows the appeals to be crowdfunded. + /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded. This function allows the appeals to be crowdfunded. /// Note that the surplus deposit will be reimbursed. /// @param _disputeID Index of the dispute to appeal. /// @param _choice A choice that receives funding. diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 118112ddf..7b9afd9cf 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -890,7 +890,7 @@ contract KlerosCore is IArbitrator { } } - /// @dev Executes a specified dispute's ruling. UNTRUSTED. + /// @dev Executes a specified dispute's ruling. /// @param _disputeID The ID of the dispute. function executeRuling(uint256 _disputeID) external { Dispute storage dispute = disputes[_disputeID]; diff --git a/contracts/src/arbitration/KlerosGovernor.sol b/contracts/src/arbitration/KlerosGovernor.sol index 20af82ff5..6730d4a3c 100644 --- a/contracts/src/arbitration/KlerosGovernor.sol +++ b/contracts/src/arbitration/KlerosGovernor.sol @@ -265,7 +265,7 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { reservedETH = reservedETH.subCap(submission.deposit); } - /// @dev Approves a transaction list or creates a dispute if more than one list was submitted. TRUSTED. + /// @dev Approves a transaction list or creates a dispute if more than one list was submitted. /// If nothing was submitted changes session. function executeSubmissions() external duringApprovalPeriod { Session storage session = sessions[sessions.length - 1]; @@ -328,7 +328,7 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { emit Ruling(IArbitrator(msg.sender), _disputeID, _ruling); } - /// @dev Executes selected transactions of the list. UNTRUSTED. + /// @dev Executes selected transactions of the list. /// @param _listID The index of the transaction list in the array of lists. /// @param _cursor Index of the transaction from which to start executing. /// @param _count Number of transactions to execute. Executes until the end if set to "0" or number higher than number of transactions in the list. diff --git a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol index a3ba0d255..8c7f6de49 100644 --- a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol +++ b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol @@ -64,7 +64,7 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { // * State Modifiers * // // ************************************* // - /// @dev TRUSTED. Creates a dispute with the arbitrator and pays for the fees in the native currency, typically ETH. + /// @dev Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. /// @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from. /// @param _arbitratorExtraData Extra data for the arbitrator. diff --git a/contracts/src/arbitration/arbitrables/DisputeResolver.sol b/contracts/src/arbitration/arbitrables/DisputeResolver.sol index c49f10386..1addb7995 100644 --- a/contracts/src/arbitration/arbitrables/DisputeResolver.sol +++ b/contracts/src/arbitration/arbitrables/DisputeResolver.sol @@ -30,7 +30,7 @@ contract DisputeResolver is IArbitrableV2 { arbitrator = _arbitrator; } - /// @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. + /// @dev Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute. /// @param _template Dispute template. diff --git a/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol b/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol index 4675b98ab..39ca27ba5 100644 --- a/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol +++ b/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol @@ -89,7 +89,7 @@ contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { dispute.klerosLiquidDisputeID = _disputeID; } - /// @dev Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED. + /// @dev Give a ruling for a dispute. Can only be called by the arbitrator. /// Triggers rule() from KlerosLiquid to the arbitrable contract which created the dispute. /// @param _disputeID ID of the dispute in the arbitrator contract. /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Refused to arbitrate". From 95a4e9e795f4f3936a599655caa862adedf606be Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Wed, 14 Jun 2023 00:24:45 +0100 Subject: [PATCH 15/29] feat: deploy scripts improvements --- contracts/deploy/00-home-chain-arbitrable.ts | 6 ++++++ contracts/deploy/01-foreign-gateway-on-gnosis.ts | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/contracts/deploy/00-home-chain-arbitrable.ts b/contracts/deploy/00-home-chain-arbitrable.ts index 8b0724e86..6c610f216 100644 --- a/contracts/deploy/00-home-chain-arbitrable.ts +++ b/contracts/deploy/00-home-chain-arbitrable.ts @@ -29,6 +29,12 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) ], log: true, }); + + await deploy("DisputeResolver", { + from: deployer, + args: [klerosCore.address], + log: true, + }); }; deployArbitration.tags = ["HomeArbitrable"]; diff --git a/contracts/deploy/01-foreign-gateway-on-gnosis.ts b/contracts/deploy/01-foreign-gateway-on-gnosis.ts index dd7390489..1c0670516 100644 --- a/contracts/deploy/01-foreign-gateway-on-gnosis.ts +++ b/contracts/deploy/01-foreign-gateway-on-gnosis.ts @@ -2,6 +2,7 @@ import { parseUnits } from "ethers/lib/utils"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; +import { KlerosCore__factory } from "../typechain-types"; enum ForeignChains { GNOSIS_MAINNET = 100, @@ -49,13 +50,13 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme }); // TODO: disable the gateway until fully initialized with the correct fees OR allow disputeCreators to add funds again if necessary. - await execute( - "ForeignGatewayOnGnosis", - { from: deployer, log: true }, - "changeCourtJurorFee", - 0, - ethers.utils.parseEther("0.00001") - ); + const coreDeployment = await hre.companionNetworks.home.deployments.get("KlerosCore"); + const core = await KlerosCore__factory.connect(coreDeployment.address, homeChainProvider); + // TODO: set up the correct fees for the FORKING_COURT + const courtId = await core.GENERAL_COURT(); + const fee = (await core.courts(courtId)).feeForJuror; + await execute("ForeignGatewayOnGnosis", { from: deployer, log: true }, "changeCourtJurorFee", courtId, fee); + // TODO: set up the correct fees for the lower courts }; deployForeignGateway.tags = ["ForeignGatewayOnGnosis"]; From 1eae9fe6eef2cbf9a3aec92bc6686bea61a4cb3a Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Wed, 14 Jun 2023 01:28:03 +0100 Subject: [PATCH 16/29] feat: resolver migrated and deployed to chiado, interfaces natspec improved --- contracts/README.md | 1 + contracts/deploy/04-resolver-to-v2-gnosis.ts | 39 +++++++ contracts/src/arbitration/IArbitrable.sol | 12 +- contracts/src/arbitration/IArbitrableV2.sol | 20 ++-- contracts/src/arbitration/IArbitrator.sol | 10 +- contracts/src/arbitration/IArbitratorV2.sol | 10 +- .../arbitrables/DisputeResolver.sol | 105 ++++++++++++++---- contracts/src/gateway/ForeignGateway.sol | 4 +- .../curate/NewDisputeTemplate.curate.jsonc | 4 +- 9 files changed, 154 insertions(+), 51 deletions(-) create mode 100644 contracts/deploy/04-resolver-to-v2-gnosis.ts diff --git a/contracts/README.md b/contracts/README.md index 0bf26ae77..2a132ddcf 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -11,6 +11,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Chiado - [ArbitrableExample](https://blockscout.com/gnosis/chiado/address/0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b) +- [DisputeResolver](https://blockscout.com/gnosis/chiado/address/0x433eD78895df1df7668C40b3e82d54410331F942) - [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x573bcD6ee4aEe152eCC9Cafd2c0820Dc548AF6cC) - [SortitionSumTreeFactory](https://blockscout.com/gnosis/chiado/address/0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636) - [TokenBridge](https://blockscout.com/gnosis/chiado/address/0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2) diff --git a/contracts/deploy/04-resolver-to-v2-gnosis.ts b/contracts/deploy/04-resolver-to-v2-gnosis.ts new file mode 100644 index 000000000..ceed24413 --- /dev/null +++ b/contracts/deploy/04-resolver-to-v2-gnosis.ts @@ -0,0 +1,39 @@ +import { parseUnits } from "ethers/lib/utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; + +enum ForeignChains { + GNOSIS_MAINNET = 100, + GNOSIS_CHIADO = 10200, + HARDHAT = 31337, +} + +const ONE_GWEI = parseUnits("1", "gwei"); + +const deployResolver: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, getNamedAccounts, getChainId } = hre; + const { deploy } = deployments; + + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; + const chainId = Number(await getChainId()); + console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + + const foreignGateway = await deployments.get("ForeignGatewayOnGnosis"); + + await deploy("DisputeResolver", { + from: deployer, + args: [foreignGateway.address], + log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, + }); +}; + +deployResolver.tags = ["ResolverOnGnosis"]; +deployResolver.skip = async ({ getChainId }) => { + const chainId = Number(await getChainId()); + return !ForeignChains[chainId]; +}; + +export default deployResolver; diff --git a/contracts/src/arbitration/IArbitrable.sol b/contracts/src/arbitration/IArbitrable.sol index cac0fa6af..17195853f 100644 --- a/contracts/src/arbitration/IArbitrable.sol +++ b/contracts/src/arbitration/IArbitrable.sol @@ -12,13 +12,15 @@ import "./IArbitrator.sol"; interface IArbitrable { /// @dev To be raised when a ruling is given. /// @param _arbitrator The arbitrator giving the ruling. - /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling The ruling which was given. event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling); - /// @dev Give a ruling for a dispute. Must be called by the arbitrator. - /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. - /// @param _disputeID ID of the dispute in the Arbitrator contract. - /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision". + /// @dev Give a ruling for a dispute. + /// Must be called by the arbitrator. + /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. + /// @param _ruling Ruling given by the arbitrator. + /// Note that 0 is reserved for "Not able/wanting to make a decision". function rule(uint256 _disputeID, uint256 _ruling) external; } diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index ca3aa1c7e..821c96b14 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8; +pragma solidity 0.8.18; import "./IArbitratorV2.sol"; @@ -11,17 +11,17 @@ import "./IArbitratorV2.sol"; /// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); interface IArbitrableV2 { /// @dev To be emitted when a new dispute template is created. - /// @param _templateId The ID of the dispute template. + /// @param _templateId The identifier of the dispute template. /// @param _templateTag An optional tag for the dispute template, such as "registration" or "removal". /// @param data The template data. event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data); /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. /// @param _arbitrator The arbitrator of the contract. - /// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. + /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. - /// @param _templateId The ID of the dispute template. Should not be used with _templateUri. - /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. + /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. + /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId. event DisputeRequest( IArbitratorV2 indexed _arbitrator, uint256 indexed _arbitrableDisputeID, @@ -32,11 +32,11 @@ interface IArbitrableV2 { /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. /// @param _arbitrator The arbitrator of the contract. - /// @param _arbitrableChainId The chain ID of the Arbitrable contract. + /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. /// @param _arbitrable The address of the Arbitrable contract. - /// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract. + /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. - /// @param _templateId The ID of the dispute template. Should not be used with _templateUri. + /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. event CrossChainDisputeRequest( IArbitratorV2 indexed _arbitrator, @@ -50,14 +50,14 @@ interface IArbitrableV2 { /// @dev To be raised when a ruling is given. /// @param _arbitrator The arbitrator giving the ruling. - /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling The ruling which was given. event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling); /// @dev Give a ruling for a dispute. /// Must be called by the arbitrator. /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. - /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling Ruling given by the arbitrator. /// Note that 0 is reserved for "Not able/wanting to make a decision". function rule(uint256 _disputeID, uint256 _ruling) external; diff --git a/contracts/src/arbitration/IArbitrator.sol b/contracts/src/arbitration/IArbitrator.sol index 047137716..df41e537f 100644 --- a/contracts/src/arbitration/IArbitrator.sol +++ b/contracts/src/arbitration/IArbitrator.sol @@ -7,20 +7,20 @@ import "./IArbitrable.sol"; /// @title Arbitrator /// Arbitrator interface that implements the new arbitration standard. -/// Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most. +/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most. /// When developing arbitrator contracts we need to: /// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes). /// - Define the functions for cost display (arbitrationCost). /// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling). interface IArbitrator { /// @dev To be emitted when a dispute is created. - /// @param _disputeID ID of the dispute. + /// @param _disputeID The identifier of the dispute. /// @param _arbitrable The contract which created the dispute. event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); /// @dev To be raised when a ruling is given. /// @param _arbitrable The arbitrable receiving the ruling. - /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling The ruling which was given. event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); @@ -55,8 +55,8 @@ interface IArbitrator { uint256 _feeAmount ) external returns (uint256 disputeID); - /// @dev Compute the cost of arbitration denominated in ETH. - /// 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. + /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH. + /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). /// @return cost The arbitration cost in ETH. function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost); diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/IArbitratorV2.sol index 4887781ca..89b20e24a 100644 --- a/contracts/src/arbitration/IArbitratorV2.sol +++ b/contracts/src/arbitration/IArbitratorV2.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8; +pragma solidity 0.8.18; import "./IArbitrableV2.sol"; @@ -13,13 +13,13 @@ import "./IArbitrableV2.sol"; /// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling). interface IArbitratorV2 { /// @dev To be emitted when a dispute is created. - /// @param _disputeID Identifier of the dispute. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _arbitrable The contract which created the dispute. event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); /// @dev To be raised when a ruling is given. /// @param _arbitrable The arbitrable receiving the ruling. - /// @param _disputeID Identifier of the dispute in the Arbitrator contract. + /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling The ruling which was given. event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); @@ -28,7 +28,7 @@ interface IArbitratorV2 { /// Must pay at least arbitrationCost(_extraData). /// @param _choices Amount of choices the arbitrator can make in this dispute. /// @param _extraData Can be used to give additional info on the dispute to be created. - /// @return disputeID Identifier of the dispute created. + /// @return disputeID The identifier of the dispute created. function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID); /// @dev Compute the cost of arbitration. @@ -39,7 +39,7 @@ interface IArbitratorV2 { /// @dev Return the current ruling of a dispute. /// This is useful for parties to know if they should appeal. - /// @param _disputeID ID of the dispute. + /// @param _disputeID The identifer of the dispute. /// @return ruling The ruling which has been given or the one which will be given if there is no appeal. function currentRuling(uint _disputeID) external view returns (uint ruling); } diff --git a/contracts/src/arbitration/arbitrables/DisputeResolver.sol b/contracts/src/arbitration/arbitrables/DisputeResolver.sol index 1addb7995..725b2c7ff 100644 --- a/contracts/src/arbitration/arbitrables/DisputeResolver.sol +++ b/contracts/src/arbitration/arbitrables/DisputeResolver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -/// @custom:authors: [@ferittuncer, @unknownunknown1,@jaybuidl] +/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl] /// @custom:reviewers: [] /// @custom:auditors: [] /// @custom:bounties: [] @@ -10,8 +10,12 @@ import "../IArbitrableV2.sol"; pragma solidity 0.8.18; /// @title DisputeResolver -/// DisputeResolver contract adapted for V2 https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol. +/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol. contract DisputeResolver is IArbitrableV2 { + // ************************************* // + // * Enums / Structs * // + // ************************************* // + struct DisputeStruct { bytes arbitratorExtraData; // Extra data for the dispute. bool isRuled; // True if the dispute has been ruled. @@ -19,44 +23,72 @@ contract DisputeResolver is IArbitrableV2 { uint256 numberOfRulingOptions; // The number of choices the arbitrator can give. } - IArbitratorV2 public immutable arbitrator; // Arbitrator is set in constructor and never changed. + // ************************************* // + // * Storage * // + // ************************************* // + address public governor; // The governor. + IArbitratorV2 public arbitrator; // The arbitrator. DisputeStruct[] public disputes; // Local disputes. - mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. + mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs. + + // ************************************* // + // * Constructor * // + // ************************************* // /// @dev Constructor /// @param _arbitrator Target global arbitrator for any disputes. constructor(IArbitratorV2 _arbitrator) { + governor = msg.sender; arbitrator = _arbitrator; } + // ************************************* // + // * Governance * // + // ************************************* // + + /// @dev Changes the governor. + /// @param _governor The address of the new governor. + function changeGovernor(address _governor) external { + require(governor == msg.sender, "Access not allowed: Governor only."); + governor = _governor; + } + + function changeArbitrator(IArbitratorV2 _arbitrator) external { + require(governor == msg.sender, "Access not allowed: Governor only."); + arbitrator = _arbitrator; + } + + // ************************************* // + // * State Modifiers * // + // ************************************* // + /// @dev Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute. - /// @param _template Dispute template. + /// @param _disputeTemplate Dispute template. /// @param _numberOfRulingOptions Number of ruling options. /// @return disputeID Dispute id (on arbitrator side) of the created dispute. - function createDispute( + function createDisputeForTemplate( bytes calldata _arbitratorExtraData, - string calldata _template, + string calldata _disputeTemplate, uint256 _numberOfRulingOptions ) external payable returns (uint256 disputeID) { - require(_numberOfRulingOptions > 1, "Should be at least 2 ruling options."); - - disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData); - uint256 localDisputeID = disputes.length; - disputes.push( - DisputeStruct({ - arbitratorExtraData: _arbitratorExtraData, - isRuled: false, - ruling: 0, - numberOfRulingOptions: _numberOfRulingOptions - }) - ); + return _createDispute(_arbitratorExtraData, _disputeTemplate, "", _numberOfRulingOptions); + } - arbitratorDisputeIDToLocalID[disputeID] = localDisputeID; - emit DisputeTemplate(localDisputeID, "", _template); - emit DisputeRequest(arbitrator, disputeID, localDisputeID, localDisputeID, ""); + /// @dev Calls createDispute function of the specified arbitrator to create a dispute. + /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. + /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute. + /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. + /// @param _numberOfRulingOptions Number of ruling options. + /// @return disputeID Dispute id (on arbitrator side) of the created dispute. + function createDisputeForTemplateUri( + bytes calldata _arbitratorExtraData, + string calldata _disputeTemplateUri, + uint256 _numberOfRulingOptions + ) external payable returns (uint256 disputeID) { + return _createDispute(_arbitratorExtraData, "", _disputeTemplateUri, _numberOfRulingOptions); } /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling. @@ -74,4 +106,33 @@ contract DisputeResolver is IArbitrableV2 { emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling); } + + // ************************************* // + // * Internal * // + // ************************************* // + + function _createDispute( + bytes calldata _arbitratorExtraData, + string memory _disputeTemplate, + string memory _disputeUri, + uint256 _numberOfRulingOptions + ) internal returns (uint256 disputeID) { + require(_numberOfRulingOptions > 1, "Should be at least 2 ruling options."); + + disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData); + uint256 localDisputeID = disputes.length; + disputes.push( + DisputeStruct({ + arbitratorExtraData: _arbitratorExtraData, + isRuled: false, + ruling: 0, + numberOfRulingOptions: _numberOfRulingOptions + }) + ); + arbitratorDisputeIDToLocalID[disputeID] = localDisputeID; + + uint256 templateId = localDisputeID; + emit DisputeTemplate(templateId, "", _disputeTemplate); + emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeUri); + } } diff --git a/contracts/src/gateway/ForeignGateway.sol b/contracts/src/gateway/ForeignGateway.sol index 1944ba1ff..12c88898a 100644 --- a/contracts/src/gateway/ForeignGateway.sol +++ b/contracts/src/gateway/ForeignGateway.sol @@ -47,7 +47,7 @@ contract ForeignGateway is IForeignGateway { uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute. uint256 internal localDisputeID = 1; // The disputeID must start from 1 as the KlerosV1 proxy governor depends on this implementation. We now also depend on localDisputeID not ever being zero. - mapping(uint96 => uint256) public feeForJuror; // feeForJuror[courtID], it mirrors the value on KlerosCore. + mapping(uint96 => uint256) public feeForJuror; // feeForJuror[v2CourtID], it mirrors the value on KlerosCore. address public governor; address public veaOutbox; uint256 public immutable override homeChainID; @@ -115,7 +115,7 @@ contract ForeignGateway is IForeignGateway { } /// @dev Changes the `feeForJuror` property value of a specified court. - /// @param _courtID The ID of the court. + /// @param _courtID The ID of the court on the v2 arbitrator. Not to be confused with the courtID on KlerosLiquid. /// @param _feeForJuror The new value for the `feeForJuror` property value. function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor { feeForJuror[_courtID] = _feeForJuror; diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc index b0febaee6..bb99c033a 100644 --- a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc @@ -6,11 +6,11 @@ "answers": [ { "title": "Yes, Add It", - "description": "Select this if you think the entry complies with the required criteria and should be added.", + "description": "Select this if you think the entry complies with the required criteria and should be added." }, { "title": "No, Don't Add It", - "description": "Select this if you think the entry does not comply with the required criteria and should not be added.", + "description": "Select this if you think the entry does not comply with the required criteria and should not be added." } ], "policyURI": "/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf", From 65c3e0feaa02167b4adb9b9e4e3b7cbdb9ae38af Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Wed, 14 Jun 2023 02:03:59 +0100 Subject: [PATCH 17/29] fix: forge doc assumes the top-level folder when linking to the github repo --- contracts/package.json | 2 +- contracts/scripts/docPostprocess.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 contracts/scripts/docPostprocess.sh diff --git a/contracts/package.json b/contracts/package.json index 3f1dceb05..9f8bfb0dc 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -31,7 +31,7 @@ "watch": "hardhat watch", "docgen": "hardhat docgen", "docserve": "scripts/docPreprocess.sh && forge doc --serve", - "docbuild": "scripts/docPreprocess.sh && forge doc --build --out dist", + "docbuild": "scripts/docPreprocess.sh && forge doc --build --out dist && scripts/docPostprocess.sh", "publish": "yarn npm publish --access public --tag $(cat package.json | jq .version)" }, "devDependencies": { diff --git a/contracts/scripts/docPostprocess.sh b/contracts/scripts/docPostprocess.sh new file mode 100755 index 000000000..802234a9d --- /dev/null +++ b/contracts/scripts/docPostprocess.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +# Forge doc assumes that the code is in the top-level folder. +# We need to add contracts/ to the path +find $SCRIPT_DIR/../dist -type f \( -name "*.md" -o -name "*.html" \) \ + | xargs sed -i "" 's|\(github.com/kleros/kleros-v2/.*\)\(/src\)|\1/contracts\2|g' + From 02a7df5a61756a6a5ebadbea8ea61d6724085e3e Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Wed, 14 Jun 2023 02:23:53 +0100 Subject: [PATCH 18/29] fix: bsd vs gnu compatibility --- contracts/scripts/console-init-chiado.ts | 3 +-- contracts/scripts/docPostprocess.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/scripts/console-init-chiado.ts b/contracts/scripts/console-init-chiado.ts index 559e5a5e9..97d9e2ac1 100644 --- a/contracts/scripts/console-init-chiado.ts +++ b/contracts/scripts/console-init-chiado.ts @@ -1,7 +1,6 @@ // .load scripts/console-init-chiado.ts receiver = await ethers.getContract("VeaInboxArbToGnosisDevnet"); -// gateway = await ethers.getContract("ForeignGatewayOnGnosis"); -gateway = await ethers.getContractAt("ForeignGatewayOnGnosis", "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE"); +gateway = await ethers.getContract("ForeignGatewayOnGnosis"); weth = await ethers.getContract("WETH"); wethFaucet = await ethers.getContract("WETHFaucet"); wpnk = await ethers.getContract("WrappedPinakionV2"); diff --git a/contracts/scripts/docPostprocess.sh b/contracts/scripts/docPostprocess.sh index 802234a9d..a52c0878c 100755 --- a/contracts/scripts/docPostprocess.sh +++ b/contracts/scripts/docPostprocess.sh @@ -5,5 +5,5 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # Forge doc assumes that the code is in the top-level folder. # We need to add contracts/ to the path find $SCRIPT_DIR/../dist -type f \( -name "*.md" -o -name "*.html" \) \ - | xargs sed -i "" 's|\(github.com/kleros/kleros-v2/.*\)\(/src\)|\1/contracts\2|g' + | xargs sed -i.bak 's|\(github.com/kleros/kleros-v2/.*\)\(/src\)|\1/contracts\2|g' From f954c206765ee56f709807cb29abcf8dbe3515f7 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Wed, 14 Jun 2023 16:02:33 +0100 Subject: [PATCH 19/29] docs: minor parameter rename --- contracts/README.md | 6 +- .../arbitrumGoerli/DisputeResolver.json | 308 ++++++++++++++---- .../arbitrables/DisputeResolver.sol | 4 +- 3 files changed, 251 insertions(+), 67 deletions(-) diff --git a/contracts/README.md b/contracts/README.md index 2a132ddcf..609afed66 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -6,8 +6,6 @@ Smart contracts for Kleros v2 Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh`. -### v2-alpha-1 - #### Chiado - [ArbitrableExample](https://blockscout.com/gnosis/chiado/address/0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b) @@ -29,10 +27,10 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Arbitrum Goerli - [PNK](https://goerli.arbiscan.io/token/0x4DEeeFD054434bf6721eF39Aa18EfB3fd0D12610/token-transfers) -- [ArbitrableExampleEthFee](https://goerli.arbiscan.io/address/0x1fF31be1924f55804350ADe4945f3B3a6a2e15d2) +- [ArbitrableExampleEthFee](https://goerli.arbiscan.io/address/0x1d533481cCD1402f83Df3D9Ba7496B5e5b602875) - [BlockHashRNG](https://goerli.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD) - [DisputeKitClassic](https://goerli.arbiscan.io/address/0xcBE3aD699919Cf59efDF715e4B41AF30A0E4c92d) -- [DisputeResolver](https://goerli.arbiscan.io/address/0x3B4edEFd12a467D1C71506ae2eE88828145202b1) +- [DisputeResolver](https://goerli.arbiscan.io/address/0xF6652c10c4D3f5bA6066254B78c57A468d9b9606) - [HomeGatewayToGnosis](https://goerli.arbiscan.io/address/0xD60CD2151e118Dd796efcb1ceFFcF892226F9b3a) - [KlerosCore](https://goerli.arbiscan.io/address/0xA429667Abb1A6c530BAd1083df4C69FBce86D696) - [PolicyRegistry](https://goerli.arbiscan.io/address/0xED503aBA65B28D81444294D1eAa5d84CeFdC2C58) diff --git a/contracts/deployments/arbitrumGoerli/DisputeResolver.json b/contracts/deployments/arbitrumGoerli/DisputeResolver.json index 341ae2368..b01058058 100644 --- a/contracts/deployments/arbitrumGoerli/DisputeResolver.json +++ b/contracts/deployments/arbitrumGoerli/DisputeResolver.json @@ -1,10 +1,10 @@ { - "address": "0x3B4edEFd12a467D1C71506ae2eE88828145202b1", + "address": "0xF6652c10c4D3f5bA6066254B78c57A468d9b9606", "abi": [ { "inputs": [ { - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" } @@ -17,30 +17,85 @@ "inputs": [ { "indexed": true, - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "_arbitrableChainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_arbitrable", + "type": "address" + }, { "indexed": true, "internalType": "uint256", - "name": "_disputeID", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "CrossChainDisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "_metaEvidenceID", + "name": "_externalDisputeID", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "_evidenceGroupID", + "name": "_templateId", "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" } ], - "name": "Dispute", + "name": "DisputeRequest", "type": "event" }, { @@ -49,17 +104,23 @@ { "indexed": true, "internalType": "uint256", - "name": "_metaEvidenceID", + "name": "_templateId", "type": "uint256" }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, { "indexed": false, "internalType": "string", - "name": "_evidence", + "name": "data", "type": "string" } ], - "name": "MetaEvidence", + "name": "DisputeTemplate", "type": "event" }, { @@ -67,7 +128,7 @@ "inputs": [ { "indexed": true, - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" }, @@ -92,7 +153,7 @@ "name": "arbitrator", "outputs": [ { - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "", "type": "address" } @@ -100,6 +161,80 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplate", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -109,7 +244,7 @@ }, { "internalType": "string", - "name": "_metaevidenceURI", + "name": "_disputeTemplateUri", "type": "string" }, { @@ -118,7 +253,7 @@ "type": "uint256" } ], - "name": "createDispute", + "name": "createDisputeForTemplateUri", "outputs": [ { "internalType": "uint256", @@ -164,19 +299,13 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "externalIDtoLocalID", + "inputs": [], + "name": "governor", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -201,70 +330,101 @@ "type": "function" } ], - "transactionHash": "0xc98034a500dfe7e53940c6c8f65ac6788f383393efbd9480ff71e47a6eabb72b", + "transactionHash": "0xed9f2c713fef809dc6e57ab0d647637b434c4a66bd3299d19112056cdf26d4f8", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x3B4edEFd12a467D1C71506ae2eE88828145202b1", + "contractAddress": "0xF6652c10c4D3f5bA6066254B78c57A468d9b9606", "transactionIndex": 1, - "gasUsed": "592785", + "gasUsed": "2186354", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb603106426692421641ace35dc368185179b479a93e1b029a7b50c68223e8aee", - "transactionHash": "0xc98034a500dfe7e53940c6c8f65ac6788f383393efbd9480ff71e47a6eabb72b", + "blockHash": "0x8b1d2f7d43ce621f44fbda339212d9c591b32e22c96a93dba151914ea4e616f1", + "transactionHash": "0xed9f2c713fef809dc6e57ab0d647637b434c4a66bd3299d19112056cdf26d4f8", "logs": [], - "blockNumber": 25602158, - "cumulativeGasUsed": "592785", + "blockNumber": 25952527, + "cumulativeGasUsed": "2186354", "status": 1, "byzantium": true }, "args": [ "0xA429667Abb1A6c530BAd1083df4C69FBce86D696" ], - "numDeployments": 2, - "solcInputHash": "e839c2860a2bc794c3b8ff7bcdbfe1cc", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"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\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_metaevidenceURI\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Dispute(address,uint256,uint256,uint256)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrator\":\"The arbitrator of the contract.\",\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group that is linked to this dispute.\",\"_metaEvidenceID\":\"Unique identifier of meta-evidence.\"}},\"MetaEvidence(uint256,string)\":{\"details\":\"To be emitted when meta-evidence is submitted.\",\"params\":{\"_evidence\":\"IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\",\"_metaEvidenceID\":\"Unique identifier of meta-evidence.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDispute(bytes,string,uint256)\":{\"details\":\"TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_metaevidenceURI\":\"Link to metaevidence of the dispute.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IArbitrable\\n/// Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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);\\ninterface IArbitrable {\\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 event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _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 function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x2a5363c37d33749f6b53c288f6d1538f013c6efbb3df86e63eceaa8163a6b212\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitrator {\\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 event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute. Must be called by the arbitrable contract.\\n /// Must pay 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 function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x8028f7d6a0fe07687f975fc51c9f889083ae1a409a134e8017a044701310948f\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport \\\"../IArbitrable.sol\\\";\\nimport \\\"../../evidence/IMetaEvidence.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrable, IMetaEvidence {\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed.\\n\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitrator _arbitrator) {\\n arbitrator = _arbitrator;\\n }\\n\\n /// @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _metaevidenceURI Link to metaevidence of the dispute.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDispute(\\n bytes calldata _arbitratorExtraData,\\n string calldata _metaevidenceURI,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n emit MetaEvidence(localDisputeID, _metaevidenceURI);\\n emit Dispute(arbitrator, disputeID, localDisputeID, localDisputeID);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n}\\n\",\"keccak256\":\"0x3d564c243e064e8172ff3768ee5ece0b004c33a19bb92766f1c2470ec341d098\",\"license\":\"MIT\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/// @title IMetaEvidence\\n/// ERC-1497: Evidence Standard excluding evidence emission as it will be handled by the arbitrator.\\ninterface IMetaEvidence {\\n /// @dev To be emitted when meta-evidence is submitted.\\n /// @param _metaEvidenceID Unique identifier of meta-evidence.\\n /// @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n event MetaEvidence(uint256 indexed _metaEvidenceID, 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 event Dispute(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0x4d985d8a86445a9556917c495b14c4074e33f4495e3674bb23b4448296579de7\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b50604051610a5d380380610a5d83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516109be61009f6000396000818160bc0152818161017c0152818161044c01526105df01526109be6000f3fe60806040526004361061004a5760003560e01c8063311a6c561461004f578063564a565d146100715780636cc6cde1146100aa578063c21ae061146100f6578063e2c7981b14610131575b600080fd5b34801561005b57600080fd5b5061006f61006a366004610635565b610144565b005b34801561007d57600080fd5b5061009161008c366004610657565b610309565b6040516100a19493929190610670565b60405180910390f35b3480156100b657600080fd5b506100de7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100a1565b34801561010257600080fd5b50610123610111366004610657565b60016020526000908152604090205481565b6040519081526020016100a1565b61012361013f36600461071e565b6103d7565b600082815260016020526040812054815490919081908390811061016a5761016a610792565b906000526020600020906004020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03161461020e5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156102545760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610205565b600181015460ff16156102b55760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610205565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000818154811061031957600080fd5b906000526020600020906004020160009150905080600001805461033c906107a8565b80601f0160208091040260200160405190810160405280929190818152602001828054610368906107a8565b80156103b55780601f1061038a576101008083540402835291602001916103b5565b820191906000526020600020905b81548152906001019060200180831161039857829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b6000600182116104355760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b6064820152608401610205565b60405163c13517e160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c13517e19034906104879086908b908b9060040161080b565b60206040518083038185885af11580156104a5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906104ca919061082e565b600080546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b908190850183828082843760009201829052509385525050506020808301829052604083018290526060909201879052835460018101855593815220815191926004020190819061054790826108ac565b506020828101516001838101805460ff191692151592909217909155604080850151600285015560609094015160039093019290925560008581529190528190208290555181907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906105bd908890889061096c565b60405180910390a2604080518281526020810183905283916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a35095945050505050565b6000806040838503121561064857600080fd5b50508035926020909101359150565b60006020828403121561066957600080fd5b5035919050565b608081526000855180608084015260005b8181101561069e57602081890181015160a0868401015201610681565b50600060a0828501015260a0601f19601f830116840101915050841515602083015283604083015282606083015295945050505050565b60008083601f8401126106e757600080fd5b50813567ffffffffffffffff8111156106ff57600080fd5b60208301915083602082850101111561071757600080fd5b9250929050565b60008060008060006060868803121561073657600080fd5b853567ffffffffffffffff8082111561074e57600080fd5b61075a89838a016106d5565b9097509550602088013591508082111561077357600080fd5b50610780888289016106d5565b96999598509660400135949350505050565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806107bc57607f821691505b6020821081036107dc57634e487b7160e01b600052602260045260246000fd5b50919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8381526040602082015260006108256040830184866107e2565b95945050505050565b60006020828403121561084057600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f8211156108a757600081815260208120601f850160051c810160208610156108845750805b601f850160051c820191505b818110156108a357828155600101610890565b5050505b505050565b815167ffffffffffffffff8111156108c6576108c6610847565b6108da816108d484546107a8565b8461085d565b602080601f83116001811461090f57600084156108f75750858301515b600019600386901b1c1916600185901b1785556108a3565b600085815260208120601f198616915b8281101561093e5788860151825594840194600190910190840161091f565b508582101561095c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020815260006109806020830184866107e2565b94935050505056fea26469706673582212208e7d47ef8d6b22a035f41afcc5f56e22a79524eb3c710b3d6299740721da8b3d64736f6c63430008120033", - "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063311a6c561461004f578063564a565d146100715780636cc6cde1146100aa578063c21ae061146100f6578063e2c7981b14610131575b600080fd5b34801561005b57600080fd5b5061006f61006a366004610635565b610144565b005b34801561007d57600080fd5b5061009161008c366004610657565b610309565b6040516100a19493929190610670565b60405180910390f35b3480156100b657600080fd5b506100de7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100a1565b34801561010257600080fd5b50610123610111366004610657565b60016020526000908152604090205481565b6040519081526020016100a1565b61012361013f36600461071e565b6103d7565b600082815260016020526040812054815490919081908390811061016a5761016a610792565b906000526020600020906004020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03161461020e5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156102545760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610205565b600181015460ff16156102b55760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610205565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000818154811061031957600080fd5b906000526020600020906004020160009150905080600001805461033c906107a8565b80601f0160208091040260200160405190810160405280929190818152602001828054610368906107a8565b80156103b55780601f1061038a576101008083540402835291602001916103b5565b820191906000526020600020905b81548152906001019060200180831161039857829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b6000600182116104355760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b6064820152608401610205565b60405163c13517e160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c13517e19034906104879086908b908b9060040161080b565b60206040518083038185885af11580156104a5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906104ca919061082e565b600080546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b908190850183828082843760009201829052509385525050506020808301829052604083018290526060909201879052835460018101855593815220815191926004020190819061054790826108ac565b506020828101516001838101805460ff191692151592909217909155604080850151600285015560609094015160039093019290925560008581529190528190208290555181907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906105bd908890889061096c565b60405180910390a2604080518281526020810183905283916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a35095945050505050565b6000806040838503121561064857600080fd5b50508035926020909101359150565b60006020828403121561066957600080fd5b5035919050565b608081526000855180608084015260005b8181101561069e57602081890181015160a0868401015201610681565b50600060a0828501015260a0601f19601f830116840101915050841515602083015283604083015282606083015295945050505050565b60008083601f8401126106e757600080fd5b50813567ffffffffffffffff8111156106ff57600080fd5b60208301915083602082850101111561071757600080fd5b9250929050565b60008060008060006060868803121561073657600080fd5b853567ffffffffffffffff8082111561074e57600080fd5b61075a89838a016106d5565b9097509550602088013591508082111561077357600080fd5b50610780888289016106d5565b96999598509660400135949350505050565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806107bc57607f821691505b6020821081036107dc57634e487b7160e01b600052602260045260246000fd5b50919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8381526040602082015260006108256040830184866107e2565b95945050505050565b60006020828403121561084057600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f8211156108a757600081815260208120601f850160051c810160208610156108845750805b601f850160051c820191505b818110156108a357828155600101610890565b5050505b505050565b815167ffffffffffffffff8111156108c6576108c6610847565b6108da816108d484546107a8565b8461085d565b602080601f83116001811461090f57600084156108f75750858301515b600019600386901b1c1916600185901b1785556108a3565b600085815260208120601f198616915b8281101561093e5788860151825594840194600190910190840161091f565b508582101561095c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020815260006109806020830184866107e2565b94935050505056fea26469706673582212208e7d47ef8d6b22a035f41afcc5f56e22a79524eb3c710b3d6299740721da8b3d64736f6c63430008120033", + "numDeployments": 3, + "solcInputHash": "c6054c8267f7fff860ff9e6cbf28bb9e", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_arbitrableChainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"CrossChainDisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"data\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"CrossChainDisputeRequest(address,uint256,address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrable\":\"The address of the Arbitrable contract.\",\"_arbitrableChainId\":\"The chain identifier where the Arbitrable contract is deployed.\",\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeTemplate(uint256,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\",\"data\":\"The template data.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param data The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\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 _arbitrableChainId The chain identifier where the Arbitrable contract is deployed.\\n /// @param _arbitrable The address of the Arbitrable contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.\\n event CrossChainDisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 _arbitrableChainId,\\n address indexed _arbitrable,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0xc1a18e122cab929e6b0a028dd48cc560806cf530a0e1e199b15078b79cfd239c\",\"license\":\"MIT\"},\"src/arbitration/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute.\\n /// Must be called by the arbitrable contract.\\n /// Must pay 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 The identifier of the dispute created.\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration.\\n /// 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Return the current ruling of a dispute.\\n /// This is useful for parties to know if they should appeal.\\n /// @param _disputeID The identifer 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 function currentRuling(uint _disputeID) external view returns (uint ruling);\\n}\\n\",\"keccak256\":\"0xe9a699c2d9c3f57c0e2acf8bea94d274198e5947e91c5eb5f69d86c99e68dbbf\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport \\\"../IArbitrableV2.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, _disputeTemplate, \\\"\\\", _numberOfRulingOptions);\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n\\n uint256 templateId = localDisputeID;\\n emit DisputeTemplate(templateId, \\\"\\\", _disputeTemplate);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x83e137298606af8bea506fff29de9c274d41fd89b85dd2d2815443a9fae38716\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610c89380380610c8983398101604081905261002f91610062565b60008054336001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055610092565b60006020828403121561007457600080fd5b81516001600160a01b038116811461008b57600080fd5b9392505050565b610be8806100a16000396000f3fe6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea26469706673582212209e73d035463fa04bd6a44a74fe31a00141aff519a72beffc9a48e5cd8476b07864736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea26469706673582212209e73d035463fa04bd6a44a74fe31a00141aff519a72beffc9a48e5cd8476b07864736f6c63430008120033", "devdoc": { "events": { - "Dispute(address,uint256,uint256,uint256)": { + "CrossChainDisputeRequest(address,uint256,address,uint256,uint256,uint256,string)": { "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", "params": { + "_arbitrable": "The address of the Arbitrable contract.", + "_arbitrableChainId": "The chain identifier where the Arbitrable contract is deployed.", + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", "_arbitrator": "The arbitrator of the contract.", - "_disputeID": "ID of the dispute in the Arbitrator contract.", - "_evidenceGroupID": "Unique identifier of the evidence group that is linked to this dispute.", - "_metaEvidenceID": "Unique identifier of meta-evidence." + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId." } }, - "MetaEvidence(uint256,string)": { - "details": "To be emitted when meta-evidence is submitted.", + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "DisputeTemplate(uint256,string,string)": { + "details": "To be emitted when a new dispute template is created.", "params": { - "_evidence": "IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'", - "_metaEvidenceID": "Unique identifier of meta-evidence." + "_templateId": "The identifier of the dispute template.", + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\".", + "data": "The template data." } }, "Ruling(address,uint256,uint256)": { "details": "To be raised when a ruling is given.", "params": { "_arbitrator": "The arbitrator giving the ruling.", - "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", "_ruling": "The ruling which was given." } } }, "kind": "dev", "methods": { + "changeGovernor(address)": { + "details": "Changes the governor.", + "params": { + "_governor": "The address of the new governor." + } + }, "constructor": { "details": "Constructor", "params": { "_arbitrator": "Target global arbitrator for any disputes." } }, - "createDispute(bytes,string,uint256)": { - "details": "TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "createDisputeForTemplate(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplate": "Dispute template.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "createDisputeForTemplateUri(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", "params": { "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", - "_metaevidenceURI": "Link to metaevidence of the dispute.", + "_disputeTemplateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.", "_numberOfRulingOptions": "Number of ruling options." }, "returns": { @@ -279,7 +439,7 @@ } } }, - "title": "DisputeResolver DisputeResolver contract adapted for V2 https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", + "title": "DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", "version": 1 }, "userdoc": { @@ -290,25 +450,46 @@ "storageLayout": { "storage": [ { - "astId": 9696, + "astId": 129, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", - "label": "disputes", + "label": "governor", "offset": 0, "slot": "0", - "type": "t_array(t_struct(DisputeStruct)9689_storage)dyn_storage" + "type": "t_address" }, { - "astId": 9700, + "astId": 132, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", - "label": "externalIDtoLocalID", + "label": "arbitrator", "offset": 0, "slot": "1", + "type": "t_contract(IArbitratorV2)112" + }, + { + "astId": 136, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(DisputeStruct)127_storage)dyn_storage" + }, + { + "astId": 140, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorDisputeIDToLocalID", + "offset": 0, + "slot": "3", "type": "t_mapping(t_uint256,t_uint256)" } ], "types": { - "t_array(t_struct(DisputeStruct)9689_storage)dyn_storage": { - "base": "t_struct(DisputeStruct)9689_storage", + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)127_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)127_storage", "encoding": "dynamic_array", "label": "struct DisputeResolver.DisputeStruct[]", "numberOfBytes": "32" @@ -323,6 +504,11 @@ "label": "bytes", "numberOfBytes": "32" }, + "t_contract(IArbitratorV2)112": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, "t_mapping(t_uint256,t_uint256)": { "encoding": "mapping", "key": "t_uint256", @@ -330,12 +516,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(DisputeStruct)9689_storage": { + "t_struct(DisputeStruct)127_storage": { "encoding": "inplace", "label": "struct DisputeResolver.DisputeStruct", "members": [ { - "astId": 9682, + "astId": 120, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "arbitratorExtraData", "offset": 0, @@ -343,7 +529,7 @@ "type": "t_bytes_storage" }, { - "astId": 9684, + "astId": 122, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "isRuled", "offset": 0, @@ -351,7 +537,7 @@ "type": "t_bool" }, { - "astId": 9686, + "astId": 124, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "ruling", "offset": 0, @@ -359,7 +545,7 @@ "type": "t_uint256" }, { - "astId": 9688, + "astId": 126, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "numberOfRulingOptions", "offset": 0, diff --git a/contracts/src/arbitration/arbitrables/DisputeResolver.sol b/contracts/src/arbitration/arbitrables/DisputeResolver.sol index 725b2c7ff..d4ec3e3ef 100644 --- a/contracts/src/arbitration/arbitrables/DisputeResolver.sol +++ b/contracts/src/arbitration/arbitrables/DisputeResolver.sol @@ -114,7 +114,7 @@ contract DisputeResolver is IArbitrableV2 { function _createDispute( bytes calldata _arbitratorExtraData, string memory _disputeTemplate, - string memory _disputeUri, + string memory _disputeTemplateUri, uint256 _numberOfRulingOptions ) internal returns (uint256 disputeID) { require(_numberOfRulingOptions > 1, "Should be at least 2 ruling options."); @@ -133,6 +133,6 @@ contract DisputeResolver is IArbitrableV2 { uint256 templateId = localDisputeID; emit DisputeTemplate(templateId, "", _disputeTemplate); - emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeUri); + emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri); } } From b6b563c46caac9674afc9eab73b385ace21ca083 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Thu, 15 Jun 2023 13:59:38 +0100 Subject: [PATCH 20/29] refactor: moved crosschain event to the gateway interface --- contracts/src/arbitration/IArbitrableV2.sol | 18 --------- .../gateway/interfaces/IForeignGateway.sol | 18 +++++++++ .../src/gateway/interfaces/IHomeGateway.sol | 39 +++++++++---------- 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index 821c96b14..2f5562e7b 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -30,24 +30,6 @@ interface IArbitrableV2 { string _templateUri ); - /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. - /// @param _arbitrator The arbitrator of the contract. - /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. - /// @param _arbitrable The address of the Arbitrable contract. - /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. - /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. - /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. - /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. - event CrossChainDisputeRequest( - IArbitratorV2 indexed _arbitrator, - uint256 _arbitrableChainId, - address indexed _arbitrable, - uint256 indexed _arbitrableDisputeID, - uint256 _externalDisputeID, - uint256 _templateId, - string _templateUri - ); - /// @dev To be raised when a ruling is given. /// @param _arbitrator The arbitrator giving the ruling. /// @param _disputeID The identifier of the dispute in the Arbitrator contract. diff --git a/contracts/src/gateway/interfaces/IForeignGateway.sol b/contracts/src/gateway/interfaces/IForeignGateway.sol index e1fa537da..3dd420b05 100644 --- a/contracts/src/gateway/interfaces/IForeignGateway.sol +++ b/contracts/src/gateway/interfaces/IForeignGateway.sol @@ -13,6 +13,24 @@ import "@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol"; import "../../arbitration/IArbitrator.sol"; interface IForeignGateway is IArbitrator, IReceiverGateway { + /// @dev To be emitted when a dispute is sent to the IHomeGateway. + /// @param _arbitrator The arbitrator of the contract. + /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. + /// @param _arbitrable The address of the Arbitrable contract. + /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. + /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. + /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. + /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. + event CrossChainDisputeOutgoing( + IArbitratorV2 indexed _arbitrator, + uint256 _arbitrableChainId, + address indexed _arbitrable, + uint256 indexed _arbitrableDisputeID, + uint256 _externalDisputeID, + uint256 _templateId, + string _templateUri + ); + /// Relay the rule call from the home gateway to the arbitrable. function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external; diff --git a/contracts/src/gateway/interfaces/IHomeGateway.sol b/contracts/src/gateway/interfaces/IHomeGateway.sol index 62a2be17f..86fbf24a0 100644 --- a/contracts/src/gateway/interfaces/IHomeGateway.sol +++ b/contracts/src/gateway/interfaces/IHomeGateway.sol @@ -14,6 +14,24 @@ import "../../arbitration/IArbitrable.sol"; import "../../evidence/IMetaEvidence.sol"; interface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway { + /// @dev To be emitted when a dispute is received from the IForeignGateway. + /// @param _arbitrator The arbitrator of the contract. + /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. + /// @param _arbitrable The address of the Arbitrable contract. + /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. + /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. + /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. + /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. + event CrossChainDisputeIncoming( + IArbitratorV2 indexed _arbitrator, + uint256 _arbitrableChainId, + address indexed _arbitrable, + uint256 indexed _arbitrableDisputeID, + uint256 _externalDisputeID, + uint256 _templateId, + string _templateUri + ); + /// @dev Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. /// Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. /// This function accepts the fees payment in the native currency of the home chain, typically ETH. @@ -32,28 +50,9 @@ interface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway { address _arbitrable ) external payable; - /// @dev Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. - /// Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. - /// This function accepts the fees payment in the ERC20 token specified by `acceptedFeeToken()`. - /// @param _foreignChainID foreignChainId - /// @param _foreignBlockHash foreignBlockHash - /// @param _foreignDisputeID foreignDisputeID - /// @param _choices number of ruling choices - /// @param _extraData extraData - /// @param _arbitrable arbitrable - /// @param _feeAmount Amount of the ERC20 token used to pay fees. - function relayCreateDispute( - uint256 _foreignChainID, - bytes32 _foreignBlockHash, - uint256 _foreignDisputeID, - uint256 _choices, - bytes calldata _extraData, - address _arbitrable, - uint256 _feeAmount - ) external payable; - /// @dev Looks up the local home disputeID for a disputeHash /// @param _disputeHash dispute hash + /// @return disputeID dispute identifier on the home chain function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256); /// @return The chain ID where the corresponding foreign gateway is deployed. From 5bc1ed7e95e3711af80c10d2081c6e7134e81138 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 20 Jun 2023 00:07:33 +0100 Subject: [PATCH 21/29] feat: migrated all the interfaces to the new v2 ones) --- contracts/deploy/00-home-chain-arbitrable.ts | 8 +- contracts/deploy/03-vea-mock.ts | 5 +- .../deploy/04-klerosliquid-to-v2-gnosis.ts | 21 +---- contracts/src/arbitration/IArbitrableV2.sol | 4 +- contracts/src/arbitration/KlerosGovernor.sol | 32 ++++---- .../arbitrables/ArbitrableExample.sol | 77 ++++++++++--------- .../src/evidence/ModeratedEvidenceModule.sol | 53 +++++++------ contracts/src/gateway/ForeignGateway.sol | 34 ++++---- contracts/src/gateway/HomeGateway.sol | 55 +++++++++++-- .../gateway/interfaces/IForeignGateway.sol | 27 +++---- .../src/gateway/interfaces/IHomeGateway.sol | 24 +++++- .../kleros-liquid-xdai/xKlerosLiquidV2.sol | 12 +-- .../KlerosLiquidToV2Governor.sol | 69 ++++++++++------- contracts/test/arbitration/draw.ts | 23 +++++- contracts/test/evidence/index.ts | 43 ++++++----- contracts/test/integration/index.ts | 31 ++++++-- 16 files changed, 295 insertions(+), 223 deletions(-) diff --git a/contracts/deploy/00-home-chain-arbitrable.ts b/contracts/deploy/00-home-chain-arbitrable.ts index 6c610f216..1cf94f5f5 100644 --- a/contracts/deploy/00-home-chain-arbitrable.ts +++ b/contracts/deploy/00-home-chain-arbitrable.ts @@ -1,5 +1,6 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; +import disputeTemplate from "../../kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json"; enum HomeChains { ARBITRUM_ONE = 42161, @@ -21,12 +22,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) await deploy("ArbitrableExample", { from: deployer, - args: [ - klerosCore.address, - 0, - "https://cloudflare-ipfs.com/ipfs/bafkreifteme6tusnjwyzajk75fyvzdmtyycxctf7yhfijb6rfigz3n4lvq", - weth.address, - ], + args: [klerosCore.address, disputeTemplate, weth.address], log: true, }); diff --git a/contracts/deploy/03-vea-mock.ts b/contracts/deploy/03-vea-mock.ts index b173a2f57..a03fcfe62 100644 --- a/contracts/deploy/03-vea-mock.ts +++ b/contracts/deploy/03-vea-mock.ts @@ -1,6 +1,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; +import disputeTemplate from "../../kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json"; const HARDHAT_NETWORK = 31337; @@ -58,11 +59,9 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) ethers.BigNumber.from(10).pow(17) ); - const metaEvidenceUri = `https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/goerli/MetaEvidence_ArbitrableExample.json`; - await deploy("ArbitrableExample", { from: deployer, - args: [foreignGateway.address, 0, metaEvidenceUri, ethers.constants.AddressZero], + args: [foreignGateway.address, disputeTemplate, ethers.constants.AddressZero], log: true, }); }; diff --git a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts index a66f1f6c4..e2a446f0a 100644 --- a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts +++ b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts @@ -1,6 +1,7 @@ import { parseUnits, parseEther } from "ethers/lib/utils"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; +import disputeTemplate from "../../kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json"; enum ForeignChains { GNOSIS_MAINNET = 100, @@ -98,29 +99,11 @@ const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment // const xKlerosLiquidV2 = await deployments.get("xKlerosLiquidV2"); await deploy("ArbitrableExample", { from: deployer, - args: [ - xKlerosLiquidV2.address, - 0, - "/ipfs/bafkreifteme6tusnjwyzajk75fyvzdmtyycxctf7yhfijb6rfigz3n4lvq", // PoH registration - weth.address, - ], + args: [xKlerosLiquidV2.address, 0, disputeTemplate, weth.address], log: true, maxFeePerGas: ONE_GWEI, maxPriorityFeePerGas: ONE_GWEI, }); - - await execute( - "ArbitrableExample", - { - from: deployer, - log: true, - maxFeePerGas: ONE_GWEI, - maxPriorityFeePerGas: ONE_GWEI, - }, - "changeMetaEvidence", - 1, - "/ipfs/bafkreibiuxwejijwg4pxco7fqszawcwmpt26itbdxeqgh7cvpeuwtmlhoa" // PoH clearing - ); }; // TODO: mock deployment on the hardhat network diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/IArbitrableV2.sol index 2f5562e7b..bd782e451 100644 --- a/contracts/src/arbitration/IArbitrableV2.sol +++ b/contracts/src/arbitration/IArbitrableV2.sol @@ -13,8 +13,8 @@ interface IArbitrableV2 { /// @dev To be emitted when a new dispute template is created. /// @param _templateId The identifier of the dispute template. /// @param _templateTag An optional tag for the dispute template, such as "registration" or "removal". - /// @param data The template data. - event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data); + /// @param _templateData The template data. + event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData); /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. /// @param _arbitrator The arbitrator of the contract. diff --git a/contracts/src/arbitration/KlerosGovernor.sol b/contracts/src/arbitration/KlerosGovernor.sol index 6730d4a3c..e97ead006 100644 --- a/contracts/src/arbitration/KlerosGovernor.sol +++ b/contracts/src/arbitration/KlerosGovernor.sol @@ -7,12 +7,11 @@ pragma solidity 0.8.18; -import "./IArbitrable.sol"; -import "../evidence/IMetaEvidence.sol"; +import {IArbitrableV2, IArbitratorV2} from "./IArbitrableV2.sol"; import "../libraries/CappedMath.sol"; /// @title KlerosGovernor for V2. Note that appeal functionality and evidence submission will be handled by the court. -contract KlerosGovernor is IArbitrable, IMetaEvidence { +contract KlerosGovernor is IArbitrableV2 { using CappedMath for uint256; // ************************************* // @@ -52,9 +51,9 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { uint256 approvalTime; // The time when the list was approved. } - IArbitrator public arbitrator; // Arbitrator contract. + IArbitratorV2 public arbitrator; // Arbitrator contract. bytes public arbitratorExtraData; // Extra data for arbitrator. - uint256 public metaEvidenceUpdates; // The number of times the meta evidence has been updated. Used to track the latest meta evidence ID. + uint256 public disputeTemplates; // The number of dispute templates created. uint256 public submissionBaseDeposit; // The base deposit in wei that needs to be paid in order to submit the list. uint256 public submissionTimeout; // Time in seconds allowed for submitting the lists. Once it's passed the contract enters the approval period. @@ -115,15 +114,15 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { /// @dev Constructor. /// @param _arbitrator The arbitrator of the contract. /// @param _arbitratorExtraData Extra data for the arbitrator. - /// @param _metaEvidence The URI of the meta evidence file. + /// @param _templateData The dispute template data. /// @param _submissionBaseDeposit The base deposit required for submission. /// @param _submissionTimeout Time in seconds allocated for submitting transaction list. /// @param _executionTimeout Time in seconds after approval that allows to execute transactions of the approved list. /// @param _withdrawTimeout Time in seconds after submission that allows to withdraw submitted list. constructor( - IArbitrator _arbitrator, + IArbitratorV2 _arbitrator, bytes memory _arbitratorExtraData, - string memory _metaEvidence, + string memory _templateData, uint256 _submissionBaseDeposit, uint256 _submissionTimeout, uint256 _executionTimeout, @@ -139,7 +138,7 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { withdrawTimeout = _withdrawTimeout; sessions.push(); - emit MetaEvidence(metaEvidenceUpdates, _metaEvidence); + emit DisputeTemplate(disputeTemplates++, "", _templateData); } /// @dev Changes the value of the base deposit required for submitting a list. @@ -171,18 +170,17 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { /// @param _arbitrator The new trusted arbitrator. /// @param _arbitratorExtraData The extra data used by the new arbitrator. function changeArbitrator( - IArbitrator _arbitrator, + IArbitratorV2 _arbitrator, bytes memory _arbitratorExtraData ) external onlyByGovernor duringSubmissionPeriod { arbitrator = _arbitrator; arbitratorExtraData = _arbitratorExtraData; } - /// @dev Update the meta evidence used for disputes. - /// @param _metaEvidence URI to the new meta evidence file. - function changeMetaEvidence(string memory _metaEvidence) external onlyByGovernor { - metaEvidenceUpdates++; - emit MetaEvidence(metaEvidenceUpdates, _metaEvidence); + /// @dev Update the dispute template data. + /// @param _templateData The new dispute template data. + function changeDisputeTemplate(string memory _templateData) external onlyByGovernor { + emit DisputeTemplate(disputeTemplates++, "", _templateData); } /// @dev Creates transaction list based on input parameters and submits it for potential approval and execution. @@ -296,7 +294,7 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { session.sumDeposit = session.sumDeposit.subCap(arbitrationCost); reservedETH = reservedETH.subCap(arbitrationCost); - emit Dispute(arbitrator, session.disputeID, metaEvidenceUpdates, sessions.length - 1); + emit DisputeRequest(arbitrator, session.disputeID, sessions.length - 1, disputeTemplates, ""); } } @@ -325,7 +323,7 @@ contract KlerosGovernor is IArbitrable, IMetaEvidence { session.ruling = _ruling; sessions.push(); - emit Ruling(IArbitrator(msg.sender), _disputeID, _ruling); + emit Ruling(IArbitratorV2(msg.sender), _disputeID, _ruling); } /// @dev Executes selected transactions of the list. diff --git a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol index 8c7f6de49..19177fc4a 100644 --- a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol +++ b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol @@ -2,32 +2,22 @@ pragma solidity 0.8.18; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../IArbitrable.sol"; import "../../evidence/IMetaEvidence.sol"; -import "../../libraries/SafeERC20.sol"; /// @title ArbitrableExample /// An example of an arbitrable contract which connects to the arbitator that implements the updated interface. contract ArbitrableExample is IArbitrable, IMetaEvidence { - using SafeERC20 for IERC20; - - // ************************************* // - // * Enums / Structs * // - // ************************************* // - struct DisputeStruct { bool isRuled; // Whether the dispute has been ruled or not. uint256 ruling; // Ruling given by the arbitrator. uint256 numberOfRulingOptions; // The number of choices the arbitrator can give. } - // ************************************* // - // * Storage * // - // ************************************* // - address public immutable governor; IArbitrator public arbitrator; // Arbitrator is set in constructor and never changed. - IERC20 public immutable weth; // The WETH token. + ERC20 public immutable weth; // The WETH token. mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID]. @@ -39,11 +29,11 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { /// @param _arbitrator The arbitrator to rule on created disputes. /// @param _metaEvidenceID Unique identifier of meta-evidence. /// @param _metaEvidence The URI of the meta evidence object for evidence submissions requests. - constructor(IArbitrator _arbitrator, uint256 _metaEvidenceID, string memory _metaEvidence, IERC20 _weth) { + constructor(IArbitrator _arbitrator, uint256 _metaEvidenceID, string memory _metaEvidence, ERC20 _weth) { governor = msg.sender; arbitrator = _arbitrator; weth = _weth; - emit MetaEvidence(_metaEvidenceID, _metaEvidence); + emit DisputeTemplate(disputeTemplates++, "", _templateData); } // ************************************* // @@ -66,55 +56,56 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { /// @dev Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. - /// @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from. + /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. + /// @param _action The action that requires arbitration. /// @param _arbitratorExtraData Extra data for the arbitrator. - /// @param _metaEvidenceID Unique identifier of meta-evidence. - /// @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute. /// @return disputeID Dispute id (on arbitrator side) of the dispute created. function createDispute( - uint256 _numberOfRulingOptions, - bytes calldata _arbitratorExtraData, - uint256 _metaEvidenceID, - uint256 _evidenceGroupID + uint256 _templateId, + string calldata _action, + bytes calldata _arbitratorExtraData ) external payable returns (uint256 disputeID) { - require(_numberOfRulingOptions > 1, "Incorrect number of choices"); + emit Action(_action); + uint256 numberOfRulingOptions = 2; uint256 localDisputeID = disputes.length; - disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: _numberOfRulingOptions})); + disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions})); + + disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, _arbitratorExtraData); - disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData); externalIDtoLocalID[disputeID] = localDisputeID; - emit Dispute(arbitrator, disputeID, _metaEvidenceID, _evidenceGroupID); + uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action))); + emit DisputeRequest(arbitrator, disputeID, externalDisputeID, _templateId, ""); } - /// @dev TRUSTED. Creates a dispute with the arbitrator and pays for the fees in WETH token. - /// Note that we don’t need to check that _feeInWeth is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. - /// @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from. + /// @dev Calls createDispute function of the specified arbitrator to create a dispute. + /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. + /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. + /// @param _action The action that requires arbitration. /// @param _arbitratorExtraData Extra data for the arbitrator. - /// @param _metaEvidenceID Unique identifier of meta-evidence. - /// @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute. /// @param _feeInWeth Amount of fees in WETH for the arbitrator. /// @return disputeID Dispute id (on arbitrator side) of the dispute created. function createDispute( - uint256 _numberOfRulingOptions, + uint256 _templateId, + string calldata _action, bytes calldata _arbitratorExtraData, - uint256 _metaEvidenceID, - uint256 _evidenceGroupID, uint256 _feeInWeth ) external payable returns (uint256 disputeID) { - require(_numberOfRulingOptions > 1, "Incorrect number of choices"); + emit Action(_action); + uint256 numberOfRulingOptions = 2; uint256 localDisputeID = disputes.length; - disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: _numberOfRulingOptions})); + disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions})); require(weth.safeTransferFrom(msg.sender, address(this), _feeInWeth), "Transfer failed"); require(weth.increaseAllowance(address(arbitrator), _feeInWeth), "Allowance increase failed"); - disputeID = arbitrator.createDispute(_numberOfRulingOptions, _arbitratorExtraData, weth, _feeInWeth); + disputeID = arbitrator.createDispute(numberOfRulingOptions, _arbitratorExtraData, weth, _feeInWeth); externalIDtoLocalID[disputeID] = localDisputeID; - emit Dispute(arbitrator, disputeID, _metaEvidenceID, _evidenceGroupID); + uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action))); + emit DisputeRequest(arbitrator, disputeID, externalDisputeID, _templateId, ""); } /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling. @@ -130,6 +121,16 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { dispute.isRuled = true; dispute.ruling = _ruling; - emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling); + emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling); + } + + function changeMetaEvidence(uint256 _metaEvidenceID, string memory _metaEvidence) external { + require(msg.sender == governor, "Not authorized: governor only."); + emit MetaEvidence(_metaEvidenceID, _metaEvidence); + } + + function changeArbitrator(IArbitrator _arbitrator) external { + require(msg.sender == governor, "Not authorized: governor only."); + arbitrator = _arbitrator; } } diff --git a/contracts/src/evidence/ModeratedEvidenceModule.sol b/contracts/src/evidence/ModeratedEvidenceModule.sol index e98c1144c..05595ad71 100644 --- a/contracts/src/evidence/ModeratedEvidenceModule.sol +++ b/contracts/src/evidence/ModeratedEvidenceModule.sol @@ -10,13 +10,11 @@ pragma solidity 0.8.18; // TODO: standard interfaces should be placed in a separated repo (?) -import "../arbitration/IArbitrable.sol"; -import "../arbitration/IArbitrator.sol"; -import "./IMetaEvidence.sol"; +import {IArbitrableV2, IArbitratorV2} from "../arbitration/IArbitrableV2.sol"; import "../libraries/CappedMath.sol"; /// @title Implementation of the Evidence Standard with Moderated Submissions -contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { +contract ModeratedEvidenceModule is IArbitrableV2 { using CappedMath for uint256; // ************************************* // @@ -48,7 +46,7 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { } struct ArbitratorData { - uint256 metaEvidenceUpdates; // The meta evidence to be used in disputes. + uint256 disputeTemplateId; // The ID of the dispute template used by the arbitrator. bytes arbitratorExtraData; // Extra data for the arbitrator. } @@ -61,8 +59,7 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { mapping(bytes32 => EvidenceData) evidences; // Maps the evidence ID to its data. evidences[evidenceID]. mapping(uint256 => bytes32) public disputeIDtoEvidenceID; // One-to-one relationship between the dispute and the evidence. ArbitratorData[] public arbitratorDataList; // Stores the arbitrator data of the contract. Updated each time the data is changed. - - IArbitrator public immutable arbitrator; // The trusted arbitrator to resolve potential disputes. If it needs to be changed, a new contract can be deployed. + IArbitratorV2 public immutable arbitrator; // The trusted arbitrator to resolve potential disputes. If it needs to be changed, a new contract can be deployed. address public governor; // The address that can make governance changes to the parameters of the contract. uint256 public bondTimeout; // The time in seconds during which the last moderation status can be challenged. uint256 public totalCostMultiplier; // Multiplier of arbitration fees that must be ultimately paid as fee stake. In basis points. @@ -81,14 +78,14 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { // * Events * // // ************************************* // - /// @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). + /// @dev To be raised when a moderated evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations). /// @param _arbitrator The arbitrator of the contract. - /// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. + /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID. /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party. /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json' - event Evidence( - IArbitrator indexed _arbitrator, - uint256 indexed _evidenceGroupID, + event ModeratedEvidence( + IArbitratorV2 indexed _arbitrator, + uint256 indexed _externalDisputeID, address indexed _party, string _evidence ); @@ -109,15 +106,15 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { /// @param _initialDepositMultiplier Multiplier of arbitration fees that must be paid as initial stake for submitting evidence. In basis points. /// @param _bondTimeout The time in seconds during which the last moderation status can be challenged. /// @param _arbitratorExtraData Extra data for the trusted arbitrator contract. - /// @param _metaEvidence The URI of the meta evidence object for evidence submissions requests. + /// @param _templateData The dispute template data. constructor( - IArbitrator _arbitrator, + IArbitratorV2 _arbitrator, address _governor, uint256 _totalCostMultiplier, uint256 _initialDepositMultiplier, uint256 _bondTimeout, bytes memory _arbitratorExtraData, - string memory _metaEvidence + string memory _templateData ) { arbitrator = _arbitrator; governor = _governor; @@ -128,7 +125,7 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { ArbitratorData storage arbitratorData = arbitratorDataList.push(); arbitratorData.arbitratorExtraData = _arbitratorExtraData; - emit MetaEvidence(0, _metaEvidence); + emit DisputeTemplate(arbitratorData.disputeTemplateId, "", _templateData); } // ************************************* // @@ -160,18 +157,18 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { bondTimeout = _bondTimeout; } - /// @dev Update the meta evidence used for disputes. - /// @param _newMetaEvidence The meta evidence to be used for future registration request disputes. - function changeMetaEvidence(string calldata _newMetaEvidence) external onlyGovernor { + /// @dev Update the dispute template data. + /// @param _templateData The new dispute template data. + function changeDisputeTemplate(string calldata _templateData) external onlyGovernor { ArbitratorData storage arbitratorData = arbitratorDataList[arbitratorDataList.length - 1]; - uint256 newMetaEvidenceUpdates = arbitratorData.metaEvidenceUpdates + 1; + uint256 newDisputeTemplateId = arbitratorData.disputeTemplateId + 1; arbitratorDataList.push( ArbitratorData({ - metaEvidenceUpdates: newMetaEvidenceUpdates, + disputeTemplateId: newDisputeTemplateId, arbitratorExtraData: arbitratorData.arbitratorExtraData }) ); - emit MetaEvidence(newMetaEvidenceUpdates, _newMetaEvidence); + emit DisputeTemplate(newDisputeTemplateId, "", _templateData); } /// @dev Change the arbitrator to be used for disputes that may be raised in the next requests. The arbitrator is trusted to support appeal period and not reenter. @@ -180,7 +177,7 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { ArbitratorData storage arbitratorData = arbitratorDataList[arbitratorDataList.length - 1]; arbitratorDataList.push( ArbitratorData({ - metaEvidenceUpdates: arbitratorData.metaEvidenceUpdates, + disputeTemplateId: arbitratorData.disputeTemplateId, arbitratorExtraData: _arbitratorExtraData }) ); @@ -215,7 +212,7 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { moderation.arbitratorDataID = arbitratorDataList.length - 1; // When evidence is submitted for a foreign arbitrable, the arbitrator field of Evidence is ignored. - emit Evidence(arbitrator, _evidenceGroupID, msg.sender, _evidence); + emit ModeratedEvidence(arbitrator, _evidenceGroupID, msg.sender, _evidence); } /// @dev Moderates an evidence submission. Requires the contester to at least double the accumulated stake of the oposing party. @@ -266,7 +263,13 @@ contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence { ); disputeIDtoEvidenceID[evidenceData.disputeID] = _evidenceID; - emit Dispute(arbitrator, evidenceData.disputeID, arbitratorData.metaEvidenceUpdates, uint256(_evidenceID)); + emit DisputeRequest( + arbitrator, + evidenceData.disputeID, + uint256(_evidenceID), + arbitratorData.disputeTemplateId, + "" + ); evidenceData.disputed = true; moderation.bondDeadline = 0; moderation.currentWinner = Party.None; diff --git a/contracts/src/gateway/ForeignGateway.sol b/contracts/src/gateway/ForeignGateway.sol index 12c88898a..85df8a655 100644 --- a/contracts/src/gateway/ForeignGateway.sol +++ b/contracts/src/gateway/ForeignGateway.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.18; -import "../arbitration/IArbitrable.sol"; +import "../arbitration/IArbitrableV2.sol"; import "./interfaces/IForeignGateway.sol"; /// Foreign Gateway @@ -30,15 +30,6 @@ contract ForeignGateway is IForeignGateway { // * Events * // // ************************************* // - event OutgoingDispute( - bytes32 disputeHash, - bytes32 blockhash, - uint256 localDisputeID, - uint256 _choices, - bytes _extraData, - address arbitrable - ); - event ArbitrationCostModified(uint96 indexed _courtID, uint256 _feeForJuror); // ************************************* // @@ -126,7 +117,7 @@ contract ForeignGateway is IForeignGateway { // * State Modifiers * // // ************************************* // - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function createDispute( uint256 _choices, bytes calldata _extraData @@ -140,13 +131,13 @@ contract ForeignGateway is IForeignGateway { } bytes32 disputeHash = keccak256( abi.encodePacked( - chainID, - blockhash(block.number - 1), "createDispute", + blockhash(block.number - 1), + chainID, + msg.sender, disputeID, _choices, - _extraData, - msg.sender + _extraData ) ); @@ -158,11 +149,10 @@ contract ForeignGateway is IForeignGateway { ruled: false }); - emit OutgoingDispute(disputeHash, blockhash(block.number - 1), disputeID, _choices, _extraData, msg.sender); - emit DisputeCreation(disputeID, IArbitrable(msg.sender)); + emit CrossChainDisputeOutgoing(blockhash(block.number - 1), msg.sender, disputeID, _choices, _extraData); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function createDispute( uint256 /*_choices*/, bytes calldata /*_extraData*/, @@ -172,7 +162,7 @@ contract ForeignGateway is IForeignGateway { revert("Not supported"); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function arbitrationCost(bytes calldata _extraData) public view override returns (uint256 cost) { (uint96 courtID, uint256 minJurors) = extraDataToCourtIDMinJurors(_extraData); cost = feeForJuror[courtID] * minJurors; @@ -201,7 +191,7 @@ contract ForeignGateway is IForeignGateway { dispute.ruled = true; dispute.relayer = _relayer; - IArbitrable arbitrable = IArbitrable(dispute.arbitrable); + IArbitrableV2 arbitrable = IArbitrableV2(dispute.arbitrable); arbitrable.rule(dispute.id, _ruling); } @@ -228,6 +218,10 @@ contract ForeignGateway is IForeignGateway { /// @inheritdoc IReceiverGateway function senderGateway() external view override returns (address) { return homeGateway; +} + + function currentRuling(uint _disputeID) external view returns (uint ruling) { + revert("Not supported"); } // ************************ // diff --git a/contracts/src/gateway/HomeGateway.sol b/contracts/src/gateway/HomeGateway.sol index 9609fc26a..005f5ca2a 100644 --- a/contracts/src/gateway/HomeGateway.sol +++ b/contracts/src/gateway/HomeGateway.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.18; -import "../arbitration/IArbitrator.sol"; +import "../arbitration/IArbitratorV2.sol"; import "./interfaces/IForeignGateway.sol"; import "./interfaces/IHomeGateway.sol"; import "../libraries/SafeERC20.sol"; @@ -33,7 +33,7 @@ contract HomeGateway is IHomeGateway { IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1. address public governor; - IArbitrator public arbitrator; + IArbitratorV2 public arbitrator; IVeaInbox public veaInbox; uint256 public immutable override foreignChainID; address public override foreignGateway; @@ -48,7 +48,7 @@ contract HomeGateway is IHomeGateway { constructor( address _governor, - IArbitrator _arbitrator, + IArbitratorV2 _arbitrator, IVeaInbox _veaInbox, uint256 _foreignChainID, address _foreignGateway, @@ -60,8 +60,6 @@ contract HomeGateway is IHomeGateway { foreignChainID = _foreignChainID; foreignGateway = _foreignGateway; feeToken = _feeToken; - - emit MetaEvidence(0, "BRIDGE"); } // ************************************* // @@ -77,7 +75,7 @@ contract HomeGateway is IHomeGateway { /// @dev Changes the arbitrator. /// @param _arbitrator The address of the new arbitrator. - function changeArbitrator(IArbitrator _arbitrator) external { + function changeArbitrator(IArbitratorV2 _arbitrator) external { require(governor == msg.sender, "Access not allowed: Governor only."); arbitrator = _arbitrator; } @@ -141,6 +139,47 @@ contract HomeGateway is IHomeGateway { emit Dispute(arbitrator, disputeID, 0, 0); } + + /// @dev Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. + /// @param _params The parameters of the dispute, see `RelayCreateDisputeParams`. + function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable override { + bytes32 disputeHash = keccak256( + abi.encodePacked( + "createDispute", + _params.foreignBlockHash, + _params.foreignChainID, + _params.foreignArbitrable, + _params.foreignDisputeID, + _params.choices, + _params.extraData + ) + ); + require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); + + RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash]; + require(relayedData.relayer == address(0), "Dispute already relayed"); + + relayedData.arbitrationCost = arbitrator.arbitrationCost(_params.extraData); + require(msg.value >= relayedData.arbitrationCost, "Not enough arbitration cost paid"); + + uint256 disputeID = arbitrator.createDispute{value: msg.value}(_params.choices, _params.extraData); + disputeIDtoHash[disputeID] = disputeHash; + disputeHashtoID[disputeHash] = disputeID; + relayedData.relayer = msg.sender; + + emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri); + + emit CrossChainDisputeIncoming( + arbitrator, + _params.foreignChainID, + _params.foreignArbitrable, + _params.foreignDisputeID, + _params.externalDisputeID, + _params.templateId, + _params.templateUri + ); + } + /// @inheritdoc IHomeGateway function relayCreateDispute( uint256 _foreignChainID, @@ -150,7 +189,7 @@ contract HomeGateway is IHomeGateway { bytes calldata _extraData, address _arbitrable, uint256 _feeAmount - ) external payable { + ) external { require(feeToken != NATIVE_CURRENCY, "Fees paid in native currency only"); require(_foreignChainID == foreignChainID, "Foreign chain ID not supported"); @@ -179,7 +218,7 @@ contract HomeGateway is IHomeGateway { emit Dispute(arbitrator, disputeID, 0, 0); } - /// @inheritdoc IArbitrable + /// @inheritdoc IArbitrableV2 function rule(uint256 _disputeID, uint256 _ruling) external override { require(msg.sender == address(arbitrator), "Only Arbitrator"); diff --git a/contracts/src/gateway/interfaces/IForeignGateway.sol b/contracts/src/gateway/interfaces/IForeignGateway.sol index 3dd420b05..a9965ee94 100644 --- a/contracts/src/gateway/interfaces/IForeignGateway.sol +++ b/contracts/src/gateway/interfaces/IForeignGateway.sol @@ -8,27 +8,20 @@ pragma solidity 0.8.18; -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "../../arbitration/IArbitratorV2.sol"; import "@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol"; -import "../../arbitration/IArbitrator.sol"; -interface IForeignGateway is IArbitrator, IReceiverGateway { +interface IForeignGateway is IArbitratorV2, IReceiverGateway { /// @dev To be emitted when a dispute is sent to the IHomeGateway. - /// @param _arbitrator The arbitrator of the contract. - /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. - /// @param _arbitrable The address of the Arbitrable contract. - /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. - /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. - /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. - /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. + /// @param _foreignBlockHash foreignBlockHash + /// @param _foreignArbitrable The address of the Arbitrable contract. + /// @param _foreignDisputeID The identifier of the dispute in the Arbitrable contract. event CrossChainDisputeOutgoing( - IArbitratorV2 indexed _arbitrator, - uint256 _arbitrableChainId, - address indexed _arbitrable, - uint256 indexed _arbitrableDisputeID, - uint256 _externalDisputeID, - uint256 _templateId, - string _templateUri + bytes32 _foreignBlockHash, + address indexed _foreignArbitrable, + uint256 indexed _foreignDisputeID, + uint256 _choices, + bytes _extraData ); /// Relay the rule call from the home gateway to the arbitrable. diff --git a/contracts/src/gateway/interfaces/IHomeGateway.sol b/contracts/src/gateway/interfaces/IHomeGateway.sol index 86fbf24a0..ca6438eee 100644 --- a/contracts/src/gateway/interfaces/IHomeGateway.sol +++ b/contracts/src/gateway/interfaces/IHomeGateway.sol @@ -9,11 +9,10 @@ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "../../arbitration/IArbitrableV2.sol"; import "@kleros/vea-contracts/src/interfaces/gateways/ISenderGateway.sol"; -import "../../arbitration/IArbitrable.sol"; -import "../../evidence/IMetaEvidence.sol"; -interface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway { +interface IHomeGateway is IArbitrableV2, ISenderGateway { /// @dev To be emitted when a dispute is received from the IForeignGateway. /// @param _arbitrator The arbitrator of the contract. /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. @@ -50,6 +49,25 @@ interface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway { address _arbitrable ) external payable; + // Workaround stack too deep for relayCreateDispute() + struct RelayCreateDisputeParams { + bytes32 foreignBlockHash; + uint256 foreignChainID; + address foreignArbitrable; + uint256 foreignDisputeID; + uint256 externalDisputeID; + uint256 templateId; + string templateUri; + uint256 choices; + bytes extraData; + } + + /// @dev Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. + /// Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. + /// This function accepts the fees payment in the native currency of the home chain, typically ETH. + /// @param _params The parameters of the dispute, see `RelayCreateDisputeParams`. + function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable; + /// @dev Looks up the local home disputeID for a disputeHash /// @param _disputeHash dispute hash /// @return disputeID dispute identifier on the home chain diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol index fb5f92060..7c41a5d29 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.18; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import {IArbitrator, IArbitrable} from "../../arbitration/IArbitrator.sol"; +import {IArbitratorV2, IArbitrableV2} from "../../arbitration/IArbitratorV2.sol"; import {ITokenController} from "../interfaces/ITokenController.sol"; import {WrappedPinakion} from "./WrappedPinakion.sol"; import {IRandomAuRa} from "./interfaces/IRandomAuRa.sol"; @@ -16,7 +16,7 @@ import "../../gateway/interfaces/IForeignGateway.sol"; /// @dev This contract is an adaption of Mainnet's KlerosLiquid (https://github.com/kleros/kleros/blob/69cfbfb2128c29f1625b3a99a3183540772fda08/contracts/kleros/KlerosLiquid.sol) /// for xDai chain. Notice that variables referring to ETH values in this contract, will hold the native token values of the chain on which xKlerosLiquid is deployed. /// When this contract gets deployed on xDai chain, ETH variables will hold xDai values. -contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitrator { +contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitratorV2 { // ************************************* // // * Enums / Structs * // // ************************************* // @@ -71,7 +71,7 @@ contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitrator { struct Dispute { // Note that appeal `0` is equivalent to the first round of the dispute. uint96 subcourtID; // The ID of the subcourt the dispute is in. - IArbitrable arbitrated; // The arbitrated arbitrable contract. + IArbitrableV2 arbitrated; // The arbitrated arbitrable contract. // The number of choices jurors have when voting. This does not include choice `0` which is reserved for "refuse to arbitrate"/"no ruling". uint256 numberOfChoices; Period period; // The current period of the dispute. @@ -463,17 +463,17 @@ contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitrator { disputeID = totalDisputes++; Dispute storage dispute = disputes[disputeID]; - dispute.arbitrated = IArbitrable(msg.sender); + dispute.arbitrated = IArbitrableV2(msg.sender); // The V2 subcourtID is off by one (uint96 subcourtID, uint256 minJurors) = extraDataToSubcourtIDAndMinJurors(_extraData); bytes memory extraDataV2 = abi.encode(uint256(subcourtID + 1), minJurors); foreignGateway.createDispute{value: msg.value}(_numberOfChoices, extraDataV2); - emit DisputeCreation(disputeID, IArbitrable(msg.sender)); + emit DisputeCreation(disputeID, IArbitrableV2(msg.sender)); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function createDispute( uint256 /*_choices*/, bytes calldata /*_extraData*/, diff --git a/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol b/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol index 39ca27ba5..98e0c355a 100644 --- a/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol +++ b/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol @@ -4,43 +4,61 @@ pragma solidity 0.8.18; import "../interfaces/IKlerosLiquid.sol"; import "../interfaces/ITokenController.sol"; -import "../../arbitration/IArbitrable.sol"; -import "../../arbitration/IArbitrator.sol"; +import {IArbitratorV2, IArbitrableV2} from "../../arbitration/IArbitratorV2.sol"; interface IPinakion { function balanceOf(address who) external view returns (uint256); } -contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { +contract KlerosLiquidToV2Governor is IArbitrableV2, ITokenController { + // ************************************* // + // * Enums / Structs * // + // ************************************* // + struct DisputeData { uint256 klerosLiquidDisputeID; bool ruled; } - IArbitrator public immutable foreignGateway; + // ************************************* // + // * Storage * // + // ************************************* // + + IArbitratorV2 public immutable foreignGateway; IKlerosLiquid public immutable klerosLiquid; address public governor; - mapping(uint256 => uint256) public klerosLiquidDisputeIDtoGatewayDisputeID; mapping(uint256 => DisputeData) public disputes; // disputes[gatewayDisputeID] mapping(address => uint256) public frozenTokens; // frozenTokens[account] locked token which shouldn't have been blocked. mapping(uint256 => mapping(uint256 => bool)) public isDisputeNotified; // isDisputeNotified[disputeID][roundID] used to track the notification of frozen tokens. + // ************************************* // + // * Function Modifiers * // + // ************************************* // + modifier onlyByGovernor() { require(governor == msg.sender); _; } + // ************************************* // + // * Constructor * // + // ************************************* // + /// @dev Constructor. Before this contract is made the new governor of KlerosLiquid, the evidence period of all subcourts has to be set to uint(-1). /// @param _klerosLiquid The trusted arbitrator to resolve potential disputes. /// @param _governor The trusted governor of the contract. /// @param _foreignGateway The trusted gateway that acts as an arbitrator, relaying disputes to v2. - constructor(IKlerosLiquid _klerosLiquid, address _governor, IArbitrator _foreignGateway) { + constructor(IKlerosLiquid _klerosLiquid, address _governor, IArbitratorV2 _foreignGateway) { klerosLiquid = _klerosLiquid; governor = _governor; foreignGateway = _foreignGateway; } + // ************************************* // + // * Governance * // + // ************************************* // + /// @dev Lets the governor call anything on behalf of the contract. /// @param _destination The destination of the call. /// @param _amount The value sent with the call. @@ -60,6 +78,10 @@ contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { governor = _governor; } + // ************************************* // + // * State Modifiers * // + // ************************************* // + /// @dev Relays disputes from KlerosLiquid to Kleros v2. Only disputes in the evidence period of the initial round can be realyed. /// @param _disputeID The ID of the dispute as defined in KlerosLiquid. function relayDispute(uint256 _disputeID) external { @@ -89,11 +111,8 @@ contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { dispute.klerosLiquidDisputeID = _disputeID; } - /// @dev Give a ruling for a dispute. Can only be called by the arbitrator. - /// Triggers rule() from KlerosLiquid to the arbitrable contract which created the dispute. - /// @param _disputeID ID of the dispute in the arbitrator contract. - /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Refused to arbitrate". - function rule(uint256 _disputeID, uint256 _ruling) public { + /// @inheritdoc IArbitrableV2 + function rule(uint256 _disputeID, uint256 _ruling) public override { require(msg.sender == address(foreignGateway), "Not the arbitrator."); DisputeData storage dispute = disputes[_disputeID]; require(dispute.klerosLiquidDisputeID != 0, "Dispute does not exist."); @@ -105,7 +124,7 @@ contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { IKlerosLiquid.Dispute memory klerosLiquidDispute = klerosLiquid.disputes(dispute.klerosLiquidDisputeID); - bytes memory data = abi.encodeCall(IArbitrable.rule, (dispute.klerosLiquidDisputeID, _ruling)); + bytes memory data = abi.encodeCall(IArbitrableV2.rule, (dispute.klerosLiquidDisputeID, _ruling)); klerosLiquid.executeGovernorProposal(klerosLiquidDispute.arbitrated, 0, data); } @@ -133,19 +152,13 @@ contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { } } - /// @dev Called when `_owner` sends ether to the MiniMe Token contract. - /// @param _owner The address that sent the ether to create tokens. - /// @return allowed Whether the operation should be allowed or not. - function proxyPayment(address _owner) external payable returns (bool allowed) { + /// @inheritdoc ITokenController + function proxyPayment(address /*_owner*/) external payable override returns (bool allowed) { allowed = false; } - /// @dev Notifies the controller about a token transfer allowing the controller to react if desired. - /// @param _from The origin of the transfer. - /// @param _to The destination of the transfer. - /// @param _amount The amount of the transfer. - /// @return allowed Whether the operation should be allowed or not. - function onTransfer(address _from, address _to, uint256 _amount) external returns (bool allowed) { + /// @inheritdoc ITokenController + function onTransfer(address _from, address /*_to*/, uint256 _amount) external view override returns (bool allowed) { if (klerosLiquid.lockInsolventTransfers()) { // Never block penalties or rewards. IPinakion pinakion = IPinakion(klerosLiquid.pinakion()); @@ -159,12 +172,12 @@ contract KlerosLiquidToV2Governor is IArbitrable, ITokenController { allowed = true; } - /// @dev Notifies the controller about an approval allowing the controller to react if desired. - /// @param _owner The address that calls `approve()`. - /// @param _spender The spender in the `approve()` call. - /// @param _amount The amount in the `approve()` call. - /// @return allowed Whether the operation should be allowed or not. - function onApprove(address _owner, address _spender, uint256 _amount) external returns (bool allowed) { + /// @inheritdoc ITokenController + function onApprove( + address /*_owner*/, + address /*_spender*/, + uint256 /*_amount*/ + ) external pure override returns (bool allowed) { allowed = true; } diff --git a/contracts/test/arbitration/draw.ts b/contracts/test/arbitration/draw.ts index 147806e94..49142949f 100644 --- a/contracts/test/arbitration/draw.ts +++ b/contracts/test/arbitration/draw.ts @@ -5,7 +5,7 @@ import { PNK, KlerosCore, ArbitrableExample, - HomeGatewayToEthereum, + HomeGateway, DisputeKitClassic, RandomizerRNG, RandomizerMock, @@ -65,7 +65,7 @@ describe("Draw Benchmark", async () => { disputeKit = (await ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; pnk = (await ethers.getContract("PNK")) as PNK; core = (await ethers.getContract("KlerosCore")) as KlerosCore; - homeGateway = (await ethers.getContract("HomeGatewayToEthereum")) as HomeGatewayToEthereum; + homeGateway = (await ethers.getContract("HomeGatewayToEthereum")) as HomeGateway; arbitrable = (await ethers.getContract("ArbitrableExample")) as ArbitrableExample; rng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG; randomizer = (await ethers.getContract("RandomizerMock")) as RandomizerMock; @@ -94,7 +94,7 @@ describe("Draw Benchmark", async () => { } // Create a dispute - const tx = await arbitrable.functions["createDispute(uint256,bytes,uint256,uint256)"](2, "0x00", 0, 0, { + const tx = await arbitrable.functions["createDispute(uint256,string,bytes)"](0, "future of france", "0x00", { value: arbitrationCost, }); const trace = await network.provider.send("debug_traceTransaction", [tx.hash]); @@ -102,6 +102,7 @@ describe("Draw Benchmark", async () => { const lastBlock = await ethers.provider.getBlock(tx.blockNumber - 1); // Relayer tx +<<<<<<< HEAD const tx2 = await homeGateway .connect(await ethers.getSigner(relayer)) .functions["relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)"]( @@ -115,6 +116,22 @@ describe("Draw Benchmark", async () => { value: arbitrationCost, } ); +======= + const tx2 = await homeGateway.connect(await ethers.getSigner(relayer)).relayCreateDispute( + { + foreignBlockHash: lastBlock.hash, + foreignChainID: 31337, + foreignArbitrable: arbitrable.address, + foreignDisputeID: disputeId, + externalDisputeID: ethers.utils.keccak256(ethers.utils.toUtf8Bytes("future of france")), + templateId: 0, + templateUri: "", + choices: 2, + extraData: "0x00", + }, + { value: arbitrationCost } + ); +>>>>>>> 6a280d9 (feat: migrated all the interfaces to the new v2 ones)) await network.provider.send("evm_increaseTime", [2000]); // Wait for minStakingTime await network.provider.send("evm_mine"); diff --git a/contracts/test/evidence/index.ts b/contracts/test/evidence/index.ts index 71a7466aa..281dc119f 100644 --- a/contracts/test/evidence/index.ts +++ b/contracts/test/evidence/index.ts @@ -21,7 +21,7 @@ describe("Home Evidence contract", async () => { const bondTimeout = 60 * 10; const totalCostMultiplier = 15000; const initialDepositMultiplier = 625; - const metaEvidenceUri = "https://kleros.io"; + const disputeTemplate = '{ "disputeTemplate": "foo"}'; const MULTIPLIER_DIVISOR = BigNumber.from(10000); const totalCost = BigNumber.from(arbitrationFee).mul(BigNumber.from(totalCostMultiplier)).div(MULTIPLIER_DIVISOR); const minRequiredDeposit = totalCost.mul(BigNumber.from(initialDepositMultiplier)).div(MULTIPLIER_DIVISOR); @@ -51,7 +51,7 @@ describe("Home Evidence contract", async () => { initialDepositMultiplier, bondTimeout, arbitratorExtraData, - metaEvidenceUri + disputeTemplate ); }); @@ -71,20 +71,18 @@ describe("Home Evidence contract", async () => { await evidenceModule.changeBondTimeout(1); expect(await evidenceModule.bondTimeout()).to.equal(1); - const newMetaEvidenceUri = "https://kleros.io/new"; - let tx = await evidenceModule.changeMetaEvidence(newMetaEvidenceUri); + const newDisputeTemplate = '{ "disputeTemplate": "bar"}'; + let tx = await evidenceModule.changeDisputeTemplate(newDisputeTemplate); let receipt = await tx.wait(); let lastArbitratorIndex = await evidenceModule.getCurrentArbitratorIndex(); let newArbitratorData = await evidenceModule.arbitratorDataList(lastArbitratorIndex); let oldArbitratorData = await evidenceModule.arbitratorDataList(lastArbitratorIndex.sub(BigNumber.from(1))); - expect(newArbitratorData.metaEvidenceUpdates).to.equal( - oldArbitratorData.metaEvidenceUpdates.add(BigNumber.from(1)) - ); + expect(newArbitratorData.disputeTemplateId).to.equal(oldArbitratorData.disputeTemplateId.add(BigNumber.from(1))); expect(newArbitratorData.arbitratorExtraData).to.equal(oldArbitratorData.arbitratorExtraData); - const [newMetaEvidenceUpdates, newMetaEvidence] = getEmittedEvent("MetaEvidence", receipt).args; - expect(newMetaEvidence).to.equal(newMetaEvidenceUri, "Wrong MetaEvidence."); - expect(newMetaEvidenceUpdates).to.equal(newArbitratorData.metaEvidenceUpdates, "Wrong MetaEvidence ID."); + const [_templateId, _, _templateData] = getEmittedEvent("DisputeTemplate", receipt).args; + expect(_templateData).to.equal(newDisputeTemplate, "Wrong Template Data."); + expect(_templateId).to.equal(newArbitratorData.disputeTemplateId, "Wrong Template ID."); const newArbitratorExtraData = "0x86"; await evidenceModule.changeArbitratorExtraData(newArbitratorExtraData); @@ -109,7 +107,7 @@ describe("Home Evidence contract", async () => { "The caller must be the governor" ); - await expect(evidenceModule.connect(user2).changeMetaEvidence(metaEvidenceUri)).to.be.revertedWith( + await expect(evidenceModule.connect(user2).changeDisputeTemplate(disputeTemplate)).to.be.revertedWith( "The caller must be the governor" ); @@ -128,11 +126,11 @@ describe("Home Evidence contract", async () => { const receipt = await tx.wait(); const evidenceID = ethers.utils.solidityKeccak256(["uint", "string"], [1234, newEvidence]); - const [arbitratorAddress, evidenceGroupID, submitter, evidenceStr] = getEmittedEvent("Evidence", receipt).args; - expect(arbitratorAddress).to.equal(arbitrator.address, "Wrong arbitrator."); - expect(evidenceGroupID).to.equal(1234, "Wrong evidence group ID."); - expect(submitter).to.equal(user1.address, "Wrong submitter."); - expect(evidenceStr).to.equal(newEvidence, "Wrong evidence message."); + const [_arbitrator, _externalDisputeID, _party, _evidence] = getEmittedEvent("ModeratedEvidence", receipt).args; + expect(_arbitrator).to.equal(arbitrator.address, "Wrong arbitrator."); + expect(_externalDisputeID).to.equal(1234, "Wrong external dispute ID."); + expect(_party).to.equal(user1.address, "Wrong submitter."); + expect(_evidence).to.equal(newEvidence, "Wrong evidence message."); let contributions = await evidenceModule.getContributions(evidenceID, 0, user1.address); expect(contributions[0]).to.equal(ZERO); // it's 1am and to.deep.equal() won't work, can't be bothered @@ -141,7 +139,7 @@ describe("Home Evidence contract", async () => { expect(contributions.length).to.equal(3); }); - it("Should not allowed the same evidence twice for the same evidence group id.", async () => { + it("Should not allowed the same evidence twice for the same external dispute id.", async () => { const newEvidence = "Irrefutable evidence"; await evidenceModule.submitEvidence(1234, newEvidence, { value: minRequiredDeposit, @@ -235,11 +233,14 @@ describe("Home Evidence contract", async () => { }); let receipt = await tx.wait(); - let [_arbitrator, disputeID, metaEvidenceID, _evidenceID] = getEmittedEvent("Dispute", receipt).args; + let [_arbitrator, _arbitrableDisputeID, _externalDisputeID, _templateId, _templateUri] = getEmittedEvent( + "DisputeRequest", + receipt + ).args; expect(_arbitrator).to.equal(arbitrator.address, "Wrong arbitrator."); - expect(disputeID).to.equal(0, "Wrong dispute ID."); - expect(metaEvidenceID).to.equal(0, "Wrong meta-evidence ID."); - expect(_evidenceID).to.equal(evidenceID, "Wrong evidence ID."); + expect(_arbitrableDisputeID).to.equal(0, "Wrong dispute ID."); + expect(_templateId).to.equal(0, "Wrong template ID."); + expect(_externalDisputeID).to.equal(evidenceID, "Wrong external dispute ID."); await expect( evidenceModule.connect(user2).moderate(evidenceID, Party.Moderator, { diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index 89154d456..a30fddb92 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -4,15 +4,16 @@ import { BigNumber } from "ethers"; import { PNK, KlerosCore, - ForeignGatewayOnEthereum, + ForeignGateway, ArbitrableExample, - HomeGatewayToEthereum, + HomeGateway, VeaMock, DisputeKitClassic, RandomizerRNG, RandomizerMock, SortitionModule, } from "../../typechain-types"; +import { keccak256 } from "ethers/lib/utils"; /* eslint-disable no-unused-vars */ /* eslint-disable no-unused-expressions */ // https://github.com/standard/standard/issues/690#issuecomment-278533482 @@ -56,9 +57,9 @@ describe("Integration tests", async () => { pnk = (await ethers.getContract("PNK")) as PNK; core = (await ethers.getContract("KlerosCore")) as KlerosCore; vea = (await ethers.getContract("VeaMock")) as VeaMock; - foreignGateway = (await ethers.getContract("ForeignGatewayOnEthereum")) as ForeignGatewayOnEthereum; + foreignGateway = (await ethers.getContract("ForeignGatewayOnEthereum")) as ForeignGateway; arbitrable = (await ethers.getContract("ArbitrableExample")) as ArbitrableExample; - homeGateway = (await ethers.getContract("HomeGatewayToEthereum")) as HomeGatewayToEthereum; + homeGateway = (await ethers.getContract("HomeGatewayToEthereum")) as HomeGateway; sortitionModule = (await ethers.getContract("SortitionModule")) as SortitionModule; }); @@ -107,13 +108,13 @@ describe("Integration tests", async () => { const lastBlock = await ethers.provider.getBlock(tx.blockNumber - 1); const disputeHash = ethers.utils.solidityKeccak256( - ["uint", "bytes", "bytes", "uint", "uint", "bytes", "address"], - [31337, lastBlock.hash, ethers.utils.toUtf8Bytes("createDispute"), disputeId, 2, "0x00", arbitrable.address] + ["bytes", "bytes32", "uint256", "address", "uint256", "uint256", "bytes"], + [ethers.utils.toUtf8Bytes("createDispute"), lastBlock.hash, 31337, arbitrable.address, disputeId, 2, "0x00"] ); - const events = (await tx.wait()).events; // Relayer tx +<<<<<<< HEAD const tx2 = await homeGateway .connect(relayer) .functions["relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)"]( @@ -127,6 +128,22 @@ describe("Integration tests", async () => { value: arbitrationCost, } ); +======= + const tx2 = await homeGateway.connect(relayer).relayCreateDispute( + { + foreignBlockHash: lastBlock.hash, + foreignChainID: 31337, + foreignArbitrable: arbitrable.address, + foreignDisputeID: disputeId, + externalDisputeID: ethers.utils.keccak256(ethers.utils.toUtf8Bytes("future of france")), + templateId: 0, + templateUri: "", + choices: 2, + extraData: "0x00", + }, + { value: arbitrationCost } + ); +>>>>>>> 6a280d9 (feat: migrated all the interfaces to the new v2 ones)) expect(tx2).to.emit(homeGateway, "Dispute"); const events2 = (await tx2.wait()).events; From c6b7470e695a2a79291dadad4de42a8b5fef5ad3 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 20 Jun 2023 00:22:46 +0100 Subject: [PATCH 22/29] feat: added a simple dispute template, moved IMetaEvidence to the v1 folder And removed intermediate interfaces --- contracts/src/arbitration/IArbitrable.sol | 26 ---------- contracts/src/arbitration/IArbitratorV2.sol | 49 +++++++++++++++---- .../interfaces/IEvidenceV1.sol} | 25 ++++++++-- contracts/test/integration/index.ts | 2 +- .../simple/NewDisputeTemplate.simple.json | 23 +++++++++ .../example/DisputeDetails.simple.jsonc | 44 +++++++++++++++++ .../example/DisputeTemplateInputs.curate.txt | 2 + .../simple/example/NewDispute.simple.jsonc | 8 +++ 8 files changed, 140 insertions(+), 39 deletions(-) delete mode 100644 contracts/src/arbitration/IArbitrable.sol rename contracts/src/{evidence/IMetaEvidence.sol => kleros-v1/interfaces/IEvidenceV1.sol} (52%) create mode 100644 kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json create mode 100644 kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc create mode 100644 kleros-sdk/config/v2-disputetemplate/simple/example/DisputeTemplateInputs.curate.txt create mode 100644 kleros-sdk/config/v2-disputetemplate/simple/example/NewDispute.simple.jsonc diff --git a/contracts/src/arbitration/IArbitrable.sol b/contracts/src/arbitration/IArbitrable.sol deleted file mode 100644 index 17195853f..000000000 --- a/contracts/src/arbitration/IArbitrable.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "./IArbitrator.sol"; - -/// @title IArbitrable -/// Arbitrable interface. Note that this interface follows the ERC-792 standard. -/// When developing arbitrable contracts, we need to: -/// - Define the action taken when a ruling is received by the contract. -/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); -interface IArbitrable { - /// @dev To be raised when a ruling is given. - /// @param _arbitrator The arbitrator giving the ruling. - /// @param _disputeID The identifier of the dispute in the Arbitrator contract. - /// @param _ruling The ruling which was given. - event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling); - - /// @dev Give a ruling for a dispute. - /// Must be called by the arbitrator. - /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. - /// @param _disputeID The identifier of the dispute in the Arbitrator contract. - /// @param _ruling Ruling given by the arbitrator. - /// Note that 0 is reserved for "Not able/wanting to make a decision". - function rule(uint256 _disputeID, uint256 _ruling) external; -} diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/IArbitratorV2.sol index 89b20e24a..24486f642 100644 --- a/contracts/src/arbitration/IArbitratorV2.sol +++ b/contracts/src/arbitration/IArbitratorV2.sol @@ -2,7 +2,8 @@ pragma solidity 0.8.18; -import "./IArbitrableV2.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "./IArbitrable.sol"; /// @title Arbitrator /// Arbitrator interface that implements the new arbitration standard. @@ -21,22 +22,52 @@ interface IArbitratorV2 { /// @param _arbitrable The arbitrable receiving the ruling. /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling The ruling which was given. - event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); + event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); - /// @dev Create a dispute. + /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees. + /// @param _token The ERC20 token. + /// @param _accepted Whether the token is accepted or not. + event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted); + + /// @dev Create a dispute and pay for the fees in the native currency, typically ETH. + /// Must be called by the arbitrable contract. + /// Must pay at least arbitrationCost(_extraData). + /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute. + /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). + /// @return disputeID The identifier of the dispute created. + function createDispute( + uint256 _numberOfChoices, + bytes calldata _extraData + ) external payable returns (uint256 disputeID); + + /// @dev Create a dispute and pay for the fees in a supported ERC20 token. /// Must be called by the arbitrable contract. /// Must pay at least arbitrationCost(_extraData). - /// @param _choices Amount of choices the arbitrator can make in this dispute. - /// @param _extraData Can be used to give additional info on the dispute to be created. + /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute. + /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). + /// @param _feeToken The ERC20 token used to pay fees. + /// @param _feeAmount Amount of the ERC20 token used to pay fees. /// @return disputeID The identifier of the dispute created. - function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID); + function createDispute( + uint256 _numberOfChoices, + bytes calldata _extraData, + IERC20 _feeToken, + uint256 _feeAmount + ) external returns (uint256 disputeID); - /// @dev Compute the cost of arbitration. + /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH. /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. - /// @param _extraData Can be used to give additional info on the dispute to be created. - /// @return cost Required cost of arbitration. + /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). + /// @return cost The arbitration cost in ETH. function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost); + /// @dev Compute the cost of arbitration denominated in `_feeToken`. + /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. + /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). + /// @param _feeToken The ERC20 token used to pay fees. + /// @return cost The arbitration cost in `_feeToken`. + function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost); + /// @dev Return the current ruling of a dispute. /// This is useful for parties to know if they should appeal. /// @param _disputeID The identifer of the dispute. diff --git a/contracts/src/evidence/IMetaEvidence.sol b/contracts/src/kleros-v1/interfaces/IEvidenceV1.sol similarity index 52% rename from contracts/src/evidence/IMetaEvidence.sol rename to contracts/src/kleros-v1/interfaces/IEvidenceV1.sol index 05a673b5c..2e53be127 100644 --- a/contracts/src/evidence/IMetaEvidence.sol +++ b/contracts/src/kleros-v1/interfaces/IEvidenceV1.sol @@ -2,23 +2,42 @@ pragma solidity 0.8.18; -import "../arbitration/IArbitrator.sol"; +/** + * @authors: [@ferittuncer, @hbarcelos] + * @reviewers: [] + * @auditors: [] + * @bounties: [] + * @deployments: [] + */ +import "./IArbitratorV1.sol"; /// @title IMetaEvidence /// ERC-1497: Evidence Standard excluding evidence emission as it will be handled by the arbitrator. -interface IMetaEvidence { +interface IEvidenceV1 { /// @dev To be emitted when meta-evidence is submitted. /// @param _metaEvidenceID Unique identifier of meta-evidence. /// @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json' event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence); + /// @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). + /// @param _arbitrator The arbitrator of the contract. + /// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. + /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party. + /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json' + event Evidence( + IArbitratorV1 indexed _arbitrator, + uint256 indexed _evidenceGroupID, + address indexed _party, + string _evidence + ); + /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID. /// @param _arbitrator The arbitrator of the contract. /// @param _disputeID ID of the dispute in the Arbitrator contract. /// @param _metaEvidenceID Unique identifier of meta-evidence. /// @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute. event Dispute( - IArbitrator indexed _arbitrator, + IArbitratorV1 indexed _arbitrator, uint256 indexed _disputeID, uint256 _metaEvidenceID, uint256 _evidenceGroupID diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index a30fddb92..cafec0c5f 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -65,7 +65,7 @@ describe("Integration tests", async () => { it("Resolves a dispute on the home chain with no appeal", async () => { const arbitrationCost = ONE_TENTH_ETH.mul(3); - const [bridger, challenger, relayer] = await ethers.getSigners(); + const [, , relayer] = await ethers.getSigners(); await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(100)); diff --git a/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json b/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json new file mode 100644 index 000000000..50b3760dc --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json @@ -0,0 +1,23 @@ +{ + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Let's do this", + "description": "We want to do this: %s", + "question": "Does it comply with the policy?", + "answers": [ + { + "title": "Yes", + "description": "Select this if you agree that it must be done." + }, + { + "title": "No", + "description": "Select this if you do not agree that it must be done." + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", + "category": "Others", + "specification": "KIP001", + "lang": "en_US" +} diff --git a/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc new file mode 100644 index 000000000..8429d6255 --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc @@ -0,0 +1,44 @@ +{ + "title": "Let's do this", + "description": "We want to do this: airdrop magic money", + "question": "Does it comply with the policy?", + "type": "single-select", + "answers": [ + { + "id": "0x00", + "title": "Invalid/Refuse to Arbitrate", + "reserved": true + }, + { + "id": "0x01", + "title": "Yes", + "description": "Select this if you agree that it must be done.", + "reserved": false + }, + { + "id": "0x02", + "title": "No", + "description": "Select this if you do not agree that it must be done.", + "reserved": false + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitrableChainID": "10200", // Chiado + "arbitrableAddress": "0x22f40371b1d1bd7e6229e33b832cbe00d0b991b2", + "arbitratorChainID": "421613", // ArbitrumGoerli + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore + "category": "Others", + "specification": "KIP001", + "lang": "en_US", + "metadata": { + "aliases": { + "submitter": "0x5B0EdFcD1038746Cc1C1eE3aCdb31feD910B13f4" + } + }, + "externalDisputeID": "13", // hash(action) + "arbitrableDisputeID": "3", + "arbitratorDisputeID": "4564", + "disputeTemplateID": "1", + "disputeTemplateHash": "0xD1u9...2254" +} diff --git a/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeTemplateInputs.curate.txt b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeTemplateInputs.curate.txt new file mode 100644 index 000000000..7f62d34be --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeTemplateInputs.curate.txt @@ -0,0 +1,2 @@ +airdrop magic money +3 diff --git a/kleros-sdk/config/v2-disputetemplate/simple/example/NewDispute.simple.jsonc b/kleros-sdk/config/v2-disputetemplate/simple/example/NewDispute.simple.jsonc new file mode 100644 index 000000000..97c28de7e --- /dev/null +++ b/kleros-sdk/config/v2-disputetemplate/simple/example/NewDispute.simple.jsonc @@ -0,0 +1,8 @@ +{ + "externalDisputeID": "ea6ed15a0867e22f40371b1d1bd7e6229e33b832cbe00d0b991b2da19d4f951a", + "arbitrableDisputeID": "3", + "templateID": "1" +} + +// action = "airdrop magic money" +// externalDisputeID = hash(action) = 0xea6ed15a0867e22f40371b1d1bd7e6229e33b832cbe00d0b991b2da19d4f951a \ No newline at end of file From 73eec68f40b005b709aa3aaef860ae8e436ac50e Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 20 Jun 2023 02:17:11 +0100 Subject: [PATCH 23/29] fix: adding missing files for the dispute resolver --- .../deployments/chiado/DisputeResolver.json | 565 ++++++++++++++++++ .../scripts/console-init-chiado-resolver.ts | 25 + 2 files changed, 590 insertions(+) create mode 100644 contracts/deployments/chiado/DisputeResolver.json create mode 100644 contracts/scripts/console-init-chiado-resolver.ts diff --git a/contracts/deployments/chiado/DisputeResolver.json b/contracts/deployments/chiado/DisputeResolver.json new file mode 100644 index 000000000..5ccce5b6b --- /dev/null +++ b/contracts/deployments/chiado/DisputeResolver.json @@ -0,0 +1,565 @@ +{ + "address": "0x433eD78895df1df7668C40b3e82d54410331F942", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_arbitrableChainId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "CrossChainDisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplate", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplateUri", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplateUri", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x48bb5243e06a6dee8e772e2e69e4fa415d4794edf3c9e35afa348b85021a6868", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x433eD78895df1df7668C40b3e82d54410331F942", + "transactionIndex": 0, + "gasUsed": "758346", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x48d38d9df0d5b356f5f6e50085ad042777fca7649e743ba102264e5d67a7c31b", + "transactionHash": "0x48bb5243e06a6dee8e772e2e69e4fa415d4794edf3c9e35afa348b85021a6868", + "logs": [], + "blockNumber": 4448702, + "cumulativeGasUsed": "758346", + "status": 1, + "byzantium": true + }, + "args": [ + "0x573bcD6ee4aEe152eCC9Cafd2c0820Dc548AF6cC" + ], + "numDeployments": 2, + "solcInputHash": "e5cc0e9bf05bbcd7b6145f8ea4d3c9a9", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_arbitrableChainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"CrossChainDisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"data\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"CrossChainDisputeRequest(address,uint256,address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrable\":\"The address of the Arbitrable contract.\",\"_arbitrableChainId\":\"The chain ID of the Arbitrable contract.\",\"_arbitrableDisputeID\":\"The ID of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The ID of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The ID of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The ID of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeTemplate(uint256,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateId\":\"The ID of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\",\"data\":\"The template data.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The ID of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param data The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data);\\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 _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The ID of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\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 _arbitrableChainId The chain ID of the Arbitrable contract.\\n /// @param _arbitrable The address of the Arbitrable contract.\\n /// @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The ID of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.\\n event CrossChainDisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 _arbitrableChainId,\\n address indexed _arbitrable,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\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 event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x4e29b75fbf3d030d231b7e963bcd21b70c624144cbcc039c4ae25055dac95e6a\",\"license\":\"MIT\"},\"src/arbitration/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID Identifier of the dispute.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID Identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute.\\n /// Must be called by the arbitrable contract.\\n /// Must pay 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 Identifier of the dispute created.\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration.\\n /// 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Return the current ruling of a dispute.\\n /// 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 function currentRuling(uint _disputeID) external view returns (uint ruling);\\n}\\n\",\"keccak256\":\"0x07d5b8029368fcb701315273eaa3b3845cbee9303f6aad7993d551ed2f4360f2\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport \\\"../IArbitrableV2.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n \\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n \\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n \\n address public governor;\\n IArbitratorV2 public arbitrator; // Arbitrator is set in constructor and never changed.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, _disputeTemplate, \\\"\\\", _numberOfRulingOptions);\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n \\n uint256 templateId = localDisputeID;\\n emit DisputeTemplate(templateId, \\\"\\\", _disputeTemplate);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeUri);\\n }\\n}\\n\",\"keccak256\":\"0x72a8602b50246bbf9829fa61eecd80344842d45c9b63ed606d732cfffe23b341\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610c89380380610c8983398101604081905261002f91610062565b60008054336001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055610092565b60006020828403121561007457600080fd5b81516001600160a01b038116811461008b57600080fd5b9392505050565b610be8806100a16000396000f3fe6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea2646970667358221220a719b050bca90307d777fff41b441c2f1ee3ba5b5292ac5605dfd7ab9b7b043964736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea2646970667358221220a719b050bca90307d777fff41b441c2f1ee3ba5b5292ac5605dfd7ab9b7b043964736f6c63430008120033", + "devdoc": { + "events": { + "CrossChainDisputeRequest(address,uint256,address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrable": "The address of the Arbitrable contract.", + "_arbitrableChainId": "The chain ID of the Arbitrable contract.", + "_arbitrableDisputeID": "The ID of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The ID of the dispute template. Should not be used with _templateUri.", + "_templateUri": "IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The ID of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The ID of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "DisputeTemplate(uint256,string,string)": { + "details": "To be emitted when a new dispute template is created.", + "params": { + "_templateId": "The ID of the dispute template.", + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\".", + "data": "The template data." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor.", + "params": { + "_governor": "The address of the new governor." + } + }, + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "Target global arbitrator for any disputes." + } + }, + "createDisputeForTemplate(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplate": "Dispute template.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "createDisputeForTemplateUri(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 129, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 132, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitrator", + "offset": 0, + "slot": "1", + "type": "t_contract(IArbitratorV2)112" + }, + { + "astId": 136, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(DisputeStruct)127_storage)dyn_storage" + }, + { + "astId": 140, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorDisputeIDToLocalID", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)127_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)127_storage", + "encoding": "dynamic_array", + "label": "struct DisputeResolver.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)112": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)127_storage": { + "encoding": "inplace", + "label": "struct DisputeResolver.DisputeStruct", + "members": [ + { + "astId": 120, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "0", + "type": "t_bytes_storage" + }, + { + "astId": 122, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "isRuled", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 124, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "ruling", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 126, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/scripts/console-init-chiado-resolver.ts b/contracts/scripts/console-init-chiado-resolver.ts new file mode 100644 index 000000000..480c7c471 --- /dev/null +++ b/contracts/scripts/console-init-chiado-resolver.ts @@ -0,0 +1,25 @@ +// TODO: SDK utility formatDisputeExtraData(_courtId, _nbOfJurors): string +// TODO: SDK utility formatDisputeExtraData(_courtId, _nbOfJurors, disputeKitId): string + +// On the foreign chain +const extraData = + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; +const template = `{"$schema":"../NewDisputeTemplate.schema.json","title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf","frontendUrl":"https://curate.kleros.io/tcr/%s/%s/%s","arbitrableChainID":"100","arbitrableAddress":"0x957A53A994860BE4750810131d9c876b2f52d6E1","arbitratorChainID":"421613","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Curated Lists","specification":"KIP88"}`; +const nbOfChoices = 2; +const cost = await foreignGateway.arbitrationCost(extraData); +const tx = await resolver.createDisputeForTemplate(extraData, template, nbOfChoices, { value: cost }); + +// Or to test the fallback to IPFS +const uri = "/ipfs/QmQ9...."; +const tx2 = await resolver.createDisputeForTemplateUri(extraData, uri, nbOfChoices, { value: cost }); + +// Then a relayer must relay the dispute on the HomeGateway... + +core = await ethers.getContract("KlerosCore"); +resolver = await ethers.getContract("DisputeResolver"); +extraData = + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; +template = `{"$schema":"../NewDisputeTemplate.schema.json","title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf","frontendUrl":"https://curate.kleros.io/tcr/%s/%s/%s","arbitrableChainID":"100","arbitrableAddress":"0x957A53A994860BE4750810131d9c876b2f52d6E1","arbitratorChainID":"421613","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Curated Lists","specification":"KIP88"}`; +nbOfChoices = 2; +cost = await core.arbitrationCost(extraData); +tx = await resolver.createDisputeForTemplate(extraData, template, nbOfChoices, { value: cost }); From dede020db4a92bd850da59fde22a1fd6b4eb13d7 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 20 Jun 2023 03:21:05 +0100 Subject: [PATCH 24/29] fix: manual fixes after rebasing onto feat/erc20-fees-on-arbitrator --- .../src/arbitration/CentralizedArbitrator.sol | 30 ++++++++++--------- contracts/src/arbitration/IArbitratorV2.sol | 15 ++++++---- contracts/src/arbitration/IDisputeKit.sol | 2 +- contracts/src/arbitration/KlerosCore.sol | 18 +++++------ contracts/src/evidence/EvidenceModule.sol | 8 ++--- contracts/src/evidence/IEvidence.sol | 4 +-- contracts/src/gateway/ForeignGateway.sol | 6 ++-- .../kleros-liquid-xdai/xKlerosLiquidV2.sol | 9 +++--- contracts/test/integration/index.ts | 2 +- 9 files changed, 51 insertions(+), 43 deletions(-) diff --git a/contracts/src/arbitration/CentralizedArbitrator.sol b/contracts/src/arbitration/CentralizedArbitrator.sol index c55553a88..7b23a593b 100644 --- a/contracts/src/arbitration/CentralizedArbitrator.sol +++ b/contracts/src/arbitration/CentralizedArbitrator.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.18; -import "./IArbitrator.sol"; +import {IArbitrableV2, IArbitratorV2} from "./IArbitratorV2.sol"; /// @title Centralized Arbitrator -/// @dev This is a centralized arbitrator deciding alone on the result of disputes. It illustrates how IArbitrator interface can be implemented. +/// @dev This is a centralized arbitrator deciding alone on the result of disputes. It illustrates how IArbitratorV2 interface can be implemented. /// Note that this contract supports appeals. The ruling given by the arbitrator can be appealed by crowdfunding a desired choice. -contract CentralizedArbitrator is IArbitrator { +contract CentralizedArbitrator is IArbitratorV2 { // ************************************* // // * Enums / Structs * // // ************************************* // @@ -19,7 +19,7 @@ contract CentralizedArbitrator is IArbitrator { } struct DisputeStruct { - IArbitrable arbitrated; // The address of the arbitrable contract. + IArbitrableV2 arbitrated; // The address of the arbitrable contract. bytes arbitratorExtraData; // Extra data for the arbitrator. uint256 choices; // The number of choices the arbitrator can choose from. uint256 appealPeriodStart; // Time when the appeal funding becomes possible. @@ -61,12 +61,12 @@ contract CentralizedArbitrator is IArbitrator { /// @dev To be emitted when a dispute can be appealed. /// @param _disputeID ID of the dispute. /// @param _arbitrable The contract which created the dispute. - event AppealPossible(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); + event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); /// @dev To be emitted when the current ruling is appealed. /// @param _disputeID ID of the dispute. /// @param _arbitrable The contract which created the dispute. - event AppealDecision(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); + event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); /// @dev Raised when a contribution is made, inside fundAppeal function. /// @param _disputeID ID of the dispute. @@ -151,11 +151,7 @@ contract CentralizedArbitrator is IArbitrator { // * State Modifiers * // // ************************************* // - /// @dev Create a dispute. Must be called by the arbitrable contract. - /// Must be paid at least arbitrationCost(). - /// @param _choices Amount of choices the arbitrator can make in this dispute. - /// @param _extraData Can be used to give additional info on the dispute to be created. - /// @return disputeID ID of the dispute created. + /// @inheritdoc IArbitratorV2 function createDispute( uint256 _choices, bytes calldata _extraData @@ -164,7 +160,7 @@ contract CentralizedArbitrator is IArbitrator { disputeID = disputes.length; disputes.push( DisputeStruct({ - arbitrated: IArbitrable(msg.sender), + arbitrated: IArbitrableV2(msg.sender), arbitratorExtraData: _extraData, choices: _choices, appealPeriodStart: 0, @@ -175,10 +171,10 @@ contract CentralizedArbitrator is IArbitrator { ); disputeIDtoRoundArray[disputeID].push(); - emit DisputeCreation(disputeID, IArbitrable(msg.sender)); + emit DisputeCreation(disputeID, IArbitrableV2(msg.sender)); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function createDispute( uint256 /*_choices*/, bytes calldata /*_extraData*/, @@ -373,4 +369,10 @@ contract CentralizedArbitrator is IArbitrator { } return (start, end); } + + function currentRuling( + uint256 /*_disputeID*/ + ) public pure returns (uint256 /*ruling*/, bool /*tied*/, bool /*overridden*/) { + revert("Not supported"); + } } diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/IArbitratorV2.sol index 24486f642..beb1acd22 100644 --- a/contracts/src/arbitration/IArbitratorV2.sol +++ b/contracts/src/arbitration/IArbitratorV2.sol @@ -29,7 +29,11 @@ interface IArbitratorV2 { /// @param _accepted Whether the token is accepted or not. event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted); +<<<<<<< HEAD /// @dev Create a dispute and pay for the fees in the native currency, typically ETH. +======= + /// @dev Create a dispute. +>>>>>>> c716852 (fix: manual fixes after rebasing onto feat/erc20-fees-on-arbitrator) /// Must be called by the arbitrable contract. /// Must pay at least arbitrationCost(_extraData). /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute. @@ -68,9 +72,10 @@ interface IArbitratorV2 { /// @return cost The arbitration cost in `_feeToken`. function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost); - /// @dev Return the current ruling of a dispute. - /// This is useful for parties to know if they should appeal. - /// @param _disputeID The identifer of the dispute. - /// @return ruling The ruling which has been given or the one which will be given if there is no appeal. - function currentRuling(uint _disputeID) external view returns (uint ruling); + /// @dev Gets the current ruling of a specified dispute. + /// @param _disputeID The ID of the dispute. + /// @return ruling The current ruling. + /// @return tied Whether it's a tie or not. + /// @return overridden Whether the ruling was overridden by appeal funding or not. + function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden); } diff --git a/contracts/src/arbitration/IDisputeKit.sol b/contracts/src/arbitration/IDisputeKit.sol index 1212a580c..4070bfe94 100644 --- a/contracts/src/arbitration/IDisputeKit.sol +++ b/contracts/src/arbitration/IDisputeKit.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.18; -import "./IArbitrator.sol"; +import "./IArbitratorV2.sol"; /// @title IDisputeKit /// An abstraction of the Dispute Kits intended for interfacing with KlerosCore. diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 7b9afd9cf..26501892f 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.18; -import "./IArbitrator.sol"; +import {IArbitrableV2, IArbitratorV2} from "./IArbitratorV2.sol"; import "./IDisputeKit.sol"; import "./ISortitionModule.sol"; import "../libraries/SafeERC20.sol"; @@ -16,7 +16,7 @@ import "../libraries/SafeERC20.sol"; /// @title KlerosCore /// Core arbitrator contract for Kleros v2. /// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts. -contract KlerosCore is IArbitrator { +contract KlerosCore is IArbitratorV2 { using SafeERC20 for IERC20; // ************************************* // @@ -46,7 +46,7 @@ contract KlerosCore is IArbitrator { struct Dispute { uint96 courtID; // The ID of the court the dispute is in. - IArbitrable arbitrated; // The arbitrable contract. + IArbitrableV2 arbitrated; // The arbitrable contract. Period period; // The current period of the dispute. bool ruled; // True if the ruling has been executed, false otherwise. uint256 lastPeriodChange; // The last time the period was changed. @@ -128,8 +128,8 @@ contract KlerosCore is IArbitrator { event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty); event NewPeriod(uint256 indexed _disputeID, Period _period); - event AppealPossible(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); - event AppealDecision(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); + event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); + event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID); event CourtCreated( uint256 indexed _courtID, @@ -490,7 +490,7 @@ contract KlerosCore is IArbitrator { _setStakeForAccount(_account, _courtID, _stake, _penalty); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function createDispute( uint256 _numberOfChoices, bytes memory _extraData @@ -500,7 +500,7 @@ contract KlerosCore is IArbitrator { return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function createDispute( uint256 _numberOfChoices, bytes calldata _extraData, @@ -526,7 +526,7 @@ contract KlerosCore is IArbitrator { disputeID = disputes.length; Dispute storage dispute = disputes.push(); dispute.courtID = courtID; - dispute.arbitrated = IArbitrable(msg.sender); + dispute.arbitrated = IArbitrableV2(msg.sender); dispute.lastPeriodChange = block.timestamp; IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit; @@ -546,7 +546,7 @@ contract KlerosCore is IArbitrator { sortitionModule.createDisputeHook(disputeID, 0); // Default round ID. disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes); - emit DisputeCreation(disputeID, IArbitrable(msg.sender)); + emit DisputeCreation(disputeID, IArbitrableV2(msg.sender)); } /// @dev Passes the period of a specified dispute. diff --git a/contracts/src/evidence/EvidenceModule.sol b/contracts/src/evidence/EvidenceModule.sol index ada5c7449..843248cc9 100644 --- a/contracts/src/evidence/EvidenceModule.sol +++ b/contracts/src/evidence/EvidenceModule.sol @@ -10,20 +10,20 @@ pragma solidity 0.8.18; // TODO: standard interfaces should be placed in a separated repo (?) -import "../arbitration/IArbitrator.sol"; +import "../arbitration/IArbitratorV2.sol"; /// @title Implementation of the Evidence Standard for cross-chain submissions contract EvidenceModule { - IArbitrator public arbitrator; + IArbitratorV2 public arbitrator; event Evidence( - IArbitrator indexed _arbitrator, + IArbitratorV2 indexed _arbitrator, uint256 indexed _evidenceGroupID, address indexed _party, string _evidence ); - constructor(IArbitrator _arbitrator) { + constructor(IArbitratorV2 _arbitrator) { arbitrator = _arbitrator; } diff --git a/contracts/src/evidence/IEvidence.sol b/contracts/src/evidence/IEvidence.sol index c45ced642..54b9146a1 100644 --- a/contracts/src/evidence/IEvidence.sol +++ b/contracts/src/evidence/IEvidence.sol @@ -2,12 +2,10 @@ pragma solidity 0.8.18; -import "../arbitration/IArbitrator.sol"; - /// @title IEvidence interface IEvidence { /// @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). - /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID. + /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID. /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party. /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json' event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence); diff --git a/contracts/src/gateway/ForeignGateway.sol b/contracts/src/gateway/ForeignGateway.sol index 85df8a655..0f101ff01 100644 --- a/contracts/src/gateway/ForeignGateway.sol +++ b/contracts/src/gateway/ForeignGateway.sol @@ -218,9 +218,11 @@ contract ForeignGateway is IForeignGateway { /// @inheritdoc IReceiverGateway function senderGateway() external view override returns (address) { return homeGateway; -} + } - function currentRuling(uint _disputeID) external view returns (uint ruling) { + function currentRuling( + uint256 /*_disputeID*/ + ) public pure returns (uint256 /*ruling*/, bool /*tied*/, bool /*overridden*/) { revert("Not supported"); } diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol index 7c41a5d29..58077bb9e 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol @@ -631,14 +631,15 @@ contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitratorV2 { /// @dev Gets the current ruling of a specified dispute. /// @param _disputeID The ID of the dispute. /// @return ruling The current ruling. - function currentRuling(uint256 _disputeID) public view returns (uint256 ruling) { + /// @return tied Whether it's a tie or not. + /// @return overridden Whether the ruling was overridden by appeal funding or not. + function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool /*overridden*/) { Dispute storage dispute = disputes[_disputeID]; if (dispute.voteCounters.length == 0) { ruling = disputesRuling[_disputeID]; } else { - ruling = dispute.voteCounters[dispute.voteCounters.length - 1].tied - ? 0 - : dispute.voteCounters[dispute.voteCounters.length - 1].winningChoice; + tied = dispute.voteCounters[dispute.voteCounters.length - 1].tied; + ruling = tied ? 0 : dispute.voteCounters[dispute.voteCounters.length - 1].winningChoice; } } diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index cafec0c5f..e898d4cfc 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -96,7 +96,7 @@ describe("Integration tests", async () => { expect(result.locked).to.equal(0); logJurorBalance(result); }); - const tx = await arbitrable.functions["createDispute(uint256,bytes,uint256,uint256)"](2, "0x00", 0, 0, { + const tx = await arbitrable.functions["createDispute(uint256,string,bytes)"](0, "future of france", "0x00", { value: arbitrationCost, }); const trace = await network.provider.send("debug_traceTransaction", [tx.hash]); From fae3c88cc87a923040e74c31dc8bfaaa6a390fc1 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Tue, 20 Jun 2023 03:31:58 +0100 Subject: [PATCH 25/29] refactor: folder structure --- contracts/src/arbitration/CentralizedArbitrator.sol | 2 +- contracts/src/arbitration/KlerosCore.sol | 6 +++--- contracts/src/arbitration/KlerosGovernor.sol | 2 +- contracts/src/arbitration/SortitionModule.sol | 6 +++--- contracts/src/arbitration/arbitrables/ArbitrableExample.sol | 4 +--- contracts/src/arbitration/arbitrables/DisputeResolver.sol | 2 +- contracts/src/arbitration/dispute-kits/BaseDisputeKit.sol | 2 +- .../src/arbitration/dispute-kits/DisputeKitClassic.sol | 2 +- .../arbitration/dispute-kits/DisputeKitSybilResistant.sol | 2 +- contracts/src/{ => arbitration}/evidence/EvidenceModule.sol | 2 +- .../{ => arbitration}/evidence/ModeratedEvidenceModule.sol | 4 ++-- .../src/arbitration/{ => interfaces}/IArbitrableV2.sol | 0 .../src/arbitration/{ => interfaces}/IArbitratorV2.sol | 0 contracts/src/arbitration/{ => interfaces}/IDisputeKit.sol | 0 .../src/{evidence => arbitration/interfaces}/IEvidence.sol | 0 .../src/arbitration/{ => interfaces}/ISortitionModule.sol | 0 contracts/src/gateway/ForeignGateway.sol | 1 - contracts/src/gateway/HomeGateway.sol | 1 - contracts/src/gateway/interfaces/IForeignGateway.sol | 2 +- contracts/src/gateway/interfaces/IHomeGateway.sol | 2 +- .../src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol | 2 +- .../kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol | 2 +- 22 files changed, 20 insertions(+), 24 deletions(-) rename contracts/src/{ => arbitration}/evidence/EvidenceModule.sol (96%) rename contracts/src/{ => arbitration}/evidence/ModeratedEvidenceModule.sol (99%) rename contracts/src/arbitration/{ => interfaces}/IArbitrableV2.sol (100%) rename contracts/src/arbitration/{ => interfaces}/IArbitratorV2.sol (100%) rename contracts/src/arbitration/{ => interfaces}/IDisputeKit.sol (100%) rename contracts/src/{evidence => arbitration/interfaces}/IEvidence.sol (100%) rename contracts/src/arbitration/{ => interfaces}/ISortitionModule.sol (100%) diff --git a/contracts/src/arbitration/CentralizedArbitrator.sol b/contracts/src/arbitration/CentralizedArbitrator.sol index 7b23a593b..95aca22fa 100644 --- a/contracts/src/arbitration/CentralizedArbitrator.sol +++ b/contracts/src/arbitration/CentralizedArbitrator.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.18; -import {IArbitrableV2, IArbitratorV2} from "./IArbitratorV2.sol"; +import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol"; /// @title Centralized Arbitrator /// @dev This is a centralized arbitrator deciding alone on the result of disputes. It illustrates how IArbitratorV2 interface can be implemented. diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 26501892f..e3269ab34 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -8,9 +8,9 @@ pragma solidity 0.8.18; -import {IArbitrableV2, IArbitratorV2} from "./IArbitratorV2.sol"; -import "./IDisputeKit.sol"; -import "./ISortitionModule.sol"; +import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol"; +import "./interfaces/IDisputeKit.sol"; +import "./interfaces/ISortitionModule.sol"; import "../libraries/SafeERC20.sol"; /// @title KlerosCore diff --git a/contracts/src/arbitration/KlerosGovernor.sol b/contracts/src/arbitration/KlerosGovernor.sol index e97ead006..32b4f8c33 100644 --- a/contracts/src/arbitration/KlerosGovernor.sol +++ b/contracts/src/arbitration/KlerosGovernor.sol @@ -7,7 +7,7 @@ pragma solidity 0.8.18; -import {IArbitrableV2, IArbitratorV2} from "./IArbitrableV2.sol"; +import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitrableV2.sol"; import "../libraries/CappedMath.sol"; /// @title KlerosGovernor for V2. Note that appeal functionality and evidence submission will be handled by the court. diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 23e652c39..ac9eef13a 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -10,9 +10,9 @@ pragma solidity 0.8.18; -import "../arbitration/KlerosCore.sol"; -import "./ISortitionModule.sol"; -import "../arbitration/IDisputeKit.sol"; +import "./KlerosCore.sol"; +import "./interfaces/ISortitionModule.sol"; +import "./interfaces/IDisputeKit.sol"; import "../rng/RNG.sol"; /// @title SortitionModule diff --git a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol index 19177fc4a..d157d36b3 100644 --- a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol +++ b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol @@ -2,9 +2,7 @@ pragma solidity 0.8.18; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "../IArbitrable.sol"; -import "../../evidence/IMetaEvidence.sol"; +import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol"; /// @title ArbitrableExample /// An example of an arbitrable contract which connects to the arbitator that implements the updated interface. diff --git a/contracts/src/arbitration/arbitrables/DisputeResolver.sol b/contracts/src/arbitration/arbitrables/DisputeResolver.sol index d4ec3e3ef..3ba9c1f4c 100644 --- a/contracts/src/arbitration/arbitrables/DisputeResolver.sol +++ b/contracts/src/arbitration/arbitrables/DisputeResolver.sol @@ -5,7 +5,7 @@ /// @custom:auditors: [] /// @custom:bounties: [] -import "../IArbitrableV2.sol"; +import "../interfaces/IArbitrableV2.sol"; pragma solidity 0.8.18; diff --git a/contracts/src/arbitration/dispute-kits/BaseDisputeKit.sol b/contracts/src/arbitration/dispute-kits/BaseDisputeKit.sol index 6e81c241b..878cf99bf 100644 --- a/contracts/src/arbitration/dispute-kits/BaseDisputeKit.sol +++ b/contracts/src/arbitration/dispute-kits/BaseDisputeKit.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.18; -import "../IDisputeKit.sol"; +import "../interfaces/IDisputeKit.sol"; import "../KlerosCore.sol"; /// @title BaseDisputeKit diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol index c870b1f21..ae9a9d2de 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol @@ -9,7 +9,7 @@ pragma solidity 0.8.18; import "./BaseDisputeKit.sol"; -import "../../evidence/IEvidence.sol"; +import "../interfaces/IEvidence.sol"; /// @title DisputeKitClassic /// Dispute kit implementation of the Kleros v1 features including: diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol index 16583c2f9..5a5c83aa7 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol @@ -9,7 +9,7 @@ pragma solidity 0.8.18; import "./BaseDisputeKit.sol"; -import "../../evidence/IEvidence.sol"; +import "../interfaces//IEvidence.sol"; interface IProofOfHumanity { /// @dev Return true if the submission is registered and not expired. diff --git a/contracts/src/evidence/EvidenceModule.sol b/contracts/src/arbitration/evidence/EvidenceModule.sol similarity index 96% rename from contracts/src/evidence/EvidenceModule.sol rename to contracts/src/arbitration/evidence/EvidenceModule.sol index 843248cc9..be2b076da 100644 --- a/contracts/src/evidence/EvidenceModule.sol +++ b/contracts/src/arbitration/evidence/EvidenceModule.sol @@ -10,7 +10,7 @@ pragma solidity 0.8.18; // TODO: standard interfaces should be placed in a separated repo (?) -import "../arbitration/IArbitratorV2.sol"; +import "../interfaces/IArbitratorV2.sol"; /// @title Implementation of the Evidence Standard for cross-chain submissions contract EvidenceModule { diff --git a/contracts/src/evidence/ModeratedEvidenceModule.sol b/contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol similarity index 99% rename from contracts/src/evidence/ModeratedEvidenceModule.sol rename to contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol index 05595ad71..0cdb300d8 100644 --- a/contracts/src/evidence/ModeratedEvidenceModule.sol +++ b/contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol @@ -10,8 +10,8 @@ pragma solidity 0.8.18; // TODO: standard interfaces should be placed in a separated repo (?) -import {IArbitrableV2, IArbitratorV2} from "../arbitration/IArbitrableV2.sol"; -import "../libraries/CappedMath.sol"; +import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol"; +import "../../libraries/CappedMath.sol"; /// @title Implementation of the Evidence Standard with Moderated Submissions contract ModeratedEvidenceModule is IArbitrableV2 { diff --git a/contracts/src/arbitration/IArbitrableV2.sol b/contracts/src/arbitration/interfaces/IArbitrableV2.sol similarity index 100% rename from contracts/src/arbitration/IArbitrableV2.sol rename to contracts/src/arbitration/interfaces/IArbitrableV2.sol diff --git a/contracts/src/arbitration/IArbitratorV2.sol b/contracts/src/arbitration/interfaces/IArbitratorV2.sol similarity index 100% rename from contracts/src/arbitration/IArbitratorV2.sol rename to contracts/src/arbitration/interfaces/IArbitratorV2.sol diff --git a/contracts/src/arbitration/IDisputeKit.sol b/contracts/src/arbitration/interfaces/IDisputeKit.sol similarity index 100% rename from contracts/src/arbitration/IDisputeKit.sol rename to contracts/src/arbitration/interfaces/IDisputeKit.sol diff --git a/contracts/src/evidence/IEvidence.sol b/contracts/src/arbitration/interfaces/IEvidence.sol similarity index 100% rename from contracts/src/evidence/IEvidence.sol rename to contracts/src/arbitration/interfaces/IEvidence.sol diff --git a/contracts/src/arbitration/ISortitionModule.sol b/contracts/src/arbitration/interfaces/ISortitionModule.sol similarity index 100% rename from contracts/src/arbitration/ISortitionModule.sol rename to contracts/src/arbitration/interfaces/ISortitionModule.sol diff --git a/contracts/src/gateway/ForeignGateway.sol b/contracts/src/gateway/ForeignGateway.sol index 0f101ff01..d3f954dc8 100644 --- a/contracts/src/gateway/ForeignGateway.sol +++ b/contracts/src/gateway/ForeignGateway.sol @@ -8,7 +8,6 @@ pragma solidity 0.8.18; -import "../arbitration/IArbitrableV2.sol"; import "./interfaces/IForeignGateway.sol"; /// Foreign Gateway diff --git a/contracts/src/gateway/HomeGateway.sol b/contracts/src/gateway/HomeGateway.sol index 005f5ca2a..862065123 100644 --- a/contracts/src/gateway/HomeGateway.sol +++ b/contracts/src/gateway/HomeGateway.sol @@ -8,7 +8,6 @@ pragma solidity 0.8.18; -import "../arbitration/IArbitratorV2.sol"; import "./interfaces/IForeignGateway.sol"; import "./interfaces/IHomeGateway.sol"; import "../libraries/SafeERC20.sol"; diff --git a/contracts/src/gateway/interfaces/IForeignGateway.sol b/contracts/src/gateway/interfaces/IForeignGateway.sol index a9965ee94..ac43f5e2c 100644 --- a/contracts/src/gateway/interfaces/IForeignGateway.sol +++ b/contracts/src/gateway/interfaces/IForeignGateway.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.18; -import "../../arbitration/IArbitratorV2.sol"; +import "../../arbitration/interfaces/IArbitratorV2.sol"; import "@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol"; interface IForeignGateway is IArbitratorV2, IReceiverGateway { diff --git a/contracts/src/gateway/interfaces/IHomeGateway.sol b/contracts/src/gateway/interfaces/IHomeGateway.sol index ca6438eee..2f7c98ea1 100644 --- a/contracts/src/gateway/interfaces/IHomeGateway.sol +++ b/contracts/src/gateway/interfaces/IHomeGateway.sol @@ -9,8 +9,8 @@ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "../../arbitration/IArbitrableV2.sol"; import "@kleros/vea-contracts/src/interfaces/gateways/ISenderGateway.sol"; +import "../../arbitration/interfaces/IArbitrableV2.sol"; interface IHomeGateway is IArbitrableV2, ISenderGateway { /// @dev To be emitted when a dispute is received from the IForeignGateway. diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol index 58077bb9e..6a27915f7 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.18; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import {IArbitratorV2, IArbitrableV2} from "../../arbitration/IArbitratorV2.sol"; +import {IArbitratorV2, IArbitrableV2} from "../../arbitration/interfaces/IArbitratorV2.sol"; import {ITokenController} from "../interfaces/ITokenController.sol"; import {WrappedPinakion} from "./WrappedPinakion.sol"; import {IRandomAuRa} from "./interfaces/IRandomAuRa.sol"; diff --git a/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol b/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol index 98e0c355a..e8cf617af 100644 --- a/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol +++ b/contracts/src/kleros-v1/kleros-liquid/KlerosLiquidToV2Governor.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.18; import "../interfaces/IKlerosLiquid.sol"; import "../interfaces/ITokenController.sol"; -import {IArbitratorV2, IArbitrableV2} from "../../arbitration/IArbitratorV2.sol"; +import {IArbitratorV2, IArbitrableV2} from "../../arbitration/interfaces/IArbitratorV2.sol"; interface IPinakion { function balanceOf(address who) external view returns (uint256); From 7a08a37247831ea79353e4308efc33c5dcbdc187 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Fri, 23 Jun 2023 01:55:10 +0100 Subject: [PATCH 26/29] fix: manual fixes after rebase --- .../src/arbitration/CentralizedArbitrator.sol | 6 +- contracts/src/arbitration/IArbitrator.sol | 70 ---------------- .../arbitrables/ArbitrableExample.sol | 39 +++++---- .../arbitration/interfaces/IArbitratorV2.sol | 8 +- contracts/src/gateway/ForeignGateway.sol | 2 +- contracts/src/gateway/HomeGateway.sol | 80 +++++-------------- .../src/gateway/interfaces/IHomeGateway.sol | 24 ++---- .../kleros-liquid-xdai/xKlerosLiquidV2.sol | 4 +- contracts/test/arbitration/draw.ts | 38 +++------ contracts/test/integration/index.ts | 38 +++------ 10 files changed, 79 insertions(+), 230 deletions(-) delete mode 100644 contracts/src/arbitration/IArbitrator.sol diff --git a/contracts/src/arbitration/CentralizedArbitrator.sol b/contracts/src/arbitration/CentralizedArbitrator.sol index 95aca22fa..23dd1e0a0 100644 --- a/contracts/src/arbitration/CentralizedArbitrator.sol +++ b/contracts/src/arbitration/CentralizedArbitrator.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.18; -import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol"; +import {IArbitrableV2, IArbitratorV2, IERC20} from "./interfaces/IArbitratorV2.sol"; /// @title Centralized Arbitrator /// @dev This is a centralized arbitrator deciding alone on the result of disputes. It illustrates how IArbitratorV2 interface can be implemented. @@ -322,12 +322,12 @@ contract CentralizedArbitrator is IArbitratorV2 { // * Public Views * // // ************************************* // - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function arbitrationCost(bytes calldata /*_extraData*/) public view override returns (uint256 fee) { return arbitrationFee; } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function arbitrationCost( bytes calldata /*_extraData*/, IERC20 /*_feeToken*/ diff --git a/contracts/src/arbitration/IArbitrator.sol b/contracts/src/arbitration/IArbitrator.sol deleted file mode 100644 index df41e537f..000000000 --- a/contracts/src/arbitration/IArbitrator.sol +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "./IArbitrable.sol"; - -/// @title Arbitrator -/// Arbitrator interface that implements the new arbitration standard. -/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most. -/// When developing arbitrator contracts we need to: -/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes). -/// - Define the functions for cost display (arbitrationCost). -/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling). -interface IArbitrator { - /// @dev To be emitted when a dispute is created. - /// @param _disputeID The identifier of the dispute. - /// @param _arbitrable The contract which created the dispute. - event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable); - - /// @dev To be raised when a ruling is given. - /// @param _arbitrable The arbitrable receiving the ruling. - /// @param _disputeID The identifier of the dispute in the Arbitrator contract. - /// @param _ruling The ruling which was given. - event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); - - /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees. - /// @param _token The ERC20 token. - /// @param _accepted Whether the token is accepted or not. - event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted); - - /// @dev Create a dispute and pay for the fees in the native currency, typically ETH. - /// Must be called by the arbitrable contract. - /// Must pay at least arbitrationCost(_extraData). - /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute. - /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). - /// @return disputeID ID of the dispute created. - function createDispute( - uint256 _numberOfChoices, - bytes calldata _extraData - ) external payable returns (uint256 disputeID); - - /// @dev Create a dispute and pay for the fees in a supported ERC20 token. - /// Must be called by the arbitrable contract. - /// Must pay at least arbitrationCost(_extraData). - /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute. - /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). - /// @param _feeToken The ERC20 token used to pay fees. - /// @param _feeAmount Amount of the ERC20 token used to pay fees. - /// @return disputeID ID of the dispute created. - function createDispute( - uint256 _numberOfChoices, - bytes calldata _extraData, - IERC20 _feeToken, - uint256 _feeAmount - ) external returns (uint256 disputeID); - - /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH. - /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. - /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). - /// @return cost The arbitration cost in ETH. - function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost); - - /// @dev Compute the cost of arbitration denominated in `_feeToken`. - /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. - /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). - /// @param _feeToken The ERC20 token used to pay fees. - /// @return cost The arbitration cost in `_feeToken`. - function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost); -} diff --git a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol index d157d36b3..254c45a3e 100644 --- a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol +++ b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol @@ -3,19 +3,29 @@ pragma solidity 0.8.18; import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol"; +import "../../libraries/SafeERC20.sol"; /// @title ArbitrableExample /// An example of an arbitrable contract which connects to the arbitator that implements the updated interface. -contract ArbitrableExample is IArbitrable, IMetaEvidence { +contract ArbitrableExample is IArbitrableV2 { + using SafeERC20 for IERC20; + + // ************************************* // + // * Enums / Structs * // + // ************************************* // + struct DisputeStruct { bool isRuled; // Whether the dispute has been ruled or not. uint256 ruling; // Ruling given by the arbitrator. uint256 numberOfRulingOptions; // The number of choices the arbitrator can give. } + event Action(string indexed _action); + address public immutable governor; - IArbitrator public arbitrator; // Arbitrator is set in constructor and never changed. - ERC20 public immutable weth; // The WETH token. + IArbitratorV2 public arbitrator; // Arbitrator is set in constructor. + uint256 public disputeTemplates; // The number of dispute templates created. + IERC20 public immutable weth; // The WETH token. mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID]. @@ -25,9 +35,9 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { /// @dev Constructor /// @param _arbitrator The arbitrator to rule on created disputes. - /// @param _metaEvidenceID Unique identifier of meta-evidence. - /// @param _metaEvidence The URI of the meta evidence object for evidence submissions requests. - constructor(IArbitrator _arbitrator, uint256 _metaEvidenceID, string memory _metaEvidence, ERC20 _weth) { + /// @param _templateData The dispute template data. + /// @param _weth The WETH token. + constructor(IArbitratorV2 _arbitrator, string memory _templateData, IERC20 _weth) { governor = msg.sender; arbitrator = _arbitrator; weth = _weth; @@ -38,12 +48,12 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { // * Governance * // // ************************************* // - function changeMetaEvidence(uint256 _metaEvidenceID, string memory _metaEvidence) external { + function changeDisputeTemplate(string memory _templateData) external { require(msg.sender == governor, "Not authorized: governor only."); - emit MetaEvidence(_metaEvidenceID, _metaEvidence); + emit DisputeTemplate(disputeTemplates++, "", _templateData); } - function changeArbitrator(IArbitrator _arbitrator) external { + function changeArbitrator(IArbitratorV2 _arbitrator) external { require(msg.sender == governor, "Not authorized: governor only."); arbitrator = _arbitrator; } @@ -70,7 +80,6 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions})); disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, _arbitratorExtraData); - externalIDtoLocalID[disputeID] = localDisputeID; uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action))); @@ -121,14 +130,4 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling); } - - function changeMetaEvidence(uint256 _metaEvidenceID, string memory _metaEvidence) external { - require(msg.sender == governor, "Not authorized: governor only."); - emit MetaEvidence(_metaEvidenceID, _metaEvidence); - } - - function changeArbitrator(IArbitrator _arbitrator) external { - require(msg.sender == governor, "Not authorized: governor only."); - arbitrator = _arbitrator; - } } diff --git a/contracts/src/arbitration/interfaces/IArbitratorV2.sol b/contracts/src/arbitration/interfaces/IArbitratorV2.sol index beb1acd22..f5cce0b09 100644 --- a/contracts/src/arbitration/interfaces/IArbitratorV2.sol +++ b/contracts/src/arbitration/interfaces/IArbitratorV2.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "./IArbitrable.sol"; +import "./IArbitrableV2.sol"; /// @title Arbitrator /// Arbitrator interface that implements the new arbitration standard. @@ -22,18 +22,14 @@ interface IArbitratorV2 { /// @param _arbitrable The arbitrable receiving the ruling. /// @param _disputeID The identifier of the dispute in the Arbitrator contract. /// @param _ruling The ruling which was given. - event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); + event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling); /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees. /// @param _token The ERC20 token. /// @param _accepted Whether the token is accepted or not. event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted); -<<<<<<< HEAD /// @dev Create a dispute and pay for the fees in the native currency, typically ETH. -======= - /// @dev Create a dispute. ->>>>>>> c716852 (fix: manual fixes after rebasing onto feat/erc20-fees-on-arbitrator) /// Must be called by the arbitrable contract. /// Must pay at least arbitrationCost(_extraData). /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute. diff --git a/contracts/src/gateway/ForeignGateway.sol b/contracts/src/gateway/ForeignGateway.sol index d3f954dc8..eca0aef52 100644 --- a/contracts/src/gateway/ForeignGateway.sol +++ b/contracts/src/gateway/ForeignGateway.sol @@ -167,7 +167,7 @@ contract ForeignGateway is IForeignGateway { cost = feeForJuror[courtID] * minJurors; } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function arbitrationCost( bytes calldata /*_extraData*/, IERC20 /*_feeToken*/ diff --git a/contracts/src/gateway/HomeGateway.sol b/contracts/src/gateway/HomeGateway.sol index 862065123..83ca736c9 100644 --- a/contracts/src/gateway/HomeGateway.sol +++ b/contracts/src/gateway/HomeGateway.sol @@ -105,43 +105,10 @@ contract HomeGateway is IHomeGateway { // ************************************* // /// @inheritdoc IHomeGateway - function relayCreateDispute( - uint256 _foreignChainID, - bytes32 _foreignBlockHash, - uint256 _foreignDisputeID, - uint256 _choices, - bytes calldata _extraData, - address _arbitrable - ) external payable override { + function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable override { require(feeToken == NATIVE_CURRENCY, "Fees paid in ERC20 only"); - require(_foreignChainID == foreignChainID, "Foreign chain ID not supported"); - - bytes32 disputeHash = keccak256( - abi.encodePacked( - _foreignChainID, - _foreignBlockHash, - "createDispute", - _foreignDisputeID, - _choices, - _extraData, - _arbitrable - ) - ); - RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash]; - require(relayedData.relayer == address(0), "Dispute already relayed"); - - uint256 disputeID = arbitrator.createDispute{value: msg.value}(_choices, _extraData); - disputeIDtoHash[disputeID] = disputeHash; - disputeHashtoID[disputeHash] = disputeID; - relayedData.relayer = msg.sender; - - emit Dispute(arbitrator, disputeID, 0, 0); - } - + require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); - /// @dev Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. - /// @param _params The parameters of the dispute, see `RelayCreateDisputeParams`. - function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable override { bytes32 disputeHash = keccak256( abi.encodePacked( "createDispute", @@ -153,14 +120,9 @@ contract HomeGateway is IHomeGateway { _params.extraData ) ); - require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); - RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash]; require(relayedData.relayer == address(0), "Dispute already relayed"); - relayedData.arbitrationCost = arbitrator.arbitrationCost(_params.extraData); - require(msg.value >= relayedData.arbitrationCost, "Not enough arbitration cost paid"); - uint256 disputeID = arbitrator.createDispute{value: msg.value}(_params.choices, _params.extraData); disputeIDtoHash[disputeID] = disputeHash; disputeHashtoID[disputeHash] = disputeID; @@ -180,27 +142,19 @@ contract HomeGateway is IHomeGateway { } /// @inheritdoc IHomeGateway - function relayCreateDispute( - uint256 _foreignChainID, - bytes32 _foreignBlockHash, - uint256 _foreignDisputeID, - uint256 _choices, - bytes calldata _extraData, - address _arbitrable, - uint256 _feeAmount - ) external { + function relayCreateDispute(RelayCreateDisputeParams memory _params, uint256 _feeAmount) external { require(feeToken != NATIVE_CURRENCY, "Fees paid in native currency only"); - require(_foreignChainID == foreignChainID, "Foreign chain ID not supported"); + require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); bytes32 disputeHash = keccak256( abi.encodePacked( - _foreignChainID, - _foreignBlockHash, "createDispute", - _foreignDisputeID, - _choices, - _extraData, - _arbitrable + _params.foreignBlockHash, + _params.foreignChainID, + _params.foreignArbitrable, + _params.foreignDisputeID, + _params.choices, + _params.extraData ) ); RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash]; @@ -209,12 +163,22 @@ contract HomeGateway is IHomeGateway { require(feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount), "Transfer failed"); require(feeToken.increaseAllowance(address(arbitrator), _feeAmount), "Allowance increase failed"); - uint256 disputeID = arbitrator.createDispute(_choices, _extraData, feeToken, _feeAmount); + uint256 disputeID = arbitrator.createDispute(_params.choices, _params.extraData, feeToken, _feeAmount); disputeIDtoHash[disputeID] = disputeHash; disputeHashtoID[disputeHash] = disputeID; relayedData.relayer = msg.sender; - emit Dispute(arbitrator, disputeID, 0, 0); + emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri); + + emit CrossChainDisputeIncoming( + arbitrator, + _params.foreignChainID, + _params.foreignArbitrable, + _params.foreignDisputeID, + _params.externalDisputeID, + _params.templateId, + _params.templateUri + ); } /// @inheritdoc IArbitrableV2 diff --git a/contracts/src/gateway/interfaces/IHomeGateway.sol b/contracts/src/gateway/interfaces/IHomeGateway.sol index 2f7c98ea1..474e4f028 100644 --- a/contracts/src/gateway/interfaces/IHomeGateway.sol +++ b/contracts/src/gateway/interfaces/IHomeGateway.sol @@ -31,24 +31,6 @@ interface IHomeGateway is IArbitrableV2, ISenderGateway { string _templateUri ); - /// @dev Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. - /// Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. - /// This function accepts the fees payment in the native currency of the home chain, typically ETH. - /// @param _foreignChainID foreignChainId - /// @param _foreignBlockHash foreignBlockHash - /// @param _foreignDisputeID foreignDisputeID - /// @param _choices number of ruling choices - /// @param _extraData extraData - /// @param _arbitrable arbitrable - function relayCreateDispute( - uint256 _foreignChainID, - bytes32 _foreignBlockHash, - uint256 _foreignDisputeID, - uint256 _choices, - bytes calldata _extraData, - address _arbitrable - ) external payable; - // Workaround stack too deep for relayCreateDispute() struct RelayCreateDisputeParams { bytes32 foreignBlockHash; @@ -68,6 +50,12 @@ interface IHomeGateway is IArbitrableV2, ISenderGateway { /// @param _params The parameters of the dispute, see `RelayCreateDisputeParams`. function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable; + /// @dev Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. + /// Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. + /// This function accepts the fees payment in the ERC20 `acceptedFeeToken()`. + /// @param _params The parameters of the dispute, see `RelayCreateDisputeParams`. + function relayCreateDispute(RelayCreateDisputeParams memory _params, uint256 _feeAmount) external; + /// @dev Looks up the local home disputeID for a disputeHash /// @param _disputeHash dispute hash /// @return disputeID dispute identifier on the home chain diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol index 6a27915f7..ed8249b80 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol @@ -615,12 +615,12 @@ contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitratorV2 { // * Public Views * // // ************************************* // - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) { cost = foreignGateway.arbitrationCost(_extraData); } - /// @inheritdoc IArbitrator + /// @inheritdoc IArbitratorV2 function arbitrationCost( bytes calldata /*_extraData*/, IERC20 /*_feeToken*/ diff --git a/contracts/test/arbitration/draw.ts b/contracts/test/arbitration/draw.ts index 49142949f..8ab270121 100644 --- a/contracts/test/arbitration/draw.ts +++ b/contracts/test/arbitration/draw.ts @@ -102,36 +102,22 @@ describe("Draw Benchmark", async () => { const lastBlock = await ethers.provider.getBlock(tx.blockNumber - 1); // Relayer tx -<<<<<<< HEAD const tx2 = await homeGateway .connect(await ethers.getSigner(relayer)) - .functions["relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)"]( - 31337, - lastBlock.hash, - disputeId, - 2, - "0x00", - arbitrable.address, + .functions["relayCreateDispute((bytes32,uint256,address,uint256,uint256,uint256,string,uint256,bytes))"]( { - value: arbitrationCost, - } + foreignBlockHash: lastBlock.hash, + foreignChainID: 31337, + foreignArbitrable: arbitrable.address, + foreignDisputeID: disputeId, + externalDisputeID: ethers.utils.keccak256(ethers.utils.toUtf8Bytes("future of france")), + templateId: 0, + templateUri: "", + choices: 2, + extraData: "0x00", + }, + { value: arbitrationCost } ); -======= - const tx2 = await homeGateway.connect(await ethers.getSigner(relayer)).relayCreateDispute( - { - foreignBlockHash: lastBlock.hash, - foreignChainID: 31337, - foreignArbitrable: arbitrable.address, - foreignDisputeID: disputeId, - externalDisputeID: ethers.utils.keccak256(ethers.utils.toUtf8Bytes("future of france")), - templateId: 0, - templateUri: "", - choices: 2, - extraData: "0x00", - }, - { value: arbitrationCost } - ); ->>>>>>> 6a280d9 (feat: migrated all the interfaces to the new v2 ones)) await network.provider.send("evm_increaseTime", [2000]); // Wait for minStakingTime await network.provider.send("evm_mine"); diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index e898d4cfc..bf4112632 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -114,36 +114,22 @@ describe("Integration tests", async () => { const events = (await tx.wait()).events; // Relayer tx -<<<<<<< HEAD const tx2 = await homeGateway .connect(relayer) - .functions["relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)"]( - 31337, - lastBlock.hash, - disputeId, - 2, - "0x00", - arbitrable.address, + .functions["relayCreateDispute((bytes32,uint256,address,uint256,uint256,uint256,string,uint256,bytes))"]( { - value: arbitrationCost, - } + foreignBlockHash: lastBlock.hash, + foreignChainID: 31337, + foreignArbitrable: arbitrable.address, + foreignDisputeID: disputeId, + externalDisputeID: ethers.utils.keccak256(ethers.utils.toUtf8Bytes("future of france")), + templateId: 0, + templateUri: "", + choices: 2, + extraData: "0x00", + }, + { value: arbitrationCost } ); -======= - const tx2 = await homeGateway.connect(relayer).relayCreateDispute( - { - foreignBlockHash: lastBlock.hash, - foreignChainID: 31337, - foreignArbitrable: arbitrable.address, - foreignDisputeID: disputeId, - externalDisputeID: ethers.utils.keccak256(ethers.utils.toUtf8Bytes("future of france")), - templateId: 0, - templateUri: "", - choices: 2, - extraData: "0x00", - }, - { value: arbitrationCost } - ); ->>>>>>> 6a280d9 (feat: migrated all the interfaces to the new v2 ones)) expect(tx2).to.emit(homeGateway, "Dispute"); const events2 = (await tx2.wait()).events; From 515350852acd7030e4e132a67a677506035a4119 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Fri, 23 Jun 2023 15:45:26 +0200 Subject: [PATCH 27/29] fix: variable in DisputeDetails.simple.jsonc --- .../simple/example/DisputeDetails.simple.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc index 8429d6255..a7e189e79 100644 --- a/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc @@ -23,7 +23,7 @@ } ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", - "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/4564/overview", "arbitrableChainID": "10200", // Chiado "arbitrableAddress": "0x22f40371b1d1bd7e6229e33b832cbe00d0b991b2", "arbitratorChainID": "421613", // ArbitrumGoerli From ac47dd50ed1cbf29394916f6f1050fa0b55f92a6 Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Sat, 24 Jun 2023 00:20:15 +0100 Subject: [PATCH 28/29] fix: added the arbitrator disputeID to the CrossChainDisputeIncoming event Also simplified ArbitrableExample.createDispute(). --- contracts/deploy/00-home-chain-arbitrable.ts | 4 +- .../deploy/01-foreign-gateway-on-ethereum.ts | 15 +++---- contracts/deploy/03-vea-mock.ts | 22 +++++++---- contracts/deploy/04-foreign-arbitrable.ts | 7 +++- .../deploy/04-klerosliquid-to-v2-gnosis.ts | 4 +- contracts/hardhat.config.ts | 4 ++ .../arbitrables/ArbitrableExample.sol | 39 +++++++++---------- contracts/src/gateway/HomeGateway.sol | 3 ++ .../src/gateway/interfaces/IHomeGateway.sol | 4 +- contracts/test/arbitration/draw.ts | 2 +- contracts/test/integration/index.ts | 2 +- 11 files changed, 64 insertions(+), 42 deletions(-) diff --git a/contracts/deploy/00-home-chain-arbitrable.ts b/contracts/deploy/00-home-chain-arbitrable.ts index 1cf94f5f5..84827f520 100644 --- a/contracts/deploy/00-home-chain-arbitrable.ts +++ b/contracts/deploy/00-home-chain-arbitrable.ts @@ -18,11 +18,13 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); const klerosCore = await deployments.get("KlerosCore"); + const extraData = + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors const weth = await deployments.get("WETH"); await deploy("ArbitrableExample", { from: deployer, - args: [klerosCore.address, disputeTemplate, weth.address], + args: [klerosCore.address, disputeTemplate, extraData, weth.address], log: true, }); diff --git a/contracts/deploy/01-foreign-gateway-on-ethereum.ts b/contracts/deploy/01-foreign-gateway-on-ethereum.ts index 624d7a55f..1304fec72 100644 --- a/contracts/deploy/01-foreign-gateway-on-ethereum.ts +++ b/contracts/deploy/01-foreign-gateway-on-ethereum.ts @@ -1,6 +1,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; +import { KlerosCore__factory } from "../typechain-types"; enum ForeignChains { ETHEREUM_MAINNET = 1, @@ -45,13 +46,13 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme }); // TODO: disable the gateway until fully initialized with the correct fees OR allow disputeCreators to add funds again if necessary. - await execute( - "ForeignGatewayOnEthereum", - { from: deployer, log: true }, - "changeCourtJurorFee", - 0, - ethers.BigNumber.from(10).pow(17) - ); + const coreDeployment = await hre.companionNetworks.home.deployments.get("KlerosCore"); + const core = await KlerosCore__factory.connect(coreDeployment.address, homeChainProvider); + // TODO: set up the correct fees for the FORKING_COURT + const courtId = await core.GENERAL_COURT(); + const fee = (await core.courts(courtId)).feeForJuror; + await execute("ForeignGatewayOnGnosis", { from: deployer, log: true }, "changeCourtJurorFee", courtId, fee); + // TODO: set up the correct fees for the lower courts }; deployForeignGateway.tags = ["ForeignGatewayOnEthereum"]; diff --git a/contracts/deploy/03-vea-mock.ts b/contracts/deploy/03-vea-mock.ts index a03fcfe62..c0c51897b 100644 --- a/contracts/deploy/03-vea-mock.ts +++ b/contracts/deploy/03-vea-mock.ts @@ -1,6 +1,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; +import { KlerosCore__factory } from "../typechain-types"; import disputeTemplate from "../../kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json"; const HARDHAT_NETWORK = 31337; @@ -51,17 +52,22 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) log: true, }); // nonce+1 - await execute( - "ForeignGatewayOnEthereum", - { from: deployer, log: true }, - "changeCourtJurorFee", - 0, - ethers.BigNumber.from(10).pow(17) - ); + // TODO: disable the gateway until fully initialized with the correct fees OR allow disputeCreators to add funds again if necessary. + const signer = (await hre.ethers.getSigners())[0]; + const core = await KlerosCore__factory.connect(klerosCore.address, signer); + // TODO: set up the correct fees for the FORKING_COURT + const courtId = await core.GENERAL_COURT(); + const fee = (await core.courts(courtId)).feeForJuror; + await execute("ForeignGatewayOnEthereum", { from: deployer, log: true }, "changeCourtJurorFee", courtId, fee); + // TODO: set up the correct fees for the lower courts + // TODO: debug why this extraData fails but "0x00" works + // const extraData = + // "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors + const extraData = "0x00"; await deploy("ArbitrableExample", { from: deployer, - args: [foreignGateway.address, disputeTemplate, ethers.constants.AddressZero], + args: [foreignGateway.address, disputeTemplate, extraData, ethers.constants.AddressZero], log: true, }); }; diff --git a/contracts/deploy/04-foreign-arbitrable.ts b/contracts/deploy/04-foreign-arbitrable.ts index b0bbe2b41..591433a35 100644 --- a/contracts/deploy/04-foreign-arbitrable.ts +++ b/contracts/deploy/04-foreign-arbitrable.ts @@ -1,5 +1,6 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; +import disputeTemplate from "../../kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json"; enum ForeignChains { ETHEREUM_MAINNET = 1, @@ -16,11 +17,13 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme console.log("Deploying to chainId %s with deployer %s", chainId, deployer); const foreignGateway = await deployments.get("ForeignGatewayOnEthereum"); - const metaEvidenceUri = `https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/${hre.network.name}/MetaEvidence_ArbitrableExample.json`; + // TODO: add the dispute template + const extraData = + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors const weth = await deployments.get("WETH"); await deploy("ArbitrableExample", { from: deployer, - args: [foreignGateway.address, 0, metaEvidenceUri, weth.address], + args: [foreignGateway.address, disputeTemplate, extraData, weth.address], log: true, }); }; diff --git a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts index e2a446f0a..49760a685 100644 --- a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts +++ b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts @@ -54,6 +54,8 @@ const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment const jurorsForCourtJump = 9999999; const sortitionSumTreeK = 3; const foreignGateway = await deployments.get("ForeignGatewayOnGnosis"); + const extraData = + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors const weth = await deployments.get("WETH"); console.log("Using: \nwPNK at %s, \nForeignGateway at %s", wPnkAddress, foreignGateway.address, weth.address); @@ -99,7 +101,7 @@ const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment // const xKlerosLiquidV2 = await deployments.get("xKlerosLiquidV2"); await deploy("ArbitrableExample", { from: deployer, - args: [xKlerosLiquidV2.address, 0, disputeTemplate, weth.address], + args: [xKlerosLiquidV2.address, 0, disputeTemplate, extraData, weth.address], log: true, maxFeePerGas: ONE_GWEI, maxPriorityFeePerGas: ONE_GWEI, diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 0ae7482fb..b7c6f2cd4 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -37,6 +37,10 @@ const config: HardhatUserConfig = { saveDeployments: true, allowUnlimitedContractSize: true, tags: ["test", "local"], + companionNetworks: { + home: "hardhat", + foreign: "hardhat", + }, }, localhost: { url: `http://127.0.0.1:8545`, diff --git a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol index 254c45a3e..1557a8ce4 100644 --- a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol +++ b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol @@ -25,6 +25,7 @@ contract ArbitrableExample is IArbitrableV2 { address public immutable governor; IArbitratorV2 public arbitrator; // Arbitrator is set in constructor. uint256 public disputeTemplates; // The number of dispute templates created. + bytes public arbitratorExtraData; // Extra data to set up the arbitration. IERC20 public immutable weth; // The WETH token. mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID]. @@ -37,9 +38,15 @@ contract ArbitrableExample is IArbitrableV2 { /// @param _arbitrator The arbitrator to rule on created disputes. /// @param _templateData The dispute template data. /// @param _weth The WETH token. - constructor(IArbitratorV2 _arbitrator, string memory _templateData, IERC20 _weth) { + constructor( + IArbitratorV2 _arbitrator, + string memory _templateData, + bytes memory _arbitratorExtraData, + IERC20 _weth + ) { governor = msg.sender; arbitrator = _arbitrator; + arbitratorExtraData = _arbitratorExtraData; weth = _weth; emit DisputeTemplate(disputeTemplates++, "", _templateData); } @@ -58,47 +65,39 @@ contract ArbitrableExample is IArbitrableV2 { arbitrator = _arbitrator; } + function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external { + require(msg.sender == governor, "Not authorized: governor only."); + arbitratorExtraData = _arbitratorExtraData; + } + // ************************************* // // * State Modifiers * // // ************************************* // /// @dev Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. - /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. /// @param _action The action that requires arbitration. - /// @param _arbitratorExtraData Extra data for the arbitrator. /// @return disputeID Dispute id (on arbitrator side) of the dispute created. - function createDispute( - uint256 _templateId, - string calldata _action, - bytes calldata _arbitratorExtraData - ) external payable returns (uint256 disputeID) { + function createDispute(string calldata _action) external payable returns (uint256 disputeID) { emit Action(_action); uint256 numberOfRulingOptions = 2; uint256 localDisputeID = disputes.length; disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions})); - disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, _arbitratorExtraData); + disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, arbitratorExtraData); externalIDtoLocalID[disputeID] = localDisputeID; uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action))); - emit DisputeRequest(arbitrator, disputeID, externalDisputeID, _templateId, ""); + emit DisputeRequest(arbitrator, disputeID, externalDisputeID, disputeTemplates - 1, ""); } /// @dev Calls createDispute function of the specified arbitrator to create a dispute. /// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. - /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. /// @param _action The action that requires arbitration. - /// @param _arbitratorExtraData Extra data for the arbitrator. /// @param _feeInWeth Amount of fees in WETH for the arbitrator. /// @return disputeID Dispute id (on arbitrator side) of the dispute created. - function createDispute( - uint256 _templateId, - string calldata _action, - bytes calldata _arbitratorExtraData, - uint256 _feeInWeth - ) external payable returns (uint256 disputeID) { + function createDispute(string calldata _action, uint256 _feeInWeth) external payable returns (uint256 disputeID) { emit Action(_action); uint256 numberOfRulingOptions = 2; @@ -108,11 +107,11 @@ contract ArbitrableExample is IArbitrableV2 { require(weth.safeTransferFrom(msg.sender, address(this), _feeInWeth), "Transfer failed"); require(weth.increaseAllowance(address(arbitrator), _feeInWeth), "Allowance increase failed"); - disputeID = arbitrator.createDispute(numberOfRulingOptions, _arbitratorExtraData, weth, _feeInWeth); + disputeID = arbitrator.createDispute(numberOfRulingOptions, arbitratorExtraData, weth, _feeInWeth); externalIDtoLocalID[disputeID] = localDisputeID; uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action))); - emit DisputeRequest(arbitrator, disputeID, externalDisputeID, _templateId, ""); + emit DisputeRequest(arbitrator, disputeID, externalDisputeID, disputeTemplates - 1, ""); } /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling. diff --git a/contracts/src/gateway/HomeGateway.sol b/contracts/src/gateway/HomeGateway.sol index 4100d44da..53b31f491 100644 --- a/contracts/src/gateway/HomeGateway.sol +++ b/contracts/src/gateway/HomeGateway.sol @@ -135,6 +135,7 @@ contract HomeGateway is IHomeGateway { _params.foreignChainID, _params.foreignArbitrable, _params.foreignDisputeID, + disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri @@ -168,6 +169,7 @@ contract HomeGateway is IHomeGateway { disputeHashtoID[disputeHash] = disputeID; relayedData.relayer = msg.sender; + // Not strictly necessary for functionality, only to satisfy IArbitrableV2 emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri); emit CrossChainDisputeIncoming( @@ -175,6 +177,7 @@ contract HomeGateway is IHomeGateway { _params.foreignChainID, _params.foreignArbitrable, _params.foreignDisputeID, + disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri diff --git a/contracts/src/gateway/interfaces/IHomeGateway.sol b/contracts/src/gateway/interfaces/IHomeGateway.sol index 028fedb76..8a6931688 100644 --- a/contracts/src/gateway/interfaces/IHomeGateway.sol +++ b/contracts/src/gateway/interfaces/IHomeGateway.sol @@ -18,14 +18,16 @@ interface IHomeGateway is IArbitrableV2, ISenderGateway { /// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed. /// @param _arbitrable The address of the Arbitrable contract. /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract. + /// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract. /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration. /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri. /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId. event CrossChainDisputeIncoming( - IArbitratorV2 indexed _arbitrator, + IArbitratorV2 _arbitrator, uint256 _arbitrableChainId, address indexed _arbitrable, uint256 indexed _arbitrableDisputeID, + uint256 indexed _arbitratorDisputeID, uint256 _externalDisputeID, uint256 _templateId, string _templateUri diff --git a/contracts/test/arbitration/draw.ts b/contracts/test/arbitration/draw.ts index 8ab270121..16de529e5 100644 --- a/contracts/test/arbitration/draw.ts +++ b/contracts/test/arbitration/draw.ts @@ -94,7 +94,7 @@ describe("Draw Benchmark", async () => { } // Create a dispute - const tx = await arbitrable.functions["createDispute(uint256,string,bytes)"](0, "future of france", "0x00", { + const tx = await arbitrable.functions["createDispute(string)"]("future of france", { value: arbitrationCost, }); const trace = await network.provider.send("debug_traceTransaction", [tx.hash]); diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index bf4112632..0dd3c6f82 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -96,7 +96,7 @@ describe("Integration tests", async () => { expect(result.locked).to.equal(0); logJurorBalance(result); }); - const tx = await arbitrable.functions["createDispute(uint256,string,bytes)"](0, "future of france", "0x00", { + const tx = await arbitrable.functions["createDispute(string)"]("future of france", { value: arbitrationCost, }); const trace = await network.provider.send("debug_traceTransaction", [tx.hash]); From eb703cbcc713b0f2b305a480477932ed3f4d9eda Mon Sep 17 00:00:00 2001 From: jaybuidl <jb@kleros.io> Date: Sat, 24 Jun 2023 00:33:40 +0100 Subject: [PATCH 29/29] chore: redeployed the contracts --- contracts/README.md | 17 +- contracts/deploy/04-foreign-arbitrable.ts | 17 +- contracts/deployments/arbitrumGoerli/DAI.json | 458 ++++++++++ .../arbitrumGoerli/DisputeKitClassic.json | 114 +-- .../arbitrumGoerli/DisputeResolver.json | 123 +-- .../arbitrumGoerli/KlerosCore.json | 818 +++++++++++++----- .../arbitrumGoerli/SortitionModule.json | 100 +-- .../deployments/arbitrumGoerli/WETH.json | 458 ++++++++++ .../deployments/chiado/ArbitrableExample.json | 327 +++++-- .../chiado/ForeignGatewayOnGnosis.json | 400 ++++++--- .../deployments/goerli/ArbitrableExample.json | 434 ---------- 11 files changed, 2176 insertions(+), 1090 deletions(-) create mode 100644 contracts/deployments/arbitrumGoerli/DAI.json create mode 100644 contracts/deployments/arbitrumGoerli/WETH.json delete mode 100644 contracts/deployments/goerli/ArbitrableExample.json diff --git a/contracts/README.md b/contracts/README.md index 609afed66..0c7ae086c 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -8,9 +8,9 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Chiado -- [ArbitrableExample](https://blockscout.com/gnosis/chiado/address/0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b) +- [ArbitrableExample](https://blockscout.com/gnosis/chiado/address/0x6BC234359c2Bc212B81A5cF2dfE504940e98d4cC) - [DisputeResolver](https://blockscout.com/gnosis/chiado/address/0x433eD78895df1df7668C40b3e82d54410331F942) -- [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x573bcD6ee4aEe152eCC9Cafd2c0820Dc548AF6cC) +- [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x2357ef115E98d171b083105E9b398231206989A3) - [SortitionSumTreeFactory](https://blockscout.com/gnosis/chiado/address/0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636) - [TokenBridge](https://blockscout.com/gnosis/chiado/address/0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2) - [WETH](https://blockscout.com/gnosis/chiado/address/0x2DFC9c3141268e6eac04a7D6d98Fbf64BDe836a8) @@ -22,20 +22,20 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Goerli - [PNK](https://goerli.etherscan.io/token/0xA3B02bA6E10F55fb177637917B1b472da0110CcC) -- [ArbitrableExample](https://goerli.etherscan.io/address/0xd78dcdde2c5a2bd4bb246bc7db6994b95f7c442c) #### Arbitrum Goerli - [PNK](https://goerli.arbiscan.io/token/0x4DEeeFD054434bf6721eF39Aa18EfB3fd0D12610/token-transfers) -- [ArbitrableExampleEthFee](https://goerli.arbiscan.io/address/0x1d533481cCD1402f83Df3D9Ba7496B5e5b602875) - [BlockHashRNG](https://goerli.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD) -- [DisputeKitClassic](https://goerli.arbiscan.io/address/0xcBE3aD699919Cf59efDF715e4B41AF30A0E4c92d) -- [DisputeResolver](https://goerli.arbiscan.io/address/0xF6652c10c4D3f5bA6066254B78c57A468d9b9606) +- [DAI](https://goerli.arbiscan.io/address/0x70A704Dce4cCC00568Cc142C86D07Ec71C944a39) +- [DisputeKitClassic](https://goerli.arbiscan.io/address/0x0245A93ABd9c5b2d767B2D98cE6d5e612208E474) +- [DisputeResolver](https://goerli.arbiscan.io/address/0xcDC05c8d2EEEe384359Bd22E8631528B6b0564e9) - [HomeGatewayToGnosis](https://goerli.arbiscan.io/address/0xD60CD2151e118Dd796efcb1ceFFcF892226F9b3a) -- [KlerosCore](https://goerli.arbiscan.io/address/0xA429667Abb1A6c530BAd1083df4C69FBce86D696) +- [KlerosCore](https://goerli.arbiscan.io/address/0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24) - [PolicyRegistry](https://goerli.arbiscan.io/address/0xED503aBA65B28D81444294D1eAa5d84CeFdC2C58) - [RandomizerRNG](https://goerli.arbiscan.io/address/0xa90f7D2e35718FDE9AD96c8B6667AFcAa4BEfd4d) -- [SortitionModule](https://goerli.arbiscan.io/address/0xa65D3ED6494ec5fcAa115A39D625B2F01786F094) +- [SortitionModule](https://goerli.arbiscan.io/address/0x5Ae75Db8B66B574b2c5C29eE4D32cc9Fe62bfdEE) +- [WETH](https://goerli.arbiscan.io/address/0xddE1b84E43505432Fdf5F810ebB9373dD37e9230) ## Getting Started @@ -120,6 +120,7 @@ yarn deploy --network localhost --tags <Arbitration|VeaMock|ForeignGatewayOnEthe yarn deploy --network arbitrumGoerli --tags Arbitration yarn deploy --network chiado --tags ForeignGatewayOnGnosis yarn deploy --network chiado --tags KlerosLiquidOnGnosis +yarn deploy --network chiado --tags ForeignArbitrable yarn deploy --network arbitrumGoerli --tags HomeGatewayToGnosis # Goerli diff --git a/contracts/deploy/04-foreign-arbitrable.ts b/contracts/deploy/04-foreign-arbitrable.ts index 591433a35..3623aca43 100644 --- a/contracts/deploy/04-foreign-arbitrable.ts +++ b/contracts/deploy/04-foreign-arbitrable.ts @@ -5,8 +5,17 @@ import disputeTemplate from "../../kleros-sdk/config/v2-disputetemplate/simple/N enum ForeignChains { ETHEREUM_MAINNET = 1, ETHEREUM_GOERLI = 5, + GNOSIS_MAINNET = 100, + GNOSIS_CHIADO = 10200, } +const foreignGatewayArtifactByChain = new Map<ForeignChains, string>([ + [ForeignChains.ETHEREUM_MAINNET, "ForeignGatewayOnEthereum"], + [ForeignChains.ETHEREUM_GOERLI, "ForeignGatewayOnEthereum"], + [ForeignChains.GNOSIS_MAINNET, "ForeignGatewayOnGnosis"], + [ForeignChains.GNOSIS_CHIADO, "ForeignGatewayOnGnosis"], +]); + const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; const { deploy, execute } = deployments; @@ -16,8 +25,10 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme const chainId = Number(await getChainId()); console.log("Deploying to chainId %s with deployer %s", chainId, deployer); - const foreignGateway = await deployments.get("ForeignGatewayOnEthereum"); - // TODO: add the dispute template + const foreignGatewayArtifact = foreignGatewayArtifactByChain.get(chainId) ?? ethers.constants.AddressZero; + const foreignGateway = await deployments.get(foreignGatewayArtifact); + console.log("Using foreign gateway: %s", foreignGatewayArtifact); + const extraData = "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors const weth = await deployments.get("WETH"); @@ -28,7 +39,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme }); }; -deployForeignGateway.tags = ["ArbitrableOnEthereum"]; +deployForeignGateway.tags = ["ForeignArbitrable"]; deployForeignGateway.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !ForeignChains[chainId]; diff --git a/contracts/deployments/arbitrumGoerli/DAI.json b/contracts/deployments/arbitrumGoerli/DAI.json new file mode 100644 index 000000000..a6e1a444e --- /dev/null +++ b/contracts/deployments/arbitrumGoerli/DAI.json @@ -0,0 +1,458 @@ +{ + "address": "0x70A704Dce4cCC00568Cc142C86D07Ec71C944a39", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xfbc967b6d873208cf131adc3a04f1725eabb5d7b690fe5e1faaf15267c8600fe", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x70A704Dce4cCC00568Cc142C86D07Ec71C944a39", + "transactionIndex": 1, + "gasUsed": "621518", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000200000000010000000000000040000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000028000000000000000000800000000000000000000000010000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000080000000000000000000000000000000000000000000000", + "blockHash": "0x13adc0f91e797f199645b3da2d714520492e37fbe602040296772320707f5f62", + "transactionHash": "0xfbc967b6d873208cf131adc3a04f1725eabb5d7b690fe5e1faaf15267c8600fe", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 27808396, + "transactionHash": "0xfbc967b6d873208cf131adc3a04f1725eabb5d7b690fe5e1faaf15267c8600fe", + "address": "0x70A704Dce4cCC00568Cc142C86D07Ec71C944a39", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f50e77f2a2b6138d16c6c7511562e5c33c4b15a3" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0x13adc0f91e797f199645b3da2d714520492e37fbe602040296772320707f5f62" + } + ], + "blockNumber": 27808396, + "cumulativeGasUsed": "621518", + "status": 1, + "byzantium": true + }, + "args": [ + "DAI", + "DAI" + ], + "numDeployments": 1, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC20.sol\":\"TestERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"src/token/TestERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestERC20 is ERC20 {\\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x9f67e6b63ca87e6c98b2986364ce16a747ce4098e9146fffb17ea13863c0b7e4\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000c5838038062000c5883398101604081905262000034916200020a565b8181600362000044838262000302565b50600462000053828262000302565b505050620000723369d3c21bcecceda10000006200007a60201b60201c565b5050620003f6565b6001600160a01b038216620000d55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e99190620003ce565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016d57600080fd5b81516001600160401b03808211156200018a576200018a62000145565b604051601f8301601f19908116603f01168101908282118183101715620001b557620001b562000145565b81604052838152602092508683858801011115620001d257600080fd5b600091505b83821015620001f65785820183015181830184015290820190620001d7565b600093810190920192909252949350505050565b600080604083850312156200021e57600080fd5b82516001600160401b03808211156200023657600080fd5b62000244868387016200015b565b935060208501519150808211156200025b57600080fd5b506200026a858286016200015b565b9150509250929050565b600181811c908216806200028957607f821691505b602082108103620002aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c81016020861015620002d95750805b601f850160051c820191505b81811015620002fa57828155600101620002e5565b505050505050565b81516001600160401b038111156200031e576200031e62000145565b62000336816200032f845462000274565b84620002b0565b602080601f8311600181146200036e5760008415620003555750858301515b600019600386901b1c1916600185901b178555620002fa565b600085815260208120601f198616915b828110156200039f578886015182559484019460019091019084016200037e565b5085821015620003be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003f057634e487b7160e01b600052601160045260246000fd5b92915050565b61085280620004066000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea2646970667358221220c4d9cff0468928ae77b92a978647e277561af91e75ca535aba25c3cd49cba40564736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea2646970667358221220c4d9cff0468928ae77b92a978647e277561af91e75ca535aba25c3cd49cba40564736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 280, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 286, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 288, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 290, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 292, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumGoerli/DisputeKitClassic.json b/contracts/deployments/arbitrumGoerli/DisputeKitClassic.json index 7136810d1..f485d4e2b 100644 --- a/contracts/deployments/arbitrumGoerli/DisputeKitClassic.json +++ b/contracts/deployments/arbitrumGoerli/DisputeKitClassic.json @@ -1,5 +1,5 @@ { - "address": "0xcBE3aD699919Cf59efDF715e4B41AF30A0E4c92d", + "address": "0x0245A93ABd9c5b2d767B2D98cE6d5e612208E474", "abi": [ { "inputs": [ @@ -135,7 +135,7 @@ { "indexed": true, "internalType": "uint256", - "name": "_evidenceGroupID", + "name": "_externalDisputeID", "type": "uint256" }, { @@ -788,7 +788,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_evidenceGroupID", + "name": "_externalDisputeID", "type": "uint256" }, { @@ -837,19 +837,19 @@ "type": "function" } ], - "transactionHash": "0xc53d3227f205e10a6ad7ed8e3b3ff695a4852b705f96ae406dda5cba9e85fb00", + "transactionHash": "0x81a07ba3c1bc56d95f6b4e40b586a5f1e6f761c0a6494c8b642da3771bd9366f", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xcBE3aD699919Cf59efDF715e4B41AF30A0E4c92d", + "contractAddress": "0x0245A93ABd9c5b2d767B2D98cE6d5e612208E474", "transactionIndex": 1, - "gasUsed": "3262324", + "gasUsed": "3272435", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x35a919daac632027580c95be569c9a90c2b222be007062abd36b4e9875be9d07", - "transactionHash": "0xc53d3227f205e10a6ad7ed8e3b3ff695a4852b705f96ae406dda5cba9e85fb00", + "blockHash": "0xa777a996e1fadd2476fdd0ca8890ef7810f8fc5ced55ce20d544a4c974536429", + "transactionHash": "0x81a07ba3c1bc56d95f6b4e40b586a5f1e6f761c0a6494c8b642da3771bd9366f", "logs": [], - "blockNumber": 25602098, - "cumulativeGasUsed": "3262324", + "blockNumber": 27808415, + "cumulativeGasUsed": "3272435", "status": 1, "byzantium": true }, @@ -857,18 +857,18 @@ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", "0x0000000000000000000000000000000000000000" ], - "numDeployments": 2, - "solcInputHash": "36e3015201aa6368fd28e007dfb67b68", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"CommitCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"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\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"Justification\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areCommitsAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areVotesAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_nbVotes\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"jumped\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"getFundedChoices\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"fundedChoices\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Evidence(uint256,address,string)\":{\"details\":\"To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\",\"_evidenceGroupID\":\"Unique identifier of the evidence group the evidence belongs to.\",\"_party\":\"The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\"}},\"Justification(uint256,address,uint256,string)\":{\"details\":\"Emitted when casting a vote to provide the justification of juror's choice.\",\"params\":{\"_choice\":\"The choice juror voted for.\",\"_coreDisputeID\":\"ID of the dispute in the core contract.\",\"_juror\":\"Address of the juror.\",\"_justification\":\"Justification of the choice.\"}}},\"kind\":\"dev\",\"methods\":{\"areCommitsAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their commits for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their commits for the last round.\"}},\"areVotesAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their votes for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their votes for the last round.\"}},\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit. Note that justification string is a part of the commit.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256,string)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_justification\":\"Justification of the choice.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\"}},\"createDispute(uint256,uint256,bytes,uint256)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_nbVotes\":\"Number of votes for this dispute.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"submitEvidence(uint256,string)\":{\"details\":\"Submits evidence.\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.\"}},\"withdrawFeesAndRewards(uint256,address,uint256,uint256)\":{\"details\":\"Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core contract.\",\"_coreRoundID\":\"The round in the Kleros Core contract the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggreation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IArbitrable\\n/// Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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);\\ninterface IArbitrable {\\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 event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _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 function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x2a5363c37d33749f6b53c288f6d1538f013c6efbb3df86e63eceaa8163a6b212\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitrator {\\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 event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute. Must be called by the arbitrable contract.\\n /// Must pay 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 function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x8028f7d6a0fe07687f975fc51c9f889083ae1a409a134e8017a044701310948f\",\"license\":\"MIT\"},\"src/arbitration/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Address of the juror.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event Justification(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x64acb1fb52ebc6f7b61282e0c2781319a7a9a3ff4e460b6513048c34b6e4ba32\",\"license\":\"MIT\"},\"src/arbitration/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n enum preStakeHookResult {\\n ok,\\n delayed,\\n failed\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(address _account, uint96 _courtID, uint256 _value) external;\\n\\n function setJurorInactive(address _account) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _voteID) external view returns (address);\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external returns (preStakeHookResult);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x28911aa78669746f40c4c3bce723db21600a49a74142c0fe378680b1b356d633\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrator.sol\\\";\\nimport \\\"./IDisputeKit.sol\\\";\\nimport \\\"./ISortitionModule.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the token and the dispute kit contracts.\\ncontract KlerosCore is IArbitrator {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum tokens needed to stake in the court.\\n uint256 alpha; // Basis point of tokens that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrable arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 tokensAtStakePerJuror; // The amount of tokens at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 penalties; // The amount of tokens collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumTokenRewardPaid; // Total sum of tokens paid to coherent jurors as a reward in this round.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n mapping(uint96 => uint256) stakedTokens; // The number of tokens the juror has staked in the court in the form `stakedTokens[courtID]`.\\n mapping(uint96 => uint256) lockedTokens; // The number of tokens the juror has locked in the court in the form `lockedTokens[courtID]`.\\n }\\n\\n struct DisputeKitNode {\\n uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root.\\n uint256[] children; // List of child dispute kits.\\n IDisputeKit disputeKit; // The dispute kit implementation.\\n uint256 depthLevel; // How far this DK is from the root. 0 for root DK.\\n bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 penaltiesInRound; // The amount of tokens collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n // TODO: interactions with jurorProsecutionModule.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n\\n Court[] public courts; // The courts.\\n DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID.\\n Dispute[] public disputes; // The disputes.\\n\\n mapping(address => Juror) internal jurors; // The jurors.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty);\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(uint96 indexed _courtID, string _param);\\n event DisputeKitCreated(\\n uint256 indexed _disputeKitID,\\n IDisputeKit indexed _disputeKitAddress,\\n uint256 indexed _parent\\n );\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _tokenAmount,\\n int256 _ethAmount\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _tokenAmount,\\n uint256 _ethAmount\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent.\\n disputeKitNodes.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: NULL_DISPUTE_KIT,\\n children: new uint256[](0),\\n disputeKit: _disputeKit,\\n depthLevel: 0,\\n disabled: false\\n })\\n );\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit, NULL_DISPUTE_KIT);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created.\\n /// Note that the root DK must be supported by the general court.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor {\\n uint256 disputeKitID = disputeKitNodes.length;\\n require(_parent < disputeKitID, \\\"!Parent\\\");\\n uint256 depthLevel;\\n if (_parent != NULL_DISPUTE_KIT) {\\n depthLevel = disputeKitNodes[_parent].depthLevel + 1;\\n // It should be always possible to reach the root from the leaf with the defined number of search iterations.\\n require(depthLevel < SEARCH_ITERATIONS, \\\"Depth level max\\\");\\n }\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: _parent,\\n children: new uint256[](0),\\n disputeKit: _disputeKitAddress,\\n depthLevel: depthLevel,\\n disabled: false\\n })\\n );\\n\\n disputeKitNodes[_parent].children.push(disputeKitID);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent);\\n if (_parent == NULL_DISPUTE_KIT) {\\n // A new dispute kit tree root should always be supported by the General court.\\n _enableDisputeKit(GENERAL_COURT, disputeKitID, true);\\n }\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n require(courts[_parent].minStake <= _minStake, \\\"MinStake lower than parent court\\\");\\n require(_supportedDisputeKits.length > 0, \\\"!Supported DK\\\");\\n require(_parent != FORKING_COURT, \\\"Invalid: Forking court as parent\\\");\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n require(\\n _supportedDisputeKits[i] > 0 && _supportedDisputeKits[i] < disputeKitNodes.length,\\n \\\"Wrong DK index\\\"\\n );\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n /// @dev Changes the `minStake` property value of a specified court. Don't set to a value lower than its parent's `minStake` property value.\\n /// @param _courtID The ID of the court.\\n /// @param _minStake The new value for the `minStake` property value.\\n function changeCourtMinStake(uint96 _courtID, uint256 _minStake) external onlyByGovernor {\\n require(\\n _courtID == GENERAL_COURT || courts[courts[_courtID].parent].minStake <= _minStake,\\n \\\"MinStake lower than parent court\\\"\\n );\\n for (uint256 i = 0; i < courts[_courtID].children.length; i++) {\\n require(courts[courts[_courtID].children[i]].minStake >= _minStake, \\\"MinStake lower than parent court\\\");\\n }\\n\\n courts[_courtID].minStake = _minStake;\\n emit CourtModified(_courtID, \\\"minStake\\\");\\n }\\n\\n /// @dev Changes the `alpha` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _alpha The new value for the `alpha` property value.\\n function changeCourtAlpha(uint96 _courtID, uint256 _alpha) external onlyByGovernor {\\n courts[_courtID].alpha = _alpha;\\n emit CourtModified(_courtID, \\\"alpha\\\");\\n }\\n\\n /// @dev Changes the `feeForJuror` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _feeForJuror The new value for the `feeForJuror` property value.\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n courts[_courtID].feeForJuror = _feeForJuror;\\n emit CourtModified(_courtID, \\\"feeForJuror\\\");\\n }\\n\\n /// @dev Changes the `jurorsForCourtJump` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _jurorsForCourtJump The new value for the `jurorsForCourtJump` property value.\\n function changeCourtJurorsForJump(uint96 _courtID, uint256 _jurorsForCourtJump) external onlyByGovernor {\\n courts[_courtID].jurorsForCourtJump = _jurorsForCourtJump;\\n emit CourtModified(_courtID, \\\"jurorsForCourtJump\\\");\\n }\\n\\n /// @dev Changes the `hiddenVotes` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _hiddenVotes The new value for the `hiddenVotes` property value.\\n function changeCourtHiddenVotes(uint96 _courtID, bool _hiddenVotes) external onlyByGovernor {\\n courts[_courtID].hiddenVotes = _hiddenVotes;\\n emit CourtModified(_courtID, \\\"hiddenVotes\\\");\\n }\\n\\n /// @dev Changes the `timesPerPeriod` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _timesPerPeriod The new value for the `timesPerPeriod` property value.\\n function changeCourtTimesPerPeriod(uint96 _courtID, uint256[4] memory _timesPerPeriod) external onlyByGovernor {\\n courts[_courtID].timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(_courtID, \\\"timesPerPeriod\\\");\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n require(_disputeKitIDs[i] > 0 && _disputeKitIDs[i] < disputeKitNodes.length, \\\"Wrong DK index\\\");\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n require(\\n !(_courtID == GENERAL_COURT && disputeKitNodes[_disputeKitIDs[i]].parent == NULL_DISPUTE_KIT),\\n \\\"Can't disable Root DK in General\\\"\\n );\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n function setStake(uint96 _courtID, uint256 _stake) external {\\n require(_setStakeForAccount(msg.sender, _courtID, _stake, 0), \\\"Staking failed\\\");\\n }\\n\\n function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _stake, uint256 _penalty) external {\\n require(msg.sender == address(sortitionModule), \\\"Wrong caller\\\");\\n _setStakeForAccount(_account, _courtID, _stake, _penalty);\\n }\\n\\n /// @dev Creates a dispute. Must be called by the arbitrable contract.\\n /// @param _numberOfChoices Number of choices for the jurors to choose from.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes),\\n /// the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The ID of the created dispute.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"ETH too low for arbitration cost\\\");\\n\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n require(courts[courtID].supportedDisputeKits[disputeKitID], \\\"DK unsupported by court\\\");\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrable(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit;\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = msg.value / court.feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.tokensAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = msg.value;\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n require(\\n currentRound > 0 ||\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)],\\n \\\"Evidence not passed && !Appeal\\\"\\n );\\n require(round.drawnJurors.length == round.nbVotes, \\\"Dispute still drawing\\\");\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)] ||\\n disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID),\\n \\\"Commit period not passed\\\"\\n );\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)] ||\\n disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID),\\n \\\"Vote period not passed\\\"\\n );\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)],\\n \\\"Appeal period not passed\\\"\\n );\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert(\\\"Dispute period is final\\\");\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n require(dispute.period == Period.evidence, \\\"!Evidence period\\\");\\n\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= round.nbVotes ? startIndex + _iterations : round.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n jurors[drawnAddress].lockedTokens[dispute.courtID] += round.tokensAtStakePerJuror;\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n }\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n require(msg.value >= appealCost(_disputeID), \\\"ETH too low for appeal cost\\\");\\n\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.appeal, \\\"Dispute not appealable\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n require(msg.sender == address(disputeKitNodes[round.disputeKitID].disputeKit), \\\"Dispute Kit only\\\");\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) {\\n if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n break;\\n } else if (disputeKitNodes[newDisputeKitID].parent != NULL_DISPUTE_KIT) {\\n newDisputeKitID = disputeKitNodes[newDisputeKitID].parent;\\n } else {\\n // DK's parent has 0 index, that means we reached the root DK (0 depth level).\\n // Jump to the next parent court if the current court doesn't support any DK from this tree.\\n // Note that we don't reset newDisputeKitID in this case as, a precaution.\\n newCourtID = courts[newCourtID].parent;\\n }\\n }\\n // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court.\\n // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default.\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n newCourtID = GENERAL_COURT;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.tokensAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n IDisputeKit disputeKit = disputeKitNodes[extraRound.disputeKitID].disputeKit;\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKit.createDispute(_disputeID, _numberOfChoices, _extraData, extraRound.nbVotes);\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute tokens and ETH for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"!Execution period\\\");\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 penaltiesInRoundCache = round.penalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n penaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, penaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, penaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.penalties != penaltiesInRoundCache) {\\n round.penalties = penaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the tokens and ETH for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return penaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.tokensAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.penaltiesInRound += penalty;\\n\\n // Unlock the tokens affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n jurors[account].lockedTokens[dispute.courtID] -= penalty;\\n\\n // Apply the penalty to the staked tokens\\n if (jurors[account].stakedTokens[dispute.courtID] >= courts[dispute.courtID].minStake + penalty) {\\n // The juror still has enough staked token after penalty for this court.\\n uint256 newStake = jurors[account].stakedTokens[dispute.courtID] - penalty;\\n _setStakeForAccount(account, dispute.courtID, newStake, penalty);\\n } else if (jurors[account].stakedTokens[dispute.courtID] != 0) {\\n // The juror does not have enough staked tokens after penalty for this court, unstake them.\\n _setStakeForAccount(account, dispute.courtID, 0, penalty);\\n }\\n emit TokenAndETHShift(account, _params.disputeID, _params.round, degreeOfCoherence, -int256(penalty), 0);\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n payable(governor).send(round.totalFeesForJurors);\\n _safeTransfer(governor, _params.penaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.penaltiesInRound,\\n round.totalFeesForJurors\\n );\\n }\\n return _params.penaltiesInRound;\\n }\\n\\n /// @dev Distribute the tokens and ETH for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 tokenLocked = (round.tokensAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the tokens of the juror for this round.\\n jurors[account].lockedTokens[dispute.courtID] -= tokenLocked;\\n\\n // Give back the locked tokens in case the juror fully unstaked earlier.\\n if (jurors[account].stakedTokens[dispute.courtID] == 0) {\\n _safeTransfer(account, tokenLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 tokenReward = ((_params.penaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumTokenRewardPaid += tokenReward;\\n uint256 ethReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumRewardPaid += ethReward;\\n _safeTransfer(account, tokenReward);\\n payable(account).send(ethReward);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(tokenReward),\\n int256(ethReward)\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverTokenReward = _params.penaltiesInRound - round.sumTokenRewardPaid;\\n uint256 leftoverReward = round.totalFeesForJurors - round.sumRewardPaid;\\n if (leftoverTokenReward != 0 || leftoverReward != 0) {\\n if (leftoverTokenReward != 0) {\\n _safeTransfer(governor, leftoverTokenReward);\\n }\\n if (leftoverReward != 0) {\\n payable(governor).send(leftoverReward);\\n }\\n emit LeftoverRewardSent(_params.disputeID, _params.round, leftoverTokenReward, leftoverReward);\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling. UNTRUSTED.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"!Execution period\\\");\\n require(!dispute.ruled, \\\"Ruling already executed\\\");\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the cost of arbitration in a specified court.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the court to create the dispute in (first 32 bytes)\\n /// and the minimum number of jurors required (next 32 bytes).\\n /// @return cost The arbitration cost.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round\\n )\\n external\\n view\\n returns (\\n uint256 tokensAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 repartitions,\\n uint256 penalties,\\n address[] memory drawnJurors,\\n uint256 disputeKitID,\\n uint256 sumRewardPaid,\\n uint256 sumTokenRewardPaid\\n )\\n {\\n Round storage round = disputes[_disputeID].rounds[_round];\\n return (\\n round.tokensAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.repartitions,\\n round.penalties,\\n round.drawnJurors,\\n round.disputeKitID,\\n round.sumRewardPaid,\\n round.sumTokenRewardPaid\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 staked, uint256 locked, uint256 nbCourts) {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedTokens[_courtID];\\n locked = juror.lockedTokens[_courtID];\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets non-primitive properties of a specified dispute kit node.\\n /// @param _disputeKitID The ID of the dispute kit.\\n /// @return children Indexes of children of this DK.\\n function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) {\\n return disputeKitNodes[_disputeKitID].children;\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_courtID];\\n timesPerPeriod = court.timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitNodesLength() external view returns (uint256) {\\n return disputeKitNodes.length;\\n }\\n\\n /// @dev Gets the dispute kit for a specific `_disputeKitID`.\\n /// @param _disputeKitID The ID of the dispute kit.\\n function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) {\\n return disputeKitNodes[_disputeKitID].disputeKit;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n /// @param _penalty Penalized amount won't be transferred back to juror when the stake is lowered.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function _setStakeForAccount(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) return false;\\n\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = juror.stakedTokens[_courtID];\\n\\n if (_stake != 0) {\\n // Check against locked tokens in case the min stake was lowered.\\n if (_stake < courts[_courtID].minStake || _stake < juror.lockedTokens[_courtID]) return false;\\n }\\n\\n ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _stake, _penalty);\\n if (result == ISortitionModule.preStakeHookResult.failed) {\\n return false;\\n } else if (result == ISortitionModule.preStakeHookResult.delayed) {\\n emit StakeDelayed(_account, _courtID, _stake, _penalty);\\n return true;\\n }\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (_safeTransferFrom(_account, address(this), transferredAmount)) {\\n if (currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n if (_stake == 0) {\\n // Keep locked tokens in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedTokens[_courtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (_safeTransfer(_account, transferredAmount)) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!_safeTransfer(_account, transferredAmount)) {\\n return false;\\n }\\n }\\n }\\n }\\n\\n // Update juror's records.\\n juror.stakedTokens[_courtID] = _stake;\\n\\n sortitionModule.setStake(_account, _courtID, _stake);\\n emit StakeSet(_account, _courtID, _stake);\\n return true;\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = MIN_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = MIN_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function _safeTransfer(address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(pinakion).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function _safeTransferFrom(address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(pinakion).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x40ea2ff69298920e83a2f4817bbc742127c35b0fc3ecdf552f33b33f7dc72a84\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/BaseDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../IDisputeKit.sol\\\";\\nimport \\\"../KlerosCore.sol\\\";\\n\\n/// @title BaseDisputeKit\\n/// Provides common basic behaviours to the Dispute Kit implementations.\\nabstract contract BaseDisputeKit is IDisputeKit {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _core The KlerosCore arbitrator.\\n constructor(address _governor, KlerosCore _core) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal virtual returns (bool);\\n}\\n\",\"keccak256\":\"0x278e95e7b2e2357a55e99a7582504fbc28c721cc3d892b62ca34c796f9c28696\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./BaseDisputeKit.sol\\\";\\nimport \\\"../../evidence/IEvidence.sol\\\";\\n\\n/// @title DisputeKitClassic\\n/// Dispute kit implementation of the Kleros v1 features including:\\n/// - a drawing system: proportional to staked PNK,\\n/// - a vote aggreation system: plurality,\\n/// - an incentive system: equal split between coherent votes,\\n/// - an appeal system: fund 2 choices only, vote on any choice.\\ncontract DisputeKitClassic is BaseDisputeKit, IEvidence {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n bool jumped; // True if dispute jumped to a parent dispute kit and won't be handled by this DK anymore.\\n mapping(uint256 => uint256) coreRoundIDToLocal; // Maps id of the round in the core contract to the index of the round of related local dispute.\\n bytes extraData; // Extradata for the dispute.\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n uint256 nbVotes; // Maximal number of votes this dispute can get.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n Dispute[] public disputes; // Array of the locally created disputes.\\n mapping(uint256 => uint256) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event DisputeCreation(uint256 indexed _coreDisputeID, uint256 _numberOfChoices, bytes _extraData);\\n\\n event CommitCast(uint256 indexed _coreDisputeID, uint256[] _voteIDs, bytes32 _commit);\\n\\n event Contribution(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event Withdrawal(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event ChoiceFunded(uint256 indexed _coreDisputeID, uint256 indexed _coreRoundID, uint256 indexed _choice);\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier notJumped(uint256 _coreDisputeID) {\\n require(!disputes[coreDisputeIDToLocal[_coreDisputeID]].jumped, \\\"Dispute jumped to a parent DK!\\\");\\n _;\\n }\\n\\n /** @dev Constructor.\\n * @param _governor The governor's address.\\n * @param _core The KlerosCore arbitrator.\\n */\\n constructor(address _governor, KlerosCore _core) BaseDisputeKit(_governor, _core) {}\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `core` storage variable.\\n /// @param _core The new value for the `core` storage variable.\\n function changeCore(address _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n /// @param _nbVotes Number of votes for this dispute.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n dispute.extraData = _extraData;\\n\\n // New round in the Core should be created before the dispute creation in DK.\\n dispute.coreRoundIDToLocal[core.getNumberOfRounds(_coreDisputeID) - 1] = dispute.rounds.length;\\n\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = _nbVotes;\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;\\n emit DisputeCreation(_coreDisputeID, _numberOfChoices, _extraData);\\n }\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return drawnAddress The drawn address.\\n function draw(\\n uint256 _coreDisputeID\\n ) external override onlyByCore notJumped(_coreDisputeID) returns (address drawnAddress) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n ISortitionModule sortitionModule = core.sortitionModule();\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n bytes32 key = bytes32(uint256(courtID)); // Get the ID of the tree.\\n\\n // TODO: Handle the situation when no one has staked yet.\\n drawnAddress = sortitionModule.draw(key, _coreDisputeID, round.votes.length);\\n\\n if (_postDrawCheck(_coreDisputeID, drawnAddress)) {\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n } else {\\n drawnAddress = address(0);\\n }\\n }\\n\\n /// @dev Sets the caller's commit for the specified votes. It can be called multiple times during the\\n /// commit period, each call overrides the commits of the previous one.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _commit The commit. Note that justification string is a part of the commit.\\n function castCommit(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.commit, \\\"The dispute should be in Commit period.\\\");\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n emit CommitCast(_coreDisputeID, _voteIDs, _commit);\\n }\\n\\n /// @dev Sets the caller's choices for the specified votes.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _choice The choice.\\n /// @param _salt The salt for the commit if the votes were hidden.\\n /// @param _justification Justification of the choice.\\n function castVote(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt,\\n string memory _justification\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, bool hiddenVotes, , , , , ) = core.courts(courtID);\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes ||\\n round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _justification, _salt)),\\n \\\"The commit must match the choice in courts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n emit Justification(_coreDisputeID, msg.sender, _choice, _justification);\\n }\\n\\n /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n /// Note that the surplus deposit will be reimbursed.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _choice A choice that receives funding.\\n function fundAppeal(uint256 _coreDisputeID, uint256 _choice) external payable notJumped(_coreDisputeID) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n (uint256 ruling, , ) = this.currentRuling(_coreDisputeID);\\n if (ruling == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n uint256 coreRoundID = core.getNumberOfRounds(_coreDisputeID) - 1;\\n\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_coreDisputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_coreDisputeID, coreRoundID, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_coreDisputeID, coreRoundID, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n if (core.isDisputeKitJumping(_coreDisputeID)) {\\n // Don't create a new round in case of a jump, and remove local dispute from the flow.\\n dispute.jumped = true;\\n } else {\\n // Don't subtract 1 from length since both round arrays haven't been updated yet.\\n dispute.coreRoundIDToLocal[coreRoundID + 1] = dispute.rounds.length;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.nbVotes = core.getNumberOfVotes(_coreDisputeID);\\n newRound.tied = true;\\n }\\n core.appeal{value: appealCost}(_coreDisputeID, dispute.numberOfChoices, dispute.extraData);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core contract.\\n /// @param _beneficiary The address whose rewards to withdraw.\\n /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from.\\n /// @param _choice The ruling option that the caller wants to withdraw from.\\n /// @return amount The withdrawn amount.\\n function withdrawFeesAndRewards(\\n uint256 _coreDisputeID,\\n address payable _beneficiary,\\n uint256 _coreRoundID,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n (, , , bool isRuled, ) = core.disputes(_coreDisputeID);\\n require(isRuled, \\\"Dispute should be resolved.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 finalRuling, , ) = core.currentRuling(_coreDisputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);\\n }\\n }\\n\\n /// @dev Submits evidence.\\n /// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\\n function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {\\n emit Evidence(_evidenceGroupID, msg.sender, _evidence);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function getFundedChoices(uint256 _coreDisputeID) public view returns (uint256[] memory fundedChoices) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n return lastRound.fundedChoices;\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(\\n uint256 _coreDisputeID\\n ) external view override returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n tied = round.tied;\\n ruling = tied ? 0 : round.winningChoice;\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n // Override the final ruling if only one side funded the appeals.\\n if (period == KlerosCore.Period.execution) {\\n uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID);\\n if (fundedChoices.length == 1) {\\n ruling = fundedChoices[0];\\n tied = false;\\n overridden = true;\\n }\\n }\\n }\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (vote.voted && (vote.choice == winningChoice || tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage currentRound = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (currentRound.totalVoted == 0 || (!tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalCommitted == round.votes.length;\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalVoted == round.votes.length;\\n }\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view override returns (bool) {\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (uint256 lockedAmountPerJuror, , , , , , , ) = core.getRoundInfo(\\n _coreDisputeID,\\n core.getNumberOfRounds(_coreDisputeID) - 1\\n );\\n (uint256 stakedTokens, uint256 lockedTokens, ) = core.getJurorBalance(_juror, courtID);\\n (, , uint256 minStake, , , , ) = core.courts(courtID);\\n return stakedTokens >= lockedTokens + lockedAmountPerJuror && stakedTokens >= minStake;\\n }\\n}\\n\",\"keccak256\":\"0x5c30f438f9e6cbacbc065ec7a7ad2503a421105491779a02f78cbe78f695b352\",\"license\":\"MIT\"},\"src/evidence/IEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/// @title IEvidence\\ninterface IEvidence {\\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 _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 IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n event Evidence(uint256 indexed _evidenceGroupID, address indexed _party, string _evidence);\\n}\\n\",\"keccak256\":\"0x7f322617ce869516a3b12809e94b8e6254d474c176f44d17601daf9006a1bb32\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162003a5e38038062003a5e83398101604081905262000034916200007f565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055620000be565b6001600160a01b03811681146200007c57600080fd5b50565b600080604083850312156200009357600080fd5b8251620000a08162000066565b6020840151909250620000b38162000066565b809150509250929050565b61399080620000ce6000396000f3fe60806040526004361061016c5760003560e01c8063751accd0116100cc578063b6ede5401161007a578063b6ede540146104ac578063ba66fde7146104cc578063be467604146104ec578063da3beb8c14610502578063e349ad30146103d4578063e4c0aaf414610522578063f2f4eb261461054257600080fd5b8063751accd0146103b4578063796490f9146103d45780637c04034e146103ea5780638e4264601461040a578063a6a7f0eb1461042a578063a7cc08fe1461044a578063b34bfaa81461049657600080fd5b80634b2f0ea0116101295780634b2f0ea0146102965780634fe264fb146102ab578063564a565d146102cb5780635c92e2f6146102fa57806365540b961461031a57806369f3f041146103475780636d4cd8ea1461039457600080fd5b80630baa64d1146101715780630c340a24146101a65780631200aabc146101de5780631c3db16d14610219578063362c3479146102565780633b30414714610276575b600080fd5b34801561017d57600080fd5b5061019161018c366004612d42565b610562565b60405190151581526020015b60405180910390f35b3480156101b257600080fd5b506000546101c6906001600160a01b031681565b6040516001600160a01b03909116815260200161019d565b3480156101ea57600080fd5b5061020b6101f9366004612d42565b60036020526000908152604090205481565b60405190815260200161019d565b34801561022557600080fd5b50610239610234366004612d42565b6105d9565b60408051938452911515602084015215159082015260600161019d565b34801561026257600080fd5b5061020b610271366004612d73565b610747565b34801561028257600080fd5b506101c6610291366004612d42565b610b1d565b6102a96102a4366004612db0565b610e29565b005b3480156102b757600080fd5b5061020b6102c6366004612dd2565b611690565b3480156102d757600080fd5b506102eb6102e6366004612d42565b6117d3565b60405161019d93929190612e4e565b34801561030657600080fd5b506102a9610315366004612ec3565b611899565b34801561032657600080fd5b5061033a610335366004612d42565b611ba4565b60405161019d9190612f15565b34801561035357600080fd5b50610367610362366004612dd2565b611c68565b604080519687529415156020870152938501929092526060840152608083015260a082015260c00161019d565b3480156103a057600080fd5b506101916103af366004612d42565b611d20565b3480156103c057600080fd5b506102a96103cf366004612ff6565b611d97565b3480156103e057600080fd5b5061020b61271081565b3480156103f657600080fd5b506102a9610405366004613062565b611e69565b34801561041657600080fd5b506102a96104253660046130fa565b612541565b34801561043657600080fd5b506102a9610445366004613158565b61258d565b34801561045657600080fd5b5061046a610465366004612dd2565b6125d6565b604080516001600160a01b0390951685526020850193909352918301521515606082015260800161019d565b3480156104a257600080fd5b5061020b614e2081565b3480156104b857600080fd5b506102a96104c73660046131a3565b61269c565b3480156104d857600080fd5b506101916104e7366004612dd2565b61285f565b3480156104f857600080fd5b5061020b61138881565b34801561050e57600080fd5b5061020b61051d366004612db0565b6128fa565b34801561052e57600080fd5b506102a961053d3660046130fa565b612a4d565b34801561054e57600080fd5b506001546101c6906001600160a01b031681565b600081815260036020526040812054600280548392908110610586576105866131fd565b600091825260208220600590910201805490925082906105a890600190613229565b815481106105b8576105b86131fd565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610605576106056131fd565b6000918252602082206005909102018054909250829061062790600190613229565b81548110610637576106376131fd565b60009182526020909120600c90910201600381015460ff169450905083610662578060010154610665565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d89190613268565b50909350600492506106e8915050565b8160048111156106fa576106fa6132cf565b0361073d57600061070a88611ba4565b9050805160010361073b5780600081518110610728576107286131fd565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b99190613268565b509350505050806108115760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610835576108356131fd565b60009182526020808320888452600360059093020191820190526040822054815491935083918110610869576108696131fd565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e891906132e5565b5050600087815260078401602052604090205490915060ff16610932576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610a77565b8086036109a75760008681526006830160205260409020546109555760006109a0565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109969190613321565b6109a09190613338565b9450610a77565b600081815260078301602052604090205460ff16610a775781600601600083600a016001815481106109db576109db6131fd565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a1157610a116131fd565b9060005260206000200154815260200190815260200160002054610a35919061335a565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610a6a9190613321565b610a749190613338565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b11576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b6001546000906001600160a01b03163314610b4a5760405162461bcd60e51b81526004016108089061336d565b600082815260036020526040902054600280548492908110610b6e57610b6e6131fd565b600091825260209091206002600590920201015460ff1615610ba25760405162461bcd60e51b8152600401610808906133b1565b600083815260036020526040812054600280549091908110610bc657610bc66131fd565b60009182526020822060059091020180549092508290610be890600190613229565b81548110610bf857610bf86131fd565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8191906133e8565b60015460405163564a565d60e01b8152600481018990529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610cd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf49190613268565b50508554604051632638506b60e11b81526001600160601b03851660048201819052602482018d90526044820192909252939450926001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8091906133e8565b9650610d8c8888612a99565b15610e1957604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055610e1e565b600096505b505050505050919050565b600082815260036020526040902054600280548492908110610e4d57610e4d6131fd565b600091825260209091206002600590920201015460ff1615610e815760405162461bcd60e51b8152600401610808906133b1565b600083815260036020526040812054600280549091908110610ea557610ea56131fd565b906000526020600020906005020190508060010154831115610f095760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610808565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190613405565b91509150814210158015610f8d57508042105b610fd25760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610808565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015611013573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103791906132e5565b5050905086810361104c5761271091506110cd565b61271061138861105c8686613229565b6110669190613321565b6110709190613338565b61107a8542613229565b106110c75760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610808565b614e2091505b845460009086906110e090600190613229565b815481106110f0576110f06131fd565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa15801561114f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111739190613429565b61117d9190613229565b60008a815260078401602052604090205490915060ff16156111e15760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610808565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f9190613429565b905060006127106112608784613321565b61126a9190613338565b611274908361335a565b60008c8152600686016020526040812054919250908211156113255760008c815260068601602052604090205434906112ad9084613229565b116112d25760008c81526006860160205260409020546112cd9083613229565b6112d4565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161131c929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061135190849061335a565b909155505060008c81526006860160205260408120805483929061137690849061335a565b909155505060008c815260068601602052604090205482116114485760008c8152600686016020526040812054600987018054919290916113b890849061335a565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611653578285600901546114659190613229565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d79190613442565b156114f05760028a01805460ff191660011790556115d3565b895460038b01600061150387600161335a565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161157e91815260200190565b602060405180830381865afa15801561159b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bf9190613429565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161162093929190613497565b6000604051808303818588803b15801561163957600080fd5b505af115801561164d573d6000803e3d6000fd5b50505050505b8034111561168157336108fc6116698334613229565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6000838152600360205260408120546002805483929081106116b4576116b46131fd565b600091825260208083208784526003600590930201918201905260408220548154919350839181106116e8576116e86131fd565b90600052602060002090600c0201600001848154811061170a5761170a6131fd565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178c91906132e5565b506003850154919350915060ff1680156117b0575081836002015414806117b05750805b156117c3576127109450505050506117cc565b60009450505050505b9392505050565b600281815481106117e357600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118169061345d565b80601f01602080910402602001604051908101604052809291908181526020018280546118429061345d565b801561188f5780601f106118645761010080835404028352916020019161188f565b820191906000526020600020905b81548152906001019060200180831161187257829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118bd576118bd6131fd565b600091825260209091206002600590920201015460ff16156118f15760405162461bcd60e51b8152600401610808906133b1565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f9190613268565b509093506001925061196f915050565b816004811115611981576119816132cf565b146119de5760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610808565b82611a1b5760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610808565b600086815260036020526040812054600280549091908110611a3f57611a3f6131fd565b60009182526020822060059091020180549092508290611a6190600190613229565b81548110611a7157611a716131fd565b90600052602060002090600c0201905060005b86811015611b3f573382898984818110611aa057611aa06131fd565b9050602002013581548110611ab757611ab76131fd565b60009182526020909120600490910201546001600160a01b031614611aee5760405162461bcd60e51b815260040161080890613531565b8582898984818110611b0257611b026131fd565b9050602002013581548110611b1957611b196131fd565b600091825260209091206001600490920201015580611b3781613568565b915050611a84565b5086869050816005016000828254611b57919061335a565b92505081905550877f631164ab329e3544c9075658fc5cd19297e0b191060d307414cf10ebc99d4a65888888604051611b9293929190613581565b60405180910390a25050505050505050565b6000818152600360205260408120546002805460609392908110611bca57611bca6131fd565b60009182526020822060059091020180549092508290611bec90600190613229565b81548110611bfc57611bfc6131fd565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c5a57602002820191906000526020600020905b815481526020019060010190808311611c46575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611c9957611c996131fd565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611ccd57611ccd6131fd565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611d4457611d446131fd565b60009182526020822060059091020180549092508290611d6690600190613229565b81548110611d7657611d766131fd565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611dc15760405162461bcd60e51b8152600401610808906135bf565b6000836001600160a01b03168383604051611ddc9190613601565b60006040518083038185875af1925050503d8060008114611e19576040519150601f19603f3d011682016040523d82523d6000602084013e611e1e565b606091505b5050905080611e635760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610808565b50505050565b600086815260036020526040902054600280548892908110611e8d57611e8d6131fd565b600091825260209091206002600590920201015460ff1615611ec15760405162461bcd60e51b8152600401610808906133b1565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f9190613268565b5090935060029250611f3f915050565b816004811115611f5157611f516132cf565b14611fac5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610808565b85611fee5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610808565b600088815260036020526040812054600280549091908110612012576120126131fd565b90600052602060002090600502019050806001015486111561206d5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610808565b8054600090829061208090600190613229565b81548110612090576120906131fd565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa1580156120eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210f9190613268565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e919061361d565b505050505091505060005b8a81101561240b5733848d8d848181106121b5576121b56131fd565b90506020020135815481106121cc576121cc6131fd565b60009182526020909120600490910201546001600160a01b0316146122035760405162461bcd60e51b815260040161080890613531565b811580612277575089888a60405160200161222093929190613687565b60405160208183030381529060405280519060200120846000018d8d8481811061224c5761224c6131fd565b9050602002013581548110612263576122636131fd565b906000526020600020906004020160010154145b6122e95760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610808565b838c8c838181106122fc576122fc6131fd565b9050602002013581548110612313576123136131fd565b600091825260209091206003600490920201015460ff161561236c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610808565b89848d8d84818110612380576123806131fd565b9050602002013581548110612397576123976131fd565b60009182526020909120600260049092020101556001848d8d848181106123c0576123c06131fd565b90506020020135815481106123d7576123d76131fd565b60009182526020909120600490910201600301805460ff19169115159190911790558061240381613568565b915050612199565b508a8a9050836004016000828254612423919061335a565b90915550506000898152600284016020526040812080548c929061244890849061335a565b90915550506001830154890361247757600383015460ff16156124725760038301805460ff191690555b6124f0565b60018301546000908152600284016020526040808220548b8352912054036124b957600383015460ff166124725760038301805460ff191660011790556124f0565b60018301546000908152600284016020526040808220548b835291205411156124f0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fbf654140f91f2e524d875f097947702b44380492730dd1653f5482c0b33e49cd8a60405161252b91906136b4565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461256b5760405162461bcd60e51b8152600401610808906135bf565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516125c99291906136f0565b60405180910390a3505050565b60008060008060006002600360008a81526020019081526020016000205481548110612604576126046131fd565b600091825260208083208a8452600360059093020191820190526040822054815491935083918110612638576126386131fd565b90600052602060002090600c0201600001878154811061265a5761265a6131fd565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146126c65760405162461bcd60e51b81526004016108089061336d565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad20161275185878361375b565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156127a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cc9190613429565b6127d69190613229565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890611b92908a908a908a9061381b565b600083815260036020526040812054600280548392908110612883576128836131fd565b600091825260208083208784526003600590930201918201905260408220548154919350839181106128b7576128b76131fd565b90600052602060002090600c020160000184815481106128d9576128d96131fd565b600091825260209091206004909102016003015460ff169695505050505050565b60008281526003602052604081205460028054839290811061291e5761291e6131fd565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612952576129526131fd565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156129b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d591906132e5565b5091509150826004015460001480612a04575080158015612a0457506000828152600284016020526040902054155b15612a16576000945050505050612a47565b8015612a2b575050600401549150612a479050565b506000908152600290910160205260409020549150612a479050565b92915050565b6000546001600160a01b03163314612a775760405162461bcd60e51b8152600401610808906135bf565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b0b9190613268565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8e9190613429565b612b989190613229565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612bd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c019190810190613835565b5050600154604051631a383be960e31b81526001600160a01b038c811660048301526001600160601b038b166024830152979850600097889750909116945063d1c1df4893506044019150612c539050565b606060405180830381865afa158015612c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c94919061392c565b50600154604051630fad06e960e11b81526001600160601b03881660048201529294509092506000916001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015612cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d13919061361d565b50505050925050508382612d27919061335a565b8310158015612d365750808310155b98975050505050505050565b600060208284031215612d5457600080fd5b5035919050565b6001600160a01b0381168114612d7057600080fd5b50565b60008060008060808587031215612d8957600080fd5b843593506020850135612d9b81612d5b565b93969395505050506040820135916060013590565b60008060408385031215612dc357600080fd5b50508035926020909101359150565b600080600060608486031215612de757600080fd5b505081359360208301359350604090920135919050565b60005b83811015612e19578181015183820152602001612e01565b50506000910152565b60008151808452612e3a816020860160208601612dfe565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000612e6f6060830184612e22565b95945050505050565b60008083601f840112612e8a57600080fd5b5081356001600160401b03811115612ea157600080fd5b6020830191508360208260051b8501011115612ebc57600080fd5b9250929050565b60008060008060608587031215612ed957600080fd5b8435935060208501356001600160401b03811115612ef657600080fd5b612f0287828801612e78565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b81811015612f4d57835183529284019291840191600101612f31565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612f9757612f97612f59565b604052919050565b60006001600160401b03831115612fb857612fb8612f59565b612fcb601f8401601f1916602001612f6f565b9050828152838383011115612fdf57600080fd5b828260208301376000602084830101529392505050565b60008060006060848603121561300b57600080fd5b833561301681612d5b565b92506020840135915060408401356001600160401b0381111561303857600080fd5b8401601f8101861361304957600080fd5b61305886823560208401612f9f565b9150509250925092565b60008060008060008060a0878903121561307b57600080fd5b8635955060208701356001600160401b038082111561309957600080fd5b6130a58a838b01612e78565b9097509550604089013594506060890135935060808901359150808211156130cc57600080fd5b508701601f810189136130de57600080fd5b6130ed89823560208401612f9f565b9150509295509295509295565b60006020828403121561310c57600080fd5b81356117cc81612d5b565b60008083601f84011261312957600080fd5b5081356001600160401b0381111561314057600080fd5b602083019150836020828501011115612ebc57600080fd5b60008060006040848603121561316d57600080fd5b8335925060208401356001600160401b0381111561318a57600080fd5b61319686828701613117565b9497909650939450505050565b6000806000806000608086880312156131bb57600080fd5b853594506020860135935060408601356001600160401b038111156131df57600080fd5b6131eb88828901613117565b96999598509660600135949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612a4757612a47613213565b80516001600160601b038116811461325357600080fd5b919050565b8051801515811461325357600080fd5b600080600080600060a0868803121561328057600080fd5b6132898661323c565b9450602086015161329981612d5b565b6040870151909450600581106132ae57600080fd5b92506132bc60608701613258565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156132fa57600080fd5b8351925061330a60208501613258565b915061331860408501613258565b90509250925092565b8082028115828204841417612a4757612a47613213565b60008261335557634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612a4757612a47613213565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000602082840312156133fa57600080fd5b81516117cc81612d5b565b6000806040838503121561341857600080fd5b505080516020909101519092909150565b60006020828403121561343b57600080fd5b5051919050565b60006020828403121561345457600080fd5b6117cc82613258565b600181811c9082168061347157607f821691505b60208210810361349157634e487b7160e01b600052602260045260246000fd5b50919050565b83815260006020848184015260606040840152600084546134b78161345d565b80606087015260806001808416600081146134d957600181146134f357613521565b60ff1985168984015283151560051b890183019550613521565b896000528660002060005b858110156135195781548b82018601529083019088016134fe565b8a0184019650505b50939a9950505050505050505050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161357a5761357a613213565b5060010190565b6040808252810183905260006001600160fb1b038411156135a157600080fd5b8360051b808660608501376020830193909352500160600192915050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60008251613613818460208701612dfe565b9190910192915050565b600080600080600080600060e0888a03121561363857600080fd5b6136418861323c565b965061364f60208901613258565b955060408801519450606088015193506080880151925060a0880151915061367960c08901613258565b905092959891949750929550565b8381526000835161369f816020850160208801612dfe565b60209201918201929092526040019392505050565b6020815260006117cc6020830184612e22565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006137046020830184866136c7565b949350505050565b601f82111561375657600081815260208120601f850160051c810160208610156137335750805b601f850160051c820191505b818110156137525782815560010161373f565b5050505b505050565b6001600160401b0383111561377257613772612f59565b61378683613780835461345d565b8361370c565b6000601f8411600181146137ba57600085156137a25750838201355b600019600387901b1c1916600186901b178355613814565b600083815260209020601f19861690835b828110156137eb57868501358255602094850194600190920191016137cb565b50868210156138085760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b838152604060208201526000612e6f6040830184866136c7565b600080600080600080600080610100898b03121561385257600080fd5b885197506020808a0151975060408a0151965060608a0151955060808a01516001600160401b038082111561388657600080fd5b818c0191508c601f83011261389a57600080fd5b8151818111156138ac576138ac612f59565b8060051b91506138bd848301612f6f565b818152918301840191848101908f8411156138d757600080fd5b938501935b8385101561390157845192506138f183612d5b565b82825293850193908501906138dc565b80995050505050505060a0890151925060c0890151915060e089015190509295985092959890939650565b60008060006060848603121561394157600080fd5b835192506020840151915060408401519050925092509256fea26469706673582212206dd2f7be9167160cf1a9082e6b8f8c4f004160397675c896b5346d4d397d986964736f6c63430008120033", - "deployedBytecode": "0x60806040526004361061016c5760003560e01c8063751accd0116100cc578063b6ede5401161007a578063b6ede540146104ac578063ba66fde7146104cc578063be467604146104ec578063da3beb8c14610502578063e349ad30146103d4578063e4c0aaf414610522578063f2f4eb261461054257600080fd5b8063751accd0146103b4578063796490f9146103d45780637c04034e146103ea5780638e4264601461040a578063a6a7f0eb1461042a578063a7cc08fe1461044a578063b34bfaa81461049657600080fd5b80634b2f0ea0116101295780634b2f0ea0146102965780634fe264fb146102ab578063564a565d146102cb5780635c92e2f6146102fa57806365540b961461031a57806369f3f041146103475780636d4cd8ea1461039457600080fd5b80630baa64d1146101715780630c340a24146101a65780631200aabc146101de5780631c3db16d14610219578063362c3479146102565780633b30414714610276575b600080fd5b34801561017d57600080fd5b5061019161018c366004612d42565b610562565b60405190151581526020015b60405180910390f35b3480156101b257600080fd5b506000546101c6906001600160a01b031681565b6040516001600160a01b03909116815260200161019d565b3480156101ea57600080fd5b5061020b6101f9366004612d42565b60036020526000908152604090205481565b60405190815260200161019d565b34801561022557600080fd5b50610239610234366004612d42565b6105d9565b60408051938452911515602084015215159082015260600161019d565b34801561026257600080fd5b5061020b610271366004612d73565b610747565b34801561028257600080fd5b506101c6610291366004612d42565b610b1d565b6102a96102a4366004612db0565b610e29565b005b3480156102b757600080fd5b5061020b6102c6366004612dd2565b611690565b3480156102d757600080fd5b506102eb6102e6366004612d42565b6117d3565b60405161019d93929190612e4e565b34801561030657600080fd5b506102a9610315366004612ec3565b611899565b34801561032657600080fd5b5061033a610335366004612d42565b611ba4565b60405161019d9190612f15565b34801561035357600080fd5b50610367610362366004612dd2565b611c68565b604080519687529415156020870152938501929092526060840152608083015260a082015260c00161019d565b3480156103a057600080fd5b506101916103af366004612d42565b611d20565b3480156103c057600080fd5b506102a96103cf366004612ff6565b611d97565b3480156103e057600080fd5b5061020b61271081565b3480156103f657600080fd5b506102a9610405366004613062565b611e69565b34801561041657600080fd5b506102a96104253660046130fa565b612541565b34801561043657600080fd5b506102a9610445366004613158565b61258d565b34801561045657600080fd5b5061046a610465366004612dd2565b6125d6565b604080516001600160a01b0390951685526020850193909352918301521515606082015260800161019d565b3480156104a257600080fd5b5061020b614e2081565b3480156104b857600080fd5b506102a96104c73660046131a3565b61269c565b3480156104d857600080fd5b506101916104e7366004612dd2565b61285f565b3480156104f857600080fd5b5061020b61138881565b34801561050e57600080fd5b5061020b61051d366004612db0565b6128fa565b34801561052e57600080fd5b506102a961053d3660046130fa565b612a4d565b34801561054e57600080fd5b506001546101c6906001600160a01b031681565b600081815260036020526040812054600280548392908110610586576105866131fd565b600091825260208220600590910201805490925082906105a890600190613229565b815481106105b8576105b86131fd565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610605576106056131fd565b6000918252602082206005909102018054909250829061062790600190613229565b81548110610637576106376131fd565b60009182526020909120600c90910201600381015460ff169450905083610662578060010154610665565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d89190613268565b50909350600492506106e8915050565b8160048111156106fa576106fa6132cf565b0361073d57600061070a88611ba4565b9050805160010361073b5780600081518110610728576107286131fd565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b99190613268565b509350505050806108115760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610835576108356131fd565b60009182526020808320888452600360059093020191820190526040822054815491935083918110610869576108696131fd565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e891906132e5565b5050600087815260078401602052604090205490915060ff16610932576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610a77565b8086036109a75760008681526006830160205260409020546109555760006109a0565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109969190613321565b6109a09190613338565b9450610a77565b600081815260078301602052604090205460ff16610a775781600601600083600a016001815481106109db576109db6131fd565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a1157610a116131fd565b9060005260206000200154815260200190815260200160002054610a35919061335a565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610a6a9190613321565b610a749190613338565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b11576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b6001546000906001600160a01b03163314610b4a5760405162461bcd60e51b81526004016108089061336d565b600082815260036020526040902054600280548492908110610b6e57610b6e6131fd565b600091825260209091206002600590920201015460ff1615610ba25760405162461bcd60e51b8152600401610808906133b1565b600083815260036020526040812054600280549091908110610bc657610bc66131fd565b60009182526020822060059091020180549092508290610be890600190613229565b81548110610bf857610bf86131fd565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8191906133e8565b60015460405163564a565d60e01b8152600481018990529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610cd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf49190613268565b50508554604051632638506b60e11b81526001600160601b03851660048201819052602482018d90526044820192909252939450926001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8091906133e8565b9650610d8c8888612a99565b15610e1957604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055610e1e565b600096505b505050505050919050565b600082815260036020526040902054600280548492908110610e4d57610e4d6131fd565b600091825260209091206002600590920201015460ff1615610e815760405162461bcd60e51b8152600401610808906133b1565b600083815260036020526040812054600280549091908110610ea557610ea56131fd565b906000526020600020906005020190508060010154831115610f095760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610808565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190613405565b91509150814210158015610f8d57508042105b610fd25760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610808565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015611013573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103791906132e5565b5050905086810361104c5761271091506110cd565b61271061138861105c8686613229565b6110669190613321565b6110709190613338565b61107a8542613229565b106110c75760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610808565b614e2091505b845460009086906110e090600190613229565b815481106110f0576110f06131fd565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa15801561114f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111739190613429565b61117d9190613229565b60008a815260078401602052604090205490915060ff16156111e15760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610808565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f9190613429565b905060006127106112608784613321565b61126a9190613338565b611274908361335a565b60008c8152600686016020526040812054919250908211156113255760008c815260068601602052604090205434906112ad9084613229565b116112d25760008c81526006860160205260409020546112cd9083613229565b6112d4565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161131c929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061135190849061335a565b909155505060008c81526006860160205260408120805483929061137690849061335a565b909155505060008c815260068601602052604090205482116114485760008c8152600686016020526040812054600987018054919290916113b890849061335a565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611653578285600901546114659190613229565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d79190613442565b156114f05760028a01805460ff191660011790556115d3565b895460038b01600061150387600161335a565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161157e91815260200190565b602060405180830381865afa15801561159b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bf9190613429565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161162093929190613497565b6000604051808303818588803b15801561163957600080fd5b505af115801561164d573d6000803e3d6000fd5b50505050505b8034111561168157336108fc6116698334613229565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6000838152600360205260408120546002805483929081106116b4576116b46131fd565b600091825260208083208784526003600590930201918201905260408220548154919350839181106116e8576116e86131fd565b90600052602060002090600c0201600001848154811061170a5761170a6131fd565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178c91906132e5565b506003850154919350915060ff1680156117b0575081836002015414806117b05750805b156117c3576127109450505050506117cc565b60009450505050505b9392505050565b600281815481106117e357600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118169061345d565b80601f01602080910402602001604051908101604052809291908181526020018280546118429061345d565b801561188f5780601f106118645761010080835404028352916020019161188f565b820191906000526020600020905b81548152906001019060200180831161187257829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118bd576118bd6131fd565b600091825260209091206002600590920201015460ff16156118f15760405162461bcd60e51b8152600401610808906133b1565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f9190613268565b509093506001925061196f915050565b816004811115611981576119816132cf565b146119de5760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610808565b82611a1b5760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610808565b600086815260036020526040812054600280549091908110611a3f57611a3f6131fd565b60009182526020822060059091020180549092508290611a6190600190613229565b81548110611a7157611a716131fd565b90600052602060002090600c0201905060005b86811015611b3f573382898984818110611aa057611aa06131fd565b9050602002013581548110611ab757611ab76131fd565b60009182526020909120600490910201546001600160a01b031614611aee5760405162461bcd60e51b815260040161080890613531565b8582898984818110611b0257611b026131fd565b9050602002013581548110611b1957611b196131fd565b600091825260209091206001600490920201015580611b3781613568565b915050611a84565b5086869050816005016000828254611b57919061335a565b92505081905550877f631164ab329e3544c9075658fc5cd19297e0b191060d307414cf10ebc99d4a65888888604051611b9293929190613581565b60405180910390a25050505050505050565b6000818152600360205260408120546002805460609392908110611bca57611bca6131fd565b60009182526020822060059091020180549092508290611bec90600190613229565b81548110611bfc57611bfc6131fd565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c5a57602002820191906000526020600020905b815481526020019060010190808311611c46575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611c9957611c996131fd565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611ccd57611ccd6131fd565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611d4457611d446131fd565b60009182526020822060059091020180549092508290611d6690600190613229565b81548110611d7657611d766131fd565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611dc15760405162461bcd60e51b8152600401610808906135bf565b6000836001600160a01b03168383604051611ddc9190613601565b60006040518083038185875af1925050503d8060008114611e19576040519150601f19603f3d011682016040523d82523d6000602084013e611e1e565b606091505b5050905080611e635760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610808565b50505050565b600086815260036020526040902054600280548892908110611e8d57611e8d6131fd565b600091825260209091206002600590920201015460ff1615611ec15760405162461bcd60e51b8152600401610808906133b1565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f9190613268565b5090935060029250611f3f915050565b816004811115611f5157611f516132cf565b14611fac5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610808565b85611fee5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610808565b600088815260036020526040812054600280549091908110612012576120126131fd565b90600052602060002090600502019050806001015486111561206d5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610808565b8054600090829061208090600190613229565b81548110612090576120906131fd565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa1580156120eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210f9190613268565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e919061361d565b505050505091505060005b8a81101561240b5733848d8d848181106121b5576121b56131fd565b90506020020135815481106121cc576121cc6131fd565b60009182526020909120600490910201546001600160a01b0316146122035760405162461bcd60e51b815260040161080890613531565b811580612277575089888a60405160200161222093929190613687565b60405160208183030381529060405280519060200120846000018d8d8481811061224c5761224c6131fd565b9050602002013581548110612263576122636131fd565b906000526020600020906004020160010154145b6122e95760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610808565b838c8c838181106122fc576122fc6131fd565b9050602002013581548110612313576123136131fd565b600091825260209091206003600490920201015460ff161561236c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610808565b89848d8d84818110612380576123806131fd565b9050602002013581548110612397576123976131fd565b60009182526020909120600260049092020101556001848d8d848181106123c0576123c06131fd565b90506020020135815481106123d7576123d76131fd565b60009182526020909120600490910201600301805460ff19169115159190911790558061240381613568565b915050612199565b508a8a9050836004016000828254612423919061335a565b90915550506000898152600284016020526040812080548c929061244890849061335a565b90915550506001830154890361247757600383015460ff16156124725760038301805460ff191690555b6124f0565b60018301546000908152600284016020526040808220548b8352912054036124b957600383015460ff166124725760038301805460ff191660011790556124f0565b60018301546000908152600284016020526040808220548b835291205411156124f0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fbf654140f91f2e524d875f097947702b44380492730dd1653f5482c0b33e49cd8a60405161252b91906136b4565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461256b5760405162461bcd60e51b8152600401610808906135bf565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516125c99291906136f0565b60405180910390a3505050565b60008060008060006002600360008a81526020019081526020016000205481548110612604576126046131fd565b600091825260208083208a8452600360059093020191820190526040822054815491935083918110612638576126386131fd565b90600052602060002090600c0201600001878154811061265a5761265a6131fd565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146126c65760405162461bcd60e51b81526004016108089061336d565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad20161275185878361375b565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156127a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cc9190613429565b6127d69190613229565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890611b92908a908a908a9061381b565b600083815260036020526040812054600280548392908110612883576128836131fd565b600091825260208083208784526003600590930201918201905260408220548154919350839181106128b7576128b76131fd565b90600052602060002090600c020160000184815481106128d9576128d96131fd565b600091825260209091206004909102016003015460ff169695505050505050565b60008281526003602052604081205460028054839290811061291e5761291e6131fd565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612952576129526131fd565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156129b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d591906132e5565b5091509150826004015460001480612a04575080158015612a0457506000828152600284016020526040902054155b15612a16576000945050505050612a47565b8015612a2b575050600401549150612a479050565b506000908152600290910160205260409020549150612a479050565b92915050565b6000546001600160a01b03163314612a775760405162461bcd60e51b8152600401610808906135bf565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b0b9190613268565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8e9190613429565b612b989190613229565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612bd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c019190810190613835565b5050600154604051631a383be960e31b81526001600160a01b038c811660048301526001600160601b038b166024830152979850600097889750909116945063d1c1df4893506044019150612c539050565b606060405180830381865afa158015612c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c94919061392c565b50600154604051630fad06e960e11b81526001600160601b03881660048201529294509092506000916001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015612cef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d13919061361d565b50505050925050508382612d27919061335a565b8310158015612d365750808310155b98975050505050505050565b600060208284031215612d5457600080fd5b5035919050565b6001600160a01b0381168114612d7057600080fd5b50565b60008060008060808587031215612d8957600080fd5b843593506020850135612d9b81612d5b565b93969395505050506040820135916060013590565b60008060408385031215612dc357600080fd5b50508035926020909101359150565b600080600060608486031215612de757600080fd5b505081359360208301359350604090920135919050565b60005b83811015612e19578181015183820152602001612e01565b50506000910152565b60008151808452612e3a816020860160208601612dfe565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000612e6f6060830184612e22565b95945050505050565b60008083601f840112612e8a57600080fd5b5081356001600160401b03811115612ea157600080fd5b6020830191508360208260051b8501011115612ebc57600080fd5b9250929050565b60008060008060608587031215612ed957600080fd5b8435935060208501356001600160401b03811115612ef657600080fd5b612f0287828801612e78565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b81811015612f4d57835183529284019291840191600101612f31565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612f9757612f97612f59565b604052919050565b60006001600160401b03831115612fb857612fb8612f59565b612fcb601f8401601f1916602001612f6f565b9050828152838383011115612fdf57600080fd5b828260208301376000602084830101529392505050565b60008060006060848603121561300b57600080fd5b833561301681612d5b565b92506020840135915060408401356001600160401b0381111561303857600080fd5b8401601f8101861361304957600080fd5b61305886823560208401612f9f565b9150509250925092565b60008060008060008060a0878903121561307b57600080fd5b8635955060208701356001600160401b038082111561309957600080fd5b6130a58a838b01612e78565b9097509550604089013594506060890135935060808901359150808211156130cc57600080fd5b508701601f810189136130de57600080fd5b6130ed89823560208401612f9f565b9150509295509295509295565b60006020828403121561310c57600080fd5b81356117cc81612d5b565b60008083601f84011261312957600080fd5b5081356001600160401b0381111561314057600080fd5b602083019150836020828501011115612ebc57600080fd5b60008060006040848603121561316d57600080fd5b8335925060208401356001600160401b0381111561318a57600080fd5b61319686828701613117565b9497909650939450505050565b6000806000806000608086880312156131bb57600080fd5b853594506020860135935060408601356001600160401b038111156131df57600080fd5b6131eb88828901613117565b96999598509660600135949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612a4757612a47613213565b80516001600160601b038116811461325357600080fd5b919050565b8051801515811461325357600080fd5b600080600080600060a0868803121561328057600080fd5b6132898661323c565b9450602086015161329981612d5b565b6040870151909450600581106132ae57600080fd5b92506132bc60608701613258565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156132fa57600080fd5b8351925061330a60208501613258565b915061331860408501613258565b90509250925092565b8082028115828204841417612a4757612a47613213565b60008261335557634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612a4757612a47613213565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000602082840312156133fa57600080fd5b81516117cc81612d5b565b6000806040838503121561341857600080fd5b505080516020909101519092909150565b60006020828403121561343b57600080fd5b5051919050565b60006020828403121561345457600080fd5b6117cc82613258565b600181811c9082168061347157607f821691505b60208210810361349157634e487b7160e01b600052602260045260246000fd5b50919050565b83815260006020848184015260606040840152600084546134b78161345d565b80606087015260806001808416600081146134d957600181146134f357613521565b60ff1985168984015283151560051b890183019550613521565b896000528660002060005b858110156135195781548b82018601529083019088016134fe565b8a0184019650505b50939a9950505050505050505050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161357a5761357a613213565b5060010190565b6040808252810183905260006001600160fb1b038411156135a157600080fd5b8360051b808660608501376020830193909352500160600192915050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60008251613613818460208701612dfe565b9190910192915050565b600080600080600080600060e0888a03121561363857600080fd5b6136418861323c565b965061364f60208901613258565b955060408801519450606088015193506080880151925060a0880151915061367960c08901613258565b905092959891949750929550565b8381526000835161369f816020850160208801612dfe565b60209201918201929092526040019392505050565b6020815260006117cc6020830184612e22565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006137046020830184866136c7565b949350505050565b601f82111561375657600081815260208120601f850160051c810160208610156137335750805b601f850160051c820191505b818110156137525782815560010161373f565b5050505b505050565b6001600160401b0383111561377257613772612f59565b61378683613780835461345d565b8361370c565b6000601f8411600181146137ba57600085156137a25750838201355b600019600387901b1c1916600186901b178355613814565b600083815260209020601f19861690835b828110156137eb57868501358255602094850194600190920191016137cb565b50868210156138085760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b838152604060208201526000612e6f6040830184866136c7565b600080600080600080600080610100898b03121561385257600080fd5b885197506020808a0151975060408a0151965060608a0151955060808a01516001600160401b038082111561388657600080fd5b818c0191508c601f83011261389a57600080fd5b8151818111156138ac576138ac612f59565b8060051b91506138bd848301612f6f565b818152918301840191848101908f8411156138d757600080fd5b938501935b8385101561390157845192506138f183612d5b565b82825293850193908501906138dc565b80995050505050505060a0890151925060c0890151915060e089015190509295985092959890939650565b60008060006060848603121561394157600080fd5b835192506020840151915060408401519050925092509256fea26469706673582212206dd2f7be9167160cf1a9082e6b8f8c4f004160397675c896b5346d4d397d986964736f6c63430008120033", + "numDeployments": 3, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"CommitCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"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\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"Justification\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areCommitsAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areVotesAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_nbVotes\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"jumped\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"getFundedChoices\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"fundedChoices\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Evidence(uint256,address,string)\":{\"details\":\"To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\",\"_party\":\"The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\"}},\"Justification(uint256,address,uint256,string)\":{\"details\":\"Emitted when casting a vote to provide the justification of juror's choice.\",\"params\":{\"_choice\":\"The choice juror voted for.\",\"_coreDisputeID\":\"ID of the dispute in the core contract.\",\"_juror\":\"Address of the juror.\",\"_justification\":\"Justification of the choice.\"}}},\"kind\":\"dev\",\"methods\":{\"areCommitsAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their commits for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their commits for the last round.\"}},\"areVotesAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their votes for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their votes for the last round.\"}},\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit. Note that justification string is a part of the commit.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256,string)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_justification\":\"Justification of the choice.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\"}},\"createDispute(uint256,uint256,bytes,uint256)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_nbVotes\":\"Number of votes for this dispute.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"submitEvidence(uint256,string)\":{\"details\":\"Submits evidence for a dispute.\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\"}},\"withdrawFeesAndRewards(uint256,address,uint256,uint256)\":{\"details\":\"Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core contract.\",\"_coreRoundID\":\"The round in the Kleros Core contract the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggreation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"../libraries/SafeERC20.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n mapping(uint96 => uint256) stakedPnk; // The amount of PNKs the juror has staked in the court in the form `stakedPnk[courtID]`.\\n mapping(uint96 => uint256) lockedPnk; // The amount of PNKs the juror has locked in the court in the form `lockedPnk[courtID]`.\\n }\\n\\n struct DisputeKitNode {\\n uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root.\\n uint256[] children; // List of child dispute kits.\\n IDisputeKit disputeKit; // The dispute kit implementation.\\n uint256 depthLevel; // How far this DK is from the root. 0 for root DK.\\n bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n // TODO: interactions with jurorProsecutionModule.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID.\\n Dispute[] public disputes; // The disputes.\\n mapping(address => Juror) internal jurors; // The jurors.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty);\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(\\n uint256 indexed _disputeKitID,\\n IDisputeKit indexed _disputeKitAddress,\\n uint256 indexed _parent\\n );\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent.\\n disputeKitNodes.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: NULL_DISPUTE_KIT,\\n children: new uint256[](0),\\n disputeKit: _disputeKit,\\n depthLevel: 0,\\n disabled: false\\n })\\n );\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit, NULL_DISPUTE_KIT);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created.\\n /// Note that the root DK must be supported by the general court.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor {\\n uint256 disputeKitID = disputeKitNodes.length;\\n if (_parent >= disputeKitID) revert InvalidDisputKitParent();\\n uint256 depthLevel;\\n if (_parent != NULL_DISPUTE_KIT) {\\n depthLevel = disputeKitNodes[_parent].depthLevel + 1;\\n // It should be always possible to reach the root from the leaf with the defined number of search iterations.\\n if (depthLevel >= SEARCH_ITERATIONS) revert DepthLevelMax();\\n }\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: _parent,\\n children: new uint256[](0),\\n disputeKit: _disputeKitAddress,\\n depthLevel: depthLevel,\\n disabled: false\\n })\\n );\\n\\n disputeKitNodes[_parent].children.push(disputeKitID);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent);\\n if (_parent == NULL_DISPUTE_KIT) {\\n // A new dispute kit tree root should always be supported by the General court.\\n _enableDisputeKit(GENERAL_COURT, disputeKitID, true);\\n }\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKitNodes.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n if (_courtID != GENERAL_COURT && courts[courts[_courtID].parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < courts[_courtID].children.length; i++) {\\n if (courts[courts[_courtID].children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n courts[_courtID].minStake = _minStake;\\n courts[_courtID].hiddenVotes = _hiddenVotes;\\n courts[_courtID].alpha = _alpha;\\n courts[_courtID].feeForJuror = _feeForJuror;\\n courts[_courtID].jurorsForCourtJump = _jurorsForCourtJump;\\n courts[_courtID].timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKitNodes.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n if (_courtID == GENERAL_COURT && disputeKitNodes[_disputeKitIDs[i]].parent == NULL_DISPUTE_KIT) {\\n revert CannotDisableRootDKInGeneral();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n CurrencyRate storage rate = currencyRates[_feeToken];\\n rate.rateInEth = _rateInEth;\\n rate.rateDecimals = _rateDecimals;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n function setStake(uint96 _courtID, uint256 _stake) external {\\n if (!_setStakeForAccount(msg.sender, _courtID, _stake, 0)) revert StakingFailed();\\n }\\n\\n function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _stake, uint256 _penalty) external {\\n if (msg.sender != address(sortitionModule)) revert WrongCaller();\\n _setStakeForAccount(_account, _courtID, _stake, _penalty);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n require(_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount), \\\"Transfer failed\\\");\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit;\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= round.nbVotes ? startIndex + _iterations : round.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n jurors[drawnAddress].lockedPnk[dispute.courtID] += round.pnkAtStakePerJuror;\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n }\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKitNodes[round.disputeKitID].disputeKit)) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) {\\n if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n break;\\n } else if (disputeKitNodes[newDisputeKitID].parent != NULL_DISPUTE_KIT) {\\n newDisputeKitID = disputeKitNodes[newDisputeKitID].parent;\\n } else {\\n // DK's parent has 0 index, that means we reached the root DK (0 depth level).\\n // Jump to the next parent court if the current court doesn't support any DK from this tree.\\n // Note that we don't reset newDisputeKitID in this case as, a precaution.\\n newCourtID = courts[newCourtID].parent;\\n }\\n }\\n // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court.\\n // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default.\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n newCourtID = GENERAL_COURT;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n IDisputeKit disputeKit = disputeKitNodes[extraRound.disputeKitID].disputeKit;\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKit.createDispute(_disputeID, _numberOfChoices, _extraData, extraRound.nbVotes);\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n jurors[account].lockedPnk[dispute.courtID] -= penalty;\\n\\n // Apply the penalty to the staked PNKs\\n if (jurors[account].stakedPnk[dispute.courtID] >= courts[dispute.courtID].minStake + penalty) {\\n // The juror still has enough staked PNKs after penalty for this court.\\n uint256 newStake = jurors[account].stakedPnk[dispute.courtID] - penalty;\\n _setStakeForAccount(account, dispute.courtID, newStake, penalty);\\n } else if (jurors[account].stakedPnk[dispute.courtID] != 0) {\\n // The juror does not have enough staked PNKs after penalty for this court, unstake them.\\n _setStakeForAccount(account, dispute.courtID, 0, penalty);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n // TODO Change me\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n jurors[account].lockedPnk[dispute.courtID] -= pnkLocked;\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (jurors[account].stakedPnk[dispute.courtID] == 0) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round\\n )\\n external\\n view\\n returns (\\n uint256 disputeKitID,\\n uint256 pnkAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 nbVotes,\\n uint256 repartitions,\\n uint256 pnkPenalties,\\n address[] memory drawnJurors,\\n uint256 sumFeeRewardPaid,\\n uint256 sumPnkRewardPaid,\\n IERC20 feeToken\\n )\\n {\\n Round storage round = disputes[_disputeID].rounds[_round];\\n return (\\n round.disputeKitID,\\n round.pnkAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.nbVotes,\\n round.repartitions,\\n round.pnkPenalties,\\n round.drawnJurors,\\n round.sumFeeRewardPaid,\\n round.sumPnkRewardPaid,\\n round.feeToken\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 staked, uint256 locked, uint256 nbCourts) {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedPnk[_courtID];\\n locked = juror.lockedPnk[_courtID];\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets non-primitive properties of a specified dispute kit node.\\n /// @param _disputeKitID The ID of the dispute kit.\\n /// @return children Indexes of children of this DK.\\n function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) {\\n return disputeKitNodes[_disputeKitID].children;\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_courtID];\\n timesPerPeriod = court.timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitNodesLength() external view returns (uint256) {\\n return disputeKitNodes.length;\\n }\\n\\n /// @dev Gets the dispute kit for a specific `_disputeKitID`.\\n /// @param _disputeKitID The ID of the dispute kit.\\n function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) {\\n return disputeKitNodes[_disputeKitID].disputeKit;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n CurrencyRate storage rate = currencyRates[_toToken];\\n return (_amountInEth * 10 ** rate.rateDecimals) / rate.rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n /// @param _penalty Penalized amount won't be transferred back to juror when the stake is lowered.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function _setStakeForAccount(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) return false;\\n\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = juror.stakedPnk[_courtID];\\n\\n if (_stake != 0) {\\n // Check against locked PNKs in case the min stake was lowered.\\n if (_stake < courts[_courtID].minStake || _stake < juror.lockedPnk[_courtID]) return false;\\n }\\n\\n ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _stake, _penalty);\\n if (result == ISortitionModule.preStakeHookResult.failed) {\\n return false;\\n } else if (result == ISortitionModule.preStakeHookResult.delayed) {\\n emit StakeDelayed(_account, _courtID, _stake, _penalty);\\n return true;\\n }\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (pinakion.safeTransferFrom(_account, address(this), transferredAmount)) {\\n if (currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n if (_stake == 0) {\\n // Keep locked PNKs in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedPnk[_courtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (pinakion.safeTransfer(_account, transferredAmount)) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!pinakion.safeTransfer(_account, transferredAmount)) {\\n return false;\\n }\\n }\\n }\\n }\\n\\n // Update juror's records.\\n juror.stakedPnk[_courtID] = _stake;\\n\\n sortitionModule.setStake(_account, _courtID, _stake);\\n emit StakeSet(_account, _courtID, _stake);\\n return true;\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableRootDKInGeneral();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error WrongCaller();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error DisputeKitOnly();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n}\\n\",\"keccak256\":\"0xe57e56a2886c61842b0ab35e8e8b54eac1d1213fa002c8f263305b80d3f702bf\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/BaseDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../interfaces/IDisputeKit.sol\\\";\\nimport \\\"../KlerosCore.sol\\\";\\n\\n/// @title BaseDisputeKit\\n/// Provides common basic behaviours to the Dispute Kit implementations.\\nabstract contract BaseDisputeKit is IDisputeKit {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _core The KlerosCore arbitrator.\\n constructor(address _governor, KlerosCore _core) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal virtual returns (bool);\\n}\\n\",\"keccak256\":\"0xa33f365553132a9cc4f0b5fdfe9e5be2337d13dfca71a65835450de17496b93f\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./BaseDisputeKit.sol\\\";\\nimport \\\"../interfaces/IEvidence.sol\\\";\\n\\n/// @title DisputeKitClassic\\n/// Dispute kit implementation of the Kleros v1 features including:\\n/// - a drawing system: proportional to staked PNK,\\n/// - a vote aggreation system: plurality,\\n/// - an incentive system: equal split between coherent votes,\\n/// - an appeal system: fund 2 choices only, vote on any choice.\\ncontract DisputeKitClassic is BaseDisputeKit, IEvidence {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n bool jumped; // True if dispute jumped to a parent dispute kit and won't be handled by this DK anymore.\\n mapping(uint256 => uint256) coreRoundIDToLocal; // Maps id of the round in the core contract to the index of the round of related local dispute.\\n bytes extraData; // Extradata for the dispute.\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n uint256 nbVotes; // Maximal number of votes this dispute can get.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n Dispute[] public disputes; // Array of the locally created disputes.\\n mapping(uint256 => uint256) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event DisputeCreation(uint256 indexed _coreDisputeID, uint256 _numberOfChoices, bytes _extraData);\\n\\n event CommitCast(uint256 indexed _coreDisputeID, uint256[] _voteIDs, bytes32 _commit);\\n\\n event Contribution(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event Withdrawal(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event ChoiceFunded(uint256 indexed _coreDisputeID, uint256 indexed _coreRoundID, uint256 indexed _choice);\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier notJumped(uint256 _coreDisputeID) {\\n require(!disputes[coreDisputeIDToLocal[_coreDisputeID]].jumped, \\\"Dispute jumped to a parent DK!\\\");\\n _;\\n }\\n\\n /** @dev Constructor.\\n * @param _governor The governor's address.\\n * @param _core The KlerosCore arbitrator.\\n */\\n constructor(address _governor, KlerosCore _core) BaseDisputeKit(_governor, _core) {}\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `core` storage variable.\\n /// @param _core The new value for the `core` storage variable.\\n function changeCore(address _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n /// @param _nbVotes Number of votes for this dispute.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n dispute.extraData = _extraData;\\n\\n // New round in the Core should be created before the dispute creation in DK.\\n dispute.coreRoundIDToLocal[core.getNumberOfRounds(_coreDisputeID) - 1] = dispute.rounds.length;\\n\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = _nbVotes;\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;\\n emit DisputeCreation(_coreDisputeID, _numberOfChoices, _extraData);\\n }\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return drawnAddress The drawn address.\\n function draw(\\n uint256 _coreDisputeID\\n ) external override onlyByCore notJumped(_coreDisputeID) returns (address drawnAddress) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n ISortitionModule sortitionModule = core.sortitionModule();\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n bytes32 key = bytes32(uint256(courtID)); // Get the ID of the tree.\\n\\n // TODO: Handle the situation when no one has staked yet.\\n drawnAddress = sortitionModule.draw(key, _coreDisputeID, round.votes.length);\\n\\n if (_postDrawCheck(_coreDisputeID, drawnAddress)) {\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n } else {\\n drawnAddress = address(0);\\n }\\n }\\n\\n /// @dev Sets the caller's commit for the specified votes. It can be called multiple times during the\\n /// commit period, each call overrides the commits of the previous one.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _commit The commit. Note that justification string is a part of the commit.\\n function castCommit(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.commit, \\\"The dispute should be in Commit period.\\\");\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n emit CommitCast(_coreDisputeID, _voteIDs, _commit);\\n }\\n\\n /// @dev Sets the caller's choices for the specified votes.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _choice The choice.\\n /// @param _salt The salt for the commit if the votes were hidden.\\n /// @param _justification Justification of the choice.\\n function castVote(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt,\\n string memory _justification\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, bool hiddenVotes, , , , , ) = core.courts(courtID);\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes ||\\n round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _justification, _salt)),\\n \\\"The commit must match the choice in courts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n emit Justification(_coreDisputeID, msg.sender, _choice, _justification);\\n }\\n\\n /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n /// Note that the surplus deposit will be reimbursed.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _choice A choice that receives funding.\\n function fundAppeal(uint256 _coreDisputeID, uint256 _choice) external payable notJumped(_coreDisputeID) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n (uint256 ruling, , ) = this.currentRuling(_coreDisputeID);\\n if (ruling == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n uint256 coreRoundID = core.getNumberOfRounds(_coreDisputeID) - 1;\\n\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_coreDisputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_coreDisputeID, coreRoundID, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_coreDisputeID, coreRoundID, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n if (core.isDisputeKitJumping(_coreDisputeID)) {\\n // Don't create a new round in case of a jump, and remove local dispute from the flow.\\n dispute.jumped = true;\\n } else {\\n // Don't subtract 1 from length since both round arrays haven't been updated yet.\\n dispute.coreRoundIDToLocal[coreRoundID + 1] = dispute.rounds.length;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.nbVotes = core.getNumberOfVotes(_coreDisputeID);\\n newRound.tied = true;\\n }\\n core.appeal{value: appealCost}(_coreDisputeID, dispute.numberOfChoices, dispute.extraData);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core contract.\\n /// @param _beneficiary The address whose rewards to withdraw.\\n /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from.\\n /// @param _choice The ruling option that the caller wants to withdraw from.\\n /// @return amount The withdrawn amount.\\n function withdrawFeesAndRewards(\\n uint256 _coreDisputeID,\\n address payable _beneficiary,\\n uint256 _coreRoundID,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n (, , , bool isRuled, ) = core.disputes(_coreDisputeID);\\n require(isRuled, \\\"Dispute should be resolved.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 finalRuling, , ) = core.currentRuling(_coreDisputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);\\n }\\n }\\n\\n /// @dev Submits evidence for a dispute.\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\\n function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {\\n emit Evidence(_externalDisputeID, msg.sender, _evidence);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function getFundedChoices(uint256 _coreDisputeID) public view returns (uint256[] memory fundedChoices) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n return lastRound.fundedChoices;\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(\\n uint256 _coreDisputeID\\n ) external view override returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n tied = round.tied;\\n ruling = tied ? 0 : round.winningChoice;\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n // Override the final ruling if only one side funded the appeals.\\n if (period == KlerosCore.Period.execution) {\\n uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID);\\n if (fundedChoices.length == 1) {\\n ruling = fundedChoices[0];\\n tied = false;\\n overridden = true;\\n }\\n }\\n }\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (vote.voted && (vote.choice == winningChoice || tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage currentRound = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (currentRound.totalVoted == 0 || (!tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalCommitted == round.votes.length;\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalVoted == round.votes.length;\\n }\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view override returns (bool) {\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, uint256 lockedAmountPerJuror, , , , , , , , ) = core.getRoundInfo(\\n _coreDisputeID,\\n core.getNumberOfRounds(_coreDisputeID) - 1\\n );\\n (uint256 staked, uint256 locked, ) = core.getJurorBalance(_juror, courtID);\\n (, , uint256 minStake, , , , ) = core.courts(courtID);\\n return staked >= locked + lockedAmountPerJuror && staked >= minStake;\\n }\\n}\\n\",\"keccak256\":\"0xbbc8f730ddfea6bf3e1b6ea1427d283028ce4b16586e9a42c8d909704a71106a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7a259401627ba5546d9eb0264275aa1be9762f8a514545ae99d8c356ebf41f4f\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x9001274313a4e7eeda92332bbeeac8972f55e6378874babfaccd56eb283816f0\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Address of the juror.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event Justification(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0xd51cc7a11480d19abbd810733ddd5bf84f998e8b855ef8dd826a4b76a97ddd36\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IEvidence\\ninterface IEvidence {\\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 _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\\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 IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence);\\n}\\n\",\"keccak256\":\"0x3350da62267a5dad4616dafd9916fe3bfa4cdabfce124709ac3b7d087361e8c4\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n enum preStakeHookResult {\\n ok,\\n delayed,\\n failed\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(address _account, uint96 _courtID, uint256 _value) external;\\n\\n function setJurorInactive(address _account) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _voteID) external view returns (address);\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external returns (preStakeHookResult);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x28911aa78669746f40c4c3bce723db21600a49a74142c0fe378680b1b356d633\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003a8d38038062003a8d83398101604081905262000034916200007f565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055620000be565b6001600160a01b03811681146200007c57600080fd5b50565b600080604083850312156200009357600080fd5b8251620000a08162000066565b6020840151909250620000b38162000066565b809150509250929050565b6139bf80620000ce6000396000f3fe60806040526004361061016c5760003560e01c8063751accd0116100cc578063b6ede5401161007a578063b6ede540146104ac578063ba66fde7146104cc578063be467604146104ec578063da3beb8c14610502578063e349ad30146103d4578063e4c0aaf414610522578063f2f4eb261461054257600080fd5b8063751accd0146103b4578063796490f9146103d45780637c04034e146103ea5780638e4264601461040a578063a6a7f0eb1461042a578063a7cc08fe1461044a578063b34bfaa81461049657600080fd5b80634b2f0ea0116101295780634b2f0ea0146102965780634fe264fb146102ab578063564a565d146102cb5780635c92e2f6146102fa57806365540b961461031a57806369f3f041146103475780636d4cd8ea1461039457600080fd5b80630baa64d1146101715780630c340a24146101a65780631200aabc146101de5780631c3db16d14610219578063362c3479146102565780633b30414714610276575b600080fd5b34801561017d57600080fd5b5061019161018c366004612d44565b610562565b60405190151581526020015b60405180910390f35b3480156101b257600080fd5b506000546101c6906001600160a01b031681565b6040516001600160a01b03909116815260200161019d565b3480156101ea57600080fd5b5061020b6101f9366004612d44565b60036020526000908152604090205481565b60405190815260200161019d565b34801561022557600080fd5b50610239610234366004612d44565b6105d9565b60408051938452911515602084015215159082015260600161019d565b34801561026257600080fd5b5061020b610271366004612d75565b610747565b34801561028257600080fd5b506101c6610291366004612d44565b610b1d565b6102a96102a4366004612db2565b610e29565b005b3480156102b757600080fd5b5061020b6102c6366004612dd4565b611690565b3480156102d757600080fd5b506102eb6102e6366004612d44565b6117d3565b60405161019d93929190612e50565b34801561030657600080fd5b506102a9610315366004612ec5565b611899565b34801561032657600080fd5b5061033a610335366004612d44565b611ba4565b60405161019d9190612f17565b34801561035357600080fd5b50610367610362366004612dd4565b611c68565b604080519687529415156020870152938501929092526060840152608083015260a082015260c00161019d565b3480156103a057600080fd5b506101916103af366004612d44565b611d20565b3480156103c057600080fd5b506102a96103cf366004612ff8565b611d97565b3480156103e057600080fd5b5061020b61271081565b3480156103f657600080fd5b506102a9610405366004613064565b611e69565b34801561041657600080fd5b506102a96104253660046130fc565b612541565b34801561043657600080fd5b506102a961044536600461315a565b61258d565b34801561045657600080fd5b5061046a610465366004612dd4565b6125d6565b604080516001600160a01b0390951685526020850193909352918301521515606082015260800161019d565b3480156104a257600080fd5b5061020b614e2081565b3480156104b857600080fd5b506102a96104c73660046131a5565b61269c565b3480156104d857600080fd5b506101916104e7366004612dd4565b61285f565b3480156104f857600080fd5b5061020b61138881565b34801561050e57600080fd5b5061020b61051d366004612db2565b6128fa565b34801561052e57600080fd5b506102a961053d3660046130fc565b612a4d565b34801561054e57600080fd5b506001546101c6906001600160a01b031681565b600081815260036020526040812054600280548392908110610586576105866131ff565b600091825260208220600590910201805490925082906105a89060019061322b565b815481106105b8576105b86131ff565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610605576106056131ff565b600091825260208220600590910201805490925082906106279060019061322b565b81548110610637576106376131ff565b60009182526020909120600c90910201600381015460ff169450905083610662578060010154610665565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d8919061326a565b50909350600492506106e8915050565b8160048111156106fa576106fa6132d1565b0361073d57600061070a88611ba4565b9050805160010361073b5780600081518110610728576107286131ff565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b9919061326a565b509350505050806108115760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610835576108356131ff565b60009182526020808320888452600360059093020191820190526040822054815491935083918110610869576108696131ff565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e891906132e7565b5050600087815260078401602052604090205490915060ff16610932576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610a77565b8086036109a75760008681526006830160205260409020546109555760006109a0565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109969190613323565b6109a0919061333a565b9450610a77565b600081815260078301602052604090205460ff16610a775781600601600083600a016001815481106109db576109db6131ff565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a1157610a116131ff565b9060005260206000200154815260200190815260200160002054610a35919061335c565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610a6a9190613323565b610a74919061333a565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b11576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b6001546000906001600160a01b03163314610b4a5760405162461bcd60e51b81526004016108089061336f565b600082815260036020526040902054600280548492908110610b6e57610b6e6131ff565b600091825260209091206002600590920201015460ff1615610ba25760405162461bcd60e51b8152600401610808906133b3565b600083815260036020526040812054600280549091908110610bc657610bc66131ff565b60009182526020822060059091020180549092508290610be89060019061322b565b81548110610bf857610bf86131ff565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8191906133ea565b60015460405163564a565d60e01b8152600481018990529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610cd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf4919061326a565b50508554604051632638506b60e11b81526001600160601b03851660048201819052602482018d90526044820192909252939450926001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8091906133ea565b9650610d8c8888612a99565b15610e1957604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055610e1e565b600096505b505050505050919050565b600082815260036020526040902054600280548492908110610e4d57610e4d6131ff565b600091825260209091206002600590920201015460ff1615610e815760405162461bcd60e51b8152600401610808906133b3565b600083815260036020526040812054600280549091908110610ea557610ea56131ff565b906000526020600020906005020190508060010154831115610f095760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610808565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190613407565b91509150814210158015610f8d57508042105b610fd25760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610808565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015611013573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103791906132e7565b5050905086810361104c5761271091506110cd565b61271061138861105c868661322b565b6110669190613323565b611070919061333a565b61107a854261322b565b106110c75760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610808565b614e2091505b845460009086906110e09060019061322b565b815481106110f0576110f06131ff565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa15801561114f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611173919061342b565b61117d919061322b565b60008a815260078401602052604090205490915060ff16156111e15760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610808565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f919061342b565b905060006127106112608784613323565b61126a919061333a565b611274908361335c565b60008c8152600686016020526040812054919250908211156113255760008c815260068601602052604090205434906112ad908461322b565b116112d25760008c81526006860160205260409020546112cd908361322b565b6112d4565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161131c929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061135190849061335c565b909155505060008c81526006860160205260408120805483929061137690849061335c565b909155505060008c815260068601602052604090205482116114485760008c8152600686016020526040812054600987018054919290916113b890849061335c565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a8501546001101561165357828560090154611465919061322b565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d79190613444565b156114f05760028a01805460ff191660011790556115d3565b895460038b01600061150387600161335c565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161157e91815260200190565b602060405180830381865afa15801561159b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bf919061342b565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161162093929190613499565b6000604051808303818588803b15801561163957600080fd5b505af115801561164d573d6000803e3d6000fd5b50505050505b8034111561168157336108fc611669833461322b565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6000838152600360205260408120546002805483929081106116b4576116b46131ff565b600091825260208083208784526003600590930201918201905260408220548154919350839181106116e8576116e86131ff565b90600052602060002090600c0201600001848154811061170a5761170a6131ff565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178c91906132e7565b506003850154919350915060ff1680156117b0575081836002015414806117b05750805b156117c3576127109450505050506117cc565b60009450505050505b9392505050565b600281815481106117e357600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118169061345f565b80601f01602080910402602001604051908101604052809291908181526020018280546118429061345f565b801561188f5780601f106118645761010080835404028352916020019161188f565b820191906000526020600020905b81548152906001019060200180831161187257829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118bd576118bd6131ff565b600091825260209091206002600590920201015460ff16156118f15760405162461bcd60e51b8152600401610808906133b3565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f919061326a565b509093506001925061196f915050565b816004811115611981576119816132d1565b146119de5760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610808565b82611a1b5760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610808565b600086815260036020526040812054600280549091908110611a3f57611a3f6131ff565b60009182526020822060059091020180549092508290611a619060019061322b565b81548110611a7157611a716131ff565b90600052602060002090600c0201905060005b86811015611b3f573382898984818110611aa057611aa06131ff565b9050602002013581548110611ab757611ab76131ff565b60009182526020909120600490910201546001600160a01b031614611aee5760405162461bcd60e51b815260040161080890613533565b8582898984818110611b0257611b026131ff565b9050602002013581548110611b1957611b196131ff565b600091825260209091206001600490920201015580611b378161356a565b915050611a84565b5086869050816005016000828254611b57919061335c565b92505081905550877f631164ab329e3544c9075658fc5cd19297e0b191060d307414cf10ebc99d4a65888888604051611b9293929190613583565b60405180910390a25050505050505050565b6000818152600360205260408120546002805460609392908110611bca57611bca6131ff565b60009182526020822060059091020180549092508290611bec9060019061322b565b81548110611bfc57611bfc6131ff565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c5a57602002820191906000526020600020905b815481526020019060010190808311611c46575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611c9957611c996131ff565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611ccd57611ccd6131ff565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611d4457611d446131ff565b60009182526020822060059091020180549092508290611d669060019061322b565b81548110611d7657611d766131ff565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611dc15760405162461bcd60e51b8152600401610808906135c1565b6000836001600160a01b03168383604051611ddc9190613603565b60006040518083038185875af1925050503d8060008114611e19576040519150601f19603f3d011682016040523d82523d6000602084013e611e1e565b606091505b5050905080611e635760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610808565b50505050565b600086815260036020526040902054600280548892908110611e8d57611e8d6131ff565b600091825260209091206002600590920201015460ff1615611ec15760405162461bcd60e51b8152600401610808906133b3565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f919061326a565b5090935060029250611f3f915050565b816004811115611f5157611f516132d1565b14611fac5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610808565b85611fee5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610808565b600088815260036020526040812054600280549091908110612012576120126131ff565b90600052602060002090600502019050806001015486111561206d5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610808565b805460009082906120809060019061322b565b81548110612090576120906131ff565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa1580156120eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210f919061326a565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e919061361f565b505050505091505060005b8a81101561240b5733848d8d848181106121b5576121b56131ff565b90506020020135815481106121cc576121cc6131ff565b60009182526020909120600490910201546001600160a01b0316146122035760405162461bcd60e51b815260040161080890613533565b811580612277575089888a60405160200161222093929190613689565b60405160208183030381529060405280519060200120846000018d8d8481811061224c5761224c6131ff565b9050602002013581548110612263576122636131ff565b906000526020600020906004020160010154145b6122e95760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610808565b838c8c838181106122fc576122fc6131ff565b9050602002013581548110612313576123136131ff565b600091825260209091206003600490920201015460ff161561236c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610808565b89848d8d84818110612380576123806131ff565b9050602002013581548110612397576123976131ff565b60009182526020909120600260049092020101556001848d8d848181106123c0576123c06131ff565b90506020020135815481106123d7576123d76131ff565b60009182526020909120600490910201600301805460ff1916911515919091179055806124038161356a565b915050612199565b508a8a9050836004016000828254612423919061335c565b90915550506000898152600284016020526040812080548c929061244890849061335c565b90915550506001830154890361247757600383015460ff16156124725760038301805460ff191690555b6124f0565b60018301546000908152600284016020526040808220548b8352912054036124b957600383015460ff166124725760038301805460ff191660011790556124f0565b60018301546000908152600284016020526040808220548b835291205411156124f0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fbf654140f91f2e524d875f097947702b44380492730dd1653f5482c0b33e49cd8a60405161252b91906136b6565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461256b5760405162461bcd60e51b8152600401610808906135c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516125c99291906136f2565b60405180910390a3505050565b60008060008060006002600360008a81526020019081526020016000205481548110612604576126046131ff565b600091825260208083208a8452600360059093020191820190526040822054815491935083918110612638576126386131ff565b90600052602060002090600c0201600001878154811061265a5761265a6131ff565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146126c65760405162461bcd60e51b81526004016108089061336f565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad20161275185878361375d565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156127a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cc919061342b565b6127d6919061322b565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890611b92908a908a908a9061381d565b600083815260036020526040812054600280548392908110612883576128836131ff565b600091825260208083208784526003600590930201918201905260408220548154919350839181106128b7576128b76131ff565b90600052602060002090600c020160000184815481106128d9576128d96131ff565b600091825260209091206004909102016003015460ff169695505050505050565b60008281526003602052604081205460028054839290811061291e5761291e6131ff565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612952576129526131ff565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156129b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d591906132e7565b5091509150826004015460001480612a04575080158015612a0457506000828152600284016020526040902054155b15612a16576000945050505050612a47565b8015612a2b575050600401549150612a479050565b506000908152600290910160205260409020549150612a479050565b92915050565b6000546001600160a01b03163314612a775760405162461bcd60e51b8152600401610808906135c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b0b919061326a565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8e919061342b565b612b98919061322b565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612bd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c019190810190613842565b5050600154604051631a383be960e31b81526001600160a01b038e811660048301526001600160601b038d166024830152989a50600099508998909116965063d1c1df4895506044019350612c5592505050565b606060405180830381865afa158015612c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c96919061395b565b50600154604051630fad06e960e11b81526001600160601b03881660048201529294509092506000916001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015612cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d15919061361f565b50505050925050508382612d29919061335c565b8310158015612d385750808310155b98975050505050505050565b600060208284031215612d5657600080fd5b5035919050565b6001600160a01b0381168114612d7257600080fd5b50565b60008060008060808587031215612d8b57600080fd5b843593506020850135612d9d81612d5d565b93969395505050506040820135916060013590565b60008060408385031215612dc557600080fd5b50508035926020909101359150565b600080600060608486031215612de957600080fd5b505081359360208301359350604090920135919050565b60005b83811015612e1b578181015183820152602001612e03565b50506000910152565b60008151808452612e3c816020860160208601612e00565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000612e716060830184612e24565b95945050505050565b60008083601f840112612e8c57600080fd5b5081356001600160401b03811115612ea357600080fd5b6020830191508360208260051b8501011115612ebe57600080fd5b9250929050565b60008060008060608587031215612edb57600080fd5b8435935060208501356001600160401b03811115612ef857600080fd5b612f0487828801612e7a565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b81811015612f4f57835183529284019291840191600101612f33565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612f9957612f99612f5b565b604052919050565b60006001600160401b03831115612fba57612fba612f5b565b612fcd601f8401601f1916602001612f71565b9050828152838383011115612fe157600080fd5b828260208301376000602084830101529392505050565b60008060006060848603121561300d57600080fd5b833561301881612d5d565b92506020840135915060408401356001600160401b0381111561303a57600080fd5b8401601f8101861361304b57600080fd5b61305a86823560208401612fa1565b9150509250925092565b60008060008060008060a0878903121561307d57600080fd5b8635955060208701356001600160401b038082111561309b57600080fd5b6130a78a838b01612e7a565b9097509550604089013594506060890135935060808901359150808211156130ce57600080fd5b508701601f810189136130e057600080fd5b6130ef89823560208401612fa1565b9150509295509295509295565b60006020828403121561310e57600080fd5b81356117cc81612d5d565b60008083601f84011261312b57600080fd5b5081356001600160401b0381111561314257600080fd5b602083019150836020828501011115612ebe57600080fd5b60008060006040848603121561316f57600080fd5b8335925060208401356001600160401b0381111561318c57600080fd5b61319886828701613119565b9497909650939450505050565b6000806000806000608086880312156131bd57600080fd5b853594506020860135935060408601356001600160401b038111156131e157600080fd5b6131ed88828901613119565b96999598509660600135949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612a4757612a47613215565b80516001600160601b038116811461325557600080fd5b919050565b8051801515811461325557600080fd5b600080600080600060a0868803121561328257600080fd5b61328b8661323e565b9450602086015161329b81612d5d565b6040870151909450600581106132b057600080fd5b92506132be6060870161325a565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156132fc57600080fd5b8351925061330c6020850161325a565b915061331a6040850161325a565b90509250925092565b8082028115828204841417612a4757612a47613215565b60008261335757634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612a4757612a47613215565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000602082840312156133fc57600080fd5b81516117cc81612d5d565b6000806040838503121561341a57600080fd5b505080516020909101519092909150565b60006020828403121561343d57600080fd5b5051919050565b60006020828403121561345657600080fd5b6117cc8261325a565b600181811c9082168061347357607f821691505b60208210810361349357634e487b7160e01b600052602260045260246000fd5b50919050565b83815260006020848184015260606040840152600084546134b98161345f565b80606087015260806001808416600081146134db57600181146134f557613523565b60ff1985168984015283151560051b890183019550613523565b896000528660002060005b8581101561351b5781548b8201860152908301908801613500565b8a0184019650505b50939a9950505050505050505050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161357c5761357c613215565b5060010190565b6040808252810183905260006001600160fb1b038411156135a357600080fd5b8360051b808660608501376020830193909352500160600192915050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60008251613615818460208701612e00565b9190910192915050565b600080600080600080600060e0888a03121561363a57600080fd5b6136438861323e565b96506136516020890161325a565b955060408801519450606088015193506080880151925060a0880151915061367b60c0890161325a565b905092959891949750929550565b838152600083516136a1816020850160208801612e00565b60209201918201929092526040019392505050565b6020815260006117cc6020830184612e24565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006137066020830184866136c9565b949350505050565b601f82111561375857600081815260208120601f850160051c810160208610156137355750805b601f850160051c820191505b8181101561375457828155600101613741565b5050505b505050565b6001600160401b0383111561377457613774612f5b565b61378883613782835461345f565b8361370e565b6000601f8411600181146137bc57600085156137a45750838201355b600019600387901b1c1916600186901b178355613816565b600083815260209020601f19861690835b828110156137ed57868501358255602094850194600190920191016137cd565b508682101561380a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b838152604060208201526000612e716040830184866136c9565b805161325581612d5d565b6000806000806000806000806000806101408b8d03121561386257600080fd5b8a51995060208b0151985060408b0151975060608b0151965060808b0151955060a08b0151945060c08b01516001600160401b03808211156138a357600080fd5b818d0191508d601f8301126138b757600080fd5b8151818111156138c9576138c9612f5b565b6138d860208260051b01612f71565b91508181835260208301925060208260051b85010191508f8211156138fc57600080fd5b6020840193505b8184101561392757835161391681612d5d565b835260209384019390920191613903565b8097505050505060e08b015192506101008b0151915061394a6101208c01613837565b90509295989b9194979a5092959850565b60008060006060848603121561397057600080fd5b835192506020840151915060408401519050925092509256fea26469706673582212204e5ecc8efc317caa38ec37dde10d9ca06cf6213e8ca1af24c60ac7a2a09f0dcf64736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061016c5760003560e01c8063751accd0116100cc578063b6ede5401161007a578063b6ede540146104ac578063ba66fde7146104cc578063be467604146104ec578063da3beb8c14610502578063e349ad30146103d4578063e4c0aaf414610522578063f2f4eb261461054257600080fd5b8063751accd0146103b4578063796490f9146103d45780637c04034e146103ea5780638e4264601461040a578063a6a7f0eb1461042a578063a7cc08fe1461044a578063b34bfaa81461049657600080fd5b80634b2f0ea0116101295780634b2f0ea0146102965780634fe264fb146102ab578063564a565d146102cb5780635c92e2f6146102fa57806365540b961461031a57806369f3f041146103475780636d4cd8ea1461039457600080fd5b80630baa64d1146101715780630c340a24146101a65780631200aabc146101de5780631c3db16d14610219578063362c3479146102565780633b30414714610276575b600080fd5b34801561017d57600080fd5b5061019161018c366004612d44565b610562565b60405190151581526020015b60405180910390f35b3480156101b257600080fd5b506000546101c6906001600160a01b031681565b6040516001600160a01b03909116815260200161019d565b3480156101ea57600080fd5b5061020b6101f9366004612d44565b60036020526000908152604090205481565b60405190815260200161019d565b34801561022557600080fd5b50610239610234366004612d44565b6105d9565b60408051938452911515602084015215159082015260600161019d565b34801561026257600080fd5b5061020b610271366004612d75565b610747565b34801561028257600080fd5b506101c6610291366004612d44565b610b1d565b6102a96102a4366004612db2565b610e29565b005b3480156102b757600080fd5b5061020b6102c6366004612dd4565b611690565b3480156102d757600080fd5b506102eb6102e6366004612d44565b6117d3565b60405161019d93929190612e50565b34801561030657600080fd5b506102a9610315366004612ec5565b611899565b34801561032657600080fd5b5061033a610335366004612d44565b611ba4565b60405161019d9190612f17565b34801561035357600080fd5b50610367610362366004612dd4565b611c68565b604080519687529415156020870152938501929092526060840152608083015260a082015260c00161019d565b3480156103a057600080fd5b506101916103af366004612d44565b611d20565b3480156103c057600080fd5b506102a96103cf366004612ff8565b611d97565b3480156103e057600080fd5b5061020b61271081565b3480156103f657600080fd5b506102a9610405366004613064565b611e69565b34801561041657600080fd5b506102a96104253660046130fc565b612541565b34801561043657600080fd5b506102a961044536600461315a565b61258d565b34801561045657600080fd5b5061046a610465366004612dd4565b6125d6565b604080516001600160a01b0390951685526020850193909352918301521515606082015260800161019d565b3480156104a257600080fd5b5061020b614e2081565b3480156104b857600080fd5b506102a96104c73660046131a5565b61269c565b3480156104d857600080fd5b506101916104e7366004612dd4565b61285f565b3480156104f857600080fd5b5061020b61138881565b34801561050e57600080fd5b5061020b61051d366004612db2565b6128fa565b34801561052e57600080fd5b506102a961053d3660046130fc565b612a4d565b34801561054e57600080fd5b506001546101c6906001600160a01b031681565b600081815260036020526040812054600280548392908110610586576105866131ff565b600091825260208220600590910201805490925082906105a89060019061322b565b815481106105b8576105b86131ff565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610605576106056131ff565b600091825260208220600590910201805490925082906106279060019061322b565b81548110610637576106376131ff565b60009182526020909120600c90910201600381015460ff169450905083610662578060010154610665565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d8919061326a565b50909350600492506106e8915050565b8160048111156106fa576106fa6132d1565b0361073d57600061070a88611ba4565b9050805160010361073b5780600081518110610728576107286131ff565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b9919061326a565b509350505050806108115760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610835576108356131ff565b60009182526020808320888452600360059093020191820190526040822054815491935083918110610869576108696131ff565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e891906132e7565b5050600087815260078401602052604090205490915060ff16610932576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610a77565b8086036109a75760008681526006830160205260409020546109555760006109a0565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109969190613323565b6109a0919061333a565b9450610a77565b600081815260078301602052604090205460ff16610a775781600601600083600a016001815481106109db576109db6131ff565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a1157610a116131ff565b9060005260206000200154815260200190815260200160002054610a35919061335c565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610a6a9190613323565b610a74919061333a565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b11576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b6001546000906001600160a01b03163314610b4a5760405162461bcd60e51b81526004016108089061336f565b600082815260036020526040902054600280548492908110610b6e57610b6e6131ff565b600091825260209091206002600590920201015460ff1615610ba25760405162461bcd60e51b8152600401610808906133b3565b600083815260036020526040812054600280549091908110610bc657610bc66131ff565b60009182526020822060059091020180549092508290610be89060019061322b565b81548110610bf857610bf86131ff565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8191906133ea565b60015460405163564a565d60e01b8152600481018990529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015610cd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf4919061326a565b50508554604051632638506b60e11b81526001600160601b03851660048201819052602482018d90526044820192909252939450926001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8091906133ea565b9650610d8c8888612a99565b15610e1957604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055610e1e565b600096505b505050505050919050565b600082815260036020526040902054600280548492908110610e4d57610e4d6131ff565b600091825260209091206002600590920201015460ff1615610e815760405162461bcd60e51b8152600401610808906133b3565b600083815260036020526040812054600280549091908110610ea557610ea56131ff565b906000526020600020906005020190508060010154831115610f095760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610808565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190613407565b91509150814210158015610f8d57508042105b610fd25760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610808565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015611013573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103791906132e7565b5050905086810361104c5761271091506110cd565b61271061138861105c868661322b565b6110669190613323565b611070919061333a565b61107a854261322b565b106110c75760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610808565b614e2091505b845460009086906110e09060019061322b565b815481106110f0576110f06131ff565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa15801561114f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611173919061342b565b61117d919061322b565b60008a815260078401602052604090205490915060ff16156111e15760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610808565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f919061342b565b905060006127106112608784613323565b61126a919061333a565b611274908361335c565b60008c8152600686016020526040812054919250908211156113255760008c815260068601602052604090205434906112ad908461322b565b116112d25760008c81526006860160205260409020546112cd908361322b565b6112d4565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161131c929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061135190849061335c565b909155505060008c81526006860160205260408120805483929061137690849061335c565b909155505060008c815260068601602052604090205482116114485760008c8152600686016020526040812054600987018054919290916113b890849061335c565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a8501546001101561165357828560090154611465919061322b565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d79190613444565b156114f05760028a01805460ff191660011790556115d3565b895460038b01600061150387600161335c565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161157e91815260200190565b602060405180830381865afa15801561159b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bf919061342b565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161162093929190613499565b6000604051808303818588803b15801561163957600080fd5b505af115801561164d573d6000803e3d6000fd5b50505050505b8034111561168157336108fc611669833461322b565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6000838152600360205260408120546002805483929081106116b4576116b46131ff565b600091825260208083208784526003600590930201918201905260408220548154919350839181106116e8576116e86131ff565b90600052602060002090600c0201600001848154811061170a5761170a6131ff565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178c91906132e7565b506003850154919350915060ff1680156117b0575081836002015414806117b05750805b156117c3576127109450505050506117cc565b60009450505050505b9392505050565b600281815481106117e357600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118169061345f565b80601f01602080910402602001604051908101604052809291908181526020018280546118429061345f565b801561188f5780601f106118645761010080835404028352916020019161188f565b820191906000526020600020905b81548152906001019060200180831161187257829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118bd576118bd6131ff565b600091825260209091206002600590920201015460ff16156118f15760405162461bcd60e51b8152600401610808906133b3565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f919061326a565b509093506001925061196f915050565b816004811115611981576119816132d1565b146119de5760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610808565b82611a1b5760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610808565b600086815260036020526040812054600280549091908110611a3f57611a3f6131ff565b60009182526020822060059091020180549092508290611a619060019061322b565b81548110611a7157611a716131ff565b90600052602060002090600c0201905060005b86811015611b3f573382898984818110611aa057611aa06131ff565b9050602002013581548110611ab757611ab76131ff565b60009182526020909120600490910201546001600160a01b031614611aee5760405162461bcd60e51b815260040161080890613533565b8582898984818110611b0257611b026131ff565b9050602002013581548110611b1957611b196131ff565b600091825260209091206001600490920201015580611b378161356a565b915050611a84565b5086869050816005016000828254611b57919061335c565b92505081905550877f631164ab329e3544c9075658fc5cd19297e0b191060d307414cf10ebc99d4a65888888604051611b9293929190613583565b60405180910390a25050505050505050565b6000818152600360205260408120546002805460609392908110611bca57611bca6131ff565b60009182526020822060059091020180549092508290611bec9060019061322b565b81548110611bfc57611bfc6131ff565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c5a57602002820191906000526020600020905b815481526020019060010190808311611c46575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611c9957611c996131ff565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611ccd57611ccd6131ff565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611d4457611d446131ff565b60009182526020822060059091020180549092508290611d669060019061322b565b81548110611d7657611d766131ff565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611dc15760405162461bcd60e51b8152600401610808906135c1565b6000836001600160a01b03168383604051611ddc9190613603565b60006040518083038185875af1925050503d8060008114611e19576040519150601f19603f3d011682016040523d82523d6000602084013e611e1e565b606091505b5050905080611e635760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610808565b50505050565b600086815260036020526040902054600280548892908110611e8d57611e8d6131ff565b600091825260209091206002600590920201015460ff1615611ec15760405162461bcd60e51b8152600401610808906133b3565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f919061326a565b5090935060029250611f3f915050565b816004811115611f5157611f516132d1565b14611fac5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610808565b85611fee5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610808565b600088815260036020526040812054600280549091908110612012576120126131ff565b90600052602060002090600502019050806001015486111561206d5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610808565b805460009082906120809060019061322b565b81548110612090576120906131ff565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa1580156120eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210f919061326a565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218e919061361f565b505050505091505060005b8a81101561240b5733848d8d848181106121b5576121b56131ff565b90506020020135815481106121cc576121cc6131ff565b60009182526020909120600490910201546001600160a01b0316146122035760405162461bcd60e51b815260040161080890613533565b811580612277575089888a60405160200161222093929190613689565b60405160208183030381529060405280519060200120846000018d8d8481811061224c5761224c6131ff565b9050602002013581548110612263576122636131ff565b906000526020600020906004020160010154145b6122e95760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610808565b838c8c838181106122fc576122fc6131ff565b9050602002013581548110612313576123136131ff565b600091825260209091206003600490920201015460ff161561236c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610808565b89848d8d84818110612380576123806131ff565b9050602002013581548110612397576123976131ff565b60009182526020909120600260049092020101556001848d8d848181106123c0576123c06131ff565b90506020020135815481106123d7576123d76131ff565b60009182526020909120600490910201600301805460ff1916911515919091179055806124038161356a565b915050612199565b508a8a9050836004016000828254612423919061335c565b90915550506000898152600284016020526040812080548c929061244890849061335c565b90915550506001830154890361247757600383015460ff16156124725760038301805460ff191690555b6124f0565b60018301546000908152600284016020526040808220548b8352912054036124b957600383015460ff166124725760038301805460ff191660011790556124f0565b60018301546000908152600284016020526040808220548b835291205411156124f0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fbf654140f91f2e524d875f097947702b44380492730dd1653f5482c0b33e49cd8a60405161252b91906136b6565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461256b5760405162461bcd60e51b8152600401610808906135c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516125c99291906136f2565b60405180910390a3505050565b60008060008060006002600360008a81526020019081526020016000205481548110612604576126046131ff565b600091825260208083208a8452600360059093020191820190526040822054815491935083918110612638576126386131ff565b90600052602060002090600c0201600001878154811061265a5761265a6131ff565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146126c65760405162461bcd60e51b81526004016108089061336f565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad20161275185878361375d565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156127a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127cc919061342b565b6127d6919061322b565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890611b92908a908a908a9061381d565b600083815260036020526040812054600280548392908110612883576128836131ff565b600091825260208083208784526003600590930201918201905260408220548154919350839181106128b7576128b76131ff565b90600052602060002090600c020160000184815481106128d9576128d96131ff565b600091825260209091206004909102016003015460ff169695505050505050565b60008281526003602052604081205460028054839290811061291e5761291e6131ff565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612952576129526131ff565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156129b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d591906132e7565b5091509150826004015460001480612a04575080158015612a0457506000828152600284016020526040902054155b15612a16576000945050505050612a47565b8015612a2b575050600401549150612a479050565b506000908152600290910160205260409020549150612a479050565b92915050565b6000546001600160a01b03163314612a775760405162461bcd60e51b8152600401610808906135c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b0b919061326a565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8e919061342b565b612b98919061322b565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612bd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c019190810190613842565b5050600154604051631a383be960e31b81526001600160a01b038e811660048301526001600160601b038d166024830152989a50600099508998909116965063d1c1df4895506044019350612c5592505050565b606060405180830381865afa158015612c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c96919061395b565b50600154604051630fad06e960e11b81526001600160601b03881660048201529294509092506000916001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015612cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d15919061361f565b50505050925050508382612d29919061335c565b8310158015612d385750808310155b98975050505050505050565b600060208284031215612d5657600080fd5b5035919050565b6001600160a01b0381168114612d7257600080fd5b50565b60008060008060808587031215612d8b57600080fd5b843593506020850135612d9d81612d5d565b93969395505050506040820135916060013590565b60008060408385031215612dc557600080fd5b50508035926020909101359150565b600080600060608486031215612de957600080fd5b505081359360208301359350604090920135919050565b60005b83811015612e1b578181015183820152602001612e03565b50506000910152565b60008151808452612e3c816020860160208601612e00565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000612e716060830184612e24565b95945050505050565b60008083601f840112612e8c57600080fd5b5081356001600160401b03811115612ea357600080fd5b6020830191508360208260051b8501011115612ebe57600080fd5b9250929050565b60008060008060608587031215612edb57600080fd5b8435935060208501356001600160401b03811115612ef857600080fd5b612f0487828801612e7a565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b81811015612f4f57835183529284019291840191600101612f33565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612f9957612f99612f5b565b604052919050565b60006001600160401b03831115612fba57612fba612f5b565b612fcd601f8401601f1916602001612f71565b9050828152838383011115612fe157600080fd5b828260208301376000602084830101529392505050565b60008060006060848603121561300d57600080fd5b833561301881612d5d565b92506020840135915060408401356001600160401b0381111561303a57600080fd5b8401601f8101861361304b57600080fd5b61305a86823560208401612fa1565b9150509250925092565b60008060008060008060a0878903121561307d57600080fd5b8635955060208701356001600160401b038082111561309b57600080fd5b6130a78a838b01612e7a565b9097509550604089013594506060890135935060808901359150808211156130ce57600080fd5b508701601f810189136130e057600080fd5b6130ef89823560208401612fa1565b9150509295509295509295565b60006020828403121561310e57600080fd5b81356117cc81612d5d565b60008083601f84011261312b57600080fd5b5081356001600160401b0381111561314257600080fd5b602083019150836020828501011115612ebe57600080fd5b60008060006040848603121561316f57600080fd5b8335925060208401356001600160401b0381111561318c57600080fd5b61319886828701613119565b9497909650939450505050565b6000806000806000608086880312156131bd57600080fd5b853594506020860135935060408601356001600160401b038111156131e157600080fd5b6131ed88828901613119565b96999598509660600135949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612a4757612a47613215565b80516001600160601b038116811461325557600080fd5b919050565b8051801515811461325557600080fd5b600080600080600060a0868803121561328257600080fd5b61328b8661323e565b9450602086015161329b81612d5d565b6040870151909450600581106132b057600080fd5b92506132be6060870161325a565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156132fc57600080fd5b8351925061330c6020850161325a565b915061331a6040850161325a565b90509250925092565b8082028115828204841417612a4757612a47613215565b60008261335757634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612a4757612a47613215565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000602082840312156133fc57600080fd5b81516117cc81612d5d565b6000806040838503121561341a57600080fd5b505080516020909101519092909150565b60006020828403121561343d57600080fd5b5051919050565b60006020828403121561345657600080fd5b6117cc8261325a565b600181811c9082168061347357607f821691505b60208210810361349357634e487b7160e01b600052602260045260246000fd5b50919050565b83815260006020848184015260606040840152600084546134b98161345f565b80606087015260806001808416600081146134db57600181146134f557613523565b60ff1985168984015283151560051b890183019550613523565b896000528660002060005b8581101561351b5781548b8201860152908301908801613500565b8a0184019650505b50939a9950505050505050505050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161357c5761357c613215565b5060010190565b6040808252810183905260006001600160fb1b038411156135a357600080fd5b8360051b808660608501376020830193909352500160600192915050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60008251613615818460208701612e00565b9190910192915050565b600080600080600080600060e0888a03121561363a57600080fd5b6136438861323e565b96506136516020890161325a565b955060408801519450606088015193506080880151925060a0880151915061367b60c0890161325a565b905092959891949750929550565b838152600083516136a1816020850160208801612e00565b60209201918201929092526040019392505050565b6020815260006117cc6020830184612e24565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006137066020830184866136c9565b949350505050565b601f82111561375857600081815260208120601f850160051c810160208610156137355750805b601f850160051c820191505b8181101561375457828155600101613741565b5050505b505050565b6001600160401b0383111561377457613774612f5b565b61378883613782835461345f565b8361370e565b6000601f8411600181146137bc57600085156137a45750838201355b600019600387901b1c1916600186901b178355613816565b600083815260209020601f19861690835b828110156137ed57868501358255602094850194600190920191016137cd565b508682101561380a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b838152604060208201526000612e716040830184866136c9565b805161325581612d5d565b6000806000806000806000806000806101408b8d03121561386257600080fd5b8a51995060208b0151985060408b0151975060608b0151965060808b0151955060a08b0151945060c08b01516001600160401b03808211156138a357600080fd5b818d0191508d601f8301126138b757600080fd5b8151818111156138c9576138c9612f5b565b6138d860208260051b01612f71565b91508181835260208301925060208260051b85010191508f8211156138fc57600080fd5b6020840193505b8184101561392757835161391681612d5d565b835260209384019390920191613903565b8097505050505060e08b015192506101008b0151915061394a6101208c01613837565b90509295989b9194979a5092959850565b60008060006060848603121561397057600080fd5b835192506020840151915060408401519050925092509256fea26469706673582212204e5ecc8efc317caa38ec37dde10d9ca06cf6213e8ca1af24c60ac7a2a09f0dcf64736f6c63430008120033", "devdoc": { "events": { "Evidence(uint256,address,string)": { "details": "To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).", "params": { "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'", - "_evidenceGroupID": "Unique identifier of the evidence group the evidence belongs to.", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.", "_party": "The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party." } }, @@ -1016,10 +1016,10 @@ } }, "submitEvidence(uint256,string)": { - "details": "Submits evidence.", + "details": "Submits evidence for a dispute.", "params": { "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.", - "_evidenceGroupID": "Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID." + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID." } }, "withdrawFeesAndRewards(uint256,address,uint256,uint256)": { @@ -1046,7 +1046,7 @@ "storageLayout": { "storage": [ { - "astId": 6969, + "astId": 9884, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "governor", "offset": 0, @@ -1054,23 +1054,23 @@ "type": "t_address" }, { - "astId": 6972, + "astId": 9887, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "core", "offset": 0, "slot": "1", - "type": "t_contract(KlerosCore)5505" + "type": "t_contract(KlerosCore)6601" }, { - "astId": 7142, + "astId": 10057, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "disputes", "offset": 0, "slot": "2", - "type": "t_array(t_struct(Dispute)7079_storage)dyn_storage" + "type": "t_array(t_struct(Dispute)9994_storage)dyn_storage" }, { - "astId": 7146, + "astId": 10061, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "coreDisputeIDToLocal", "offset": 0, @@ -1084,20 +1084,20 @@ "label": "address", "numberOfBytes": "20" }, - "t_array(t_struct(Dispute)7079_storage)dyn_storage": { - "base": "t_struct(Dispute)7079_storage", + "t_array(t_struct(Dispute)9994_storage)dyn_storage": { + "base": "t_struct(Dispute)9994_storage", "encoding": "dynamic_array", "label": "struct DisputeKitClassic.Dispute[]", "numberOfBytes": "32" }, - "t_array(t_struct(Round)7117_storage)dyn_storage": { - "base": "t_struct(Round)7117_storage", + "t_array(t_struct(Round)10032_storage)dyn_storage": { + "base": "t_struct(Round)10032_storage", "encoding": "dynamic_array", "label": "struct DisputeKitClassic.Round[]", "numberOfBytes": "32" }, - "t_array(t_struct(Vote)7126_storage)dyn_storage": { - "base": "t_struct(Vote)7126_storage", + "t_array(t_struct(Vote)10041_storage)dyn_storage": { + "base": "t_struct(Vote)10041_storage", "encoding": "dynamic_array", "label": "struct DisputeKitClassic.Vote[]", "numberOfBytes": "32" @@ -1123,7 +1123,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(KlerosCore)5505": { + "t_contract(KlerosCore)6601": { "encoding": "inplace", "label": "contract KlerosCore", "numberOfBytes": "20" @@ -1149,20 +1149,20 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(Dispute)7079_storage": { + "t_struct(Dispute)9994_storage": { "encoding": "inplace", "label": "struct DisputeKitClassic.Dispute", "members": [ { - "astId": 7068, + "astId": 9983, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "rounds", "offset": 0, "slot": "0", - "type": "t_array(t_struct(Round)7117_storage)dyn_storage" + "type": "t_array(t_struct(Round)10032_storage)dyn_storage" }, { - "astId": 7070, + "astId": 9985, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "numberOfChoices", "offset": 0, @@ -1170,7 +1170,7 @@ "type": "t_uint256" }, { - "astId": 7072, + "astId": 9987, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "jumped", "offset": 0, @@ -1178,7 +1178,7 @@ "type": "t_bool" }, { - "astId": 7076, + "astId": 9991, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "coreRoundIDToLocal", "offset": 0, @@ -1186,7 +1186,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 7078, + "astId": 9993, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "extraData", "offset": 0, @@ -1196,20 +1196,20 @@ ], "numberOfBytes": "160" }, - "t_struct(Round)7117_storage": { + "t_struct(Round)10032_storage": { "encoding": "inplace", "label": "struct DisputeKitClassic.Round", "members": [ { - "astId": 7083, + "astId": 9998, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "votes", "offset": 0, "slot": "0", - "type": "t_array(t_struct(Vote)7126_storage)dyn_storage" + "type": "t_array(t_struct(Vote)10041_storage)dyn_storage" }, { - "astId": 7085, + "astId": 10000, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "winningChoice", "offset": 0, @@ -1217,7 +1217,7 @@ "type": "t_uint256" }, { - "astId": 7089, + "astId": 10004, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "counts", "offset": 0, @@ -1225,7 +1225,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 7091, + "astId": 10006, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "tied", "offset": 0, @@ -1233,7 +1233,7 @@ "type": "t_bool" }, { - "astId": 7093, + "astId": 10008, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "totalVoted", "offset": 0, @@ -1241,7 +1241,7 @@ "type": "t_uint256" }, { - "astId": 7095, + "astId": 10010, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "totalCommitted", "offset": 0, @@ -1249,7 +1249,7 @@ "type": "t_uint256" }, { - "astId": 7099, + "astId": 10014, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "paidFees", "offset": 0, @@ -1257,7 +1257,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 7103, + "astId": 10018, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "hasPaid", "offset": 0, @@ -1265,7 +1265,7 @@ "type": "t_mapping(t_uint256,t_bool)" }, { - "astId": 7109, + "astId": 10024, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "contributions", "offset": 0, @@ -1273,7 +1273,7 @@ "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" }, { - "astId": 7111, + "astId": 10026, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "feeRewards", "offset": 0, @@ -1281,7 +1281,7 @@ "type": "t_uint256" }, { - "astId": 7114, + "astId": 10029, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "fundedChoices", "offset": 0, @@ -1289,7 +1289,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 7116, + "astId": 10031, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "nbVotes", "offset": 0, @@ -1299,12 +1299,12 @@ ], "numberOfBytes": "384" }, - "t_struct(Vote)7126_storage": { + "t_struct(Vote)10041_storage": { "encoding": "inplace", "label": "struct DisputeKitClassic.Vote", "members": [ { - "astId": 7119, + "astId": 10034, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "account", "offset": 0, @@ -1312,7 +1312,7 @@ "type": "t_address" }, { - "astId": 7121, + "astId": 10036, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "commit", "offset": 0, @@ -1320,7 +1320,7 @@ "type": "t_bytes32" }, { - "astId": 7123, + "astId": 10038, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "choice", "offset": 0, @@ -1328,7 +1328,7 @@ "type": "t_uint256" }, { - "astId": 7125, + "astId": 10040, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "voted", "offset": 0, diff --git a/contracts/deployments/arbitrumGoerli/DisputeResolver.json b/contracts/deployments/arbitrumGoerli/DisputeResolver.json index b01058058..ed24789ce 100644 --- a/contracts/deployments/arbitrumGoerli/DisputeResolver.json +++ b/contracts/deployments/arbitrumGoerli/DisputeResolver.json @@ -1,5 +1,5 @@ { - "address": "0xF6652c10c4D3f5bA6066254B78c57A468d9b9606", + "address": "0xcDC05c8d2EEEe384359Bd22E8631528B6b0564e9", "abi": [ { "inputs": [ @@ -12,55 +12,6 @@ "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract IArbitratorV2", - "name": "_arbitrator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_arbitrableChainId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "_arbitrable", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "_arbitrableDisputeID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_externalDisputeID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_templateId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "_templateUri", - "type": "string" - } - ], - "name": "CrossChainDisputeRequest", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -116,7 +67,7 @@ { "indexed": false, "internalType": "string", - "name": "data", + "name": "_templateData", "type": "string" } ], @@ -330,44 +281,32 @@ "type": "function" } ], - "transactionHash": "0xed9f2c713fef809dc6e57ab0d647637b434c4a66bd3299d19112056cdf26d4f8", + "transactionHash": "0x4fa633a2729ae3d9fbcb9ac259a0c2f08605fb5178b9b3d0d29550af884bc0af", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xF6652c10c4D3f5bA6066254B78c57A468d9b9606", + "contractAddress": "0xcDC05c8d2EEEe384359Bd22E8631528B6b0564e9", "transactionIndex": 1, - "gasUsed": "2186354", + "gasUsed": "758142", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8b1d2f7d43ce621f44fbda339212d9c591b32e22c96a93dba151914ea4e616f1", - "transactionHash": "0xed9f2c713fef809dc6e57ab0d647637b434c4a66bd3299d19112056cdf26d4f8", + "blockHash": "0xf23aeb7729a12461a87210ae4e3c63489b73cbb7bd95d8c953c2c6f6779eb430", + "transactionHash": "0x4fa633a2729ae3d9fbcb9ac259a0c2f08605fb5178b9b3d0d29550af884bc0af", "logs": [], - "blockNumber": 25952527, - "cumulativeGasUsed": "2186354", + "blockNumber": 27808516, + "cumulativeGasUsed": "758142", "status": 1, "byzantium": true }, "args": [ - "0xA429667Abb1A6c530BAd1083df4C69FBce86D696" + "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24" ], - "numDeployments": 3, - "solcInputHash": "c6054c8267f7fff860ff9e6cbf28bb9e", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_arbitrableChainId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"CrossChainDisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"data\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"CrossChainDisputeRequest(address,uint256,address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrable\":\"The address of the Arbitrable contract.\",\"_arbitrableChainId\":\"The chain identifier where the Arbitrable contract is deployed.\",\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeTemplate(uint256,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\",\"data\":\"The template data.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param data The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string data);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\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 _arbitrableChainId The chain identifier where the Arbitrable contract is deployed.\\n /// @param _arbitrable The address of the Arbitrable contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.\\n event CrossChainDisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 _arbitrableChainId,\\n address indexed _arbitrable,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0xc1a18e122cab929e6b0a028dd48cc560806cf530a0e1e199b15078b79cfd239c\",\"license\":\"MIT\"},\"src/arbitration/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute.\\n /// Must be called by the arbitrable contract.\\n /// Must pay 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 The identifier of the dispute created.\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration.\\n /// 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Return the current ruling of a dispute.\\n /// This is useful for parties to know if they should appeal.\\n /// @param _disputeID The identifer 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 function currentRuling(uint _disputeID) external view returns (uint ruling);\\n}\\n\",\"keccak256\":\"0xe9a699c2d9c3f57c0e2acf8bea94d274198e5947e91c5eb5f69d86c99e68dbbf\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport \\\"../IArbitrableV2.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, _disputeTemplate, \\\"\\\", _numberOfRulingOptions);\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n\\n uint256 templateId = localDisputeID;\\n emit DisputeTemplate(templateId, \\\"\\\", _disputeTemplate);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x83e137298606af8bea506fff29de9c274d41fd89b85dd2d2815443a9fae38716\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50604051610c89380380610c8983398101604081905261002f91610062565b60008054336001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055610092565b60006020828403121561007457600080fd5b81516001600160a01b038116811461008b57600080fd5b9392505050565b610be8806100a16000396000f3fe6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea26469706673582212209e73d035463fa04bd6a44a74fe31a00141aff519a72beffc9a48e5cd8476b07864736f6c63430008120033", - "deployedBytecode": "0x6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea26469706673582212209e73d035463fa04bd6a44a74fe31a00141aff519a72beffc9a48e5cd8476b07864736f6c63430008120033", + "numDeployments": 4, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeTemplate(uint256,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateData\":\"The template data.\",\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport \\\"../interfaces/IArbitrableV2.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, _disputeTemplate, \\\"\\\", _numberOfRulingOptions);\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n\\n uint256 templateId = localDisputeID;\\n emit DisputeTemplate(templateId, \\\"\\\", _disputeTemplate);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0xf2ddc32e36dac1b41c56367412e6c1575a6b75525842a7cea33fb8c9faa1651c\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7a259401627ba5546d9eb0264275aa1be9762f8a514545ae99d8c356ebf41f4f\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x9001274313a4e7eeda92332bbeeac8972f55e6378874babfaccd56eb283816f0\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610c89380380610c8983398101604081905261002f91610062565b60008054336001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055610092565b60006020828403121561007457600080fd5b81516001600160a01b038116811461008b57600080fd5b9392505050565b610be8806100a16000396000f3fe6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea2646970667358221220c1b6f6b6641df906264b752c9c09c29382bc0dce7da0f911287630761b39c67064736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100765760003560e01c80630c340a241461007b57806325fb3977146100b8578063311a6c56146100d9578063564a565d146100fb5780636cc6cde11461012b578063908bb2951461014b578063e09997d91461015e578063e4c0aaf41461018b578063fc548f08146101ab575b600080fd5b34801561008757600080fd5b5060005461009b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cb6100c6366004610811565b6101cb565b6040519081526020016100af565b3480156100e557600080fd5b506100f96100f4366004610885565b610228565b005b34801561010757600080fd5b5061011b6101163660046108a7565b6103c8565b6040516100af9493929190610906565b34801561013757600080fd5b5060015461009b906001600160a01b031681565b6100cb610159366004610811565b610496565b34801561016a57600080fd5b506100cb6101793660046108a7565b60036020526000908152604090205481565b34801561019757600080fd5b506100f96101a636600461094d565b6104eb565b3480156101b757600080fd5b506100f96101c636600461094d565b610537565b600061021e868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292508891506105839050565b9695505050505050565b600082815260036020526040812054600280549192918390811061024e5761024e610971565b6000918252602090912060015460049092020191506001600160a01b031633146102cd5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600301548311156103135760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102c4565b600181015460ff16156103745760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102c4565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103d857600080fd5b90600052602060002090600402016000915090508060000180546103fb90610987565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610987565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b600061021e86866040518060200160405280600081525087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250610583915050565b6000546001600160a01b031633146105155760405162461bcd60e51b81526004016102c4906109c1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105615760405162461bcd60e51b81526004016102c4906109c1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116105e15760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102c4565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106179086908b908b90600401610a03565b60206040518083038185885af1158015610635573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061065a9190610a39565b600280546040805160a06020601f8c018190040282018101909252608081018a8152949550919382918b908b90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906106d79082610ab7565b5060208281015160018301805460ff1916911515919091179055604080840151600284015560609093015160039283015560008581529190528190208290555181907fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709082907f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba978409061076a908a90610b77565b60405180910390a360015460405184916001600160a01b0316907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906107b590869086908b90610b8a565b60405180910390a3505095945050505050565b60008083601f8401126107da57600080fd5b50813567ffffffffffffffff8111156107f257600080fd5b60208301915083602082850101111561080a57600080fd5b9250929050565b60008060008060006060868803121561082957600080fd5b853567ffffffffffffffff8082111561084157600080fd5b61084d89838a016107c8565b9097509550602088013591508082111561086657600080fd5b50610873888289016107c8565b96999598509660400135949350505050565b6000806040838503121561089857600080fd5b50508035926020909101359150565b6000602082840312156108b957600080fd5b5035919050565b6000815180845260005b818110156108e6576020818501810151868301820152016108ca565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061091960808301876108c0565b9415156020830152506040810192909252606090910152919050565b6001600160a01b038116811461094a57600080fd5b50565b60006020828403121561095f57600080fd5b813561096a81610935565b9392505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061099b57607f821691505b6020821081036109bb57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610a4b57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b601f821115610ab257600081815260208120601f850160051c81016020861015610a8f5750805b601f850160051c820191505b81811015610aae57828155600101610a9b565b5050505b505050565b815167ffffffffffffffff811115610ad157610ad1610a52565b610ae581610adf8454610987565b84610a68565b602080601f831160018114610b1a5760008415610b025750858301515b600019600386901b1c1916600185901b178555610aae565b600085815260208120601f198616915b82811015610b4957888601518255948401946001909101908401610b2a565b5085821015610b675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061096a60208301846108c0565b838152826020820152606060408201526000610ba960608301846108c0565b9594505050505056fea2646970667358221220c1b6f6b6641df906264b752c9c09c29382bc0dce7da0f911287630761b39c67064736f6c63430008120033", "devdoc": { "events": { - "CrossChainDisputeRequest(address,uint256,address,uint256,uint256,uint256,string)": { - "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", - "params": { - "_arbitrable": "The address of the Arbitrable contract.", - "_arbitrableChainId": "The chain identifier where the Arbitrable contract is deployed.", - "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", - "_arbitrator": "The arbitrator of the contract.", - "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", - "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", - "_templateUri": "IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId." - } - }, "DisputeRequest(address,uint256,uint256,uint256,string)": { "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", "params": { @@ -381,9 +320,9 @@ "DisputeTemplate(uint256,string,string)": { "details": "To be emitted when a new dispute template is created.", "params": { + "_templateData": "The template data.", "_templateId": "The identifier of the dispute template.", - "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\".", - "data": "The template data." + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\"." } }, "Ruling(address,uint256,uint256)": { @@ -450,7 +389,7 @@ "storageLayout": { "storage": [ { - "astId": 129, + "astId": 9625, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "governor", "offset": 0, @@ -458,23 +397,23 @@ "type": "t_address" }, { - "astId": 132, + "astId": 9628, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "arbitrator", "offset": 0, "slot": "1", - "type": "t_contract(IArbitratorV2)112" + "type": "t_contract(IArbitratorV2)15154" }, { - "astId": 136, + "astId": 9632, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "disputes", "offset": 0, "slot": "2", - "type": "t_array(t_struct(DisputeStruct)127_storage)dyn_storage" + "type": "t_array(t_struct(DisputeStruct)9623_storage)dyn_storage" }, { - "astId": 140, + "astId": 9636, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "arbitratorDisputeIDToLocalID", "offset": 0, @@ -488,8 +427,8 @@ "label": "address", "numberOfBytes": "20" }, - "t_array(t_struct(DisputeStruct)127_storage)dyn_storage": { - "base": "t_struct(DisputeStruct)127_storage", + "t_array(t_struct(DisputeStruct)9623_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)9623_storage", "encoding": "dynamic_array", "label": "struct DisputeResolver.DisputeStruct[]", "numberOfBytes": "32" @@ -504,7 +443,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(IArbitratorV2)112": { + "t_contract(IArbitratorV2)15154": { "encoding": "inplace", "label": "contract IArbitratorV2", "numberOfBytes": "20" @@ -516,12 +455,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(DisputeStruct)127_storage": { + "t_struct(DisputeStruct)9623_storage": { "encoding": "inplace", "label": "struct DisputeResolver.DisputeStruct", "members": [ { - "astId": 120, + "astId": 9616, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "arbitratorExtraData", "offset": 0, @@ -529,7 +468,7 @@ "type": "t_bytes_storage" }, { - "astId": 122, + "astId": 9618, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "isRuled", "offset": 0, @@ -537,7 +476,7 @@ "type": "t_bool" }, { - "astId": 124, + "astId": 9620, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "ruling", "offset": 0, @@ -545,7 +484,7 @@ "type": "t_uint256" }, { - "astId": 126, + "astId": 9622, "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", "label": "numberOfRulingOptions", "offset": 0, diff --git a/contracts/deployments/arbitrumGoerli/KlerosCore.json b/contracts/deployments/arbitrumGoerli/KlerosCore.json index bce5d26f9..c1ceaa3be 100644 --- a/contracts/deployments/arbitrumGoerli/KlerosCore.json +++ b/contracts/deployments/arbitrumGoerli/KlerosCore.json @@ -1,5 +1,5 @@ { - "address": "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", + "address": "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24", "abi": [ { "inputs": [ @@ -52,6 +52,160 @@ "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableRootDKInGeneral", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "StakingFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WrongCaller", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -63,7 +217,7 @@ }, { "indexed": true, - "internalType": "contract IArbitrable", + "internalType": "contract IArbitrableV2", "name": "_arbitrable", "type": "address" } @@ -82,7 +236,7 @@ }, { "indexed": true, - "internalType": "contract IArbitrable", + "internalType": "contract IArbitrableV2", "name": "_arbitrable", "type": "address" } @@ -193,9 +347,39 @@ }, { "indexed": false, - "internalType": "string", - "name": "_param", - "type": "string" + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" } ], "name": "CourtModified", @@ -212,7 +396,7 @@ }, { "indexed": true, - "internalType": "contract IArbitrable", + "internalType": "contract IArbitrableV2", "name": "_arbitrable", "type": "address" } @@ -350,14 +534,20 @@ { "indexed": false, "internalType": "uint256", - "name": "_tokenAmount", + "name": "_pnkAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "_ethAmount", + "name": "_feeAmount", "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" } ], "name": "LeftoverRewardSent", @@ -387,7 +577,7 @@ "inputs": [ { "indexed": true, - "internalType": "contract IArbitrable", + "internalType": "contract IArbitrableV2", "name": "_arbitrable", "type": "address" }, @@ -493,14 +683,20 @@ { "indexed": false, "internalType": "int256", - "name": "_tokenAmount", + "name": "_pnkAmount", "type": "int256" }, { "indexed": false, "internalType": "int256", - "name": "_ethAmount", + "name": "_feeAmount", "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" } ], "name": "TokenAndETHShift", @@ -519,6 +715,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "DEFAULT_NB_OF_JURORS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "DISPUTE_KIT_CLASSIC", @@ -560,12 +769,12 @@ }, { "inputs": [], - "name": "MIN_JURORS", + "name": "NATIVE_CURRENCY", "outputs": [ { - "internalType": "uint256", + "internalType": "contract IERC20", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -700,6 +909,11 @@ "internalType": "bytes", "name": "_extraData", "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" } ], "name": "arbitrationCost", @@ -716,35 +930,36 @@ { "inputs": [ { - "internalType": "uint96", - "name": "_courtID", - "type": "uint96" - }, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ { "internalType": "uint256", - "name": "_alpha", + "name": "cost", "type": "uint256" } ], - "name": "changeCourtAlpha", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { - "internalType": "uint96", - "name": "_courtID", - "type": "uint96" + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" }, { "internalType": "bool", - "name": "_hiddenVotes", + "name": "_accepted", "type": "bool" } ], - "name": "changeCourtHiddenVotes", + "name": "changeAcceptedFeeTokens", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -756,49 +971,38 @@ "name": "_courtID", "type": "uint96" }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, { "internalType": "uint256", - "name": "_feeForJuror", + "name": "_minStake", "type": "uint256" - } - ], - "name": "changeCourtJurorFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint96", - "name": "_courtID", - "type": "uint96" }, { "internalType": "uint256", - "name": "_jurorsForCourtJump", + "name": "_alpha", "type": "uint256" - } - ], - "name": "changeCourtJurorsForJump", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + }, { - "internalType": "uint96", - "name": "_courtID", - "type": "uint96" + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" }, { "internalType": "uint256", - "name": "_minStake", + "name": "_jurorsForCourtJump", "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" } ], - "name": "changeCourtMinStake", + "name": "changeCourtParameters", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -806,17 +1010,22 @@ { "inputs": [ { - "internalType": "uint96", - "name": "_courtID", - "type": "uint96" + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" }, { - "internalType": "uint256[4]", - "name": "_timesPerPeriod", - "type": "uint256[4]" + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" } ], - "name": "changeCourtTimesPerPeriod", + "name": "changeCurrencyRates", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -873,6 +1082,30 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -999,6 +1232,69 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1078,7 +1374,7 @@ "type": "uint96" }, { - "internalType": "contract IArbitrable", + "internalType": "contract IArbitrableV2", "name": "arbitrated", "type": "address" }, @@ -1360,7 +1656,12 @@ "outputs": [ { "internalType": "uint256", - "name": "tokensAtStakePerJuror", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", "type": "uint256" }, { @@ -1368,6 +1669,11 @@ "name": "totalFeesForJurors", "type": "uint256" }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, { "internalType": "uint256", "name": "repartitions", @@ -1375,7 +1681,7 @@ }, { "internalType": "uint256", - "name": "penalties", + "name": "pnkPenalties", "type": "uint256" }, { @@ -1385,18 +1691,18 @@ }, { "internalType": "uint256", - "name": "disputeKitID", + "name": "sumFeeRewardPaid", "type": "uint256" }, { "internalType": "uint256", - "name": "sumRewardPaid", + "name": "sumPnkRewardPaid", "type": "uint256" }, { - "internalType": "uint256", - "name": "sumTokenRewardPaid", - "type": "uint256" + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" } ], "stateMutability": "view", @@ -1576,37 +1882,37 @@ "type": "function" } ], - "transactionHash": "0xd967daaaf1a4304242eab96e6e879719cd29bc2e0bc6d6a0792262a026c64153", + "transactionHash": "0x2fab71f981bedb09db89647da80be07bf55a3ea59652e1c176b681acc4bf9228", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", + "contractAddress": "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24", "transactionIndex": 1, - "gasUsed": "5295885", - "logsBloom": "0x00000000000000000100000000000000000000000000000000000000020000000000000000800000000000000000000000000000000000000000000000040000000000000800000000000000000000000000000000040002000000000000000000000000020000080000000000000800400000000000000008000000000000000000000000000000004000000000040000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000060000000001001000001000000000000000000000000000000000000000000000000", - "blockHash": "0x7293863fec0aace686402bf3ddd888bb814bf3e8301a3b8bf01241576c36ae0f", - "transactionHash": "0xd967daaaf1a4304242eab96e6e879719cd29bc2e0bc6d6a0792262a026c64153", + "gasUsed": "5389403", + "logsBloom": "0x00000000000000000000002000000000000000000000000008000000020000000000000000000000000000000000000000000000000000000000000200040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000000800400000000000000008000080000000000000000000000000004000000000040000000000000000000000000000000000000010000000000008000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000060000000001001000000000000000000000000000000000000004000000000000000", + "blockHash": "0xbdcd49fa1514f4d51faf5bac01bdebafd734ba0570bc218c9a1497112385e845", + "transactionHash": "0x2fab71f981bedb09db89647da80be07bf55a3ea59652e1c176b681acc4bf9228", "logs": [ { "transactionIndex": 1, - "blockNumber": 25602125, - "transactionHash": "0xd967daaaf1a4304242eab96e6e879719cd29bc2e0bc6d6a0792262a026c64153", - "address": "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", + "blockNumber": 27808431, + "transactionHash": "0x2fab71f981bedb09db89647da80be07bf55a3ea59652e1c176b681acc4bf9228", + "address": "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24", "topics": [ "0x7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c498", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x000000000000000000000000cbe3ad699919cf59efdf715e4b41af30a0e4c92d", + "0x0000000000000000000000000245a93abd9c5b2d767b2d98ce6d5e612208e474", "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x", "logIndex": 0, - "blockHash": "0x7293863fec0aace686402bf3ddd888bb814bf3e8301a3b8bf01241576c36ae0f" + "blockHash": "0xbdcd49fa1514f4d51faf5bac01bdebafd734ba0570bc218c9a1497112385e845" }, { "transactionIndex": 1, - "blockNumber": 25602125, - "transactionHash": "0xd967daaaf1a4304242eab96e6e879719cd29bc2e0bc6d6a0792262a026c64153", - "address": "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", + "blockNumber": 27808431, + "transactionHash": "0x2fab71f981bedb09db89647da80be07bf55a3ea59652e1c176b681acc4bf9228", + "address": "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24", "topics": [ "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -1614,13 +1920,13 @@ ], "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", "logIndex": 1, - "blockHash": "0x7293863fec0aace686402bf3ddd888bb814bf3e8301a3b8bf01241576c36ae0f" + "blockHash": "0xbdcd49fa1514f4d51faf5bac01bdebafd734ba0570bc218c9a1497112385e845" }, { "transactionIndex": 1, - "blockNumber": 25602125, - "transactionHash": "0xd967daaaf1a4304242eab96e6e879719cd29bc2e0bc6d6a0792262a026c64153", - "address": "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", + "blockNumber": 27808431, + "transactionHash": "0x2fab71f981bedb09db89647da80be07bf55a3ea59652e1c176b681acc4bf9228", + "address": "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24", "topics": [ "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -1629,11 +1935,11 @@ ], "data": "0x", "logIndex": 2, - "blockHash": "0x7293863fec0aace686402bf3ddd888bb814bf3e8301a3b8bf01241576c36ae0f" + "blockHash": "0xbdcd49fa1514f4d51faf5bac01bdebafd734ba0570bc218c9a1497112385e845" } ], - "blockNumber": 25602125, - "cumulativeGasUsed": "5295885", + "blockNumber": 27808431, + "cumulativeGasUsed": "5389403", "status": 1, "byzantium": true }, @@ -1641,7 +1947,7 @@ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", "0x4DEeeFD054434bf6721eF39Aa18EfB3fd0D12610", "0x0000000000000000000000000000000000000000", - "0xcBE3aD699919Cf59efDF715e4B41AF30A0E4c92d", + "0x0245A93ABd9c5b2d767B2D98cE6d5e612208E474", false, [ "200000000000000000000", @@ -1656,27 +1962,34 @@ 10 ], 250, - "0xa65D3ED6494ec5fcAa115A39D625B2F01786F094" + "0x5Ae75Db8B66B574b2c5C29eE4D32cc9Fe62bfdEE" ], - "numDeployments": 2, - "solcInputHash": "36e3015201aa6368fd28e007dfb67b68", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKit\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModuleAddress\",\"type\":\"address\"}],\"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\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"CourtCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_fromCourtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"_toCourtID\",\"type\":\"uint96\"}],\"name\":\"CourtJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_param\",\"type\":\"string\"}],\"name\":\"CourtModified\",\"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\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_parent\",\"type\":\"uint256\"}],\"name\":\"DisputeKitCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"DisputeKitEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_fromDisputeKitID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toDisputeKitID\",\"type\":\"uint256\"}],\"name\":\"DisputeKitJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ethAmount\",\"type\":\"uint256\"}],\"name\":\"LeftoverRewardSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum KlerosCore.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_penalty\",\"type\":\"uint256\"}],\"name\":\"StakeDelayed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_degreeOfCoherency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_tokenAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_ethAmount\",\"type\":\"int256\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ALPHA_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DISPUTE_KIT_CLASSIC\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FORKING_COURT\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GENERAL_COURT\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NON_PAYABLE_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NULL_DISPUTE_KIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEARCH_ITERATIONS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_parent\",\"type\":\"uint256\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"}],\"name\":\"changeCourtAlpha\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"}],\"name\":\"changeCourtHiddenVotes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeCourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"}],\"name\":\"changeCourtJurorsForJump\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"}],\"name\":\"changeCourtMinStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeCourtTimesPerPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"}],\"name\":\"changeJurorProsecutionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"createCourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKitNodes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"parent\",\"type\":\"uint256\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"disputeKit\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depthLevel\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrable\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCore.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"enableDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"executeRuling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"getDisputeKit\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"getDisputeKitChildren\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeKitNodesLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"staked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"locked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfRounds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokensAtStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repartitions\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"penalties\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"drawnJurors\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"disputeKitID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumTokenRewardPaid\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"isDisputeKitJumping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"isSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"jurorProsecutionModule\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"passPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_penalty\",\"type\":\"uint256\"}],\"name\":\"setStakeBySortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"ID of the dispute.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address,uint256)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\",\"_parent\":\"The ID of the parent dispute kit. It is left empty when root DK is created. Note that the root DK must be supported by the general court.\"}},\"appeal(uint256,uint256,bytes)\":{\"details\":\"Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Extradata for the dispute. Can be required during court jump.\",\"_numberOfChoices\":\"Number of choices for the dispute. Can be required during court jump.\"}},\"appealCost(uint256)\":{\"details\":\"Gets the cost of appealing a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"cost\":\"The appeal cost.\"}},\"appealPeriod(uint256)\":{\"details\":\"Gets the start and the end of a specified dispute's current appeal period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"end\":\"The end of the appeal period.\",\"start\":\"The start of the appeal period.\"}},\"arbitrationCost(bytes)\":{\"details\":\"Gets the cost of arbitration in a specified court.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the court to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost.\"}},\"changeCourtAlpha(uint96,uint256)\":{\"details\":\"Changes the `alpha` property value of a specified court.\",\"params\":{\"_alpha\":\"The new value for the `alpha` property value.\",\"_courtID\":\"The ID of the court.\"}},\"changeCourtHiddenVotes(uint96,bool)\":{\"details\":\"Changes the `hiddenVotes` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_hiddenVotes\":\"The new value for the `hiddenVotes` property value.\"}},\"changeCourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\"}},\"changeCourtJurorsForJump(uint96,uint256)\":{\"details\":\"Changes the `jurorsForCourtJump` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_jurorsForCourtJump\":\"The new value for the `jurorsForCourtJump` property value.\"}},\"changeCourtMinStake(uint96,uint256)\":{\"details\":\"Changes the `minStake` property value of a specified court. Don't set to a value lower than its parent's `minStake` property value.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_minStake\":\"The new value for the `minStake` property value.\"}},\"changeCourtTimesPerPeriod(uint96,uint256[4])\":{\"details\":\"Changes the `timesPerPeriod` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_timesPerPeriod\":\"The new value for the `timesPerPeriod` property value.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeJurorProsecutionModule(address)\":{\"details\":\"Changes the `jurorProsecutionModule` storage variable.\",\"params\":{\"_jurorProsecutionModule\":\"The new value for the `jurorProsecutionModule` storage variable.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.\",\"params\":{\"_sortitionModule\":\"The new value for the `sortitionModule` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_courtParameters\":\"Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_governor\":\"The governor's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionExtraData\":\"The extra data for sortition module.\",\"_sortitionModuleAddress\":\"The sortition module responsible for sortition of the jurors.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\"}},\"createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])\":{\"details\":\"Creates a court under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the court.\",\"_feeForJuror\":\"The `feeForJuror` property value of the court.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the court.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the court.\",\"_minStake\":\"The `minStake` property value of the court.\",\"_parent\":\"The `parent` property value of the court.\",\"_sortitionExtraData\":\"Extra data for sortition module.\",\"_supportedDisputeKits\":\"Indexes of dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the court.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Creates a dispute. Must be called by the arbitrable contract.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"Number of choices for the jurors to choose from.\"},\"returns\":{\"disputeID\":\"The ID of the created dispute.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws jurors for the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"enableDisputeKits(uint96,uint256[],bool)\":{\"details\":\"Adds/removes court's support for specified dispute kits.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_disputeKitIDs\":\"The IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the court.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute tokens and ETH for the specific round of the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\",\"_round\":\"The appeal round.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"executeRuling(uint256)\":{\"details\":\"Executes a specified dispute's ruling. UNTRUSTED.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getDisputeKit(uint256)\":{\"details\":\"Gets the dispute kit for a specific `_disputeKitID`.\",\"params\":{\"_disputeKitID\":\"The ID of the dispute kit.\"}},\"getDisputeKitChildren(uint256)\":{\"details\":\"Gets non-primitive properties of a specified dispute kit node.\",\"params\":{\"_disputeKitID\":\"The ID of the dispute kit.\"},\"returns\":{\"_0\":\"children Indexes of children of this DK.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"getNumberOfVotes(uint256)\":{\"details\":\"Gets the number of votes permitted for the specified dispute in the latest round.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_courtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"isDisputeKitJumping(uint256)\":{\"details\":\"Returns true if the dispute kit will be switched to a parent DK.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"_0\":\"Whether DK will be switched or not.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_stake\":\"The new stake.\"}}},\"title\":\"KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the token and the dispute kit contracts.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCore.sol\":\"KlerosCore\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IArbitrable\\n/// Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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);\\ninterface IArbitrable {\\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 event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _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 function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x2a5363c37d33749f6b53c288f6d1538f013c6efbb3df86e63eceaa8163a6b212\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitrator {\\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 event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute. Must be called by the arbitrable contract.\\n /// Must pay 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 function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x8028f7d6a0fe07687f975fc51c9f889083ae1a409a134e8017a044701310948f\",\"license\":\"MIT\"},\"src/arbitration/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Address of the juror.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event Justification(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x64acb1fb52ebc6f7b61282e0c2781319a7a9a3ff4e460b6513048c34b6e4ba32\",\"license\":\"MIT\"},\"src/arbitration/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n enum preStakeHookResult {\\n ok,\\n delayed,\\n failed\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(address _account, uint96 _courtID, uint256 _value) external;\\n\\n function setJurorInactive(address _account) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _voteID) external view returns (address);\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external returns (preStakeHookResult);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x28911aa78669746f40c4c3bce723db21600a49a74142c0fe378680b1b356d633\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrator.sol\\\";\\nimport \\\"./IDisputeKit.sol\\\";\\nimport \\\"./ISortitionModule.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the token and the dispute kit contracts.\\ncontract KlerosCore is IArbitrator {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum tokens needed to stake in the court.\\n uint256 alpha; // Basis point of tokens that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrable arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 tokensAtStakePerJuror; // The amount of tokens at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 penalties; // The amount of tokens collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumTokenRewardPaid; // Total sum of tokens paid to coherent jurors as a reward in this round.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n mapping(uint96 => uint256) stakedTokens; // The number of tokens the juror has staked in the court in the form `stakedTokens[courtID]`.\\n mapping(uint96 => uint256) lockedTokens; // The number of tokens the juror has locked in the court in the form `lockedTokens[courtID]`.\\n }\\n\\n struct DisputeKitNode {\\n uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root.\\n uint256[] children; // List of child dispute kits.\\n IDisputeKit disputeKit; // The dispute kit implementation.\\n uint256 depthLevel; // How far this DK is from the root. 0 for root DK.\\n bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 penaltiesInRound; // The amount of tokens collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n // TODO: interactions with jurorProsecutionModule.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n\\n Court[] public courts; // The courts.\\n DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID.\\n Dispute[] public disputes; // The disputes.\\n\\n mapping(address => Juror) internal jurors; // The jurors.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty);\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(uint96 indexed _courtID, string _param);\\n event DisputeKitCreated(\\n uint256 indexed _disputeKitID,\\n IDisputeKit indexed _disputeKitAddress,\\n uint256 indexed _parent\\n );\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _tokenAmount,\\n int256 _ethAmount\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _tokenAmount,\\n uint256 _ethAmount\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent.\\n disputeKitNodes.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: NULL_DISPUTE_KIT,\\n children: new uint256[](0),\\n disputeKit: _disputeKit,\\n depthLevel: 0,\\n disabled: false\\n })\\n );\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit, NULL_DISPUTE_KIT);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created.\\n /// Note that the root DK must be supported by the general court.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor {\\n uint256 disputeKitID = disputeKitNodes.length;\\n require(_parent < disputeKitID, \\\"!Parent\\\");\\n uint256 depthLevel;\\n if (_parent != NULL_DISPUTE_KIT) {\\n depthLevel = disputeKitNodes[_parent].depthLevel + 1;\\n // It should be always possible to reach the root from the leaf with the defined number of search iterations.\\n require(depthLevel < SEARCH_ITERATIONS, \\\"Depth level max\\\");\\n }\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: _parent,\\n children: new uint256[](0),\\n disputeKit: _disputeKitAddress,\\n depthLevel: depthLevel,\\n disabled: false\\n })\\n );\\n\\n disputeKitNodes[_parent].children.push(disputeKitID);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent);\\n if (_parent == NULL_DISPUTE_KIT) {\\n // A new dispute kit tree root should always be supported by the General court.\\n _enableDisputeKit(GENERAL_COURT, disputeKitID, true);\\n }\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n require(courts[_parent].minStake <= _minStake, \\\"MinStake lower than parent court\\\");\\n require(_supportedDisputeKits.length > 0, \\\"!Supported DK\\\");\\n require(_parent != FORKING_COURT, \\\"Invalid: Forking court as parent\\\");\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n require(\\n _supportedDisputeKits[i] > 0 && _supportedDisputeKits[i] < disputeKitNodes.length,\\n \\\"Wrong DK index\\\"\\n );\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n /// @dev Changes the `minStake` property value of a specified court. Don't set to a value lower than its parent's `minStake` property value.\\n /// @param _courtID The ID of the court.\\n /// @param _minStake The new value for the `minStake` property value.\\n function changeCourtMinStake(uint96 _courtID, uint256 _minStake) external onlyByGovernor {\\n require(\\n _courtID == GENERAL_COURT || courts[courts[_courtID].parent].minStake <= _minStake,\\n \\\"MinStake lower than parent court\\\"\\n );\\n for (uint256 i = 0; i < courts[_courtID].children.length; i++) {\\n require(courts[courts[_courtID].children[i]].minStake >= _minStake, \\\"MinStake lower than parent court\\\");\\n }\\n\\n courts[_courtID].minStake = _minStake;\\n emit CourtModified(_courtID, \\\"minStake\\\");\\n }\\n\\n /// @dev Changes the `alpha` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _alpha The new value for the `alpha` property value.\\n function changeCourtAlpha(uint96 _courtID, uint256 _alpha) external onlyByGovernor {\\n courts[_courtID].alpha = _alpha;\\n emit CourtModified(_courtID, \\\"alpha\\\");\\n }\\n\\n /// @dev Changes the `feeForJuror` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _feeForJuror The new value for the `feeForJuror` property value.\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n courts[_courtID].feeForJuror = _feeForJuror;\\n emit CourtModified(_courtID, \\\"feeForJuror\\\");\\n }\\n\\n /// @dev Changes the `jurorsForCourtJump` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _jurorsForCourtJump The new value for the `jurorsForCourtJump` property value.\\n function changeCourtJurorsForJump(uint96 _courtID, uint256 _jurorsForCourtJump) external onlyByGovernor {\\n courts[_courtID].jurorsForCourtJump = _jurorsForCourtJump;\\n emit CourtModified(_courtID, \\\"jurorsForCourtJump\\\");\\n }\\n\\n /// @dev Changes the `hiddenVotes` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _hiddenVotes The new value for the `hiddenVotes` property value.\\n function changeCourtHiddenVotes(uint96 _courtID, bool _hiddenVotes) external onlyByGovernor {\\n courts[_courtID].hiddenVotes = _hiddenVotes;\\n emit CourtModified(_courtID, \\\"hiddenVotes\\\");\\n }\\n\\n /// @dev Changes the `timesPerPeriod` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _timesPerPeriod The new value for the `timesPerPeriod` property value.\\n function changeCourtTimesPerPeriod(uint96 _courtID, uint256[4] memory _timesPerPeriod) external onlyByGovernor {\\n courts[_courtID].timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(_courtID, \\\"timesPerPeriod\\\");\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n require(_disputeKitIDs[i] > 0 && _disputeKitIDs[i] < disputeKitNodes.length, \\\"Wrong DK index\\\");\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n require(\\n !(_courtID == GENERAL_COURT && disputeKitNodes[_disputeKitIDs[i]].parent == NULL_DISPUTE_KIT),\\n \\\"Can't disable Root DK in General\\\"\\n );\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n function setStake(uint96 _courtID, uint256 _stake) external {\\n require(_setStakeForAccount(msg.sender, _courtID, _stake, 0), \\\"Staking failed\\\");\\n }\\n\\n function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _stake, uint256 _penalty) external {\\n require(msg.sender == address(sortitionModule), \\\"Wrong caller\\\");\\n _setStakeForAccount(_account, _courtID, _stake, _penalty);\\n }\\n\\n /// @dev Creates a dispute. Must be called by the arbitrable contract.\\n /// @param _numberOfChoices Number of choices for the jurors to choose from.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes),\\n /// the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The ID of the created dispute.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"ETH too low for arbitration cost\\\");\\n\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n require(courts[courtID].supportedDisputeKits[disputeKitID], \\\"DK unsupported by court\\\");\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrable(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit;\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = msg.value / court.feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.tokensAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = msg.value;\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n require(\\n currentRound > 0 ||\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)],\\n \\\"Evidence not passed && !Appeal\\\"\\n );\\n require(round.drawnJurors.length == round.nbVotes, \\\"Dispute still drawing\\\");\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)] ||\\n disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID),\\n \\\"Commit period not passed\\\"\\n );\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)] ||\\n disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID),\\n \\\"Vote period not passed\\\"\\n );\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)],\\n \\\"Appeal period not passed\\\"\\n );\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert(\\\"Dispute period is final\\\");\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n require(dispute.period == Period.evidence, \\\"!Evidence period\\\");\\n\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= round.nbVotes ? startIndex + _iterations : round.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n jurors[drawnAddress].lockedTokens[dispute.courtID] += round.tokensAtStakePerJuror;\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n }\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n require(msg.value >= appealCost(_disputeID), \\\"ETH too low for appeal cost\\\");\\n\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.appeal, \\\"Dispute not appealable\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n require(msg.sender == address(disputeKitNodes[round.disputeKitID].disputeKit), \\\"Dispute Kit only\\\");\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) {\\n if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n break;\\n } else if (disputeKitNodes[newDisputeKitID].parent != NULL_DISPUTE_KIT) {\\n newDisputeKitID = disputeKitNodes[newDisputeKitID].parent;\\n } else {\\n // DK's parent has 0 index, that means we reached the root DK (0 depth level).\\n // Jump to the next parent court if the current court doesn't support any DK from this tree.\\n // Note that we don't reset newDisputeKitID in this case as, a precaution.\\n newCourtID = courts[newCourtID].parent;\\n }\\n }\\n // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court.\\n // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default.\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n newCourtID = GENERAL_COURT;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.tokensAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n IDisputeKit disputeKit = disputeKitNodes[extraRound.disputeKitID].disputeKit;\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKit.createDispute(_disputeID, _numberOfChoices, _extraData, extraRound.nbVotes);\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute tokens and ETH for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"!Execution period\\\");\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 penaltiesInRoundCache = round.penalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n penaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, penaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, penaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.penalties != penaltiesInRoundCache) {\\n round.penalties = penaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the tokens and ETH for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return penaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.tokensAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.penaltiesInRound += penalty;\\n\\n // Unlock the tokens affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n jurors[account].lockedTokens[dispute.courtID] -= penalty;\\n\\n // Apply the penalty to the staked tokens\\n if (jurors[account].stakedTokens[dispute.courtID] >= courts[dispute.courtID].minStake + penalty) {\\n // The juror still has enough staked token after penalty for this court.\\n uint256 newStake = jurors[account].stakedTokens[dispute.courtID] - penalty;\\n _setStakeForAccount(account, dispute.courtID, newStake, penalty);\\n } else if (jurors[account].stakedTokens[dispute.courtID] != 0) {\\n // The juror does not have enough staked tokens after penalty for this court, unstake them.\\n _setStakeForAccount(account, dispute.courtID, 0, penalty);\\n }\\n emit TokenAndETHShift(account, _params.disputeID, _params.round, degreeOfCoherence, -int256(penalty), 0);\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n payable(governor).send(round.totalFeesForJurors);\\n _safeTransfer(governor, _params.penaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.penaltiesInRound,\\n round.totalFeesForJurors\\n );\\n }\\n return _params.penaltiesInRound;\\n }\\n\\n /// @dev Distribute the tokens and ETH for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 tokenLocked = (round.tokensAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the tokens of the juror for this round.\\n jurors[account].lockedTokens[dispute.courtID] -= tokenLocked;\\n\\n // Give back the locked tokens in case the juror fully unstaked earlier.\\n if (jurors[account].stakedTokens[dispute.courtID] == 0) {\\n _safeTransfer(account, tokenLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 tokenReward = ((_params.penaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumTokenRewardPaid += tokenReward;\\n uint256 ethReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumRewardPaid += ethReward;\\n _safeTransfer(account, tokenReward);\\n payable(account).send(ethReward);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(tokenReward),\\n int256(ethReward)\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverTokenReward = _params.penaltiesInRound - round.sumTokenRewardPaid;\\n uint256 leftoverReward = round.totalFeesForJurors - round.sumRewardPaid;\\n if (leftoverTokenReward != 0 || leftoverReward != 0) {\\n if (leftoverTokenReward != 0) {\\n _safeTransfer(governor, leftoverTokenReward);\\n }\\n if (leftoverReward != 0) {\\n payable(governor).send(leftoverReward);\\n }\\n emit LeftoverRewardSent(_params.disputeID, _params.round, leftoverTokenReward, leftoverReward);\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling. UNTRUSTED.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"!Execution period\\\");\\n require(!dispute.ruled, \\\"Ruling already executed\\\");\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the cost of arbitration in a specified court.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the court to create the dispute in (first 32 bytes)\\n /// and the minimum number of jurors required (next 32 bytes).\\n /// @return cost The arbitration cost.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round\\n )\\n external\\n view\\n returns (\\n uint256 tokensAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 repartitions,\\n uint256 penalties,\\n address[] memory drawnJurors,\\n uint256 disputeKitID,\\n uint256 sumRewardPaid,\\n uint256 sumTokenRewardPaid\\n )\\n {\\n Round storage round = disputes[_disputeID].rounds[_round];\\n return (\\n round.tokensAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.repartitions,\\n round.penalties,\\n round.drawnJurors,\\n round.disputeKitID,\\n round.sumRewardPaid,\\n round.sumTokenRewardPaid\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 staked, uint256 locked, uint256 nbCourts) {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedTokens[_courtID];\\n locked = juror.lockedTokens[_courtID];\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets non-primitive properties of a specified dispute kit node.\\n /// @param _disputeKitID The ID of the dispute kit.\\n /// @return children Indexes of children of this DK.\\n function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) {\\n return disputeKitNodes[_disputeKitID].children;\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_courtID];\\n timesPerPeriod = court.timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitNodesLength() external view returns (uint256) {\\n return disputeKitNodes.length;\\n }\\n\\n /// @dev Gets the dispute kit for a specific `_disputeKitID`.\\n /// @param _disputeKitID The ID of the dispute kit.\\n function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) {\\n return disputeKitNodes[_disputeKitID].disputeKit;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n /// @param _penalty Penalized amount won't be transferred back to juror when the stake is lowered.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function _setStakeForAccount(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) return false;\\n\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = juror.stakedTokens[_courtID];\\n\\n if (_stake != 0) {\\n // Check against locked tokens in case the min stake was lowered.\\n if (_stake < courts[_courtID].minStake || _stake < juror.lockedTokens[_courtID]) return false;\\n }\\n\\n ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _stake, _penalty);\\n if (result == ISortitionModule.preStakeHookResult.failed) {\\n return false;\\n } else if (result == ISortitionModule.preStakeHookResult.delayed) {\\n emit StakeDelayed(_account, _courtID, _stake, _penalty);\\n return true;\\n }\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (_safeTransferFrom(_account, address(this), transferredAmount)) {\\n if (currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n if (_stake == 0) {\\n // Keep locked tokens in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedTokens[_courtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (_safeTransfer(_account, transferredAmount)) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!_safeTransfer(_account, transferredAmount)) {\\n return false;\\n }\\n }\\n }\\n }\\n\\n // Update juror's records.\\n juror.stakedTokens[_courtID] = _stake;\\n\\n sortitionModule.setStake(_account, _courtID, _stake);\\n emit StakeSet(_account, _courtID, _stake);\\n return true;\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = MIN_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = MIN_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function _safeTransfer(address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(pinakion).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function _safeTransferFrom(address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(pinakion).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x40ea2ff69298920e83a2f4817bbc742127c35b0fc3ecdf552f33b33f7dc72a84\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162005f3938038062005f3983398101604081905262000034916200065f565b600080546001600160a01b038b81166001600160a01b0319928316178355600180548c8316908416178155600280548c841690851617815560038054878516951694909417909355600580546040805160a081018252878152815188815260208082018452808301918252968f1692820192909252606081018890526080810188905295820183559582905284519201027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db08101918255935180519394919362000128937f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db19093019291909101906200045c565b506040828101516002830180546001600160a01b0319166001600160a01b03928316179055606084015160038401556080909301516004909201805460ff191692151592909217909155516000918816906001907f7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c498908490a460048054600101815560008181526003546040516311de995760e21b81526001600160a01b039091169263477a655c92620001e19290918791016200074c565b600060405180830381600087803b158015620001fc57600080fd5b505af115801562000211573d6000803e3d6000fd5b5050600480546001810182556000918252600c027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160601b031916815560408051838152602081019091529093509150508051620002819160018401916020909101906200045c565b50805460ff60601b19166c01000000000000000000000000871515021781558451600282015560208501516003820155604085015160048083019190915560608601516005830155620002db9060068301908690620004ac565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c90620003119060019087906004016200074c565b600060405180830381600087803b1580156200032c57600080fd5b505af115801562000341573d6000803e3d6000fd5b5050825487516020808a01516040808c015160608d0151825160008152948501928390526001600160601b039096169750600196507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d95620003ab958f959094938e91906200079e565b60405180910390a3620003c160018080620003d1565b505050505050505050506200083a565b806004846001600160601b031681548110620003f157620003f162000788565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b8280548282559060005260206000209081019282156200049a579160200282015b828111156200049a5782518255916020019190600101906200047d565b50620004a8929150620004dc565b5090565b82600481019282156200049a57916020028201828111156200049a5782518255916020019190600101906200047d565b5b80821115620004a85760008155600101620004dd565b6001600160a01b03811681146200050957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200053457600080fd5b604051608081016001600160401b03811182821017156200055957620005596200050c565b6040528060808401858111156200056f57600080fd5b845b818110156200058b57805183526020928301920162000571565b509195945050505050565b60005b83811015620005b357818101518382015260200162000599565b50506000910152565b600082601f830112620005ce57600080fd5b81516001600160401b0380821115620005eb57620005eb6200050c565b604051601f8301601f19908116603f011681019082821181831017156200061657620006166200050c565b816040528381528660208588010111156200063057600080fd5b6200064384602083016020890162000596565b9695505050505050565b80516200065a81620004f3565b919050565b60008060008060008060008060006101e08a8c0312156200067f57600080fd5b89516200068c81620004f3565b60208b01519099506200069f81620004f3565b60408b0151909850620006b281620004f3565b60608b0151909750620006c581620004f3565b60808b01519096508015158114620006dc57600080fd5b9450620006ed8b60a08c0162000522565b9350620006ff8b6101208c0162000522565b6101a08b01519093506001600160401b038111156200071d57600080fd5b6200072b8c828d01620005bc565b9250506200073d6101c08b016200064d565b90509295985092959850929598565b82815260406020820152600082518060408401526200077381606085016020870162000596565b601f01601f1916919091016060019392505050565b634e487b7160e01b600052603260045260246000fd5b60006101408083018a1515845260208a8186015289604086015288606086015287608086015260a085018760005b6004811015620007eb57815183529183019190830190600101620007cc565b5050506101208501929092528451908190526101608401918086019160005b8181101562000828578351855293820193928201926001016200080a565b50929c9b505050505050505050505050565b6156ef806200084a6000396000f3fe6080604052600436106102be5760003560e01c8063751accd011610170578063c3569902116100cc578063eaff425a11610085578063eaff425a14610990578063f12ada8b146109a5578063f56f0725146109c5578063f7434ea9146109e5578063fbf405b014610a05578063fc6f8f1614610a25578063fe524c3914610a4557600080fd5b8063c356990214610883578063c71f425314610896578063cf0c38f8146108b6578063d1c1df48146108d6578063d2b8035a14610950578063e4c0aaf41461097057600080fd5b8063a072b86c11610129578063a072b86c1461079b578063a4370ce4146107bb578063afe15cfb146107db578063b004963714610810578063b39367ed14610830578063c13517e114610850578063c258bb191461086357600080fd5b8063751accd0146106cc5780637717a6e8146106ec578063840bc19c1461070c5780638a9bb02a146107275780638bb048751461075b5780639280169a1461077b57600080fd5b80632ea7b4d01161021f578063564a565d116101d8578063564a565d146105fc57806359ec827e1461062d5780635ea5c0381461064d5780636235593f1461066257806367c51947146106775780636c1eb1b9146106975780636e5f35c2146106ac57600080fd5b80632ea7b4d01461052a57806334d5fb31146105405780633cfd11841461055557806343d4137f1461058257806344c792e7146105af578063543f8a36146105cf57600080fd5b80631956b1f91161027c5780631956b1f9146103cf57806319b81529146103ef5780631c3db16d1461041f5780631f5a0dd21461045c57806327e6ec8a146104bd5780632d29a47b146104ea5780632e1daf2f1461050a57600080fd5b8062f5822c146102c35780630b7414bc146102e55780630c340a24146103055780630d1b9d1a146103425780630d83b9401461038c578063115d5376146103af575b600080fd5b3480156102cf57600080fd5b506102e36102de366004614b9b565b610a65565b005b3480156102f157600080fd5b506102e3610300366004614cae565b610aba565b34801561031157600080fd5b50600054610325906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561034e57600080fd5b5061036261035d366004614d0f565b610c61565b604080519485526001600160a01b0390931660208501529183015215156060820152608001610339565b34801561039857600080fd5b506103a1600181565b604051908152602001610339565b3480156103bb57600080fd5b506102e36103ca366004614d0f565b610ca7565b3480156103db57600080fd5b506103256103ea366004614d0f565b6112df565b3480156103fb57600080fd5b5061040f61040a366004614d0f565b611317565b6040519015158152602001610339565b34801561042b57600080fd5b5061043f61043a366004614d0f565b611410565b604080519384529115156020840152151590820152606001610339565b34801561046857600080fd5b5061047c610477366004614d0f565b611519565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610339565b3480156104c957600080fd5b506104d2600081565b6040516001600160601b039091168152602001610339565b3480156104f657600080fd5b506102e3610505366004614d28565b611578565b34801561051657600080fd5b50600354610325906001600160a01b031681565b34801561053657600080fd5b506103a161271081565b34801561054c57600080fd5b506104d2600181565b34801561056157600080fd5b50610575610570366004614d54565b6117bf565b6040516103399190614d92565b34801561058e57600080fd5b506105a261059d366004614d0f565b611830565b6040516103399190614ddb565b3480156105bb57600080fd5b506102e36105ca366004614dee565b6118ac565b3480156105db57600080fd5b506105ef6105ea366004614b9b565b61196c565b6040516103399190614e25565b34801561060857600080fd5b5061061c610617366004614d0f565b611a08565b604051610339959493929190614eaa565b34801561063957600080fd5b506103a1610648366004614d0f565b611a64565b34801561065957600080fd5b506005546103a1565b34801561066e57600080fd5b506103a1600081565b34801561068357600080fd5b506102e3610692366004614ee9565b611bb9565b3480156106a357600080fd5b506103a1600a81565b3480156106b857600080fd5b506102e36106c7366004614ee9565b611c5a565b3480156106d857600080fd5b506102e36106e7366004614f82565b611e60565b3480156106f857600080fd5b506102e3610707366004614ee9565b611f2c565b34801561071857600080fd5b506103a16001600160ff1b0381565b34801561073357600080fd5b50610747610742366004614fda565b611f7a565b604051610339989796959493929190614ffc565b34801561076757600080fd5b506102e3610776366004614d0f565b61206e565b34801561078757600080fd5b506102e3610796366004614ee9565b6121fa565b3480156107a757600080fd5b506102e36107b63660046150ed565b612295565b3480156107c757600080fd5b506102e36107d6366004614ee9565b61261e565b3480156107e757600080fd5b506107fb6107f6366004614d0f565b6126c6565b60408051928352602083019190915201610339565b34801561081c57600080fd5b506102e361082b366004614b9b565b612772565b34801561083c57600080fd5b506102e361084b3660046151ad565b6127be565b6103a161085e3660046151e1565b61286d565b34801561086f57600080fd5b506102e361087e366004614b9b565b612ba3565b6102e3610891366004615227565b612bef565b3480156108a257600080fd5b506103a16108b1366004614d0f565b613250565b3480156108c257600080fd5b50600254610325906001600160a01b031681565b3480156108e257600080fd5b506109356108f1366004615260565b6001600160a01b0390911660009081526007602090815260408083206001600160601b03909416835260018401825280832054600285019092529091205491549092565b60408051938452602084019290925290820152606001610339565b34801561095c57600080fd5b506102e361096b366004614fda565b6132b8565b34801561097c57600080fd5b506102e361098b366004614b9b565b6135bf565b34801561099c57600080fd5b506103a1600381565b3480156109b157600080fd5b506102e36109c036600461528c565b61360b565b3480156109d157600080fd5b506102e36109e03660046152aa565b613868565b3480156109f157600080fd5b506103a1610a003660046152ee565b6138c4565b348015610a1157600080fd5b50600154610325906001600160a01b031681565b348015610a3157600080fd5b506103a1610a40366004614d0f565b613918565b348015610a5157600080fd5b5061040f610a60366004614ee9565b613947565b6000546001600160a01b03163314610a985760405162461bcd60e51b8152600401610a8f90615322565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ae45760405162461bcd60e51b8152600401610a8f90615322565b60005b8251811015610c5b578115610b81576000838281518110610b0a57610b0a615349565b6020026020010151118015610b3b57506005548351849083908110610b3157610b31615349565b6020026020010151105b610b575760405162461bcd60e51b8152600401610a8f9061535f565b610b7c84848381518110610b6d57610b6d615349565b60200260200101516001613991565b610c49565b6001600160601b0384166001148015610bd7575060006005848381518110610bab57610bab615349565b602002602001015181548110610bc357610bc3615349565b906000526020600020906005020160000154145b15610c245760405162461bcd60e51b815260206004820181905260248201527f43616e27742064697361626c6520526f6f7420444b20696e2047656e6572616c6044820152606401610a8f565b610c4984848381518110610c3a57610c3a615349565b60200260200101516000613991565b80610c538161539d565b915050610ae7565b50505050565b60058181548110610c7157600080fd5b600091825260209091206005909102018054600282015460038301546004909301549193506001600160a01b0316919060ff1684565b600060068281548110610cbc57610cbc615349565b600091825260208220600491820201805482549194506001600160601b0316908110610cea57610cea615349565b6000918252602082206003850154600c909202019250610d0c906001906153b6565b90506000836003018281548110610d2557610d25615349565b6000918252602082206009909102019150600185015460ff166004811115610d4f57610d4f614e72565b03610e81576000821180610da057506001840154600684019060ff166004811115610d7c57610d7c614e72565b60048110610d8c57610d8c615349565b01546002850154610d9d90426153b6565b10155b610dec5760405162461bcd60e51b815260206004820152601e60248201527f45766964656e6365206e6f7420706173736564202626202141707065616c00006044820152606401610a8f565b6003810154600682015414610e3b5760405162461bcd60e51b815260206004820152601560248201527444697370757465207374696c6c2064726177696e6760581b6044820152606401610a8f565b8254600160601b900460ff16610e52576002610e55565b60015b60018086018054909160ff1990911690836004811115610e7757610e77614e72565b0217905550611291565b60018085015460ff166004811115610e9b57610e9b614e72565b03610fda576001840154600684019060ff166004811115610ebe57610ebe614e72565b60048110610ece57610ece615349565b01546002850154610edf90426153b6565b101580610f7c57506005816000015481548110610efe57610efe615349565b6000918252602090912060059091020160020154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c91906153c9565b610fc35760405162461bcd60e51b815260206004820152601860248201527710dbdb5b5a5d081c195c9a5bd9081b9bdd081c185cdcd95960421b6044820152606401610a8f565b6001808501805460029260ff199091169083610e77565b6002600185015460ff166004811115610ff557610ff5614e72565b03611170576001840154600684019060ff16600481111561101857611018614e72565b6004811061102857611028615349565b0154600285015461103990426153b6565b1015806110d65750600581600001548154811061105857611058615349565b60009182526020909120600590910201600201546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa1580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906153c9565b61111b5760405162461bcd60e51b8152602060048201526016602482015275159bdd19481c195c9a5bd9081b9bdd081c185cdcd95960521b6044820152606401610a8f565b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3611291565b6003600185015460ff16600481111561118b5761118b614e72565b0361122f576001840154600684019060ff1660048111156111ae576111ae614e72565b600481106111be576111be615349565b015460028501546111cf90426153b6565b10156112185760405162461bcd60e51b8152602060048201526018602482015277105c1c19585b081c195c9a5bd9081b9bdd081c185cdcd95960421b6044820152606401610a8f565b6001808501805460049260ff199091169083610e77565b6004600185015460ff16600481111561124a5761124a614e72565b036112915760405162461bcd60e51b8152602060048201526017602482015276111a5cdc1d5d19481c195c9a5bd9081a5cc8199a5b985b604a1b6044820152606401610a8f565b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916112d09160ff16906153e6565b60405180910390a25050505050565b6000600582815481106112f4576112f4615349565b60009182526020909120600260059092020101546001600160a01b031692915050565b6000806006838154811061132d5761132d615349565b6000918252602082206003600490920201908101805491935090611353906001906153b6565b8154811061136357611363615349565b6000918252602082208454600480546009909402909201945090916001600160601b0390911690811061139857611398615349565b90600052602060002090600c020190508060050154826003015410156113c357506000949350505050565b80546004805490916001600160601b03169081106113e3576113e3615349565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b6000806000806006858154811061142957611429615349565b600091825260208220600360049092020190810180549193509061144f906001906153b6565b8154811061145f5761145f615349565b906000526020600020906009020190506000600582600001548154811061148857611488615349565b6000918252602090912060059091020160020154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156114e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150991906153f4565b9199909850909650945050505050565b6004818154811061152957600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b60006006848154811061158d5761158d615349565b600091825260209091206004918202019150600182015460ff1660048111156115b8576115b8614e72565b146115d55760405162461bcd60e51b8152600401610a8f9061542c565b60008160030184815481106115ec576115ec615349565b906000526020600020906009020190506000600582600001548154811061161557611615615349565b6000918252602082206002600590920201015460048401546001600160a01b039091169250906116458683615457565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa1580156116a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c7919061546a565b9050806000036116e257818411156116dd578193505b611702565b6116ed826002615483565b841115611702576116ff826002615483565b93505b60048701849055845b8481101561179e5782811015611757576117506040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613a19565b935061178c565b61178c6040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613f1c565b806117968161539d565b91505061170b565b50828760050154146117b257600587018390555b5050505050505050505050565b6117c7614ad8565b60006004836001600160601b0316815481106117e5576117e5615349565b60009182526020909120604080516080810191829052600c9093029091019250600683019060049082845b815481526020019060010190808311611810575050505050915050919050565b60606005828154811061184557611845615349565b90600052602060002090600502016001018054806020026020016040519081016040528092919081815260200182805480156118a057602002820191906000526020600020905b81548152602001906001019080831161188c575b50505050509050919050565b6000546001600160a01b031633146118d65760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b0316815481106118f3576118f3615349565b90600052602060002090600c0201600001600c6101000a81548160ff021916908315150217905550816001600160601b031660008051602061569a833981519152604051611960906020808252600b908201526a68696464656e566f74657360a81b604082015260600190565b60405180910390a25050565b6001600160a01b0381166000908152600760209081526040918290208054835181840281018401909452808452606093928301828280156118a057602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116119bb575094979650505050505050565b60068181548110611a1857600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b60008060068381548110611a7a57611a7a615349565b6000918252602082206003600490920201908101805491935090611aa0906001906153b6565b81548110611ab057611ab0615349565b6000918252602082208454600480546009909402909201945090916001600160601b03909116908110611ae557611ae5615349565b90600052602060002090600c020190508060050154826003015410611b845782546001600160601b031660001901611b26576001600160ff1b039350611bb1565b6003820154611b36906002615483565b611b41906001615457565b81546004805490916001600160601b0316908110611b6157611b61615349565b90600052602060002090600c020160040154611b7d9190615483565b9350611bb1565b6003820154611b94906002615483565b611b9f906001615457565b8160040154611bae9190615483565b93505b505050919050565b6000546001600160a01b03163314611be35760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b031681548110611c0057611c00615349565b90600052602060002090600c020160040181905550816001600160601b031660008051602061569a833981519152604051611960906020808252600b908201526a3332b2a337b9253ab937b960a91b604082015260600190565b6000546001600160a01b03163314611c845760405162461bcd60e51b8152600401610a8f90615322565b6001600160601b03821660011480611cf7575080600480846001600160601b031681548110611cb557611cb5615349565b60009182526020909120600c909102015481546001600160601b03909116908110611ce257611ce2615349565b90600052602060002090600c02016002015411155b611d135760405162461bcd60e51b8152600401610a8f9061549a565b60005b6004836001600160601b031681548110611d3257611d32615349565b90600052602060002090600c020160010180549050811015611deb5781600480856001600160601b031681548110611d6c57611d6c615349565b90600052602060002090600c02016001018381548110611d8e57611d8e615349565b906000526020600020015481548110611da957611da9615349565b90600052602060002090600c0201600201541015611dd95760405162461bcd60e51b8152600401610a8f9061549a565b80611de38161539d565b915050611d16565b50806004836001600160601b031681548110611e0957611e09615349565b90600052602060002090600c020160020181905550816001600160601b031660008051602061569a833981519152604051611960906020808252600890820152676d696e5374616b6560c01b604082015260600190565b6000546001600160a01b03163314611e8a5760405162461bcd60e51b8152600401610a8f90615322565b6000836001600160a01b03168383604051611ea591906154f3565b60006040518083038185875af1925050503d8060008114611ee2576040519150601f19603f3d011682016040523d82523d6000602084013e611ee7565b606091505b5050905080610c5b5760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610a8f565b611f39338383600061435c565b611f765760405162461bcd60e51b815260206004820152600e60248201526d14dd185ada5b99c819985a5b195960921b6044820152606401610a8f565b5050565b600080600080606060008060008060068b81548110611f9b57611f9b615349565b90600052602060002090600402016003018a81548110611fbd57611fbd615349565b906000526020600020906009020190508060010154816002015482600401548360050154846006018560000154866007015487600801548380548060200260200160405190810160405280929190818152602001828054801561204957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161202b575b5050505050935098509850985098509850985098509850509295985092959890939650565b60006006828154811061208357612083615349565b600091825260209091206004918202019150600182015460ff1660048111156120ae576120ae614e72565b146120cb5760405162461bcd60e51b8152600401610a8f9061542c565b6001810154610100900460ff161561211f5760405162461bcd60e51b8152602060048201526017602482015276149d5b1a5b99c8185b1c9958591e48195e1958dd5d1959604a1b6044820152606401610a8f565b600061212a83611410565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146122245760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b03168154811061224157612241615349565b90600052602060002090600c020160030181905550816001600160601b031660008051602061569a83398151915260405161196090602080825260059082015264616c70686160d81b604082015260600190565b6000546001600160a01b031633146122bf5760405162461bcd60e51b8152600401610a8f90615322565b8660048a6001600160601b0316815481106122dc576122dc615349565b90600052602060002090600c020160020154111561230c5760405162461bcd60e51b8152600401610a8f9061549a565b600081511161234d5760405162461bcd60e51b815260206004820152600d60248201526c21537570706f7274656420444b60981b6044820152606401610a8f565b6001600160601b0389166123a35760405162461bcd60e51b815260206004820181905260248201527f496e76616c69643a20466f726b696e6720636f75727420617320706172656e746044820152606401610a8f565b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b835181101561249f5760008482815181106123f8576123f8615349565b60200260200101511180156124295750600554845185908390811061241f5761241f615349565b6020026020010151105b6124455760405162461bcd60e51b8152600401610a8f9061535f565b600182600a01600086848151811061245f5761245f615349565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806124979061539d565b9150506123db565b5080546001600160601b0319166001600160601b038c1617815560408051600081526020810191829052516124d8916001840191614af6565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561251b9060068301908790614b41565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061254e908590889060040161553b565b600060405180830381600087803b15801561256857600080fd5b505af115801561257c573d6000803e3d6000fd5b5050505060048b6001600160601b03168154811061259c5761259c615349565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612609908e908e908e908e908e908e908d90615554565b60405180910390a35050505050505050505050565b6000546001600160a01b031633146126485760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b03168154811061266557612665615349565b90600052602060002090600c020160050181905550816001600160601b031660008051602061569a8339815191526040516119609060208082526012908201527106a75726f7273466f72436f7572744a756d760741b604082015260600190565b6000806000600684815481106126de576126de615349565b6000918252602090912060049091020190506003600182015460ff16600481111561270b5761270b614e72565b03612763576002810154815460048054929550916001600160601b0390911690811061273957612739615349565b600091825260209091206009600c909202010154600282015461275c9190615457565b915061276c565b60009250600091505b50915091565b6000546001600160a01b0316331461279c5760405162461bcd60e51b8152600401610a8f90615322565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146127e85760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b03168154811061280557612805615349565b90600052602060002090600c0201600601906004612824929190614b41565b50816001600160601b031660008051602061569a833981519152604051611960906020808252600e908201526d1d1a5b595cd4195c94195c9a5bd960921b604082015260600190565b6000612878826138c4565b3410156128c75760405162461bcd60e51b815260206004820181905260248201527f45544820746f6f206c6f7720666f72206172626974726174696f6e20636f73746044820152606401610a8f565b6000806128d38461489e565b92505091506004826001600160601b0316815481106128f4576128f4615349565b60009182526020808320848452600a600c90930201919091019052604090205460ff1661295d5760405162461bcd60e51b81526020600482015260176024820152761112c81d5b9cdd5c1c1bdc9d195908189e4818dbdd5c9d604a1b6044820152606401610a8f565b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d419091015560058054929650909291849081106129e8576129e8615349565b600091825260208220600260059092020101548354600480546001600160a01b039093169450916001600160601b03909116908110612a2957612a29615349565b60009182526020808320600387018054600181018255908552919093206004600c9093029093019182015491935060090290910190612a6890346155ba565b600380830191909155858255820154600283015461271091612a8991615483565b612a9391906155ba565b600182015534600282015560035460405163d09f392d60e01b815260048101899052600060248201526001600160a01b039091169063d09f392d90604401600060405180830381600087803b158015612aeb57600080fd5b505af1158015612aff573d6000803e3d6000fd5b5050505060038101546040516302dbb79560e61b81526001600160a01b0385169163b6ede54091612b38918b918e918e916004016155ce565b600060405180830381600087803b158015612b5257600080fd5b505af1158015612b66573d6000803e3d6000fd5b50506040513392508991507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505092915050565b6000546001600160a01b03163314612bcd5760405162461bcd60e51b8152600401610a8f90615322565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b612bf883611a64565b341015612c475760405162461bcd60e51b815260206004820152601b60248201527f45544820746f6f206c6f7720666f722061707065616c20636f737400000000006044820152606401610a8f565b600060068481548110612c5c57612c5c615349565b6000918252602090912060049091020190506003600182015460ff166004811115612c8957612c89614e72565b14612ccf5760405162461bcd60e51b815260206004820152601660248201527544697370757465206e6f742061707065616c61626c6560501b6044820152606401610a8f565b60038101805460009190612ce5906001906153b6565b81548110612cf557612cf5615349565b906000526020600020906009020190506005816000015481548110612d1c57612d1c615349565b60009182526020909120600590910201600201546001600160a01b03163314612d7a5760405162461bcd60e51b815260206004820152601060248201526f44697370757465204b6974206f6e6c7960801b6044820152606401610a8f565b8154815460038401805460018101825560009182526020909120600480546001600160601b039095169460099093029091019184908110612dbd57612dbd615349565b90600052602060002090600c020160050154846003015410612fbb576004836001600160601b031681548110612df557612df5615349565b600091825260208220600c90910201546001600160601b031693505b600a811015612f00576004846001600160601b031681548110612e3657612e36615349565b60009182526020808320868452600a600c90930201919091019052604090205460ff16612f0057600060058481548110612e7257612e72615349565b90600052602060002090600502016000015414612eb55760058381548110612e9c57612e9c615349565b9060005260206000209060050201600001549250612eee565b6004846001600160601b031681548110612ed157612ed1615349565b60009182526020909120600c90910201546001600160601b031693505b80612ef88161539d565b915050612e11565b506004836001600160601b031681548110612f1d57612f1d615349565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612f4957600192505b84546001600160601b03848116911614612fbb57845460038601546001600160601b0390911690612f7c906001906153b6565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612ffe57612ffe615349565b90600052602060002090600c0201905080600401543461301e91906155ba565b82600301819055506127108160030154826002015461303d9190615483565b61304791906155ba565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c9161307e916153b6565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b1580156130bc57600080fd5b505af11580156130d0573d6000803e3d6000fd5b5050865484541491506131cd905057600060058360000154815481106130f8576130f8615349565b6000918252602090912060026005909202010154865460038901546001600160a01b0390921692509061312d906001906153b6565b84546040519081528c907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a460038301546040516302dbb79560e61b81526001600160a01b0383169163b6ede54091613199918e918e918e916004016155ce565b600060405180830381600087803b1580156131b357600080fd5b505af11580156131c7573d6000803e3d6000fd5b50505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91600060405161323d91906153e6565b60405180910390a2505050505050505050565b6000806006838154811061326657613266615349565b90600052602060002090600402019050806003016001826003018054905061328e91906153b6565b8154811061329e5761329e615349565b906000526020600020906009020160030154915050919050565b6000600683815481106132cd576132cd615349565b906000526020600020906004020190506000600182600301805490506132f391906153b6565b9050600082600301828154811061330c5761330c615349565b6000918252602082206009909102019150600184015460ff16600481111561333657613336614e72565b146133765760405162461bcd60e51b815260206004820152601060248201526f08515d9a59195b98d9481c195c9a5bd960821b6044820152606401610a8f565b6000600582600001548154811061338f5761338f615349565b60009182526020822060026005909202010154600684015460038501546001600160a01b03909216935091906133c58884615457565b11156133d55783600301546133df565b6133df8783615457565b9050815b818110156135b457604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af1158015613435573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345991906155fe565b90506001600160a01b038116156135a15760018601546001600160a01b03821660009081526007602090815260408083208c546001600160601b03168452600201909152812080549091906134af908490615457565b909155505060068601546040805189815260208101929092528b916001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a36006860180546001810182556000828152602090200180546001600160a01b0319166001600160a01b03841617905560038701549054036135a157600354604051632e96bc2360e11b8152600481018c9052602481018990526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561358857600080fd5b505af115801561359c573d6000803e3d6000fd5b505050505b50806135ac8161539d565b9150506133e3565b505050505050505050565b6000546001600160a01b031633146135e95760405162461bcd60e51b8152600401610a8f90615322565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146136355760405162461bcd60e51b8152600401610a8f90615322565b6005548082106136715760405162461bcd60e51b81526020600482015260076024820152660854185c995b9d60ca1b6044820152606401610a8f565b600082156136ee576005838154811061368c5761368c615349565b90600052602060002090600502016003015460016136aa9190615457565b9050600a81106136ee5760405162461bcd60e51b815260206004820152600f60248201526e088cae0e8d040d8caeccad840dac2f608b1b6044820152606401610a8f565b6040805160a08101825284815281516000808252602080830185528084019283526001600160a01b0389169484019490945260608301859052608083018190526005805460018101825591819052835191027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db08101918255915180519394919361379f937f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db101929190910190614af6565b5060408201516002820180546001600160a01b0319166001600160a01b03909216919091179055606082015160038201556080909101516004909101805460ff191691151591909117905560058054849081106137fe576137fe615349565b600091825260208083206001600590930201820180549283018155835282200183905560405184916001600160a01b0387169185917f7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c49891a482610c5b57610c5b6001836001613991565b6003546001600160a01b031633146138b15760405162461bcd60e51b815260206004820152600c60248201526b2bb937b7339031b0b63632b960a11b6044820152606401610a8f565b6138bd8484848461435c565b5050505050565b60008060006138d28461489e565b5091509150806004836001600160601b0316815481106138f4576138f4615349565b90600052602060002090600c0201600401546139109190615483565b949350505050565b60006006828154811061392d5761392d615349565b600091825260209091206003600490920201015492915050565b60006004836001600160601b03168154811061396557613965615349565b60009182526020808320858452600a600c90930201919091019052604090205460ff1690505b92915050565b806004846001600160601b0316815481106139ae576139ae615349565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b6000806006836000015181548110613a3357613a33615349565b90600052602060002090600402019050600081600301846020015181548110613a5e57613a5e615349565b9060005260206000209060090201905060006005826000015481548110613a8757613a87615349565b600091825260208083206005929092029091016002015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa158015613afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b22919061546a565b9050612710811115613b3357506127105b6000612710613b4283826153b6565b8560010154613b519190615483565b613b5b91906155ba565b90508087608001818151613b6f9190615457565b90525060a0870151600685018054600092908110613b8f57613b8f615349565b60009182526020808320909101546001600160a01b03168083526007825260408084208a546001600160601b03168552600201909252908220805491935084929091613bdc9084906153b6565b909155505085546004805484926001600160601b0316908110613c0157613c01615349565b90600052602060002090600c020160020154613c1d9190615457565b6001600160a01b03821660009081526007602090815260408083208a546001600160601b0316845260010190915290205410613cb1576001600160a01b038116600090815260076020908152604080832089546001600160601b03168452600101909152812054613c8f9084906153b6565b8754909150613caa9083906001600160601b0316838661435c565b5050613d02565b6001600160a01b038116600090815260076020908152604080832089546001600160601b0316845260010190915290205415613d02578554613d009082906001600160601b031660008561435c565b505b602088015188516001600160a01b0383167fc171b9733293347059aeb71aadbd72eadc00a2351c088cc7b40fce882976c27886613d3e8761561b565b60408051928352602083019190915260009082015260600160405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa158015613dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613de191906153c9565b613e455760035460405163b5d69e9960e01b81526001600160a01b0383811660048301529091169063b5d69e9990602401600060405180830381600087803b158015613e2c57600080fd5b505af1158015613e40573d6000803e3d6000fd5b505050505b60018860600151613e5691906153b6565b8860a00151148015613e6a57506040880151155b15613f0b576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1505060005460808c0151613eb994506001600160a01b0390911692509050614925565b506020880151885160808a015160028801546040517f695b5df09b907b4de5cb1abe7380bd74f3cb12835dd767dbaf88c79279d73eb292613f0292908252602082015260400190565b60405180910390a35b505050608090940151949350505050565b60006006826000015181548110613f3557613f35615349565b90600052602060002090600402019050600081600301836020015181548110613f6057613f60615349565b9060005260206000209060090201905060006005826000015481548110613f8957613f89615349565b906000526020600020906005020160020160009054906101000a90046001600160a01b031690506000816001600160a01b0316634fe264fb8660000151876020015188606001518960a00151613fdf9190615637565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015614028573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061404c919061546a565b905061271081111561405d57506127105b60008360060186606001518760a001516140779190615637565b8154811061408757614087615349565b600091825260208220015460018601546001600160a01b039091169250612710906140b3908590615483565b6140bd91906155ba565b6001600160a01b03831660009081526007602090815260408083208a546001600160601b031684526002019091528120805492935083929091906141029084906153b6565b90915550506001600160a01b038216600090815260076020908152604080832089546001600160601b03168452600101909152812054900361414a576141488282614925565b505b60006127108489604001518a6080015161416491906155ba565b61416e9190615483565b61417891906155ba565b90508086600801600082825461418e9190615457565b925050819055506000612710858a6040015189600201546141af91906155ba565b6141b99190615483565b6141c391906155ba565b9050808760070160008282546141d99190615457565b909155506141e990508483614925565b506040516001600160a01b0385169082156108fc029083906000818181858888f15050506020808c01518c51604080518b8152938401889052830186905290935091506001600160a01b038716907fc171b9733293347059aeb71aadbd72eadc00a2351c088cc7b40fce882976c2789060600160405180910390a46001896060015160026142779190615483565b61428191906153b6565b8960a00151036135b457600087600801548a608001516142a191906153b6565b90506000886007015489600201546142b991906153b6565b9050811515806142c857508015155b156117b25781156142eb576000546142e9906001600160a01b031683614925565b505b801561431a57600080546040516001600160a01b039091169183156108fc02918491818181858888f150505050505b60208b01518b516040517f695b5df09b907b4de5cb1abe7380bd74f3cb12835dd767dbaf88c79279d73eb2906126099086908690918252602082015260400190565b60006001600160601b038416158061437e57506004546001600160601b038516115b1561438b57506000613910565b6001600160a01b03851660009081526007602090815260408083206001600160601b038816845260018101909252909120548415614427576004866001600160601b0316815481106143df576143df615349565b90600052602060002090600c02016002015485108061441757506001600160601b038616600090815260028301602052604090205485105b1561442757600092505050613910565b600354604051632099a71760e11b81526001600160a01b0389811660048301526001600160601b0389166024830152604482018890526064820187905260009216906341334e2e906084016020604051808303816000875af1158015614491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144b5919061564b565b905060028160028111156144cb576144cb614e72565b036144dc5760009350505050613910565b60018160028111156144f0576144f0614e72565b0361455657604080516001600160601b0389168152602081018890529081018690526001600160a01b038916907f11ae3b4b2755c1ae163e5d571ab5070da164ce1280ad3375a227271ef58bf9389060600160405180910390a260019350505050613910565b60008287106145d65761456983886153b6565b905080156145c45761457c8930836149fa565b156145c957826000036145c4578354600180820186556000868152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918b16021790555b6147b7565b6000945050505050613910565b8660000361477f576001600160601b0388166000908152600285016020526040902054869061460590856153b6565b61460f91906153b6565b905080156145c4576146218982614925565b156145c95783545b8015614779576001600160601b038916856146456001846153b6565b8154811061465557614655615349565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036147675784548590614691906001906153b6565b815481106146a1576146a1615349565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169086906146d590846153b6565b815481106146e5576146e5615349565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550846000018054806147315761473161566c565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055614779565b8061477181615682565b915050614629565b506147b7565b8561478a88856153b6565b61479491906153b6565b905080156147b7576147a68982614925565b6147b7576000945050505050613910565b6001600160601b0388166000818152600186016020526040908190208990556003549051631166238b60e21b81526001600160a01b038c811660048301526024820193909352604481018a90529116906345988e2c90606401600060405180830381600087803b15801561482a57600080fd5b505af115801561483e573d6000803e3d6000fd5b5050604080516001600160601b038c168152602081018b90526001600160a01b038d1693507f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c92500160405180910390a250600198975050505050505050565b60008060006040845110614913575050506020810151604082015160608301516001600160601b03831615806148df57506004546001600160601b03841610155b156148e957600192505b816000036148f657600391505b80158061490557506005548110155b1561490e575060015b61491e565b506001915060039050815b9193909250565b6001546040516001600160a01b03848116602483015260448201849052600092839283929091169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b1790525161498591906154f3565b6000604051808303816000865af19150503d80600081146149c2576040519150601f19603f3d011682016040523d82523d6000602084013e6149c7565b606091505b50915091508180156149f15750805115806149f15750808060200190518101906149f191906153c9565b95945050505050565b6001546040516001600160a01b038581166024830152848116604483015260648201849052600092839283929091169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251614a6291906154f3565b6000604051808303816000865af19150503d8060008114614a9f576040519150601f19603f3d011682016040523d82523d6000602084013e614aa4565b606091505b5091509150818015614ace575080511580614ace575080806020019051810190614ace91906153c9565b9695505050505050565b60405180608001604052806004906020820280368337509192915050565b828054828255906000526020600020908101928215614b31579160200282015b82811115614b31578251825591602001919060010190614b16565b50614b3d929150614b6e565b5090565b8260048101928215614b315791602002820182811115614b31578251825591602001919060010190614b16565b5b80821115614b3d5760008155600101614b6f565b6001600160a01b0381168114614b9857600080fd5b50565b600060208284031215614bad57600080fd5b8135614bb881614b83565b9392505050565b80356001600160601b0381168114614bd657600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614c1957614c19614bdb565b604052919050565b600082601f830112614c3257600080fd5b813560206001600160401b03821115614c4d57614c4d614bdb565b8160051b614c5c828201614bf1565b9283528481018201928281019087851115614c7657600080fd5b83870192505b84831015614c9557823582529183019190830190614c7c565b979650505050505050565b8015158114614b9857600080fd5b600080600060608486031215614cc357600080fd5b614ccc84614bbf565b925060208401356001600160401b03811115614ce757600080fd5b614cf386828701614c21565b9250506040840135614d0481614ca0565b809150509250925092565b600060208284031215614d2157600080fd5b5035919050565b600080600060608486031215614d3d57600080fd5b505081359360208301359350604090920135919050565b600060208284031215614d6657600080fd5b614bb882614bbf565b8060005b6004811015610c5b578151845260209384019390910190600101614d73565b6080810161398b8284614d6f565b600081518084526020808501945080840160005b83811015614dd057815187529582019590820190600101614db4565b509495945050505050565b602081526000614bb86020830184614da0565b60008060408385031215614e0157600080fd5b614e0a83614bbf565b91506020830135614e1a81614ca0565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015614e665783516001600160601b031683529284019291840191600101614e41565b50909695505050505050565b634e487b7160e01b600052602160045260246000fd5b60058110614ea657634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a08101614ed66040830186614e88565b9215156060820152608001529392505050565b60008060408385031215614efc57600080fd5b614f0583614bbf565b946020939093013593505050565b600082601f830112614f2457600080fd5b81356001600160401b03811115614f3d57614f3d614bdb565b614f50601f8201601f1916602001614bf1565b818152846020838601011115614f6557600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215614f9757600080fd5b8335614fa281614b83565b92506020840135915060408401356001600160401b03811115614fc457600080fd5b614fd086828701614f13565b9150509250925092565b60008060408385031215614fed57600080fd5b50508035926020909101359150565b60006101008083018b845260208b818601528a6040860152896060860152826080860152819250885180835261012086019350818a01925060005b8181101561505c5783516001600160a01b031685529382019392820192600101615037565b5050505060a08301959095525060c081019290925260e09091015295945050505050565b600082601f83011261509157600080fd5b604051608081018181106001600160401b03821117156150b3576150b3614bdb565b6040528060808401858111156150c857600080fd5b845b818110156150e25780358352602092830192016150ca565b509195945050505050565b60008060008060008060008060006101808a8c03121561510c57600080fd5b6151158a614bbf565b985060208a013561512581614ca0565b975060408a0135965060608a0135955060808a0135945060a08a013593506151508b60c08c01615080565b92506101408a01356001600160401b038082111561516d57600080fd5b6151798d838e01614f13565b93506101608c013591508082111561519057600080fd5b5061519d8c828d01614c21565b9150509295985092959850929598565b60008060a083850312156151c057600080fd5b6151c983614bbf565b91506151d88460208501615080565b90509250929050565b600080604083850312156151f457600080fd5b8235915060208301356001600160401b0381111561521157600080fd5b61521d85828601614f13565b9150509250929050565b60008060006060848603121561523c57600080fd5b833592506020840135915060408401356001600160401b03811115614fc457600080fd5b6000806040838503121561527357600080fd5b823561527e81614b83565b91506151d860208401614bbf565b6000806040838503121561529f57600080fd5b8235614f0581614b83565b600080600080608085870312156152c057600080fd5b84356152cb81614b83565b93506152d960208601614bbf565b93969395505050506040820135916060013590565b60006020828403121561530057600080fd5b81356001600160401b0381111561531657600080fd5b61391084828501614f13565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600e908201526d0aee4dedcce40889640d2dcc8caf60931b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000600182016153af576153af615387565b5060010190565b8181038181111561398b5761398b615387565b6000602082840312156153db57600080fd5b8151614bb881614ca0565b6020810161398b8284614e88565b60008060006060848603121561540957600080fd5b83519250602084015161541b81614ca0565b6040850151909250614d0481614ca0565b60208082526011908201527008515e1958dd5d1a5bdb881c195c9a5bd9607a1b604082015260600190565b8082018082111561398b5761398b615387565b60006020828403121561547c57600080fd5b5051919050565b808202811582820484141761398b5761398b615387565b6020808252818101527f4d696e5374616b65206c6f776572207468616e20706172656e7420636f757274604082015260600190565b60005b838110156154ea5781810151838201526020016154d2565b50506000910152565b600082516155058184602087016154cf565b9190910192915050565b600081518084526155278160208601602086016154cf565b601f01601f19169290920160200192915050565b828152604060208201526000613910604083018461550f565b6000610140891515835288602084015287604084015286606084015285608084015261558360a0840186614d6f565b8061012084015261559681840185614da0565b9a9950505050505050505050565b634e487b7160e01b600052601260045260246000fd5b6000826155c9576155c96155a4565b500490565b8481528360208201526080604082015260006155ed608083018561550f565b905082606083015295945050505050565b60006020828403121561561057600080fd5b8151614bb881614b83565b6000600160ff1b820161563057615630615387565b5060000390565b600082615646576156466155a4565b500690565b60006020828403121561565d57600080fd5b815160038110614bb857600080fd5b634e487b7160e01b600052603160045260246000fd5b60008161569157615691615387565b50600019019056fee83e0a05baa75e68db64db7387055029be50c8d8de00a3e3e56978509b9bc2dea2646970667358221220a636d1bec26af3a1cf04e14510600e9828729ba5619eb75cca0534c363ac241564736f6c63430008120033", - "deployedBytecode": "0x6080604052600436106102be5760003560e01c8063751accd011610170578063c3569902116100cc578063eaff425a11610085578063eaff425a14610990578063f12ada8b146109a5578063f56f0725146109c5578063f7434ea9146109e5578063fbf405b014610a05578063fc6f8f1614610a25578063fe524c3914610a4557600080fd5b8063c356990214610883578063c71f425314610896578063cf0c38f8146108b6578063d1c1df48146108d6578063d2b8035a14610950578063e4c0aaf41461097057600080fd5b8063a072b86c11610129578063a072b86c1461079b578063a4370ce4146107bb578063afe15cfb146107db578063b004963714610810578063b39367ed14610830578063c13517e114610850578063c258bb191461086357600080fd5b8063751accd0146106cc5780637717a6e8146106ec578063840bc19c1461070c5780638a9bb02a146107275780638bb048751461075b5780639280169a1461077b57600080fd5b80632ea7b4d01161021f578063564a565d116101d8578063564a565d146105fc57806359ec827e1461062d5780635ea5c0381461064d5780636235593f1461066257806367c51947146106775780636c1eb1b9146106975780636e5f35c2146106ac57600080fd5b80632ea7b4d01461052a57806334d5fb31146105405780633cfd11841461055557806343d4137f1461058257806344c792e7146105af578063543f8a36146105cf57600080fd5b80631956b1f91161027c5780631956b1f9146103cf57806319b81529146103ef5780631c3db16d1461041f5780631f5a0dd21461045c57806327e6ec8a146104bd5780632d29a47b146104ea5780632e1daf2f1461050a57600080fd5b8062f5822c146102c35780630b7414bc146102e55780630c340a24146103055780630d1b9d1a146103425780630d83b9401461038c578063115d5376146103af575b600080fd5b3480156102cf57600080fd5b506102e36102de366004614b9b565b610a65565b005b3480156102f157600080fd5b506102e3610300366004614cae565b610aba565b34801561031157600080fd5b50600054610325906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561034e57600080fd5b5061036261035d366004614d0f565b610c61565b604080519485526001600160a01b0390931660208501529183015215156060820152608001610339565b34801561039857600080fd5b506103a1600181565b604051908152602001610339565b3480156103bb57600080fd5b506102e36103ca366004614d0f565b610ca7565b3480156103db57600080fd5b506103256103ea366004614d0f565b6112df565b3480156103fb57600080fd5b5061040f61040a366004614d0f565b611317565b6040519015158152602001610339565b34801561042b57600080fd5b5061043f61043a366004614d0f565b611410565b604080519384529115156020840152151590820152606001610339565b34801561046857600080fd5b5061047c610477366004614d0f565b611519565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e001610339565b3480156104c957600080fd5b506104d2600081565b6040516001600160601b039091168152602001610339565b3480156104f657600080fd5b506102e3610505366004614d28565b611578565b34801561051657600080fd5b50600354610325906001600160a01b031681565b34801561053657600080fd5b506103a161271081565b34801561054c57600080fd5b506104d2600181565b34801561056157600080fd5b50610575610570366004614d54565b6117bf565b6040516103399190614d92565b34801561058e57600080fd5b506105a261059d366004614d0f565b611830565b6040516103399190614ddb565b3480156105bb57600080fd5b506102e36105ca366004614dee565b6118ac565b3480156105db57600080fd5b506105ef6105ea366004614b9b565b61196c565b6040516103399190614e25565b34801561060857600080fd5b5061061c610617366004614d0f565b611a08565b604051610339959493929190614eaa565b34801561063957600080fd5b506103a1610648366004614d0f565b611a64565b34801561065957600080fd5b506005546103a1565b34801561066e57600080fd5b506103a1600081565b34801561068357600080fd5b506102e3610692366004614ee9565b611bb9565b3480156106a357600080fd5b506103a1600a81565b3480156106b857600080fd5b506102e36106c7366004614ee9565b611c5a565b3480156106d857600080fd5b506102e36106e7366004614f82565b611e60565b3480156106f857600080fd5b506102e3610707366004614ee9565b611f2c565b34801561071857600080fd5b506103a16001600160ff1b0381565b34801561073357600080fd5b50610747610742366004614fda565b611f7a565b604051610339989796959493929190614ffc565b34801561076757600080fd5b506102e3610776366004614d0f565b61206e565b34801561078757600080fd5b506102e3610796366004614ee9565b6121fa565b3480156107a757600080fd5b506102e36107b63660046150ed565b612295565b3480156107c757600080fd5b506102e36107d6366004614ee9565b61261e565b3480156107e757600080fd5b506107fb6107f6366004614d0f565b6126c6565b60408051928352602083019190915201610339565b34801561081c57600080fd5b506102e361082b366004614b9b565b612772565b34801561083c57600080fd5b506102e361084b3660046151ad565b6127be565b6103a161085e3660046151e1565b61286d565b34801561086f57600080fd5b506102e361087e366004614b9b565b612ba3565b6102e3610891366004615227565b612bef565b3480156108a257600080fd5b506103a16108b1366004614d0f565b613250565b3480156108c257600080fd5b50600254610325906001600160a01b031681565b3480156108e257600080fd5b506109356108f1366004615260565b6001600160a01b0390911660009081526007602090815260408083206001600160601b03909416835260018401825280832054600285019092529091205491549092565b60408051938452602084019290925290820152606001610339565b34801561095c57600080fd5b506102e361096b366004614fda565b6132b8565b34801561097c57600080fd5b506102e361098b366004614b9b565b6135bf565b34801561099c57600080fd5b506103a1600381565b3480156109b157600080fd5b506102e36109c036600461528c565b61360b565b3480156109d157600080fd5b506102e36109e03660046152aa565b613868565b3480156109f157600080fd5b506103a1610a003660046152ee565b6138c4565b348015610a1157600080fd5b50600154610325906001600160a01b031681565b348015610a3157600080fd5b506103a1610a40366004614d0f565b613918565b348015610a5157600080fd5b5061040f610a60366004614ee9565b613947565b6000546001600160a01b03163314610a985760405162461bcd60e51b8152600401610a8f90615322565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ae45760405162461bcd60e51b8152600401610a8f90615322565b60005b8251811015610c5b578115610b81576000838281518110610b0a57610b0a615349565b6020026020010151118015610b3b57506005548351849083908110610b3157610b31615349565b6020026020010151105b610b575760405162461bcd60e51b8152600401610a8f9061535f565b610b7c84848381518110610b6d57610b6d615349565b60200260200101516001613991565b610c49565b6001600160601b0384166001148015610bd7575060006005848381518110610bab57610bab615349565b602002602001015181548110610bc357610bc3615349565b906000526020600020906005020160000154145b15610c245760405162461bcd60e51b815260206004820181905260248201527f43616e27742064697361626c6520526f6f7420444b20696e2047656e6572616c6044820152606401610a8f565b610c4984848381518110610c3a57610c3a615349565b60200260200101516000613991565b80610c538161539d565b915050610ae7565b50505050565b60058181548110610c7157600080fd5b600091825260209091206005909102018054600282015460038301546004909301549193506001600160a01b0316919060ff1684565b600060068281548110610cbc57610cbc615349565b600091825260208220600491820201805482549194506001600160601b0316908110610cea57610cea615349565b6000918252602082206003850154600c909202019250610d0c906001906153b6565b90506000836003018281548110610d2557610d25615349565b6000918252602082206009909102019150600185015460ff166004811115610d4f57610d4f614e72565b03610e81576000821180610da057506001840154600684019060ff166004811115610d7c57610d7c614e72565b60048110610d8c57610d8c615349565b01546002850154610d9d90426153b6565b10155b610dec5760405162461bcd60e51b815260206004820152601e60248201527f45766964656e6365206e6f7420706173736564202626202141707065616c00006044820152606401610a8f565b6003810154600682015414610e3b5760405162461bcd60e51b815260206004820152601560248201527444697370757465207374696c6c2064726177696e6760581b6044820152606401610a8f565b8254600160601b900460ff16610e52576002610e55565b60015b60018086018054909160ff1990911690836004811115610e7757610e77614e72565b0217905550611291565b60018085015460ff166004811115610e9b57610e9b614e72565b03610fda576001840154600684019060ff166004811115610ebe57610ebe614e72565b60048110610ece57610ece615349565b01546002850154610edf90426153b6565b101580610f7c57506005816000015481548110610efe57610efe615349565b6000918252602090912060059091020160020154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c91906153c9565b610fc35760405162461bcd60e51b815260206004820152601860248201527710dbdb5b5a5d081c195c9a5bd9081b9bdd081c185cdcd95960421b6044820152606401610a8f565b6001808501805460029260ff199091169083610e77565b6002600185015460ff166004811115610ff557610ff5614e72565b03611170576001840154600684019060ff16600481111561101857611018614e72565b6004811061102857611028615349565b0154600285015461103990426153b6565b1015806110d65750600581600001548154811061105857611058615349565b60009182526020909120600590910201600201546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa1580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906153c9565b61111b5760405162461bcd60e51b8152602060048201526016602482015275159bdd19481c195c9a5bd9081b9bdd081c185cdcd95960521b6044820152606401610a8f565b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3611291565b6003600185015460ff16600481111561118b5761118b614e72565b0361122f576001840154600684019060ff1660048111156111ae576111ae614e72565b600481106111be576111be615349565b015460028501546111cf90426153b6565b10156112185760405162461bcd60e51b8152602060048201526018602482015277105c1c19585b081c195c9a5bd9081b9bdd081c185cdcd95960421b6044820152606401610a8f565b6001808501805460049260ff199091169083610e77565b6004600185015460ff16600481111561124a5761124a614e72565b036112915760405162461bcd60e51b8152602060048201526017602482015276111a5cdc1d5d19481c195c9a5bd9081a5cc8199a5b985b604a1b6044820152606401610a8f565b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916112d09160ff16906153e6565b60405180910390a25050505050565b6000600582815481106112f4576112f4615349565b60009182526020909120600260059092020101546001600160a01b031692915050565b6000806006838154811061132d5761132d615349565b6000918252602082206003600490920201908101805491935090611353906001906153b6565b8154811061136357611363615349565b6000918252602082208454600480546009909402909201945090916001600160601b0390911690811061139857611398615349565b90600052602060002090600c020190508060050154826003015410156113c357506000949350505050565b80546004805490916001600160601b03169081106113e3576113e3615349565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b6000806000806006858154811061142957611429615349565b600091825260208220600360049092020190810180549193509061144f906001906153b6565b8154811061145f5761145f615349565b906000526020600020906009020190506000600582600001548154811061148857611488615349565b6000918252602090912060059091020160020154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156114e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150991906153f4565b9199909850909650945050505050565b6004818154811061152957600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b60006006848154811061158d5761158d615349565b600091825260209091206004918202019150600182015460ff1660048111156115b8576115b8614e72565b146115d55760405162461bcd60e51b8152600401610a8f9061542c565b60008160030184815481106115ec576115ec615349565b906000526020600020906009020190506000600582600001548154811061161557611615615349565b6000918252602082206002600590920201015460048401546001600160a01b039091169250906116458683615457565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa1580156116a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c7919061546a565b9050806000036116e257818411156116dd578193505b611702565b6116ed826002615483565b841115611702576116ff826002615483565b93505b60048701849055845b8481101561179e5782811015611757576117506040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613a19565b935061178c565b61178c6040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613f1c565b806117968161539d565b91505061170b565b50828760050154146117b257600587018390555b5050505050505050505050565b6117c7614ad8565b60006004836001600160601b0316815481106117e5576117e5615349565b60009182526020909120604080516080810191829052600c9093029091019250600683019060049082845b815481526020019060010190808311611810575050505050915050919050565b60606005828154811061184557611845615349565b90600052602060002090600502016001018054806020026020016040519081016040528092919081815260200182805480156118a057602002820191906000526020600020905b81548152602001906001019080831161188c575b50505050509050919050565b6000546001600160a01b031633146118d65760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b0316815481106118f3576118f3615349565b90600052602060002090600c0201600001600c6101000a81548160ff021916908315150217905550816001600160601b031660008051602061569a833981519152604051611960906020808252600b908201526a68696464656e566f74657360a81b604082015260600190565b60405180910390a25050565b6001600160a01b0381166000908152600760209081526040918290208054835181840281018401909452808452606093928301828280156118a057602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116119bb575094979650505050505050565b60068181548110611a1857600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b60008060068381548110611a7a57611a7a615349565b6000918252602082206003600490920201908101805491935090611aa0906001906153b6565b81548110611ab057611ab0615349565b6000918252602082208454600480546009909402909201945090916001600160601b03909116908110611ae557611ae5615349565b90600052602060002090600c020190508060050154826003015410611b845782546001600160601b031660001901611b26576001600160ff1b039350611bb1565b6003820154611b36906002615483565b611b41906001615457565b81546004805490916001600160601b0316908110611b6157611b61615349565b90600052602060002090600c020160040154611b7d9190615483565b9350611bb1565b6003820154611b94906002615483565b611b9f906001615457565b8160040154611bae9190615483565b93505b505050919050565b6000546001600160a01b03163314611be35760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b031681548110611c0057611c00615349565b90600052602060002090600c020160040181905550816001600160601b031660008051602061569a833981519152604051611960906020808252600b908201526a3332b2a337b9253ab937b960a91b604082015260600190565b6000546001600160a01b03163314611c845760405162461bcd60e51b8152600401610a8f90615322565b6001600160601b03821660011480611cf7575080600480846001600160601b031681548110611cb557611cb5615349565b60009182526020909120600c909102015481546001600160601b03909116908110611ce257611ce2615349565b90600052602060002090600c02016002015411155b611d135760405162461bcd60e51b8152600401610a8f9061549a565b60005b6004836001600160601b031681548110611d3257611d32615349565b90600052602060002090600c020160010180549050811015611deb5781600480856001600160601b031681548110611d6c57611d6c615349565b90600052602060002090600c02016001018381548110611d8e57611d8e615349565b906000526020600020015481548110611da957611da9615349565b90600052602060002090600c0201600201541015611dd95760405162461bcd60e51b8152600401610a8f9061549a565b80611de38161539d565b915050611d16565b50806004836001600160601b031681548110611e0957611e09615349565b90600052602060002090600c020160020181905550816001600160601b031660008051602061569a833981519152604051611960906020808252600890820152676d696e5374616b6560c01b604082015260600190565b6000546001600160a01b03163314611e8a5760405162461bcd60e51b8152600401610a8f90615322565b6000836001600160a01b03168383604051611ea591906154f3565b60006040518083038185875af1925050503d8060008114611ee2576040519150601f19603f3d011682016040523d82523d6000602084013e611ee7565b606091505b5050905080610c5b5760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610a8f565b611f39338383600061435c565b611f765760405162461bcd60e51b815260206004820152600e60248201526d14dd185ada5b99c819985a5b195960921b6044820152606401610a8f565b5050565b600080600080606060008060008060068b81548110611f9b57611f9b615349565b90600052602060002090600402016003018a81548110611fbd57611fbd615349565b906000526020600020906009020190508060010154816002015482600401548360050154846006018560000154866007015487600801548380548060200260200160405190810160405280929190818152602001828054801561204957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161202b575b5050505050935098509850985098509850985098509850509295985092959890939650565b60006006828154811061208357612083615349565b600091825260209091206004918202019150600182015460ff1660048111156120ae576120ae614e72565b146120cb5760405162461bcd60e51b8152600401610a8f9061542c565b6001810154610100900460ff161561211f5760405162461bcd60e51b8152602060048201526017602482015276149d5b1a5b99c8185b1c9958591e48195e1958dd5d1959604a1b6044820152606401610a8f565b600061212a83611410565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146122245760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b03168154811061224157612241615349565b90600052602060002090600c020160030181905550816001600160601b031660008051602061569a83398151915260405161196090602080825260059082015264616c70686160d81b604082015260600190565b6000546001600160a01b031633146122bf5760405162461bcd60e51b8152600401610a8f90615322565b8660048a6001600160601b0316815481106122dc576122dc615349565b90600052602060002090600c020160020154111561230c5760405162461bcd60e51b8152600401610a8f9061549a565b600081511161234d5760405162461bcd60e51b815260206004820152600d60248201526c21537570706f7274656420444b60981b6044820152606401610a8f565b6001600160601b0389166123a35760405162461bcd60e51b815260206004820181905260248201527f496e76616c69643a20466f726b696e6720636f75727420617320706172656e746044820152606401610a8f565b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b835181101561249f5760008482815181106123f8576123f8615349565b60200260200101511180156124295750600554845185908390811061241f5761241f615349565b6020026020010151105b6124455760405162461bcd60e51b8152600401610a8f9061535f565b600182600a01600086848151811061245f5761245f615349565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806124979061539d565b9150506123db565b5080546001600160601b0319166001600160601b038c1617815560408051600081526020810191829052516124d8916001840191614af6565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561251b9060068301908790614b41565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061254e908590889060040161553b565b600060405180830381600087803b15801561256857600080fd5b505af115801561257c573d6000803e3d6000fd5b5050505060048b6001600160601b03168154811061259c5761259c615349565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612609908e908e908e908e908e908e908d90615554565b60405180910390a35050505050505050505050565b6000546001600160a01b031633146126485760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b03168154811061266557612665615349565b90600052602060002090600c020160050181905550816001600160601b031660008051602061569a8339815191526040516119609060208082526012908201527106a75726f7273466f72436f7572744a756d760741b604082015260600190565b6000806000600684815481106126de576126de615349565b6000918252602090912060049091020190506003600182015460ff16600481111561270b5761270b614e72565b03612763576002810154815460048054929550916001600160601b0390911690811061273957612739615349565b600091825260209091206009600c909202010154600282015461275c9190615457565b915061276c565b60009250600091505b50915091565b6000546001600160a01b0316331461279c5760405162461bcd60e51b8152600401610a8f90615322565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146127e85760405162461bcd60e51b8152600401610a8f90615322565b806004836001600160601b03168154811061280557612805615349565b90600052602060002090600c0201600601906004612824929190614b41565b50816001600160601b031660008051602061569a833981519152604051611960906020808252600e908201526d1d1a5b595cd4195c94195c9a5bd960921b604082015260600190565b6000612878826138c4565b3410156128c75760405162461bcd60e51b815260206004820181905260248201527f45544820746f6f206c6f7720666f72206172626974726174696f6e20636f73746044820152606401610a8f565b6000806128d38461489e565b92505091506004826001600160601b0316815481106128f4576128f4615349565b60009182526020808320848452600a600c90930201919091019052604090205460ff1661295d5760405162461bcd60e51b81526020600482015260176024820152761112c81d5b9cdd5c1c1bdc9d195908189e4818dbdd5c9d604a1b6044820152606401610a8f565b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d419091015560058054929650909291849081106129e8576129e8615349565b600091825260208220600260059092020101548354600480546001600160a01b039093169450916001600160601b03909116908110612a2957612a29615349565b60009182526020808320600387018054600181018255908552919093206004600c9093029093019182015491935060090290910190612a6890346155ba565b600380830191909155858255820154600283015461271091612a8991615483565b612a9391906155ba565b600182015534600282015560035460405163d09f392d60e01b815260048101899052600060248201526001600160a01b039091169063d09f392d90604401600060405180830381600087803b158015612aeb57600080fd5b505af1158015612aff573d6000803e3d6000fd5b5050505060038101546040516302dbb79560e61b81526001600160a01b0385169163b6ede54091612b38918b918e918e916004016155ce565b600060405180830381600087803b158015612b5257600080fd5b505af1158015612b66573d6000803e3d6000fd5b50506040513392508991507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505092915050565b6000546001600160a01b03163314612bcd5760405162461bcd60e51b8152600401610a8f90615322565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b612bf883611a64565b341015612c475760405162461bcd60e51b815260206004820152601b60248201527f45544820746f6f206c6f7720666f722061707065616c20636f737400000000006044820152606401610a8f565b600060068481548110612c5c57612c5c615349565b6000918252602090912060049091020190506003600182015460ff166004811115612c8957612c89614e72565b14612ccf5760405162461bcd60e51b815260206004820152601660248201527544697370757465206e6f742061707065616c61626c6560501b6044820152606401610a8f565b60038101805460009190612ce5906001906153b6565b81548110612cf557612cf5615349565b906000526020600020906009020190506005816000015481548110612d1c57612d1c615349565b60009182526020909120600590910201600201546001600160a01b03163314612d7a5760405162461bcd60e51b815260206004820152601060248201526f44697370757465204b6974206f6e6c7960801b6044820152606401610a8f565b8154815460038401805460018101825560009182526020909120600480546001600160601b039095169460099093029091019184908110612dbd57612dbd615349565b90600052602060002090600c020160050154846003015410612fbb576004836001600160601b031681548110612df557612df5615349565b600091825260208220600c90910201546001600160601b031693505b600a811015612f00576004846001600160601b031681548110612e3657612e36615349565b60009182526020808320868452600a600c90930201919091019052604090205460ff16612f0057600060058481548110612e7257612e72615349565b90600052602060002090600502016000015414612eb55760058381548110612e9c57612e9c615349565b9060005260206000209060050201600001549250612eee565b6004846001600160601b031681548110612ed157612ed1615349565b60009182526020909120600c90910201546001600160601b031693505b80612ef88161539d565b915050612e11565b506004836001600160601b031681548110612f1d57612f1d615349565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612f4957600192505b84546001600160601b03848116911614612fbb57845460038601546001600160601b0390911690612f7c906001906153b6565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612ffe57612ffe615349565b90600052602060002090600c0201905080600401543461301e91906155ba565b82600301819055506127108160030154826002015461303d9190615483565b61304791906155ba565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c9161307e916153b6565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b1580156130bc57600080fd5b505af11580156130d0573d6000803e3d6000fd5b5050865484541491506131cd905057600060058360000154815481106130f8576130f8615349565b6000918252602090912060026005909202010154865460038901546001600160a01b0390921692509061312d906001906153b6565b84546040519081528c907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a460038301546040516302dbb79560e61b81526001600160a01b0383169163b6ede54091613199918e918e918e916004016155ce565b600060405180830381600087803b1580156131b357600080fd5b505af11580156131c7573d6000803e3d6000fd5b50505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91600060405161323d91906153e6565b60405180910390a2505050505050505050565b6000806006838154811061326657613266615349565b90600052602060002090600402019050806003016001826003018054905061328e91906153b6565b8154811061329e5761329e615349565b906000526020600020906009020160030154915050919050565b6000600683815481106132cd576132cd615349565b906000526020600020906004020190506000600182600301805490506132f391906153b6565b9050600082600301828154811061330c5761330c615349565b6000918252602082206009909102019150600184015460ff16600481111561333657613336614e72565b146133765760405162461bcd60e51b815260206004820152601060248201526f08515d9a59195b98d9481c195c9a5bd960821b6044820152606401610a8f565b6000600582600001548154811061338f5761338f615349565b60009182526020822060026005909202010154600684015460038501546001600160a01b03909216935091906133c58884615457565b11156133d55783600301546133df565b6133df8783615457565b9050815b818110156135b457604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af1158015613435573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345991906155fe565b90506001600160a01b038116156135a15760018601546001600160a01b03821660009081526007602090815260408083208c546001600160601b03168452600201909152812080549091906134af908490615457565b909155505060068601546040805189815260208101929092528b916001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a36006860180546001810182556000828152602090200180546001600160a01b0319166001600160a01b03841617905560038701549054036135a157600354604051632e96bc2360e11b8152600481018c9052602481018990526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561358857600080fd5b505af115801561359c573d6000803e3d6000fd5b505050505b50806135ac8161539d565b9150506133e3565b505050505050505050565b6000546001600160a01b031633146135e95760405162461bcd60e51b8152600401610a8f90615322565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146136355760405162461bcd60e51b8152600401610a8f90615322565b6005548082106136715760405162461bcd60e51b81526020600482015260076024820152660854185c995b9d60ca1b6044820152606401610a8f565b600082156136ee576005838154811061368c5761368c615349565b90600052602060002090600502016003015460016136aa9190615457565b9050600a81106136ee5760405162461bcd60e51b815260206004820152600f60248201526e088cae0e8d040d8caeccad840dac2f608b1b6044820152606401610a8f565b6040805160a08101825284815281516000808252602080830185528084019283526001600160a01b0389169484019490945260608301859052608083018190526005805460018101825591819052835191027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db08101918255915180519394919361379f937f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db101929190910190614af6565b5060408201516002820180546001600160a01b0319166001600160a01b03909216919091179055606082015160038201556080909101516004909101805460ff191691151591909117905560058054849081106137fe576137fe615349565b600091825260208083206001600590930201820180549283018155835282200183905560405184916001600160a01b0387169185917f7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c49891a482610c5b57610c5b6001836001613991565b6003546001600160a01b031633146138b15760405162461bcd60e51b815260206004820152600c60248201526b2bb937b7339031b0b63632b960a11b6044820152606401610a8f565b6138bd8484848461435c565b5050505050565b60008060006138d28461489e565b5091509150806004836001600160601b0316815481106138f4576138f4615349565b90600052602060002090600c0201600401546139109190615483565b949350505050565b60006006828154811061392d5761392d615349565b600091825260209091206003600490920201015492915050565b60006004836001600160601b03168154811061396557613965615349565b60009182526020808320858452600a600c90930201919091019052604090205460ff1690505b92915050565b806004846001600160601b0316815481106139ae576139ae615349565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b6000806006836000015181548110613a3357613a33615349565b90600052602060002090600402019050600081600301846020015181548110613a5e57613a5e615349565b9060005260206000209060090201905060006005826000015481548110613a8757613a87615349565b600091825260208083206005929092029091016002015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa158015613afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b22919061546a565b9050612710811115613b3357506127105b6000612710613b4283826153b6565b8560010154613b519190615483565b613b5b91906155ba565b90508087608001818151613b6f9190615457565b90525060a0870151600685018054600092908110613b8f57613b8f615349565b60009182526020808320909101546001600160a01b03168083526007825260408084208a546001600160601b03168552600201909252908220805491935084929091613bdc9084906153b6565b909155505085546004805484926001600160601b0316908110613c0157613c01615349565b90600052602060002090600c020160020154613c1d9190615457565b6001600160a01b03821660009081526007602090815260408083208a546001600160601b0316845260010190915290205410613cb1576001600160a01b038116600090815260076020908152604080832089546001600160601b03168452600101909152812054613c8f9084906153b6565b8754909150613caa9083906001600160601b0316838661435c565b5050613d02565b6001600160a01b038116600090815260076020908152604080832089546001600160601b0316845260010190915290205415613d02578554613d009082906001600160601b031660008561435c565b505b602088015188516001600160a01b0383167fc171b9733293347059aeb71aadbd72eadc00a2351c088cc7b40fce882976c27886613d3e8761561b565b60408051928352602083019190915260009082015260600160405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa158015613dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613de191906153c9565b613e455760035460405163b5d69e9960e01b81526001600160a01b0383811660048301529091169063b5d69e9990602401600060405180830381600087803b158015613e2c57600080fd5b505af1158015613e40573d6000803e3d6000fd5b505050505b60018860600151613e5691906153b6565b8860a00151148015613e6a57506040880151155b15613f0b576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1505060005460808c0151613eb994506001600160a01b0390911692509050614925565b506020880151885160808a015160028801546040517f695b5df09b907b4de5cb1abe7380bd74f3cb12835dd767dbaf88c79279d73eb292613f0292908252602082015260400190565b60405180910390a35b505050608090940151949350505050565b60006006826000015181548110613f3557613f35615349565b90600052602060002090600402019050600081600301836020015181548110613f6057613f60615349565b9060005260206000209060090201905060006005826000015481548110613f8957613f89615349565b906000526020600020906005020160020160009054906101000a90046001600160a01b031690506000816001600160a01b0316634fe264fb8660000151876020015188606001518960a00151613fdf9190615637565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015614028573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061404c919061546a565b905061271081111561405d57506127105b60008360060186606001518760a001516140779190615637565b8154811061408757614087615349565b600091825260208220015460018601546001600160a01b039091169250612710906140b3908590615483565b6140bd91906155ba565b6001600160a01b03831660009081526007602090815260408083208a546001600160601b031684526002019091528120805492935083929091906141029084906153b6565b90915550506001600160a01b038216600090815260076020908152604080832089546001600160601b03168452600101909152812054900361414a576141488282614925565b505b60006127108489604001518a6080015161416491906155ba565b61416e9190615483565b61417891906155ba565b90508086600801600082825461418e9190615457565b925050819055506000612710858a6040015189600201546141af91906155ba565b6141b99190615483565b6141c391906155ba565b9050808760070160008282546141d99190615457565b909155506141e990508483614925565b506040516001600160a01b0385169082156108fc029083906000818181858888f15050506020808c01518c51604080518b8152938401889052830186905290935091506001600160a01b038716907fc171b9733293347059aeb71aadbd72eadc00a2351c088cc7b40fce882976c2789060600160405180910390a46001896060015160026142779190615483565b61428191906153b6565b8960a00151036135b457600087600801548a608001516142a191906153b6565b90506000886007015489600201546142b991906153b6565b9050811515806142c857508015155b156117b25781156142eb576000546142e9906001600160a01b031683614925565b505b801561431a57600080546040516001600160a01b039091169183156108fc02918491818181858888f150505050505b60208b01518b516040517f695b5df09b907b4de5cb1abe7380bd74f3cb12835dd767dbaf88c79279d73eb2906126099086908690918252602082015260400190565b60006001600160601b038416158061437e57506004546001600160601b038516115b1561438b57506000613910565b6001600160a01b03851660009081526007602090815260408083206001600160601b038816845260018101909252909120548415614427576004866001600160601b0316815481106143df576143df615349565b90600052602060002090600c02016002015485108061441757506001600160601b038616600090815260028301602052604090205485105b1561442757600092505050613910565b600354604051632099a71760e11b81526001600160a01b0389811660048301526001600160601b0389166024830152604482018890526064820187905260009216906341334e2e906084016020604051808303816000875af1158015614491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144b5919061564b565b905060028160028111156144cb576144cb614e72565b036144dc5760009350505050613910565b60018160028111156144f0576144f0614e72565b0361455657604080516001600160601b0389168152602081018890529081018690526001600160a01b038916907f11ae3b4b2755c1ae163e5d571ab5070da164ce1280ad3375a227271ef58bf9389060600160405180910390a260019350505050613910565b60008287106145d65761456983886153b6565b905080156145c45761457c8930836149fa565b156145c957826000036145c4578354600180820186556000868152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918b16021790555b6147b7565b6000945050505050613910565b8660000361477f576001600160601b0388166000908152600285016020526040902054869061460590856153b6565b61460f91906153b6565b905080156145c4576146218982614925565b156145c95783545b8015614779576001600160601b038916856146456001846153b6565b8154811061465557614655615349565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036147675784548590614691906001906153b6565b815481106146a1576146a1615349565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169086906146d590846153b6565b815481106146e5576146e5615349565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550846000018054806147315761473161566c565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055614779565b8061477181615682565b915050614629565b506147b7565b8561478a88856153b6565b61479491906153b6565b905080156147b7576147a68982614925565b6147b7576000945050505050613910565b6001600160601b0388166000818152600186016020526040908190208990556003549051631166238b60e21b81526001600160a01b038c811660048301526024820193909352604481018a90529116906345988e2c90606401600060405180830381600087803b15801561482a57600080fd5b505af115801561483e573d6000803e3d6000fd5b5050604080516001600160601b038c168152602081018b90526001600160a01b038d1693507f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c92500160405180910390a250600198975050505050505050565b60008060006040845110614913575050506020810151604082015160608301516001600160601b03831615806148df57506004546001600160601b03841610155b156148e957600192505b816000036148f657600391505b80158061490557506005548110155b1561490e575060015b61491e565b506001915060039050815b9193909250565b6001546040516001600160a01b03848116602483015260448201849052600092839283929091169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b1790525161498591906154f3565b6000604051808303816000865af19150503d80600081146149c2576040519150601f19603f3d011682016040523d82523d6000602084013e6149c7565b606091505b50915091508180156149f15750805115806149f15750808060200190518101906149f191906153c9565b95945050505050565b6001546040516001600160a01b038581166024830152848116604483015260648201849052600092839283929091169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251614a6291906154f3565b6000604051808303816000865af19150503d8060008114614a9f576040519150601f19603f3d011682016040523d82523d6000602084013e614aa4565b606091505b5091509150818015614ace575080511580614ace575080806020019051810190614ace91906153c9565b9695505050505050565b60405180608001604052806004906020820280368337509192915050565b828054828255906000526020600020908101928215614b31579160200282015b82811115614b31578251825591602001919060010190614b16565b50614b3d929150614b6e565b5090565b8260048101928215614b315791602002820182811115614b31578251825591602001919060010190614b16565b5b80821115614b3d5760008155600101614b6f565b6001600160a01b0381168114614b9857600080fd5b50565b600060208284031215614bad57600080fd5b8135614bb881614b83565b9392505050565b80356001600160601b0381168114614bd657600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614c1957614c19614bdb565b604052919050565b600082601f830112614c3257600080fd5b813560206001600160401b03821115614c4d57614c4d614bdb565b8160051b614c5c828201614bf1565b9283528481018201928281019087851115614c7657600080fd5b83870192505b84831015614c9557823582529183019190830190614c7c565b979650505050505050565b8015158114614b9857600080fd5b600080600060608486031215614cc357600080fd5b614ccc84614bbf565b925060208401356001600160401b03811115614ce757600080fd5b614cf386828701614c21565b9250506040840135614d0481614ca0565b809150509250925092565b600060208284031215614d2157600080fd5b5035919050565b600080600060608486031215614d3d57600080fd5b505081359360208301359350604090920135919050565b600060208284031215614d6657600080fd5b614bb882614bbf565b8060005b6004811015610c5b578151845260209384019390910190600101614d73565b6080810161398b8284614d6f565b600081518084526020808501945080840160005b83811015614dd057815187529582019590820190600101614db4565b509495945050505050565b602081526000614bb86020830184614da0565b60008060408385031215614e0157600080fd5b614e0a83614bbf565b91506020830135614e1a81614ca0565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015614e665783516001600160601b031683529284019291840191600101614e41565b50909695505050505050565b634e487b7160e01b600052602160045260246000fd5b60058110614ea657634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a08101614ed66040830186614e88565b9215156060820152608001529392505050565b60008060408385031215614efc57600080fd5b614f0583614bbf565b946020939093013593505050565b600082601f830112614f2457600080fd5b81356001600160401b03811115614f3d57614f3d614bdb565b614f50601f8201601f1916602001614bf1565b818152846020838601011115614f6557600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215614f9757600080fd5b8335614fa281614b83565b92506020840135915060408401356001600160401b03811115614fc457600080fd5b614fd086828701614f13565b9150509250925092565b60008060408385031215614fed57600080fd5b50508035926020909101359150565b60006101008083018b845260208b818601528a6040860152896060860152826080860152819250885180835261012086019350818a01925060005b8181101561505c5783516001600160a01b031685529382019392820192600101615037565b5050505060a08301959095525060c081019290925260e09091015295945050505050565b600082601f83011261509157600080fd5b604051608081018181106001600160401b03821117156150b3576150b3614bdb565b6040528060808401858111156150c857600080fd5b845b818110156150e25780358352602092830192016150ca565b509195945050505050565b60008060008060008060008060006101808a8c03121561510c57600080fd5b6151158a614bbf565b985060208a013561512581614ca0565b975060408a0135965060608a0135955060808a0135945060a08a013593506151508b60c08c01615080565b92506101408a01356001600160401b038082111561516d57600080fd5b6151798d838e01614f13565b93506101608c013591508082111561519057600080fd5b5061519d8c828d01614c21565b9150509295985092959850929598565b60008060a083850312156151c057600080fd5b6151c983614bbf565b91506151d88460208501615080565b90509250929050565b600080604083850312156151f457600080fd5b8235915060208301356001600160401b0381111561521157600080fd5b61521d85828601614f13565b9150509250929050565b60008060006060848603121561523c57600080fd5b833592506020840135915060408401356001600160401b03811115614fc457600080fd5b6000806040838503121561527357600080fd5b823561527e81614b83565b91506151d860208401614bbf565b6000806040838503121561529f57600080fd5b8235614f0581614b83565b600080600080608085870312156152c057600080fd5b84356152cb81614b83565b93506152d960208601614bbf565b93969395505050506040820135916060013590565b60006020828403121561530057600080fd5b81356001600160401b0381111561531657600080fd5b61391084828501614f13565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600e908201526d0aee4dedcce40889640d2dcc8caf60931b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000600182016153af576153af615387565b5060010190565b8181038181111561398b5761398b615387565b6000602082840312156153db57600080fd5b8151614bb881614ca0565b6020810161398b8284614e88565b60008060006060848603121561540957600080fd5b83519250602084015161541b81614ca0565b6040850151909250614d0481614ca0565b60208082526011908201527008515e1958dd5d1a5bdb881c195c9a5bd9607a1b604082015260600190565b8082018082111561398b5761398b615387565b60006020828403121561547c57600080fd5b5051919050565b808202811582820484141761398b5761398b615387565b6020808252818101527f4d696e5374616b65206c6f776572207468616e20706172656e7420636f757274604082015260600190565b60005b838110156154ea5781810151838201526020016154d2565b50506000910152565b600082516155058184602087016154cf565b9190910192915050565b600081518084526155278160208601602086016154cf565b601f01601f19169290920160200192915050565b828152604060208201526000613910604083018461550f565b6000610140891515835288602084015287604084015286606084015285608084015261558360a0840186614d6f565b8061012084015261559681840185614da0565b9a9950505050505050505050565b634e487b7160e01b600052601260045260246000fd5b6000826155c9576155c96155a4565b500490565b8481528360208201526080604082015260006155ed608083018561550f565b905082606083015295945050505050565b60006020828403121561561057600080fd5b8151614bb881614b83565b6000600160ff1b820161563057615630615387565b5060000390565b600082615646576156466155a4565b500690565b60006020828403121561565d57600080fd5b815160038110614bb857600080fd5b634e487b7160e01b600052603160045260246000fd5b60008161569157615691615387565b50600019019056fee83e0a05baa75e68db64db7387055029be50c8d8de00a3e3e56978509b9bc2dea2646970667358221220a636d1bec26af3a1cf04e14510600e9828729ba5619eb75cca0534c363ac241564736f6c63430008120033", + "numDeployments": 3, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKit\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModuleAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AppealFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrationFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArraysLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotDisableRootDKInGeneral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepthLevelMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitNotSupportedByCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeNotAppealable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodIsFinal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeStillDrawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EvidenceNotPassedAndNotAppeal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDisputKitParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidForkingCourtAsParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinStakeLowerThanParentCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEvidencePeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotExecutionPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RulingAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotAccepted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsuccessfulCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedDisputeKit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VotePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongDisputeKitIndex\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"AcceptedFeeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"CourtCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_fromCourtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"_toCourtID\",\"type\":\"uint96\"}],\"name\":\"CourtJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"CourtModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_parent\",\"type\":\"uint256\"}],\"name\":\"DisputeKitCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"DisputeKitEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_fromDisputeKitID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toDisputeKitID\",\"type\":\"uint256\"}],\"name\":\"DisputeKitJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_pnkAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"LeftoverRewardSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum KlerosCore.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_penalty\",\"type\":\"uint256\"}],\"name\":\"StakeDelayed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_degreeOfCoherency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_pnkAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_feeAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ALPHA_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_NB_OF_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DISPUTE_KIT_CLASSIC\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FORKING_COURT\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GENERAL_COURT\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NATIVE_CURRENCY\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NON_PAYABLE_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NULL_DISPUTE_KIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEARCH_ITERATIONS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_parent\",\"type\":\"uint256\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"changeAcceptedFeeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeCourtParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"changeCurrencyRates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"}],\"name\":\"changeJurorProsecutionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_toToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amountInEth\",\"type\":\"uint256\"}],\"name\":\"convertEthToTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"createCourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"currencyRates\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"feePaymentAccepted\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"rateDecimals\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKitNodes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"parent\",\"type\":\"uint256\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"disputeKit\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depthLevel\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrableV2\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCore.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"enableDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"executeRuling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"getDisputeKit\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"getDisputeKitChildren\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeKitNodesLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"staked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"locked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfRounds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeKitID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkAtStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repartitions\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkPenalties\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"drawnJurors\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"sumFeeRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumPnkRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"feeToken\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"isDisputeKitJumping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"isSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"jurorProsecutionModule\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"passPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_penalty\",\"type\":\"uint256\"}],\"name\":\"setStakeBySortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"AcceptedFeeToken(address,bool)\":{\"details\":\"To be emitted when an ERC20 token is added or removed as a method to pay fees.\",\"params\":{\"_accepted\":\"Whether the token is accepted or not.\",\"_token\":\"The ERC20 token.\"}},\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address,uint256)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\",\"_parent\":\"The ID of the parent dispute kit. It is left empty when root DK is created. Note that the root DK must be supported by the general court.\"}},\"appeal(uint256,uint256,bytes)\":{\"details\":\"Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Extradata for the dispute. Can be required during court jump.\",\"_numberOfChoices\":\"Number of choices for the dispute. Can be required during court jump.\"}},\"appealCost(uint256)\":{\"details\":\"Gets the cost of appealing a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"cost\":\"The appeal cost.\"}},\"appealPeriod(uint256)\":{\"details\":\"Gets the start and the end of a specified dispute's current appeal period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"end\":\"The end of the appeal period.\",\"start\":\"The start of the appeal period.\"}},\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration denominated in ETH. 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.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost in ETH.\"}},\"arbitrationCost(bytes,address)\":{\"details\":\"Compute the cost of arbitration denominated in `_feeToken`. 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.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeToken\":\"The ERC20 token used to pay fees.\"},\"returns\":{\"cost\":\"The arbitration cost in `_feeToken`.\"}},\"changeAcceptedFeeTokens(address,bool)\":{\"details\":\"Changes the supported fee tokens.\",\"params\":{\"_accepted\":\"Whether the token is supported or not as a method of fee payment.\",\"_feeToken\":\"The fee token.\"}},\"changeCurrencyRates(address,uint64,uint8)\":{\"details\":\"Changes the currency rate of a fee token.\",\"params\":{\"_feeToken\":\"The fee token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeJurorProsecutionModule(address)\":{\"details\":\"Changes the `jurorProsecutionModule` storage variable.\",\"params\":{\"_jurorProsecutionModule\":\"The new value for the `jurorProsecutionModule` storage variable.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.\",\"params\":{\"_sortitionModule\":\"The new value for the `sortitionModule` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_courtParameters\":\"Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_governor\":\"The governor's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionExtraData\":\"The extra data for sortition module.\",\"_sortitionModuleAddress\":\"The sortition module responsible for sortition of the jurors.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\"}},\"createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])\":{\"details\":\"Creates a court under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the court.\",\"_feeForJuror\":\"The `feeForJuror` property value of the court.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the court.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the court.\",\"_minStake\":\"The `minStake` property value of the court.\",\"_parent\":\"The `parent` property value of the court.\",\"_sortitionExtraData\":\"Extra data for sortition module.\",\"_supportedDisputeKits\":\"Indexes of dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the court.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"createDispute(uint256,bytes,address,uint256)\":{\"details\":\"Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeAmount\":\"Amount of the ERC20 token used to pay fees.\",\"_feeToken\":\"The ERC20 token used to pay fees.\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws jurors for the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"enableDisputeKits(uint96,uint256[],bool)\":{\"details\":\"Adds/removes court's support for specified dispute kits.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_disputeKitIDs\":\"The IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the court.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\",\"_round\":\"The appeal round.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"executeRuling(uint256)\":{\"details\":\"Executes a specified dispute's ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getDisputeKit(uint256)\":{\"details\":\"Gets the dispute kit for a specific `_disputeKitID`.\",\"params\":{\"_disputeKitID\":\"The ID of the dispute kit.\"}},\"getDisputeKitChildren(uint256)\":{\"details\":\"Gets non-primitive properties of a specified dispute kit node.\",\"params\":{\"_disputeKitID\":\"The ID of the dispute kit.\"},\"returns\":{\"_0\":\"children Indexes of children of this DK.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"getNumberOfVotes(uint256)\":{\"details\":\"Gets the number of votes permitted for the specified dispute in the latest round.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_courtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"isDisputeKitJumping(uint256)\":{\"details\":\"Returns true if the dispute kit will be switched to a parent DK.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"_0\":\"Whether DK will be switched or not.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_stake\":\"The new stake.\"}}},\"title\":\"KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCore.sol\":\"KlerosCore\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"../libraries/SafeERC20.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n mapping(uint96 => uint256) stakedPnk; // The amount of PNKs the juror has staked in the court in the form `stakedPnk[courtID]`.\\n mapping(uint96 => uint256) lockedPnk; // The amount of PNKs the juror has locked in the court in the form `lockedPnk[courtID]`.\\n }\\n\\n struct DisputeKitNode {\\n uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root.\\n uint256[] children; // List of child dispute kits.\\n IDisputeKit disputeKit; // The dispute kit implementation.\\n uint256 depthLevel; // How far this DK is from the root. 0 for root DK.\\n bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n // TODO: interactions with jurorProsecutionModule.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID.\\n Dispute[] public disputes; // The disputes.\\n mapping(address => Juror) internal jurors; // The jurors.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty);\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(\\n uint256 indexed _disputeKitID,\\n IDisputeKit indexed _disputeKitAddress,\\n uint256 indexed _parent\\n );\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent.\\n disputeKitNodes.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: NULL_DISPUTE_KIT,\\n children: new uint256[](0),\\n disputeKit: _disputeKit,\\n depthLevel: 0,\\n disabled: false\\n })\\n );\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit, NULL_DISPUTE_KIT);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created.\\n /// Note that the root DK must be supported by the general court.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor {\\n uint256 disputeKitID = disputeKitNodes.length;\\n if (_parent >= disputeKitID) revert InvalidDisputKitParent();\\n uint256 depthLevel;\\n if (_parent != NULL_DISPUTE_KIT) {\\n depthLevel = disputeKitNodes[_parent].depthLevel + 1;\\n // It should be always possible to reach the root from the leaf with the defined number of search iterations.\\n if (depthLevel >= SEARCH_ITERATIONS) revert DepthLevelMax();\\n }\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: _parent,\\n children: new uint256[](0),\\n disputeKit: _disputeKitAddress,\\n depthLevel: depthLevel,\\n disabled: false\\n })\\n );\\n\\n disputeKitNodes[_parent].children.push(disputeKitID);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent);\\n if (_parent == NULL_DISPUTE_KIT) {\\n // A new dispute kit tree root should always be supported by the General court.\\n _enableDisputeKit(GENERAL_COURT, disputeKitID, true);\\n }\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKitNodes.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n if (_courtID != GENERAL_COURT && courts[courts[_courtID].parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < courts[_courtID].children.length; i++) {\\n if (courts[courts[_courtID].children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n courts[_courtID].minStake = _minStake;\\n courts[_courtID].hiddenVotes = _hiddenVotes;\\n courts[_courtID].alpha = _alpha;\\n courts[_courtID].feeForJuror = _feeForJuror;\\n courts[_courtID].jurorsForCourtJump = _jurorsForCourtJump;\\n courts[_courtID].timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKitNodes.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n if (_courtID == GENERAL_COURT && disputeKitNodes[_disputeKitIDs[i]].parent == NULL_DISPUTE_KIT) {\\n revert CannotDisableRootDKInGeneral();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n CurrencyRate storage rate = currencyRates[_feeToken];\\n rate.rateInEth = _rateInEth;\\n rate.rateDecimals = _rateDecimals;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n function setStake(uint96 _courtID, uint256 _stake) external {\\n if (!_setStakeForAccount(msg.sender, _courtID, _stake, 0)) revert StakingFailed();\\n }\\n\\n function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _stake, uint256 _penalty) external {\\n if (msg.sender != address(sortitionModule)) revert WrongCaller();\\n _setStakeForAccount(_account, _courtID, _stake, _penalty);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n require(_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount), \\\"Transfer failed\\\");\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit;\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= round.nbVotes ? startIndex + _iterations : round.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n jurors[drawnAddress].lockedPnk[dispute.courtID] += round.pnkAtStakePerJuror;\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n }\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKitNodes[round.disputeKitID].disputeKit)) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) {\\n if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n break;\\n } else if (disputeKitNodes[newDisputeKitID].parent != NULL_DISPUTE_KIT) {\\n newDisputeKitID = disputeKitNodes[newDisputeKitID].parent;\\n } else {\\n // DK's parent has 0 index, that means we reached the root DK (0 depth level).\\n // Jump to the next parent court if the current court doesn't support any DK from this tree.\\n // Note that we don't reset newDisputeKitID in this case as, a precaution.\\n newCourtID = courts[newCourtID].parent;\\n }\\n }\\n // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court.\\n // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default.\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n newCourtID = GENERAL_COURT;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n IDisputeKit disputeKit = disputeKitNodes[extraRound.disputeKitID].disputeKit;\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKit.createDispute(_disputeID, _numberOfChoices, _extraData, extraRound.nbVotes);\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n jurors[account].lockedPnk[dispute.courtID] -= penalty;\\n\\n // Apply the penalty to the staked PNKs\\n if (jurors[account].stakedPnk[dispute.courtID] >= courts[dispute.courtID].minStake + penalty) {\\n // The juror still has enough staked PNKs after penalty for this court.\\n uint256 newStake = jurors[account].stakedPnk[dispute.courtID] - penalty;\\n _setStakeForAccount(account, dispute.courtID, newStake, penalty);\\n } else if (jurors[account].stakedPnk[dispute.courtID] != 0) {\\n // The juror does not have enough staked PNKs after penalty for this court, unstake them.\\n _setStakeForAccount(account, dispute.courtID, 0, penalty);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n // TODO Change me\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n jurors[account].lockedPnk[dispute.courtID] -= pnkLocked;\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (jurors[account].stakedPnk[dispute.courtID] == 0) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round\\n )\\n external\\n view\\n returns (\\n uint256 disputeKitID,\\n uint256 pnkAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 nbVotes,\\n uint256 repartitions,\\n uint256 pnkPenalties,\\n address[] memory drawnJurors,\\n uint256 sumFeeRewardPaid,\\n uint256 sumPnkRewardPaid,\\n IERC20 feeToken\\n )\\n {\\n Round storage round = disputes[_disputeID].rounds[_round];\\n return (\\n round.disputeKitID,\\n round.pnkAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.nbVotes,\\n round.repartitions,\\n round.pnkPenalties,\\n round.drawnJurors,\\n round.sumFeeRewardPaid,\\n round.sumPnkRewardPaid,\\n round.feeToken\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 staked, uint256 locked, uint256 nbCourts) {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedPnk[_courtID];\\n locked = juror.lockedPnk[_courtID];\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets non-primitive properties of a specified dispute kit node.\\n /// @param _disputeKitID The ID of the dispute kit.\\n /// @return children Indexes of children of this DK.\\n function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) {\\n return disputeKitNodes[_disputeKitID].children;\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_courtID];\\n timesPerPeriod = court.timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitNodesLength() external view returns (uint256) {\\n return disputeKitNodes.length;\\n }\\n\\n /// @dev Gets the dispute kit for a specific `_disputeKitID`.\\n /// @param _disputeKitID The ID of the dispute kit.\\n function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) {\\n return disputeKitNodes[_disputeKitID].disputeKit;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n CurrencyRate storage rate = currencyRates[_toToken];\\n return (_amountInEth * 10 ** rate.rateDecimals) / rate.rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n /// @param _penalty Penalized amount won't be transferred back to juror when the stake is lowered.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function _setStakeForAccount(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) return false;\\n\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = juror.stakedPnk[_courtID];\\n\\n if (_stake != 0) {\\n // Check against locked PNKs in case the min stake was lowered.\\n if (_stake < courts[_courtID].minStake || _stake < juror.lockedPnk[_courtID]) return false;\\n }\\n\\n ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _stake, _penalty);\\n if (result == ISortitionModule.preStakeHookResult.failed) {\\n return false;\\n } else if (result == ISortitionModule.preStakeHookResult.delayed) {\\n emit StakeDelayed(_account, _courtID, _stake, _penalty);\\n return true;\\n }\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (pinakion.safeTransferFrom(_account, address(this), transferredAmount)) {\\n if (currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n if (_stake == 0) {\\n // Keep locked PNKs in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedPnk[_courtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (pinakion.safeTransfer(_account, transferredAmount)) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!pinakion.safeTransfer(_account, transferredAmount)) {\\n return false;\\n }\\n }\\n }\\n }\\n\\n // Update juror's records.\\n juror.stakedPnk[_courtID] = _stake;\\n\\n sortitionModule.setStake(_account, _courtID, _stake);\\n emit StakeSet(_account, _courtID, _stake);\\n return true;\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableRootDKInGeneral();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error WrongCaller();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error DisputeKitOnly();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n}\\n\",\"keccak256\":\"0xe57e56a2886c61842b0ab35e8e8b54eac1d1213fa002c8f263305b80d3f702bf\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7a259401627ba5546d9eb0264275aa1be9762f8a514545ae99d8c356ebf41f4f\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x9001274313a4e7eeda92332bbeeac8972f55e6378874babfaccd56eb283816f0\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Address of the juror.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event Justification(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0xd51cc7a11480d19abbd810733ddd5bf84f998e8b855ef8dd826a4b76a97ddd36\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n enum preStakeHookResult {\\n ok,\\n delayed,\\n failed\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(address _account, uint96 _courtID, uint256 _value) external;\\n\\n function setJurorInactive(address _account) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _voteID) external view returns (address);\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external returns (preStakeHookResult);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x28911aa78669746f40c4c3bce723db21600a49a74142c0fe378680b1b356d633\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b50604051620060eb380380620060eb83398101604081905262000034916200065f565b600080546001600160a01b038b81166001600160a01b0319928316178355600180548c8316908416178155600280548c841690851617815560038054878516951694909417909355600580546040805160a081018252878152815188815260208082018452808301918252968f1692820192909252606081018890526080810188905295820183559582905284519201027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db08101918255935180519394919362000128937f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db19093019291909101906200045c565b506040828101516002830180546001600160a01b0319166001600160a01b03928316179055606084015160038401556080909301516004909201805460ff191692151592909217909155516000918816906001907f7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c498908490a460048054600101815560008181526003546040516311de995760e21b81526001600160a01b039091169263477a655c92620001e19290918791016200074c565b600060405180830381600087803b158015620001fc57600080fd5b505af115801562000211573d6000803e3d6000fd5b5050600480546001810182556000918252600c027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160601b031916815560408051838152602081019091529093509150508051620002819160018401916020909101906200045c565b50805460ff60601b19166c01000000000000000000000000871515021781558451600282015560208501516003820155604085015160048083019190915560608601516005830155620002db9060068301908690620004ac565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c90620003119060019087906004016200074c565b600060405180830381600087803b1580156200032c57600080fd5b505af115801562000341573d6000803e3d6000fd5b5050825487516020808a01516040808c015160608d0151825160008152948501928390526001600160601b039096169750600196507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d95620003ab958f959094938e91906200079e565b60405180910390a3620003c160018080620003d1565b505050505050505050506200083a565b806004846001600160601b031681548110620003f157620003f162000788565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b8280548282559060005260206000209081019282156200049a579160200282015b828111156200049a5782518255916020019190600101906200047d565b50620004a8929150620004dc565b5090565b82600481019282156200049a57916020028201828111156200049a5782518255916020019190600101906200047d565b5b80821115620004a85760008155600101620004dd565b6001600160a01b03811681146200050957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200053457600080fd5b604051608081016001600160401b03811182821017156200055957620005596200050c565b6040528060808401858111156200056f57600080fd5b845b818110156200058b57805183526020928301920162000571565b509195945050505050565b60005b83811015620005b357818101518382015260200162000599565b50506000910152565b600082601f830112620005ce57600080fd5b81516001600160401b0380821115620005eb57620005eb6200050c565b604051601f8301601f19908116603f011681019082821181831017156200061657620006166200050c565b816040528381528660208588010111156200063057600080fd5b6200064384602083016020890162000596565b9695505050505050565b80516200065a81620004f3565b919050565b60008060008060008060008060006101e08a8c0312156200067f57600080fd5b89516200068c81620004f3565b60208b01519099506200069f81620004f3565b60408b0151909850620006b281620004f3565b60608b0151909750620006c581620004f3565b60808b01519096508015158114620006dc57600080fd5b9450620006ed8b60a08c0162000522565b9350620006ff8b6101208c0162000522565b6101a08b01519093506001600160401b038111156200071d57600080fd5b6200072b8c828d01620005bc565b9250506200073d6101c08b016200064d565b90509295985092959850929598565b82815260406020820152600082518060408401526200077381606085016020870162000596565b601f01601f1916919091016060019392505050565b634e487b7160e01b600052603260045260246000fd5b60006101408083018a1515845260208a8186015289604086015288606086015287608086015260a085018760005b6004811015620007eb57815183529183019190830190600101620007cc565b5050506101208501929092528451908190526101608401918086019160005b8181101562000828578351855293820193928201926001016200080a565b50929c9b505050505050505050505050565b6158a1806200084a6000396000f3fe6080604052600436106102d45760003560e01c80637717a6e81161017b578063c3569902116100d7578063f12ada8b11610085578063f12ada8b14610a25578063f56f072514610a45578063f6506db414610a65578063f7434ea914610a85578063fbf405b014610aa5578063fc6f8f1614610ac5578063fe524c3914610ae557600080fd5b8063c3569902146108f8578063c71f42531461090b578063cf0c38f81461092b578063d1c1df481461094b578063d2b8035a146109c5578063d98493f6146109e5578063e4c0aaf414610a0557600080fd5b80638bb04875116101345780638bb048751461081b578063a072b86c1461083b578063afe15cfb1461085b578063b004963714610890578063bcb1a166146108b0578063c13517e1146108c5578063c258bb19146108d857600080fd5b80637717a6e81461074a5780637934c0be1461076a57806382d022371461078a578063840bc19c146107aa57806386541b24146107c55780638a9bb02a146107e557600080fd5b80632d29a47b11610235578063543f8a36116101e3578063543f8a361461066d578063564a565d1461069a57806359ec827e146106cb5780635ea5c038146106eb5780636235593f146107005780636c1eb1b914610715578063751accd01461072a57600080fd5b80632d29a47b146105935780632e1daf2f146105b35780632ea7b4d0146105d357806334d5fb31146105e95780633cfd1184146105fe57806343d4137f1461062b57806349f426501461065857600080fd5b8063115d537611610292578063115d5376146104385780631860592b146104585780631956b1f91461047857806319b81529146104985780631c3db16d146104c85780631f5a0dd21461050557806327e6ec8a1461056657600080fd5b8062f5822c146102d95780630219da79146102fb5780630b7414bc146103735780630c340a24146103935780630d1b9d1a146103cb5780630d83b94014610415575b600080fd5b3480156102e557600080fd5b506102f96102f4366004614b1c565b610b05565b005b34801561030757600080fd5b50610346610316366004614b1c565b60086020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561037f57600080fd5b506102f961038e366004614c1d565b610b52565b34801561039f57600080fd5b506000546103b3906001600160a01b031681565b6040516001600160a01b03909116815260200161036a565b3480156103d757600080fd5b506103eb6103e6366004614c7e565b610ccd565b604080519485526001600160a01b039093166020850152918301521515606082015260800161036a565b34801561042157600080fd5b5061042a600181565b60405190815260200161036a565b34801561044457600080fd5b506102f9610453366004614c7e565b610d13565b34801561046457600080fd5b5061042a610473366004614c97565b611255565b34801561048457600080fd5b506103b3610493366004614c7e565b6112b1565b3480156104a457600080fd5b506104b86104b3366004614c7e565b6112e9565b604051901515815260200161036a565b3480156104d457600080fd5b506104e86104e3366004614c7e565b6113e2565b60408051938452911515602084015215159082015260600161036a565b34801561051157600080fd5b50610525610520366004614c7e565b6114eb565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e00161036a565b34801561057257600080fd5b5061057b600081565b6040516001600160601b03909116815260200161036a565b34801561059f57600080fd5b506102f96105ae366004614cc3565b61154a565b3480156105bf57600080fd5b506003546103b3906001600160a01b031681565b3480156105df57600080fd5b5061042a61271081565b3480156105f557600080fd5b5061057b600181565b34801561060a57600080fd5b5061061e610619366004614cef565b611792565b60405161036a9190614d2d565b34801561063757600080fd5b5061064b610646366004614c7e565b611803565b60405161036a9190614d76565b34801561066457600080fd5b506103b3600081565b34801561067957600080fd5b5061068d610688366004614b1c565b61187f565b60405161036a9190614d89565b3480156106a657600080fd5b506106ba6106b5366004614c7e565b61191b565b60405161036a959493929190614e0e565b3480156106d757600080fd5b5061042a6106e6366004614c7e565b611977565b3480156106f757600080fd5b5060055461042a565b34801561070c57600080fd5b5061042a600081565b34801561072157600080fd5b5061042a600a81565b34801561073657600080fd5b506102f9610745366004614ebc565b611acc565b34801561075657600080fd5b506102f9610765366004614f14565b611b76565b34801561077657600080fd5b506102f9610785366004614f30565b611ba4565b34801561079657600080fd5b506102f96107a5366004614f69565b611c23565b3480156107b657600080fd5b5061042a6001600160ff1b0381565b3480156107d157600080fd5b506102f96107e0366004615028565b611ca5565b3480156107f157600080fd5b50610805610800366004615096565b611fda565b60405161036a9a999897969594939291906150b8565b34801561082757600080fd5b506102f9610836366004614c7e565b6120f4565b34801561084757600080fd5b506102f9610856366004615155565b612258565b34801561086757600080fd5b5061087b610876366004614c7e565b612597565b6040805192835260208301919091520161036a565b34801561089c57600080fd5b506102f96108ab366004614b1c565b612643565b3480156108bc57600080fd5b5061042a600381565b61042a6108d3366004615215565b612690565b3480156108e457600080fd5b506102f96108f3366004614b1c565b6126cf565b6102f961090636600461525b565b61271c565b34801561091757600080fd5b5061042a610926366004614c7e565b612d04565b34801561093757600080fd5b506002546103b3906001600160a01b031681565b34801561095757600080fd5b506109aa610966366004615294565b6001600160a01b0390911660009081526007602090815260408083206001600160601b03909416835260018401825280832054600285019092529091205491549092565b6040805193845260208401929092529082015260600161036a565b3480156109d157600080fd5b506102f96109e0366004615096565b612d6c565b3480156109f157600080fd5b5061042a610a00366004615311565b613051565b348015610a1157600080fd5b506102f9610a20366004614b1c565b61309e565b348015610a3157600080fd5b506102f9610a40366004614c97565b6130eb565b348015610a5157600080fd5b506102f9610a6036600461535c565b61330e565b348015610a7157600080fd5b5061042a610a803660046153a0565b61334c565b348015610a9157600080fd5b5061042a610aa0366004615406565b613455565b348015610ab157600080fd5b506001546103b3906001600160a01b031681565b348015610ad157600080fd5b5061042a610ae0366004614c7e565b6134a1565b348015610af157600080fd5b506104b8610b00366004614f14565b6134d0565b6000546001600160a01b03163314610b305760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b7d5760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610cc7578115610c1c57828181518110610ba157610ba161543a565b602002602001015160001480610bd457506005548351849083908110610bc957610bc961543a565b602002602001015110155b15610bf257604051633d58a98960e11b815260040160405180910390fd5b610c1784848381518110610c0857610c0861543a565b60200260200101516001613518565b610cb5565b6001600160601b0384166001148015610c72575060006005848381518110610c4657610c4661543a565b602002602001015181548110610c5e57610c5e61543a565b906000526020600020906005020160000154145b15610c9057604051630c6e81c960e11b815260040160405180910390fd5b610cb584848381518110610ca657610ca661543a565b60200260200101516000613518565b80610cbf81615466565b915050610b80565b50505050565b60058181548110610cdd57600080fd5b600091825260209091206005909102018054600282015460038301546004909301549193506001600160a01b0316919060ff1684565b600060068281548110610d2857610d2861543a565b600091825260208220600491820201805482549194506001600160601b0316908110610d5657610d5661543a565b6000918252602082206003850154600c909202019250610d789060019061547f565b90506000836003018281548110610d9157610d9161543a565b600091825260208220600a909102019150600185015460ff166004811115610dbb57610dbb614dd6565b03610e965781158015610e0a57506001840154600684019060ff166004811115610de757610de7614dd6565b60048110610df757610df761543a565b01546002850154610e08904261547f565b105b15610e2857604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610e50576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610e67576002610e6a565b60015b60018086018054909160ff1990911690836004811115610e8c57610e8c614dd6565b0217905550611207565b60018085015460ff166004811115610eb057610eb0614dd6565b03610fc8576001840154600684019060ff166004811115610ed357610ed3614dd6565b60048110610ee357610ee361543a565b01546002850154610ef4904261547f565b108015610f9357506005816000015481548110610f1357610f1361543a565b6000918252602090912060059091020160020154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190615492565b155b15610fb157604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610e8c565b6002600185015460ff166004811115610fe357610fe3614dd6565b03611139576001840154600684019060ff16600481111561100657611006614dd6565b600481106110165761101661543a565b01546002850154611027904261547f565b1080156110c6575060058160000154815481106110465761104661543a565b60009182526020909120600590910201600201546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa1580156110a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c49190615492565b155b156110e457604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3611207565b6003600185015460ff16600481111561115457611154614dd6565b036111ce576001840154600684019060ff16600481111561117757611177614dd6565b600481106111875761118761543a565b01546002850154611198904261547f565b10156111b757604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610e8c565b6004600185015460ff1660048111156111e9576111e9614dd6565b03611207576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916112469160ff16906154af565b60405180910390a25050505050565b6001600160a01b0382166000908152600860205260408120805461010081046001600160401b03169061129390600160481b900460ff16600a6155a1565b61129d90856155b0565b6112a791906155dd565b9150505b92915050565b6000600582815481106112c6576112c661543a565b60009182526020909120600260059092020101546001600160a01b031692915050565b600080600683815481106112ff576112ff61543a565b60009182526020822060036004909202019081018054919350906113259060019061547f565b815481106113355761133561543a565b600091825260208220845460048054600a909402909201945090916001600160601b0390911690811061136a5761136a61543a565b90600052602060002090600c0201905080600501548260030154101561139557506000949350505050565b80546004805490916001600160601b03169081106113b5576113b561543a565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b600080600080600685815481106113fb576113fb61543a565b60009182526020822060036004909202019081018054919350906114219060019061547f565b815481106114315761143161543a565b90600052602060002090600a020190506000600582600001548154811061145a5761145a61543a565b6000918252602090912060059091020160020154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156114b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114db91906155f1565b9199909850909650945050505050565b600481815481106114fb57600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b60006006848154811061155f5761155f61543a565b600091825260209091206004918202019150600182015460ff16600481111561158a5761158a614dd6565b146115a857604051638794ce4b60e01b815260040160405180910390fd5b60008160030184815481106115bf576115bf61543a565b90600052602060002090600a02019050600060058260000154815481106115e8576115e861543a565b6000918252602082206002600590920201015460048401546001600160a01b039091169250906116188683615629565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa158015611676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169a919061563c565b9050806000036116b557818411156116b0578193505b6116d5565b6116c08260026155b0565b8411156116d5576116d28260026155b0565b93505b60048701849055845b84811015611771578281101561172a576117236040518060c001604052808e81526020018d8152602001848152602001858152602001868152602001838152506135a0565b935061175f565b61175f6040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613afd565b8061176981615466565b9150506116de565b508287600501541461178557600587018390555b5050505050505050505050565b61179a614a59565b60006004836001600160601b0316815481106117b8576117b861543a565b60009182526020909120604080516080810191829052600c9093029091019250600683019060049082845b8154815260200190600101908083116117e3575050505050915050919050565b6060600582815481106118185761181861543a565b906000526020600020906005020160010180548060200260200160405190810160405280929190818152602001828054801561187357602002820191906000526020600020905b81548152602001906001019080831161185f575b50505050509050919050565b6001600160a01b03811660009081526007602090815260409182902080548351818402810184019094528084526060939283018282801561187357602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116118ce575094979650505050505050565b6006818154811061192b57600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b6000806006838154811061198d5761198d61543a565b60009182526020822060036004909202019081018054919350906119b39060019061547f565b815481106119c3576119c361543a565b600091825260208220845460048054600a909402909201945090916001600160601b039091169081106119f8576119f861543a565b90600052602060002090600c020190508060050154826003015410611a975782546001600160601b031660001901611a39576001600160ff1b039350611ac4565b6003820154611a499060026155b0565b611a54906001615629565b81546004805490916001600160601b0316908110611a7457611a7461543a565b90600052602060002090600c020160040154611a9091906155b0565b9350611ac4565b6003820154611aa79060026155b0565b611ab2906001615629565b8160040154611ac191906155b0565b93505b505050919050565b6000546001600160a01b03163314611af75760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611b129190615679565b60006040518083038185875af1925050503d8060008114611b4f576040519150601f19603f3d011682016040523d82523d6000602084013e611b54565b606091505b5050905080610cc7576040516322092f2f60e11b815260040160405180910390fd5b611b833383836000613fd3565b611ba05760405163a437293760e01b815260040160405180910390fd5b5050565b6000546001600160a01b03163314611bcf5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611c4e5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b039092166000908152600860205260409020805460ff909316600160481b0260ff60481b196001600160401b03909316610100029290921669ffffffffffffffffff001990931692909217179055565b6000546001600160a01b03163314611cd05760405163c383977560e01b815260040160405180910390fd5b6001600160601b038716600114801590611d44575084600480896001600160601b031681548110611d0357611d0361543a565b60009182526020909120600c909102015481546001600160601b03909116908110611d3057611d3061543a565b90600052602060002090600c020160020154115b15611d6257604051639717078960e01b815260040160405180910390fd5b60005b6004886001600160601b031681548110611d8157611d8161543a565b90600052602060002090600c020160010180549050811015611e3b57856004808a6001600160601b031681548110611dbb57611dbb61543a565b90600052602060002090600c02016001018381548110611ddd57611ddd61543a565b906000526020600020015481548110611df857611df861543a565b90600052602060002090600c0201600201541015611e2957604051639717078960e01b815260040160405180910390fd5b80611e3381615466565b915050611d65565b50846004886001600160601b031681548110611e5957611e5961543a565b90600052602060002090600c020160020181905550856004886001600160601b031681548110611e8b57611e8b61543a565b90600052602060002090600c0201600001600c6101000a81548160ff021916908315150217905550836004886001600160601b031681548110611ed057611ed061543a565b90600052602060002090600c020160030181905550826004886001600160601b031681548110611f0257611f0261543a565b90600052602060002090600c020160040181905550816004886001600160601b031681548110611f3457611f3461543a565b90600052602060002090600c020160050181905550806004886001600160601b031681548110611f6657611f6661543a565b90600052602060002090600c0201600601906004611f85929190614a77565b50866001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a878787878787604051611fc996959493929190615695565b60405180910390a250505050505050565b600080600080600080606060008060008060068d81548110611ffe57611ffe61543a565b90600052602060002090600402016003018c815481106120205761202061543a565b90600052602060002090600a0201905080600001548160010154826002015483600301548460040154856005015486600601876007015488600801548960090160009054906101000a90046001600160a01b0316838054806020026020016040519081016040528092919081815260200182805480156120c957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116120ab575b505050505093509a509a509a509a509a509a509a509a509a509a50509295989b9194979a5092959850565b6000600682815481106121095761210961543a565b600091825260209091206004918202019150600182015460ff16600481111561213457612134614dd6565b1461215257604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff161561217d5760405163c977f8d360e01b815260040160405180910390fd5b6000612188836113e2565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b15801561223b57600080fd5b505af115801561224f573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146122835760405163c383977560e01b815260040160405180910390fd5b8660048a6001600160601b0316815481106122a0576122a061543a565b90600052602060002090600c02016002015411156122d157604051639717078960e01b815260040160405180910390fd5b80516000036122f35760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661231a57604051631ef4f64960e01b815260040160405180910390fd5b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b83518110156124185783818151811061236d5761236d61543a565b6020026020010151600014806123a0575060055484518590839081106123955761239561543a565b602002602001015110155b156123be57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106123d8576123d861543a565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061241090615466565b915050612352565b5080546001600160601b0319166001600160601b038c161781556040805160008152602081019182905251612451916001840191614ab5565b50805460ff60601b1916600160601b8b15150217815560028101899055600381018890556004808201889055600582018790556124949060068301908790614a77565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c906124c790859088906004016156f4565b600060405180830381600087803b1580156124e157600080fd5b505af11580156124f5573d6000803e3d6000fd5b5050505060048b6001600160601b0316815481106125155761251561543a565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612582908e908e908e908e908e908e908d9061570d565b60405180910390a35050505050505050505050565b6000806000600684815481106125af576125af61543a565b6000918252602090912060049091020190506003600182015460ff1660048111156125dc576125dc614dd6565b03612634576002810154815460048054929550916001600160601b0390911690811061260a5761260a61543a565b600091825260209091206009600c909202010154600282015461262d9190615629565b915061263d565b60009250600091505b50915091565b6000546001600160a01b0316331461266e5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061269b82613455565b3410156126bb57604051630e3360f160e21b815260040160405180910390fd5b6126c8838360003461453c565b9392505050565b6000546001600160a01b031633146126fa5760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61272583611977565b34101561274557604051633191f8f160e01b815260040160405180910390fd5b60006006848154811061275a5761275a61543a565b6000918252602090912060049091020190506003600182015460ff16600481111561278757612787614dd6565b146127a5576040516337cdefcb60e21b815260040160405180910390fd5b600381018054600091906127bb9060019061547f565b815481106127cb576127cb61543a565b90600052602060002090600a0201905060058160000154815481106127f2576127f261543a565b60009182526020909120600590910201600201546001600160a01b0316331461282e5760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600480546001600160601b0390951694600a90930290910191849081106128715761287161543a565b90600052602060002090600c020160050154846003015410612a6f576004836001600160601b0316815481106128a9576128a961543a565b600091825260208220600c90910201546001600160601b031693505b600a8110156129b4576004846001600160601b0316815481106128ea576128ea61543a565b60009182526020808320868452600a600c90930201919091019052604090205460ff166129b4576000600584815481106129265761292661543a565b9060005260206000209060050201600001541461296957600583815481106129505761295061543a565b90600052602060002090600502016000015492506129a2565b6004846001600160601b0316815481106129855761298561543a565b60009182526020909120600c90910201546001600160601b031693505b806129ac81615466565b9150506128c5565b506004836001600160601b0316815481106129d1576129d161543a565b60009182526020808320858452600a600c90930201919091019052604090205460ff166129fd57600192505b84546001600160601b03848116911614612a6f57845460038601546001600160601b0390911690612a309060019061547f565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612ab257612ab261543a565b90600052602060002090600c02019050806004015434612ad291906155dd565b826003018190555061271081600301548260020154612af191906155b0565b612afb91906155dd565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c91612b329161547f565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612b7057600080fd5b505af1158015612b84573d6000803e3d6000fd5b505086548454149150612c8190505760006005836000015481548110612bac57612bac61543a565b6000918252602090912060026005909202010154865460038901546001600160a01b03909216925090612be19060019061547f565b84546040519081528c907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a460038301546040516302dbb79560e61b81526001600160a01b0383169163b6ede54091612c4d918e918e918e9160040161575d565b600060405180830381600087803b158015612c6757600080fd5b505af1158015612c7b573d6000803e3d6000fd5b50505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612cf191906154af565b60405180910390a2505050505050505050565b60008060068381548110612d1a57612d1a61543a565b906000526020600020906004020190508060030160018260030180549050612d42919061547f565b81548110612d5257612d5261543a565b90600052602060002090600a020160030154915050919050565b600060068381548110612d8157612d8161543a565b90600052602060002090600402019050600060018260030180549050612da7919061547f565b90506000826003018281548110612dc057612dc061543a565b600091825260208220600a909102019150600184015460ff166004811115612dea57612dea614dd6565b14612e0857604051638285c4ef60e01b815260040160405180910390fd5b60006005826000015481548110612e2157612e2161543a565b60009182526020822060026005909202010154600684015460038501546001600160a01b0390921693509190612e578884615629565b1115612e67578360030154612e71565b612e718783615629565b9050815b8181101561304657604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af1158015612ec7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eeb919061578d565b90506001600160a01b038116156130335760018601546001600160a01b03821660009081526007602090815260408083208c546001600160601b0316845260020190915281208054909190612f41908490615629565b909155505060068601546040805189815260208101929092528b916001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a36006860180546001810182556000828152602090200180546001600160a01b0319166001600160a01b038416179055600387015490540361303357600354604051632e96bc2360e11b8152600481018c9052602481018990526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561301a57600080fd5b505af115801561302e573d6000803e3d6000fd5b505050505b508061303e81615466565b915050612e75565b505050505050505050565b60006130968261047386868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061345592505050565b949350505050565b6000546001600160a01b031633146130c95760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146131165760405163c383977560e01b815260040160405180910390fd5b60055480821061313957604051630becfec560e01b815260040160405180910390fd5b6000821561319457600583815481106131545761315461543a565b90600052602060002090600502016003015460016131729190615629565b9050600a8110613194576040516210d62560e51b815260040160405180910390fd5b6040805160a08101825284815281516000808252602080830185528084019283526001600160a01b0389169484019490945260608301859052608083018190526005805460018101825591819052835191027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081019182559151805193949193613245937f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db101929190910190614ab5565b5060408201516002820180546001600160a01b0319166001600160a01b03909216919091179055606082015160038201556080909101516004909101805460ff191691151591909117905560058054849081106132a4576132a461543a565b600091825260208083206001600590930201820180549283018155835282200183905560405184916001600160a01b0387169185917f7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c49891a482610cc757610cc76001836001613518565b6003546001600160a01b031633146133395760405163068690bf60e11b815260040160405180910390fd5b61334584848484613fd3565b5050505050565b6001600160a01b03821660009081526008602052604081205460ff166133855760405163e51cf7bf60e01b815260040160405180910390fd5b613390858585613051565b8210156133b057604051630e3360f160e21b815260040160405180910390fd5b6133c56001600160a01b03841633308561482d565b6134075760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640160405180910390fd5b61344b8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925087915061453c9050565b9695505050505050565b600080600061346384614909565b5091509150806004836001600160601b0316815481106134855761348561543a565b90600052602060002090600c02016004015461309691906155b0565b6000600682815481106134b6576134b661543a565b600091825260209091206003600490920201015492915050565b60006004836001600160601b0316815481106134ee576134ee61543a565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806004846001600160601b0316815481106135355761353561543a565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b60008060068360000151815481106135ba576135ba61543a565b906000526020600020906004020190506000816003018460200151815481106135e5576135e561543a565b90600052602060002090600a020190506000600582600001548154811061360e5761360e61543a565b600091825260208083206005929092029091016002015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa158015613685573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a9919061563c565b90506127108111156136ba57506127105b60006127106136c9838261547f565b85600101546136d891906155b0565b6136e291906155dd565b905080876080018181516136f69190615629565b90525060a08701516006850180546000929081106137165761371661543a565b60009182526020808320909101546001600160a01b03168083526007825260408084208a546001600160601b0316855260020190925290822080549193508492909161376390849061547f565b909155505085546004805484926001600160601b03169081106137885761378861543a565b90600052602060002090600c0201600201546137a49190615629565b6001600160a01b03821660009081526007602090815260408083208a546001600160601b0316845260010190915290205410613838576001600160a01b038116600090815260076020908152604080832089546001600160601b0316845260010190915281205461381690849061547f565b87549091506138319083906001600160601b03168386613fd3565b5050613889565b6001600160a01b038116600090815260076020908152604080832089546001600160601b03168452600101909152902054156138895785546138879082906001600160601b0316600085613fd3565b505b602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e7866138c5876157aa565b60098b01546040516138e79392916000916001600160a01b03909116906157c6565b60405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa15801561394e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139729190615492565b6139d65760035460405163b5d69e9960e01b81526001600160a01b0383811660048301529091169063b5d69e9990602401600060405180830381600087803b1580156139bd57600080fd5b505af11580156139d1573d6000803e3d6000fd5b505050505b600188606001516139e7919061547f565b8860a001511480156139fb57506040880151155b15613aec5760098501546001600160a01b0316613a44576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1935050505050613a6b565b60005460028601546009870154613a69926001600160a01b0391821692911690614990565b505b6000546080890151600154613a8e926001600160a01b0391821692911690614990565b506020880151885160808a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf493613ae393909290916001600160a01b03909116906157ea565b60405180910390a35b505050608090940151949350505050565b60006006826000015181548110613b1657613b1661543a565b90600052602060002090600402019050600081600301836020015181548110613b4157613b4161543a565b90600052602060002090600a0201905060006005826000015481548110613b6a57613b6a61543a565b906000526020600020906005020160020160009054906101000a90046001600160a01b031690506000816001600160a01b0316634fe264fb8660000151876020015188606001518960a00151613bc09190615809565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015613c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c2d919061563c565b9050612710811115613c3e57506127105b60008360060186606001518760a00151613c589190615809565b81548110613c6857613c6861543a565b600091825260208220015460018601546001600160a01b03909116925061271090613c949085906155b0565b613c9e91906155dd565b6001600160a01b03831660009081526007602090815260408083208a546001600160601b03168452600201909152812080549293508392909190613ce390849061547f565b90915550506001600160a01b038216600090815260076020908152604080832089546001600160601b031684526001019091528120549003613d3857600154613d36906001600160a01b03168383614990565b505b60006127108489604001518a60800151613d5291906155dd565b613d5c91906155b0565b613d6691906155dd565b905080866008016000828254613d7c9190615629565b925050819055506000612710858a604001518960020154613d9d91906155dd565b613da791906155b0565b613db191906155dd565b905080876007016000828254613dc79190615629565b9091555050600154613de3906001600160a01b03168584614990565b5060098701546001600160a01b0316613e21576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613e3c565b6009870154613e3a906001600160a01b03168583614990565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613e8c928c928a928a92909116906157c6565b60405180910390a4600189606001516002613ea791906155b0565b613eb1919061547f565b8960a001510361304657600087600801548a60800151613ed1919061547f565b9050600088600701548960020154613ee9919061547f565b905081151580613ef857508015155b15611785578115613f2257600054600154613f20916001600160a01b03918216911684614990565b505b8015613f895760098901546001600160a01b0316613f6857600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050613f89565b60005460098a0154613f87916001600160a01b03918216911683614990565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161258291879187916001600160a01b03909116906157ea565b60006001600160601b0384161580613ff557506004546001600160601b038516115b1561400257506000613096565b6001600160a01b03851660009081526007602090815260408083206001600160601b03881684526001810190925290912054841561409e576004866001600160601b0316815481106140565761405661543a565b90600052602060002090600c02016002015485108061408e57506001600160601b038616600090815260028301602052604090205485105b1561409e57600092505050613096565b600354604051632099a71760e11b81526001600160a01b0389811660048301526001600160601b0389166024830152604482018890526064820187905260009216906341334e2e906084016020604051808303816000875af1158015614108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061412c919061581d565b9050600281600281111561414257614142614dd6565b036141535760009350505050613096565b600181600281111561416757614167614dd6565b036141cd57604080516001600160601b0389168152602081018890529081018690526001600160a01b038916907f11ae3b4b2755c1ae163e5d571ab5070da164ce1280ad3375a227271ef58bf9389060600160405180910390a260019350505050613096565b600082871061425a576141e0838861547f565b9050801561424857600154614200906001600160a01b03168a308461482d565b1561424d5782600003614248578354600180820186556000868152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918b16021790555b614455565b6000945050505050613096565b86600003614410576001600160601b03881660009081526002850160205260409020548690614289908561547f565b614293919061547f565b90508015614248576001546142b2906001600160a01b03168a83614990565b1561424d5783545b801561440a576001600160601b038916856142d660018461547f565b815481106142e6576142e661543a565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036143f857845485906143229060019061547f565b815481106143325761433261543a565b600091825260209091206002820401546001918216600c026101000a90046001600160601b0316908690614366908461547f565b815481106143765761437661543a565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550846000018054806143c2576143c261583e565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a0219169055905561440a565b8061440281615854565b9150506142ba565b50614455565b8561441b888561547f565b614425919061547f565b9050801561445557600154614444906001600160a01b03168a83614990565b614455576000945050505050613096565b6001600160601b0388166000818152600186016020526040908190208990556003549051631166238b60e21b81526001600160a01b038c811660048301526024820193909352604481018a90529116906345988e2c90606401600060405180830381600087803b1580156144c857600080fd5b505af11580156144dc573d6000803e3d6000fd5b5050604080516001600160601b038c168152602081018b90526001600160a01b038d1693507f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c92500160405180910390a250600198975050505050505050565b600080600061454a86614909565b92505091506004826001600160601b03168154811061456b5761456b61543a565b60009182526020808320848452600a600c90930201919091019052604090205460ff166145ab5760405163b34eb75d60e01b815260040160405180910390fd5b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d419091015560058054929650909291849081106146365761463661543a565b600091825260208220600260059092020101548354600480546001600160a01b039093169450916001600160601b039091169081106146775761467761543a565b60009182526020808320600387018054600181018255908552918420600c909302019350600a0201906001600160a01b038a16156146c2576146bd8a8460040154611255565b6146c8565b82600401545b90506146d4818a6155dd565b6003808401919091558683558301546002840154612710916146f5916155b0565b6146ff91906155dd565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c81169190911790915560035460405163d09f392d60e01b8152600481018b90526000602482015291169063d09f392d90604401600060405180830381600087803b15801561477157600080fd5b505af1158015614785573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016147bf949392919061575d565b600060405180830381600087803b1580156147d957600080fd5b505af11580156147ed573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516148929190615679565b6000604051808303816000865af19150503d80600081146148cf576040519150601f19603f3d011682016040523d82523d6000602084013e6148d4565b606091505b50915091508180156148fe5750805115806148fe5750808060200190518101906148fe9190615492565b979650505050505050565b6000806000604084511061497e575050506020810151604082015160608301516001600160601b038316158061494a57506004546001600160601b03841610155b1561495457600192505b8160000361496157600391505b80158061497057506005548110155b15614979575060015b614989565b506001915060039050815b9193909250565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516149ed9190615679565b6000604051808303816000865af19150503d8060008114614a2a576040519150601f19603f3d011682016040523d82523d6000602084013e614a2f565b606091505b509150915081801561344b57508051158061344b57508080602001905181019061344b9190615492565b60405180608001604052806004906020820280368337509192915050565b8260048101928215614aa5579160200282015b82811115614aa5578251825591602001919060010190614a8a565b50614ab1929150614aef565b5090565b828054828255906000526020600020908101928215614aa55791602002820182811115614aa5578251825591602001919060010190614a8a565b5b80821115614ab15760008155600101614af0565b6001600160a01b0381168114614b1957600080fd5b50565b600060208284031215614b2e57600080fd5b81356126c881614b04565b80356001600160601b0381168114614b5057600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614b9357614b93614b55565b604052919050565b600082601f830112614bac57600080fd5b813560206001600160401b03821115614bc757614bc7614b55565b8160051b614bd6828201614b6b565b9283528481018201928281019087851115614bf057600080fd5b83870192505b848310156148fe57823582529183019190830190614bf6565b8015158114614b1957600080fd5b600080600060608486031215614c3257600080fd5b614c3b84614b39565b925060208401356001600160401b03811115614c5657600080fd5b614c6286828701614b9b565b9250506040840135614c7381614c0f565b809150509250925092565b600060208284031215614c9057600080fd5b5035919050565b60008060408385031215614caa57600080fd5b8235614cb581614b04565b946020939093013593505050565b600080600060608486031215614cd857600080fd5b505081359360208301359350604090920135919050565b600060208284031215614d0157600080fd5b6126c882614b39565b8060005b6004811015610cc7578151845260209384019390910190600101614d0e565b608081016112ab8284614d0a565b600081518084526020808501945080840160005b83811015614d6b57815187529582019590820190600101614d4f565b509495945050505050565b6020815260006126c86020830184614d3b565b6020808252825182820181905260009190848201906040850190845b81811015614dca5783516001600160601b031683529284019291840191600101614da5565b50909695505050505050565b634e487b7160e01b600052602160045260246000fd5b60058110614e0a57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a08101614e3a6040830186614dec565b9215156060820152608001529392505050565b600082601f830112614e5e57600080fd5b81356001600160401b03811115614e7757614e77614b55565b614e8a601f8201601f1916602001614b6b565b818152846020838601011115614e9f57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215614ed157600080fd5b8335614edc81614b04565b92506020840135915060408401356001600160401b03811115614efe57600080fd5b614f0a86828701614e4d565b9150509250925092565b60008060408385031215614f2757600080fd5b614cb583614b39565b60008060408385031215614f4357600080fd5b8235614f4e81614b04565b91506020830135614f5e81614c0f565b809150509250929050565b600080600060608486031215614f7e57600080fd5b8335614f8981614b04565b925060208401356001600160401b0381168114614fa557600080fd5b9150604084013560ff81168114614c7357600080fd5b600082601f830112614fcc57600080fd5b604051608081018181106001600160401b0382111715614fee57614fee614b55565b60405280608084018581111561500357600080fd5b845b8181101561501d578035835260209283019201615005565b509195945050505050565b6000806000806000806000610140888a03121561504457600080fd5b61504d88614b39565b9650602088013561505d81614c0f565b955060408801359450606088013593506080880135925060a088013591506150888960c08a01614fbb565b905092959891949750929550565b600080604083850312156150a957600080fd5b50508035926020909101359150565b60006101408083018d845260208d818601528c60408601528b60608601528a60808601528960a08601528260c0860152819250885180835261016086019350818a01925060005b818110156151245783516001600160a01b0316855293820193928201926001016150ff565b5050505060e0830195909552506101008101929092526001600160a01b031661012090910152979650505050505050565b60008060008060008060008060006101808a8c03121561517457600080fd5b61517d8a614b39565b985060208a013561518d81614c0f565b975060408a0135965060608a0135955060808a0135945060a08a013593506151b88b60c08c01614fbb565b92506101408a01356001600160401b03808211156151d557600080fd5b6151e18d838e01614e4d565b93506101608c01359150808211156151f857600080fd5b506152058c828d01614b9b565b9150509295985092959850929598565b6000806040838503121561522857600080fd5b8235915060208301356001600160401b0381111561524557600080fd5b61525185828601614e4d565b9150509250929050565b60008060006060848603121561527057600080fd5b833592506020840135915060408401356001600160401b03811115614efe57600080fd5b600080604083850312156152a757600080fd5b82356152b281614b04565b91506152c060208401614b39565b90509250929050565b60008083601f8401126152db57600080fd5b5081356001600160401b038111156152f257600080fd5b60208301915083602082850101111561530a57600080fd5b9250929050565b60008060006040848603121561532657600080fd5b83356001600160401b0381111561533c57600080fd5b615348868287016152c9565b9094509250506020840135614c7381614b04565b6000806000806080858703121561537257600080fd5b843561537d81614b04565b935061538b60208601614b39565b93969395505050506040820135916060013590565b6000806000806000608086880312156153b857600080fd5b8535945060208601356001600160401b038111156153d557600080fd5b6153e1888289016152c9565b90955093505060408601356153f581614b04565b949793965091946060013592915050565b60006020828403121561541857600080fd5b81356001600160401b0381111561542e57600080fd5b6112a784828501614e4d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161547857615478615450565b5060010190565b818103818111156112ab576112ab615450565b6000602082840312156154a457600080fd5b81516126c881614c0f565b602081016112ab8284614dec565b600181815b808511156154f85781600019048211156154de576154de615450565b808516156154eb57918102915b93841c93908002906154c2565b509250929050565b60008261550f575060016112ab565b8161551c575060006112ab565b8160018114615532576002811461553c57615558565b60019150506112ab565b60ff84111561554d5761554d615450565b50506001821b6112ab565b5060208310610133831016604e8410600b841016171561557b575081810a6112ab565b61558583836154bd565b806000190482111561559957615599615450565b029392505050565b60006126c860ff841683615500565b80820281158282048414176112ab576112ab615450565b634e487b7160e01b600052601260045260246000fd5b6000826155ec576155ec6155c7565b500490565b60008060006060848603121561560657600080fd5b83519250602084015161561881614c0f565b6040850151909250614c7381614c0f565b808201808211156112ab576112ab615450565b60006020828403121561564e57600080fd5b5051919050565b60005b83811015615670578181015183820152602001615658565b50506000910152565b6000825161568b818460208701615655565b9190910192915050565b60006101208201905087151582528660208301528560408301528460608301528360808301526148fe60a0830184614d0a565b600081518084526156e0816020860160208601615655565b601f01601f19169290920160200192915050565b82815260406020820152600061309660408301846156c8565b6000610140891515835288602084015287604084015286606084015285608084015261573c60a0840186614d0a565b8061012084015261574f81840185614d3b565b9a9950505050505050505050565b84815283602082015260806040820152600061577c60808301856156c8565b905082606083015295945050505050565b60006020828403121561579f57600080fd5b81516126c881614b04565b6000600160ff1b82016157bf576157bf615450565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615818576158186155c7565b500690565b60006020828403121561582f57600080fd5b8151600381106126c857600080fd5b634e487b7160e01b600052603160045260246000fd5b60008161586357615863615450565b50600019019056fea2646970667358221220c30d6f5a8f296b6270fa656cc8d3f42b97bb5b0d53352b768474b3af945e55de64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102d45760003560e01c80637717a6e81161017b578063c3569902116100d7578063f12ada8b11610085578063f12ada8b14610a25578063f56f072514610a45578063f6506db414610a65578063f7434ea914610a85578063fbf405b014610aa5578063fc6f8f1614610ac5578063fe524c3914610ae557600080fd5b8063c3569902146108f8578063c71f42531461090b578063cf0c38f81461092b578063d1c1df481461094b578063d2b8035a146109c5578063d98493f6146109e5578063e4c0aaf414610a0557600080fd5b80638bb04875116101345780638bb048751461081b578063a072b86c1461083b578063afe15cfb1461085b578063b004963714610890578063bcb1a166146108b0578063c13517e1146108c5578063c258bb19146108d857600080fd5b80637717a6e81461074a5780637934c0be1461076a57806382d022371461078a578063840bc19c146107aa57806386541b24146107c55780638a9bb02a146107e557600080fd5b80632d29a47b11610235578063543f8a36116101e3578063543f8a361461066d578063564a565d1461069a57806359ec827e146106cb5780635ea5c038146106eb5780636235593f146107005780636c1eb1b914610715578063751accd01461072a57600080fd5b80632d29a47b146105935780632e1daf2f146105b35780632ea7b4d0146105d357806334d5fb31146105e95780633cfd1184146105fe57806343d4137f1461062b57806349f426501461065857600080fd5b8063115d537611610292578063115d5376146104385780631860592b146104585780631956b1f91461047857806319b81529146104985780631c3db16d146104c85780631f5a0dd21461050557806327e6ec8a1461056657600080fd5b8062f5822c146102d95780630219da79146102fb5780630b7414bc146103735780630c340a24146103935780630d1b9d1a146103cb5780630d83b94014610415575b600080fd5b3480156102e557600080fd5b506102f96102f4366004614b1c565b610b05565b005b34801561030757600080fd5b50610346610316366004614b1c565b60086020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561037f57600080fd5b506102f961038e366004614c1d565b610b52565b34801561039f57600080fd5b506000546103b3906001600160a01b031681565b6040516001600160a01b03909116815260200161036a565b3480156103d757600080fd5b506103eb6103e6366004614c7e565b610ccd565b604080519485526001600160a01b039093166020850152918301521515606082015260800161036a565b34801561042157600080fd5b5061042a600181565b60405190815260200161036a565b34801561044457600080fd5b506102f9610453366004614c7e565b610d13565b34801561046457600080fd5b5061042a610473366004614c97565b611255565b34801561048457600080fd5b506103b3610493366004614c7e565b6112b1565b3480156104a457600080fd5b506104b86104b3366004614c7e565b6112e9565b604051901515815260200161036a565b3480156104d457600080fd5b506104e86104e3366004614c7e565b6113e2565b60408051938452911515602084015215159082015260600161036a565b34801561051157600080fd5b50610525610520366004614c7e565b6114eb565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e00161036a565b34801561057257600080fd5b5061057b600081565b6040516001600160601b03909116815260200161036a565b34801561059f57600080fd5b506102f96105ae366004614cc3565b61154a565b3480156105bf57600080fd5b506003546103b3906001600160a01b031681565b3480156105df57600080fd5b5061042a61271081565b3480156105f557600080fd5b5061057b600181565b34801561060a57600080fd5b5061061e610619366004614cef565b611792565b60405161036a9190614d2d565b34801561063757600080fd5b5061064b610646366004614c7e565b611803565b60405161036a9190614d76565b34801561066457600080fd5b506103b3600081565b34801561067957600080fd5b5061068d610688366004614b1c565b61187f565b60405161036a9190614d89565b3480156106a657600080fd5b506106ba6106b5366004614c7e565b61191b565b60405161036a959493929190614e0e565b3480156106d757600080fd5b5061042a6106e6366004614c7e565b611977565b3480156106f757600080fd5b5060055461042a565b34801561070c57600080fd5b5061042a600081565b34801561072157600080fd5b5061042a600a81565b34801561073657600080fd5b506102f9610745366004614ebc565b611acc565b34801561075657600080fd5b506102f9610765366004614f14565b611b76565b34801561077657600080fd5b506102f9610785366004614f30565b611ba4565b34801561079657600080fd5b506102f96107a5366004614f69565b611c23565b3480156107b657600080fd5b5061042a6001600160ff1b0381565b3480156107d157600080fd5b506102f96107e0366004615028565b611ca5565b3480156107f157600080fd5b50610805610800366004615096565b611fda565b60405161036a9a999897969594939291906150b8565b34801561082757600080fd5b506102f9610836366004614c7e565b6120f4565b34801561084757600080fd5b506102f9610856366004615155565b612258565b34801561086757600080fd5b5061087b610876366004614c7e565b612597565b6040805192835260208301919091520161036a565b34801561089c57600080fd5b506102f96108ab366004614b1c565b612643565b3480156108bc57600080fd5b5061042a600381565b61042a6108d3366004615215565b612690565b3480156108e457600080fd5b506102f96108f3366004614b1c565b6126cf565b6102f961090636600461525b565b61271c565b34801561091757600080fd5b5061042a610926366004614c7e565b612d04565b34801561093757600080fd5b506002546103b3906001600160a01b031681565b34801561095757600080fd5b506109aa610966366004615294565b6001600160a01b0390911660009081526007602090815260408083206001600160601b03909416835260018401825280832054600285019092529091205491549092565b6040805193845260208401929092529082015260600161036a565b3480156109d157600080fd5b506102f96109e0366004615096565b612d6c565b3480156109f157600080fd5b5061042a610a00366004615311565b613051565b348015610a1157600080fd5b506102f9610a20366004614b1c565b61309e565b348015610a3157600080fd5b506102f9610a40366004614c97565b6130eb565b348015610a5157600080fd5b506102f9610a6036600461535c565b61330e565b348015610a7157600080fd5b5061042a610a803660046153a0565b61334c565b348015610a9157600080fd5b5061042a610aa0366004615406565b613455565b348015610ab157600080fd5b506001546103b3906001600160a01b031681565b348015610ad157600080fd5b5061042a610ae0366004614c7e565b6134a1565b348015610af157600080fd5b506104b8610b00366004614f14565b6134d0565b6000546001600160a01b03163314610b305760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b7d5760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610cc7578115610c1c57828181518110610ba157610ba161543a565b602002602001015160001480610bd457506005548351849083908110610bc957610bc961543a565b602002602001015110155b15610bf257604051633d58a98960e11b815260040160405180910390fd5b610c1784848381518110610c0857610c0861543a565b60200260200101516001613518565b610cb5565b6001600160601b0384166001148015610c72575060006005848381518110610c4657610c4661543a565b602002602001015181548110610c5e57610c5e61543a565b906000526020600020906005020160000154145b15610c9057604051630c6e81c960e11b815260040160405180910390fd5b610cb584848381518110610ca657610ca661543a565b60200260200101516000613518565b80610cbf81615466565b915050610b80565b50505050565b60058181548110610cdd57600080fd5b600091825260209091206005909102018054600282015460038301546004909301549193506001600160a01b0316919060ff1684565b600060068281548110610d2857610d2861543a565b600091825260208220600491820201805482549194506001600160601b0316908110610d5657610d5661543a565b6000918252602082206003850154600c909202019250610d789060019061547f565b90506000836003018281548110610d9157610d9161543a565b600091825260208220600a909102019150600185015460ff166004811115610dbb57610dbb614dd6565b03610e965781158015610e0a57506001840154600684019060ff166004811115610de757610de7614dd6565b60048110610df757610df761543a565b01546002850154610e08904261547f565b105b15610e2857604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610e50576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610e67576002610e6a565b60015b60018086018054909160ff1990911690836004811115610e8c57610e8c614dd6565b0217905550611207565b60018085015460ff166004811115610eb057610eb0614dd6565b03610fc8576001840154600684019060ff166004811115610ed357610ed3614dd6565b60048110610ee357610ee361543a565b01546002850154610ef4904261547f565b108015610f9357506005816000015481548110610f1357610f1361543a565b6000918252602090912060059091020160020154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190615492565b155b15610fb157604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610e8c565b6002600185015460ff166004811115610fe357610fe3614dd6565b03611139576001840154600684019060ff16600481111561100657611006614dd6565b600481106110165761101661543a565b01546002850154611027904261547f565b1080156110c6575060058160000154815481106110465761104661543a565b60009182526020909120600590910201600201546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa1580156110a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c49190615492565b155b156110e457604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3611207565b6003600185015460ff16600481111561115457611154614dd6565b036111ce576001840154600684019060ff16600481111561117757611177614dd6565b600481106111875761118761543a565b01546002850154611198904261547f565b10156111b757604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610e8c565b6004600185015460ff1660048111156111e9576111e9614dd6565b03611207576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916112469160ff16906154af565b60405180910390a25050505050565b6001600160a01b0382166000908152600860205260408120805461010081046001600160401b03169061129390600160481b900460ff16600a6155a1565b61129d90856155b0565b6112a791906155dd565b9150505b92915050565b6000600582815481106112c6576112c661543a565b60009182526020909120600260059092020101546001600160a01b031692915050565b600080600683815481106112ff576112ff61543a565b60009182526020822060036004909202019081018054919350906113259060019061547f565b815481106113355761133561543a565b600091825260208220845460048054600a909402909201945090916001600160601b0390911690811061136a5761136a61543a565b90600052602060002090600c0201905080600501548260030154101561139557506000949350505050565b80546004805490916001600160601b03169081106113b5576113b561543a565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b600080600080600685815481106113fb576113fb61543a565b60009182526020822060036004909202019081018054919350906114219060019061547f565b815481106114315761143161543a565b90600052602060002090600a020190506000600582600001548154811061145a5761145a61543a565b6000918252602090912060059091020160020154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156114b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114db91906155f1565b9199909850909650945050505050565b600481815481106114fb57600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b60006006848154811061155f5761155f61543a565b600091825260209091206004918202019150600182015460ff16600481111561158a5761158a614dd6565b146115a857604051638794ce4b60e01b815260040160405180910390fd5b60008160030184815481106115bf576115bf61543a565b90600052602060002090600a02019050600060058260000154815481106115e8576115e861543a565b6000918252602082206002600590920201015460048401546001600160a01b039091169250906116188683615629565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa158015611676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169a919061563c565b9050806000036116b557818411156116b0578193505b6116d5565b6116c08260026155b0565b8411156116d5576116d28260026155b0565b93505b60048701849055845b84811015611771578281101561172a576117236040518060c001604052808e81526020018d8152602001848152602001858152602001868152602001838152506135a0565b935061175f565b61175f6040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613afd565b8061176981615466565b9150506116de565b508287600501541461178557600587018390555b5050505050505050505050565b61179a614a59565b60006004836001600160601b0316815481106117b8576117b861543a565b60009182526020909120604080516080810191829052600c9093029091019250600683019060049082845b8154815260200190600101908083116117e3575050505050915050919050565b6060600582815481106118185761181861543a565b906000526020600020906005020160010180548060200260200160405190810160405280929190818152602001828054801561187357602002820191906000526020600020905b81548152602001906001019080831161185f575b50505050509050919050565b6001600160a01b03811660009081526007602090815260409182902080548351818402810184019094528084526060939283018282801561187357602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116118ce575094979650505050505050565b6006818154811061192b57600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b6000806006838154811061198d5761198d61543a565b60009182526020822060036004909202019081018054919350906119b39060019061547f565b815481106119c3576119c361543a565b600091825260208220845460048054600a909402909201945090916001600160601b039091169081106119f8576119f861543a565b90600052602060002090600c020190508060050154826003015410611a975782546001600160601b031660001901611a39576001600160ff1b039350611ac4565b6003820154611a499060026155b0565b611a54906001615629565b81546004805490916001600160601b0316908110611a7457611a7461543a565b90600052602060002090600c020160040154611a9091906155b0565b9350611ac4565b6003820154611aa79060026155b0565b611ab2906001615629565b8160040154611ac191906155b0565b93505b505050919050565b6000546001600160a01b03163314611af75760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611b129190615679565b60006040518083038185875af1925050503d8060008114611b4f576040519150601f19603f3d011682016040523d82523d6000602084013e611b54565b606091505b5050905080610cc7576040516322092f2f60e11b815260040160405180910390fd5b611b833383836000613fd3565b611ba05760405163a437293760e01b815260040160405180910390fd5b5050565b6000546001600160a01b03163314611bcf5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611c4e5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b039092166000908152600860205260409020805460ff909316600160481b0260ff60481b196001600160401b03909316610100029290921669ffffffffffffffffff001990931692909217179055565b6000546001600160a01b03163314611cd05760405163c383977560e01b815260040160405180910390fd5b6001600160601b038716600114801590611d44575084600480896001600160601b031681548110611d0357611d0361543a565b60009182526020909120600c909102015481546001600160601b03909116908110611d3057611d3061543a565b90600052602060002090600c020160020154115b15611d6257604051639717078960e01b815260040160405180910390fd5b60005b6004886001600160601b031681548110611d8157611d8161543a565b90600052602060002090600c020160010180549050811015611e3b57856004808a6001600160601b031681548110611dbb57611dbb61543a565b90600052602060002090600c02016001018381548110611ddd57611ddd61543a565b906000526020600020015481548110611df857611df861543a565b90600052602060002090600c0201600201541015611e2957604051639717078960e01b815260040160405180910390fd5b80611e3381615466565b915050611d65565b50846004886001600160601b031681548110611e5957611e5961543a565b90600052602060002090600c020160020181905550856004886001600160601b031681548110611e8b57611e8b61543a565b90600052602060002090600c0201600001600c6101000a81548160ff021916908315150217905550836004886001600160601b031681548110611ed057611ed061543a565b90600052602060002090600c020160030181905550826004886001600160601b031681548110611f0257611f0261543a565b90600052602060002090600c020160040181905550816004886001600160601b031681548110611f3457611f3461543a565b90600052602060002090600c020160050181905550806004886001600160601b031681548110611f6657611f6661543a565b90600052602060002090600c0201600601906004611f85929190614a77565b50866001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a878787878787604051611fc996959493929190615695565b60405180910390a250505050505050565b600080600080600080606060008060008060068d81548110611ffe57611ffe61543a565b90600052602060002090600402016003018c815481106120205761202061543a565b90600052602060002090600a0201905080600001548160010154826002015483600301548460040154856005015486600601876007015488600801548960090160009054906101000a90046001600160a01b0316838054806020026020016040519081016040528092919081815260200182805480156120c957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116120ab575b505050505093509a509a509a509a509a509a509a509a509a509a50509295989b9194979a5092959850565b6000600682815481106121095761210961543a565b600091825260209091206004918202019150600182015460ff16600481111561213457612134614dd6565b1461215257604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff161561217d5760405163c977f8d360e01b815260040160405180910390fd5b6000612188836113e2565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b15801561223b57600080fd5b505af115801561224f573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146122835760405163c383977560e01b815260040160405180910390fd5b8660048a6001600160601b0316815481106122a0576122a061543a565b90600052602060002090600c02016002015411156122d157604051639717078960e01b815260040160405180910390fd5b80516000036122f35760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661231a57604051631ef4f64960e01b815260040160405180910390fd5b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b83518110156124185783818151811061236d5761236d61543a565b6020026020010151600014806123a0575060055484518590839081106123955761239561543a565b602002602001015110155b156123be57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106123d8576123d861543a565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061241090615466565b915050612352565b5080546001600160601b0319166001600160601b038c161781556040805160008152602081019182905251612451916001840191614ab5565b50805460ff60601b1916600160601b8b15150217815560028101899055600381018890556004808201889055600582018790556124949060068301908790614a77565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c906124c790859088906004016156f4565b600060405180830381600087803b1580156124e157600080fd5b505af11580156124f5573d6000803e3d6000fd5b5050505060048b6001600160601b0316815481106125155761251561543a565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612582908e908e908e908e908e908e908d9061570d565b60405180910390a35050505050505050505050565b6000806000600684815481106125af576125af61543a565b6000918252602090912060049091020190506003600182015460ff1660048111156125dc576125dc614dd6565b03612634576002810154815460048054929550916001600160601b0390911690811061260a5761260a61543a565b600091825260209091206009600c909202010154600282015461262d9190615629565b915061263d565b60009250600091505b50915091565b6000546001600160a01b0316331461266e5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061269b82613455565b3410156126bb57604051630e3360f160e21b815260040160405180910390fd5b6126c8838360003461453c565b9392505050565b6000546001600160a01b031633146126fa5760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61272583611977565b34101561274557604051633191f8f160e01b815260040160405180910390fd5b60006006848154811061275a5761275a61543a565b6000918252602090912060049091020190506003600182015460ff16600481111561278757612787614dd6565b146127a5576040516337cdefcb60e21b815260040160405180910390fd5b600381018054600091906127bb9060019061547f565b815481106127cb576127cb61543a565b90600052602060002090600a0201905060058160000154815481106127f2576127f261543a565b60009182526020909120600590910201600201546001600160a01b0316331461282e5760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600480546001600160601b0390951694600a90930290910191849081106128715761287161543a565b90600052602060002090600c020160050154846003015410612a6f576004836001600160601b0316815481106128a9576128a961543a565b600091825260208220600c90910201546001600160601b031693505b600a8110156129b4576004846001600160601b0316815481106128ea576128ea61543a565b60009182526020808320868452600a600c90930201919091019052604090205460ff166129b4576000600584815481106129265761292661543a565b9060005260206000209060050201600001541461296957600583815481106129505761295061543a565b90600052602060002090600502016000015492506129a2565b6004846001600160601b0316815481106129855761298561543a565b60009182526020909120600c90910201546001600160601b031693505b806129ac81615466565b9150506128c5565b506004836001600160601b0316815481106129d1576129d161543a565b60009182526020808320858452600a600c90930201919091019052604090205460ff166129fd57600192505b84546001600160601b03848116911614612a6f57845460038601546001600160601b0390911690612a309060019061547f565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612ab257612ab261543a565b90600052602060002090600c02019050806004015434612ad291906155dd565b826003018190555061271081600301548260020154612af191906155b0565b612afb91906155dd565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c91612b329161547f565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612b7057600080fd5b505af1158015612b84573d6000803e3d6000fd5b505086548454149150612c8190505760006005836000015481548110612bac57612bac61543a565b6000918252602090912060026005909202010154865460038901546001600160a01b03909216925090612be19060019061547f565b84546040519081528c907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a460038301546040516302dbb79560e61b81526001600160a01b0383169163b6ede54091612c4d918e918e918e9160040161575d565b600060405180830381600087803b158015612c6757600080fd5b505af1158015612c7b573d6000803e3d6000fd5b50505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612cf191906154af565b60405180910390a2505050505050505050565b60008060068381548110612d1a57612d1a61543a565b906000526020600020906004020190508060030160018260030180549050612d42919061547f565b81548110612d5257612d5261543a565b90600052602060002090600a020160030154915050919050565b600060068381548110612d8157612d8161543a565b90600052602060002090600402019050600060018260030180549050612da7919061547f565b90506000826003018281548110612dc057612dc061543a565b600091825260208220600a909102019150600184015460ff166004811115612dea57612dea614dd6565b14612e0857604051638285c4ef60e01b815260040160405180910390fd5b60006005826000015481548110612e2157612e2161543a565b60009182526020822060026005909202010154600684015460038501546001600160a01b0390921693509190612e578884615629565b1115612e67578360030154612e71565b612e718783615629565b9050815b8181101561304657604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af1158015612ec7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eeb919061578d565b90506001600160a01b038116156130335760018601546001600160a01b03821660009081526007602090815260408083208c546001600160601b0316845260020190915281208054909190612f41908490615629565b909155505060068601546040805189815260208101929092528b916001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a36006860180546001810182556000828152602090200180546001600160a01b0319166001600160a01b038416179055600387015490540361303357600354604051632e96bc2360e11b8152600481018c9052602481018990526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561301a57600080fd5b505af115801561302e573d6000803e3d6000fd5b505050505b508061303e81615466565b915050612e75565b505050505050505050565b60006130968261047386868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061345592505050565b949350505050565b6000546001600160a01b031633146130c95760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146131165760405163c383977560e01b815260040160405180910390fd5b60055480821061313957604051630becfec560e01b815260040160405180910390fd5b6000821561319457600583815481106131545761315461543a565b90600052602060002090600502016003015460016131729190615629565b9050600a8110613194576040516210d62560e51b815260040160405180910390fd5b6040805160a08101825284815281516000808252602080830185528084019283526001600160a01b0389169484019490945260608301859052608083018190526005805460018101825591819052835191027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081019182559151805193949193613245937f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db101929190910190614ab5565b5060408201516002820180546001600160a01b0319166001600160a01b03909216919091179055606082015160038201556080909101516004909101805460ff191691151591909117905560058054849081106132a4576132a461543a565b600091825260208083206001600590930201820180549283018155835282200183905560405184916001600160a01b0387169185917f7921860794ac14fda09ee75f7160a5a3d266e3352f7954d0401606a92a26c49891a482610cc757610cc76001836001613518565b6003546001600160a01b031633146133395760405163068690bf60e11b815260040160405180910390fd5b61334584848484613fd3565b5050505050565b6001600160a01b03821660009081526008602052604081205460ff166133855760405163e51cf7bf60e01b815260040160405180910390fd5b613390858585613051565b8210156133b057604051630e3360f160e21b815260040160405180910390fd5b6133c56001600160a01b03841633308561482d565b6134075760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640160405180910390fd5b61344b8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925087915061453c9050565b9695505050505050565b600080600061346384614909565b5091509150806004836001600160601b0316815481106134855761348561543a565b90600052602060002090600c02016004015461309691906155b0565b6000600682815481106134b6576134b661543a565b600091825260209091206003600490920201015492915050565b60006004836001600160601b0316815481106134ee576134ee61543a565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806004846001600160601b0316815481106135355761353561543a565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b60008060068360000151815481106135ba576135ba61543a565b906000526020600020906004020190506000816003018460200151815481106135e5576135e561543a565b90600052602060002090600a020190506000600582600001548154811061360e5761360e61543a565b600091825260208083206005929092029091016002015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa158015613685573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a9919061563c565b90506127108111156136ba57506127105b60006127106136c9838261547f565b85600101546136d891906155b0565b6136e291906155dd565b905080876080018181516136f69190615629565b90525060a08701516006850180546000929081106137165761371661543a565b60009182526020808320909101546001600160a01b03168083526007825260408084208a546001600160601b0316855260020190925290822080549193508492909161376390849061547f565b909155505085546004805484926001600160601b03169081106137885761378861543a565b90600052602060002090600c0201600201546137a49190615629565b6001600160a01b03821660009081526007602090815260408083208a546001600160601b0316845260010190915290205410613838576001600160a01b038116600090815260076020908152604080832089546001600160601b0316845260010190915281205461381690849061547f565b87549091506138319083906001600160601b03168386613fd3565b5050613889565b6001600160a01b038116600090815260076020908152604080832089546001600160601b03168452600101909152902054156138895785546138879082906001600160601b0316600085613fd3565b505b602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e7866138c5876157aa565b60098b01546040516138e79392916000916001600160a01b03909116906157c6565b60405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa15801561394e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139729190615492565b6139d65760035460405163b5d69e9960e01b81526001600160a01b0383811660048301529091169063b5d69e9990602401600060405180830381600087803b1580156139bd57600080fd5b505af11580156139d1573d6000803e3d6000fd5b505050505b600188606001516139e7919061547f565b8860a001511480156139fb57506040880151155b15613aec5760098501546001600160a01b0316613a44576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1935050505050613a6b565b60005460028601546009870154613a69926001600160a01b0391821692911690614990565b505b6000546080890151600154613a8e926001600160a01b0391821692911690614990565b506020880151885160808a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf493613ae393909290916001600160a01b03909116906157ea565b60405180910390a35b505050608090940151949350505050565b60006006826000015181548110613b1657613b1661543a565b90600052602060002090600402019050600081600301836020015181548110613b4157613b4161543a565b90600052602060002090600a0201905060006005826000015481548110613b6a57613b6a61543a565b906000526020600020906005020160020160009054906101000a90046001600160a01b031690506000816001600160a01b0316634fe264fb8660000151876020015188606001518960a00151613bc09190615809565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015613c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c2d919061563c565b9050612710811115613c3e57506127105b60008360060186606001518760a00151613c589190615809565b81548110613c6857613c6861543a565b600091825260208220015460018601546001600160a01b03909116925061271090613c949085906155b0565b613c9e91906155dd565b6001600160a01b03831660009081526007602090815260408083208a546001600160601b03168452600201909152812080549293508392909190613ce390849061547f565b90915550506001600160a01b038216600090815260076020908152604080832089546001600160601b031684526001019091528120549003613d3857600154613d36906001600160a01b03168383614990565b505b60006127108489604001518a60800151613d5291906155dd565b613d5c91906155b0565b613d6691906155dd565b905080866008016000828254613d7c9190615629565b925050819055506000612710858a604001518960020154613d9d91906155dd565b613da791906155b0565b613db191906155dd565b905080876007016000828254613dc79190615629565b9091555050600154613de3906001600160a01b03168584614990565b5060098701546001600160a01b0316613e21576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613e3c565b6009870154613e3a906001600160a01b03168583614990565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613e8c928c928a928a92909116906157c6565b60405180910390a4600189606001516002613ea791906155b0565b613eb1919061547f565b8960a001510361304657600087600801548a60800151613ed1919061547f565b9050600088600701548960020154613ee9919061547f565b905081151580613ef857508015155b15611785578115613f2257600054600154613f20916001600160a01b03918216911684614990565b505b8015613f895760098901546001600160a01b0316613f6857600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050613f89565b60005460098a0154613f87916001600160a01b03918216911683614990565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161258291879187916001600160a01b03909116906157ea565b60006001600160601b0384161580613ff557506004546001600160601b038516115b1561400257506000613096565b6001600160a01b03851660009081526007602090815260408083206001600160601b03881684526001810190925290912054841561409e576004866001600160601b0316815481106140565761405661543a565b90600052602060002090600c02016002015485108061408e57506001600160601b038616600090815260028301602052604090205485105b1561409e57600092505050613096565b600354604051632099a71760e11b81526001600160a01b0389811660048301526001600160601b0389166024830152604482018890526064820187905260009216906341334e2e906084016020604051808303816000875af1158015614108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061412c919061581d565b9050600281600281111561414257614142614dd6565b036141535760009350505050613096565b600181600281111561416757614167614dd6565b036141cd57604080516001600160601b0389168152602081018890529081018690526001600160a01b038916907f11ae3b4b2755c1ae163e5d571ab5070da164ce1280ad3375a227271ef58bf9389060600160405180910390a260019350505050613096565b600082871061425a576141e0838861547f565b9050801561424857600154614200906001600160a01b03168a308461482d565b1561424d5782600003614248578354600180820186556000868152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918b16021790555b614455565b6000945050505050613096565b86600003614410576001600160601b03881660009081526002850160205260409020548690614289908561547f565b614293919061547f565b90508015614248576001546142b2906001600160a01b03168a83614990565b1561424d5783545b801561440a576001600160601b038916856142d660018461547f565b815481106142e6576142e661543a565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036143f857845485906143229060019061547f565b815481106143325761433261543a565b600091825260209091206002820401546001918216600c026101000a90046001600160601b0316908690614366908461547f565b815481106143765761437661543a565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550846000018054806143c2576143c261583e565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a0219169055905561440a565b8061440281615854565b9150506142ba565b50614455565b8561441b888561547f565b614425919061547f565b9050801561445557600154614444906001600160a01b03168a83614990565b614455576000945050505050613096565b6001600160601b0388166000818152600186016020526040908190208990556003549051631166238b60e21b81526001600160a01b038c811660048301526024820193909352604481018a90529116906345988e2c90606401600060405180830381600087803b1580156144c857600080fd5b505af11580156144dc573d6000803e3d6000fd5b5050604080516001600160601b038c168152602081018b90526001600160a01b038d1693507f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c92500160405180910390a250600198975050505050505050565b600080600061454a86614909565b92505091506004826001600160601b03168154811061456b5761456b61543a565b60009182526020808320848452600a600c90930201919091019052604090205460ff166145ab5760405163b34eb75d60e01b815260040160405180910390fd5b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d419091015560058054929650909291849081106146365761463661543a565b600091825260208220600260059092020101548354600480546001600160a01b039093169450916001600160601b039091169081106146775761467761543a565b60009182526020808320600387018054600181018255908552918420600c909302019350600a0201906001600160a01b038a16156146c2576146bd8a8460040154611255565b6146c8565b82600401545b90506146d4818a6155dd565b6003808401919091558683558301546002840154612710916146f5916155b0565b6146ff91906155dd565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c81169190911790915560035460405163d09f392d60e01b8152600481018b90526000602482015291169063d09f392d90604401600060405180830381600087803b15801561477157600080fd5b505af1158015614785573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016147bf949392919061575d565b600060405180830381600087803b1580156147d957600080fd5b505af11580156147ed573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516148929190615679565b6000604051808303816000865af19150503d80600081146148cf576040519150601f19603f3d011682016040523d82523d6000602084013e6148d4565b606091505b50915091508180156148fe5750805115806148fe5750808060200190518101906148fe9190615492565b979650505050505050565b6000806000604084511061497e575050506020810151604082015160608301516001600160601b038316158061494a57506004546001600160601b03841610155b1561495457600192505b8160000361496157600391505b80158061497057506005548110155b15614979575060015b614989565b506001915060039050815b9193909250565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516149ed9190615679565b6000604051808303816000865af19150503d8060008114614a2a576040519150601f19603f3d011682016040523d82523d6000602084013e614a2f565b606091505b509150915081801561344b57508051158061344b57508080602001905181019061344b9190615492565b60405180608001604052806004906020820280368337509192915050565b8260048101928215614aa5579160200282015b82811115614aa5578251825591602001919060010190614a8a565b50614ab1929150614aef565b5090565b828054828255906000526020600020908101928215614aa55791602002820182811115614aa5578251825591602001919060010190614a8a565b5b80821115614ab15760008155600101614af0565b6001600160a01b0381168114614b1957600080fd5b50565b600060208284031215614b2e57600080fd5b81356126c881614b04565b80356001600160601b0381168114614b5057600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614b9357614b93614b55565b604052919050565b600082601f830112614bac57600080fd5b813560206001600160401b03821115614bc757614bc7614b55565b8160051b614bd6828201614b6b565b9283528481018201928281019087851115614bf057600080fd5b83870192505b848310156148fe57823582529183019190830190614bf6565b8015158114614b1957600080fd5b600080600060608486031215614c3257600080fd5b614c3b84614b39565b925060208401356001600160401b03811115614c5657600080fd5b614c6286828701614b9b565b9250506040840135614c7381614c0f565b809150509250925092565b600060208284031215614c9057600080fd5b5035919050565b60008060408385031215614caa57600080fd5b8235614cb581614b04565b946020939093013593505050565b600080600060608486031215614cd857600080fd5b505081359360208301359350604090920135919050565b600060208284031215614d0157600080fd5b6126c882614b39565b8060005b6004811015610cc7578151845260209384019390910190600101614d0e565b608081016112ab8284614d0a565b600081518084526020808501945080840160005b83811015614d6b57815187529582019590820190600101614d4f565b509495945050505050565b6020815260006126c86020830184614d3b565b6020808252825182820181905260009190848201906040850190845b81811015614dca5783516001600160601b031683529284019291840191600101614da5565b50909695505050505050565b634e487b7160e01b600052602160045260246000fd5b60058110614e0a57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a08101614e3a6040830186614dec565b9215156060820152608001529392505050565b600082601f830112614e5e57600080fd5b81356001600160401b03811115614e7757614e77614b55565b614e8a601f8201601f1916602001614b6b565b818152846020838601011115614e9f57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215614ed157600080fd5b8335614edc81614b04565b92506020840135915060408401356001600160401b03811115614efe57600080fd5b614f0a86828701614e4d565b9150509250925092565b60008060408385031215614f2757600080fd5b614cb583614b39565b60008060408385031215614f4357600080fd5b8235614f4e81614b04565b91506020830135614f5e81614c0f565b809150509250929050565b600080600060608486031215614f7e57600080fd5b8335614f8981614b04565b925060208401356001600160401b0381168114614fa557600080fd5b9150604084013560ff81168114614c7357600080fd5b600082601f830112614fcc57600080fd5b604051608081018181106001600160401b0382111715614fee57614fee614b55565b60405280608084018581111561500357600080fd5b845b8181101561501d578035835260209283019201615005565b509195945050505050565b6000806000806000806000610140888a03121561504457600080fd5b61504d88614b39565b9650602088013561505d81614c0f565b955060408801359450606088013593506080880135925060a088013591506150888960c08a01614fbb565b905092959891949750929550565b600080604083850312156150a957600080fd5b50508035926020909101359150565b60006101408083018d845260208d818601528c60408601528b60608601528a60808601528960a08601528260c0860152819250885180835261016086019350818a01925060005b818110156151245783516001600160a01b0316855293820193928201926001016150ff565b5050505060e0830195909552506101008101929092526001600160a01b031661012090910152979650505050505050565b60008060008060008060008060006101808a8c03121561517457600080fd5b61517d8a614b39565b985060208a013561518d81614c0f565b975060408a0135965060608a0135955060808a0135945060a08a013593506151b88b60c08c01614fbb565b92506101408a01356001600160401b03808211156151d557600080fd5b6151e18d838e01614e4d565b93506101608c01359150808211156151f857600080fd5b506152058c828d01614b9b565b9150509295985092959850929598565b6000806040838503121561522857600080fd5b8235915060208301356001600160401b0381111561524557600080fd5b61525185828601614e4d565b9150509250929050565b60008060006060848603121561527057600080fd5b833592506020840135915060408401356001600160401b03811115614efe57600080fd5b600080604083850312156152a757600080fd5b82356152b281614b04565b91506152c060208401614b39565b90509250929050565b60008083601f8401126152db57600080fd5b5081356001600160401b038111156152f257600080fd5b60208301915083602082850101111561530a57600080fd5b9250929050565b60008060006040848603121561532657600080fd5b83356001600160401b0381111561533c57600080fd5b615348868287016152c9565b9094509250506020840135614c7381614b04565b6000806000806080858703121561537257600080fd5b843561537d81614b04565b935061538b60208601614b39565b93969395505050506040820135916060013590565b6000806000806000608086880312156153b857600080fd5b8535945060208601356001600160401b038111156153d557600080fd5b6153e1888289016152c9565b90955093505060408601356153f581614b04565b949793965091946060013592915050565b60006020828403121561541857600080fd5b81356001600160401b0381111561542e57600080fd5b6112a784828501614e4d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161547857615478615450565b5060010190565b818103818111156112ab576112ab615450565b6000602082840312156154a457600080fd5b81516126c881614c0f565b602081016112ab8284614dec565b600181815b808511156154f85781600019048211156154de576154de615450565b808516156154eb57918102915b93841c93908002906154c2565b509250929050565b60008261550f575060016112ab565b8161551c575060006112ab565b8160018114615532576002811461553c57615558565b60019150506112ab565b60ff84111561554d5761554d615450565b50506001821b6112ab565b5060208310610133831016604e8410600b841016171561557b575081810a6112ab565b61558583836154bd565b806000190482111561559957615599615450565b029392505050565b60006126c860ff841683615500565b80820281158282048414176112ab576112ab615450565b634e487b7160e01b600052601260045260246000fd5b6000826155ec576155ec6155c7565b500490565b60008060006060848603121561560657600080fd5b83519250602084015161561881614c0f565b6040850151909250614c7381614c0f565b808201808211156112ab576112ab615450565b60006020828403121561564e57600080fd5b5051919050565b60005b83811015615670578181015183820152602001615658565b50506000910152565b6000825161568b818460208701615655565b9190910192915050565b60006101208201905087151582528660208301528560408301528460608301528360808301526148fe60a0830184614d0a565b600081518084526156e0816020860160208601615655565b601f01601f19169290920160200192915050565b82815260406020820152600061309660408301846156c8565b6000610140891515835288602084015287604084015286606084015285608084015261573c60a0840186614d0a565b8061012084015261574f81840185614d3b565b9a9950505050505050505050565b84815283602082015260806040820152600061577c60808301856156c8565b905082606083015295945050505050565b60006020828403121561579f57600080fd5b81516126c881614b04565b6000600160ff1b82016157bf576157bf615450565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615818576158186155c7565b500690565b60006020828403121561582f57600080fd5b8151600381106126c857600080fd5b634e487b7160e01b600052603160045260246000fd5b60008161586357615863615450565b50600019019056fea2646970667358221220c30d6f5a8f296b6270fa656cc8d3f42b97bb5b0d53352b768474b3af945e55de64736f6c63430008120033", "devdoc": { "events": { + "AcceptedFeeToken(address,bool)": { + "details": "To be emitted when an ERC20 token is added or removed as a method to pay fees.", + "params": { + "_accepted": "Whether the token is accepted or not.", + "_token": "The ERC20 token." + } + }, "DisputeCreation(uint256,address)": { "details": "To be emitted when a dispute is created.", "params": { "_arbitrable": "The contract which created the dispute.", - "_disputeID": "ID of the dispute." + "_disputeID": "The identifier of the dispute in the Arbitrator contract." } }, "Ruling(address,uint256,uint256)": { "details": "To be raised when a ruling is given.", "params": { "_arbitrable": "The arbitrable receiving the ruling.", - "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", "_ruling": "The ruling which was given." } } @@ -1718,54 +2031,37 @@ } }, "arbitrationCost(bytes)": { - "details": "Gets the cost of arbitration in a specified court.", + "details": "Compute the cost of arbitration denominated in ETH. 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.", "params": { - "_extraData": "Additional info about the dispute. We use it to pass the ID of the court to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes)." + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes)." }, "returns": { - "cost": "The arbitration cost." - } - }, - "changeCourtAlpha(uint96,uint256)": { - "details": "Changes the `alpha` property value of a specified court.", - "params": { - "_alpha": "The new value for the `alpha` property value.", - "_courtID": "The ID of the court." - } - }, - "changeCourtHiddenVotes(uint96,bool)": { - "details": "Changes the `hiddenVotes` property value of a specified court.", - "params": { - "_courtID": "The ID of the court.", - "_hiddenVotes": "The new value for the `hiddenVotes` property value." - } - }, - "changeCourtJurorFee(uint96,uint256)": { - "details": "Changes the `feeForJuror` property value of a specified court.", - "params": { - "_courtID": "The ID of the court.", - "_feeForJuror": "The new value for the `feeForJuror` property value." + "cost": "The arbitration cost in ETH." } }, - "changeCourtJurorsForJump(uint96,uint256)": { - "details": "Changes the `jurorsForCourtJump` property value of a specified court.", + "arbitrationCost(bytes,address)": { + "details": "Compute the cost of arbitration denominated in `_feeToken`. 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.", "params": { - "_courtID": "The ID of the court.", - "_jurorsForCourtJump": "The new value for the `jurorsForCourtJump` property value." + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeToken": "The ERC20 token used to pay fees." + }, + "returns": { + "cost": "The arbitration cost in `_feeToken`." } }, - "changeCourtMinStake(uint96,uint256)": { - "details": "Changes the `minStake` property value of a specified court. Don't set to a value lower than its parent's `minStake` property value.", + "changeAcceptedFeeTokens(address,bool)": { + "details": "Changes the supported fee tokens.", "params": { - "_courtID": "The ID of the court.", - "_minStake": "The new value for the `minStake` property value." + "_accepted": "Whether the token is supported or not as a method of fee payment.", + "_feeToken": "The fee token." } }, - "changeCourtTimesPerPeriod(uint96,uint256[4])": { - "details": "Changes the `timesPerPeriod` property value of a specified court.", + "changeCurrencyRates(address,uint64,uint8)": { + "details": "Changes the currency rate of a fee token.", "params": { - "_courtID": "The ID of the court.", - "_timesPerPeriod": "The new value for the `timesPerPeriod` property value." + "_feeToken": "The fee token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." } }, "changeGovernor(address)": { @@ -1821,13 +2117,25 @@ } }, "createDispute(uint256,bytes)": { - "details": "Creates a dispute. Must be called by the arbitrable contract.", + "details": "Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "createDispute(uint256,bytes,address,uint256)": { + "details": "Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", "params": { "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", - "_numberOfChoices": "Number of choices for the jurors to choose from." + "_feeAmount": "Amount of the ERC20 token used to pay fees.", + "_feeToken": "The ERC20 token used to pay fees.", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." }, "returns": { - "disputeID": "The ID of the created dispute." + "disputeID": "The identifier of the dispute created." } }, "currentRuling(uint256)": { @@ -1857,7 +2165,7 @@ } }, "execute(uint256,uint256,uint256)": { - "details": "Distribute tokens and ETH for the specific round of the dispute. Can be called in parts.", + "details": "Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.", "params": { "_disputeID": "The ID of the dispute.", "_iterations": "The number of iterations to run.", @@ -1873,7 +2181,7 @@ } }, "executeRuling(uint256)": { - "details": "Executes a specified dispute's ruling. UNTRUSTED.", + "details": "Executes a specified dispute's ruling.", "params": { "_disputeID": "The ID of the dispute." } @@ -1937,7 +2245,7 @@ } } }, - "title": "KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the token and the dispute kit contracts.", + "title": "KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.", "version": 1 }, "userdoc": { @@ -1948,7 +2256,7 @@ "storageLayout": { "storage": [ { - "astId": 1965, + "astId": 2851, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "governor", "offset": 0, @@ -1956,15 +2264,15 @@ "type": "t_address" }, { - "astId": 1968, + "astId": 2854, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "pinakion", "offset": 0, "slot": "1", - "type": "t_contract(IERC20)846" + "type": "t_contract(IERC20)929" }, { - "astId": 1970, + "astId": 2856, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurorProsecutionModule", "offset": 0, @@ -1972,44 +2280,52 @@ "type": "t_address" }, { - "astId": 1973, + "astId": 2859, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "sortitionModule", "offset": 0, "slot": "3", - "type": "t_contract(ISortitionModule)1816" + "type": "t_contract(ISortitionModule)15384" }, { - "astId": 1977, + "astId": 2863, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "courts", "offset": 0, "slot": "4", - "type": "t_array(t_struct(Court)1857_storage)dyn_storage" + "type": "t_array(t_struct(Court)2724_storage)dyn_storage" }, { - "astId": 1981, + "astId": 2867, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKitNodes", "offset": 0, "slot": "5", - "type": "t_array(t_struct(DisputeKitNode)1919_storage)dyn_storage" + "type": "t_array(t_struct(DisputeKitNode)2789_storage)dyn_storage" }, { - "astId": 1985, + "astId": 2871, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputes", "offset": 0, "slot": "6", - "type": "t_array(t_struct(Dispute)1874_storage)dyn_storage" + "type": "t_array(t_struct(Dispute)2741_storage)dyn_storage" }, { - "astId": 1990, + "astId": 2876, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurors", "offset": 0, "slot": "7", - "type": "t_mapping(t_address,t_struct(Juror)1906_storage)" + "type": "t_mapping(t_address,t_struct(Juror)2776_storage)" + }, + { + "astId": 2882, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "currencyRates", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_contract(IERC20)929,t_struct(CurrencyRate)2809_storage)" } ], "types": { @@ -2024,26 +2340,26 @@ "label": "address[]", "numberOfBytes": "32" }, - "t_array(t_struct(Court)1857_storage)dyn_storage": { - "base": "t_struct(Court)1857_storage", + "t_array(t_struct(Court)2724_storage)dyn_storage": { + "base": "t_struct(Court)2724_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Court[]", "numberOfBytes": "32" }, - "t_array(t_struct(Dispute)1874_storage)dyn_storage": { - "base": "t_struct(Dispute)1874_storage", + "t_array(t_struct(Dispute)2741_storage)dyn_storage": { + "base": "t_struct(Dispute)2741_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Dispute[]", "numberOfBytes": "32" }, - "t_array(t_struct(DisputeKitNode)1919_storage)dyn_storage": { - "base": "t_struct(DisputeKitNode)1919_storage", + "t_array(t_struct(DisputeKitNode)2789_storage)dyn_storage": { + "base": "t_struct(DisputeKitNode)2789_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.DisputeKitNode[]", "numberOfBytes": "32" }, - "t_array(t_struct(Round)1894_storage)dyn_storage": { - "base": "t_struct(Round)1894_storage", + "t_array(t_struct(Round)2764_storage)dyn_storage": { + "base": "t_struct(Round)2764_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Round[]", "numberOfBytes": "32" @@ -2071,37 +2387,44 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IArbitrable)1558": { + "t_contract(IArbitrableV2)15066": { "encoding": "inplace", - "label": "contract IArbitrable", + "label": "contract IArbitrableV2", "numberOfBytes": "20" }, - "t_contract(IDisputeKit)1735": { + "t_contract(IDisputeKit)15290": { "encoding": "inplace", "label": "contract IDisputeKit", "numberOfBytes": "20" }, - "t_contract(IERC20)846": { + "t_contract(IERC20)929": { "encoding": "inplace", "label": "contract IERC20", "numberOfBytes": "20" }, - "t_contract(ISortitionModule)1816": { + "t_contract(ISortitionModule)15384": { "encoding": "inplace", "label": "contract ISortitionModule", "numberOfBytes": "20" }, - "t_enum(Period)1831": { + "t_enum(Period)2698": { "encoding": "inplace", "label": "enum KlerosCore.Period", "numberOfBytes": "1" }, - "t_mapping(t_address,t_struct(Juror)1906_storage)": { + "t_mapping(t_address,t_struct(Juror)2776_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct KlerosCore.Juror)", "numberOfBytes": "32", - "value": "t_struct(Juror)1906_storage" + "value": "t_struct(Juror)2776_storage" + }, + "t_mapping(t_contract(IERC20)929,t_struct(CurrencyRate)2809_storage)": { + "encoding": "mapping", + "key": "t_contract(IERC20)929", + "label": "mapping(contract IERC20 => struct KlerosCore.CurrencyRate)", + "numberOfBytes": "32", + "value": "t_struct(CurrencyRate)2809_storage" }, "t_mapping(t_uint256,t_bool)": { "encoding": "mapping", @@ -2117,12 +2440,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(Court)1857_storage": { + "t_struct(Court)2724_storage": { "encoding": "inplace", "label": "struct KlerosCore.Court", "members": [ { - "astId": 1833, + "astId": 2700, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "parent", "offset": 0, @@ -2130,7 +2453,7 @@ "type": "t_uint96" }, { - "astId": 1835, + "astId": 2702, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "hiddenVotes", "offset": 12, @@ -2138,7 +2461,7 @@ "type": "t_bool" }, { - "astId": 1838, + "astId": 2705, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "children", "offset": 0, @@ -2146,7 +2469,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 1840, + "astId": 2707, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "minStake", "offset": 0, @@ -2154,7 +2477,7 @@ "type": "t_uint256" }, { - "astId": 1842, + "astId": 2709, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "alpha", "offset": 0, @@ -2162,7 +2485,7 @@ "type": "t_uint256" }, { - "astId": 1844, + "astId": 2711, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "feeForJuror", "offset": 0, @@ -2170,7 +2493,7 @@ "type": "t_uint256" }, { - "astId": 1846, + "astId": 2713, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurorsForCourtJump", "offset": 0, @@ -2178,7 +2501,7 @@ "type": "t_uint256" }, { - "astId": 1850, + "astId": 2717, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "timesPerPeriod", "offset": 0, @@ -2186,7 +2509,7 @@ "type": "t_array(t_uint256)4_storage" }, { - "astId": 1854, + "astId": 2721, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "supportedDisputeKits", "offset": 0, @@ -2194,7 +2517,7 @@ "type": "t_mapping(t_uint256,t_bool)" }, { - "astId": 1856, + "astId": 2723, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disabled", "offset": 0, @@ -2204,12 +2527,43 @@ ], "numberOfBytes": "384" }, - "t_struct(Dispute)1874_storage": { + "t_struct(CurrencyRate)2809_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.CurrencyRate", + "members": [ + { + "astId": 2804, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feePaymentAccepted", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 2806, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rateInEth", + "offset": 1, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2808, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rateDecimals", + "offset": 9, + "slot": "0", + "type": "t_uint8" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Dispute)2741_storage": { "encoding": "inplace", "label": "struct KlerosCore.Dispute", "members": [ { - "astId": 1859, + "astId": 2726, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "courtID", "offset": 0, @@ -2217,23 +2571,23 @@ "type": "t_uint96" }, { - "astId": 1862, + "astId": 2729, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "arbitrated", "offset": 12, "slot": "0", - "type": "t_contract(IArbitrable)1558" + "type": "t_contract(IArbitrableV2)15066" }, { - "astId": 1865, + "astId": 2732, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "period", "offset": 0, "slot": "1", - "type": "t_enum(Period)1831" + "type": "t_enum(Period)2698" }, { - "astId": 1867, + "astId": 2734, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "ruled", "offset": 1, @@ -2241,7 +2595,7 @@ "type": "t_bool" }, { - "astId": 1869, + "astId": 2736, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "lastPeriodChange", "offset": 0, @@ -2249,22 +2603,22 @@ "type": "t_uint256" }, { - "astId": 1873, + "astId": 2740, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "rounds", "offset": 0, "slot": "3", - "type": "t_array(t_struct(Round)1894_storage)dyn_storage" + "type": "t_array(t_struct(Round)2764_storage)dyn_storage" } ], "numberOfBytes": "128" }, - "t_struct(DisputeKitNode)1919_storage": { + "t_struct(DisputeKitNode)2789_storage": { "encoding": "inplace", "label": "struct KlerosCore.DisputeKitNode", "members": [ { - "astId": 1908, + "astId": 2778, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "parent", "offset": 0, @@ -2272,7 +2626,7 @@ "type": "t_uint256" }, { - "astId": 1911, + "astId": 2781, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "children", "offset": 0, @@ -2280,15 +2634,15 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 1914, + "astId": 2784, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKit", "offset": 0, "slot": "2", - "type": "t_contract(IDisputeKit)1735" + "type": "t_contract(IDisputeKit)15290" }, { - "astId": 1916, + "astId": 2786, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "depthLevel", "offset": 0, @@ -2296,7 +2650,7 @@ "type": "t_uint256" }, { - "astId": 1918, + "astId": 2788, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disabled", "offset": 0, @@ -2306,12 +2660,12 @@ ], "numberOfBytes": "160" }, - "t_struct(Juror)1906_storage": { + "t_struct(Juror)2776_storage": { "encoding": "inplace", "label": "struct KlerosCore.Juror", "members": [ { - "astId": 1897, + "astId": 2767, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "courtIDs", "offset": 0, @@ -2319,17 +2673,17 @@ "type": "t_array(t_uint96)dyn_storage" }, { - "astId": 1901, + "astId": 2771, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", - "label": "stakedTokens", + "label": "stakedPnk", "offset": 0, "slot": "1", "type": "t_mapping(t_uint96,t_uint256)" }, { - "astId": 1905, + "astId": 2775, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", - "label": "lockedTokens", + "label": "lockedPnk", "offset": 0, "slot": "2", "type": "t_mapping(t_uint96,t_uint256)" @@ -2337,12 +2691,12 @@ ], "numberOfBytes": "96" }, - "t_struct(Round)1894_storage": { + "t_struct(Round)2764_storage": { "encoding": "inplace", "label": "struct KlerosCore.Round", "members": [ { - "astId": 1876, + "astId": 2743, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKitID", "offset": 0, @@ -2350,15 +2704,15 @@ "type": "t_uint256" }, { - "astId": 1878, + "astId": 2745, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", - "label": "tokensAtStakePerJuror", + "label": "pnkAtStakePerJuror", "offset": 0, "slot": "1", "type": "t_uint256" }, { - "astId": 1880, + "astId": 2747, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "totalFeesForJurors", "offset": 0, @@ -2366,7 +2720,7 @@ "type": "t_uint256" }, { - "astId": 1882, + "astId": 2749, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nbVotes", "offset": 0, @@ -2374,7 +2728,7 @@ "type": "t_uint256" }, { - "astId": 1884, + "astId": 2751, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "repartitions", "offset": 0, @@ -2382,15 +2736,15 @@ "type": "t_uint256" }, { - "astId": 1886, + "astId": 2753, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", - "label": "penalties", + "label": "pnkPenalties", "offset": 0, "slot": "5", "type": "t_uint256" }, { - "astId": 1889, + "astId": 2756, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "drawnJurors", "offset": 0, @@ -2398,29 +2752,47 @@ "type": "t_array(t_address)dyn_storage" }, { - "astId": 1891, + "astId": 2758, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", - "label": "sumRewardPaid", + "label": "sumFeeRewardPaid", "offset": 0, "slot": "7", "type": "t_uint256" }, { - "astId": 1893, + "astId": 2760, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", - "label": "sumTokenRewardPaid", + "label": "sumPnkRewardPaid", "offset": 0, "slot": "8", "type": "t_uint256" + }, + { + "astId": 2763, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feeToken", + "offset": 0, + "slot": "9", + "type": "t_contract(IERC20)929" } ], - "numberOfBytes": "288" + "numberOfBytes": "320" }, "t_uint256": { "encoding": "inplace", "label": "uint256", "numberOfBytes": "32" }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + }, "t_uint96": { "encoding": "inplace", "label": "uint96", diff --git a/contracts/deployments/arbitrumGoerli/SortitionModule.json b/contracts/deployments/arbitrumGoerli/SortitionModule.json index 92206c7e8..75b90f40d 100644 --- a/contracts/deployments/arbitrumGoerli/SortitionModule.json +++ b/contracts/deployments/arbitrumGoerli/SortitionModule.json @@ -1,5 +1,5 @@ { - "address": "0xa65D3ED6494ec5fcAa115A39D625B2F01786F094", + "address": "0x5Ae75Db8B66B574b2c5C29eE4D32cc9Fe62bfdEE", "abi": [ { "inputs": [ @@ -510,35 +510,35 @@ "type": "function" } ], - "transactionHash": "0x91085ec7b083302b8496243a7cd64d26b02a0a0042da3272b4cd2f1a1d4ed53d", + "transactionHash": "0x9149980884d8a547e28f64de0ac06a4faa7ab6254a46b650147a0d6ebcee8755", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xa65D3ED6494ec5fcAa115A39D625B2F01786F094", + "contractAddress": "0x5Ae75Db8B66B574b2c5C29eE4D32cc9Fe62bfdEE", "transactionIndex": 1, "gasUsed": "1822849", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x32a7d744d6e58f76745e777fd95fb2231405c62fb174b1522476a820e25550a5", - "transactionHash": "0x91085ec7b083302b8496243a7cd64d26b02a0a0042da3272b4cd2f1a1d4ed53d", + "blockHash": "0xd3771b40ef9cde7ccad081915037bbba5b8f500b0ca9a869d513766d87df0717", + "transactionHash": "0x9149980884d8a547e28f64de0ac06a4faa7ab6254a46b650147a0d6ebcee8755", "logs": [], - "blockNumber": 25602108, + "blockNumber": 27808421, "cumulativeGasUsed": "1822849", "status": 1, "byzantium": true }, "args": [ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", + "0x8Af82E2F8890acb4AB84cbaB3c4C4Eb3E965CF24", 1800, 1800, "0xa90f7D2e35718FDE9AD96c8B6667AFcAa4BEfd4d", 20 ], - "numDeployments": 2, - "solcInputHash": "36e3015201aa6368fd28e007dfb67b68", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"penalty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_penalty\",\"type\":\"uint256\"}],\"name\":\"preStakeHook\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.preStakeHookResult\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_core\":\"The KlerosCore.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_voteID\":\"ID of the voter.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256)\":{\"details\":\"Sets the value for a particular court and its parent courts.\",\"params\":{\"_account\":\"Address of the juror. `O(log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\",\"_courtID\":\"ID of the court.\",\"_value\":\"The new value.\"}}},\"title\":\"SortitionModule\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModule.sol\":\"SortitionModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IArbitrable\\n/// Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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);\\ninterface IArbitrable {\\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 event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _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 function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x2a5363c37d33749f6b53c288f6d1538f013c6efbb3df86e63eceaa8163a6b212\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitrator {\\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 event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute. Must be called by the arbitrable contract.\\n /// Must pay 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 function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x8028f7d6a0fe07687f975fc51c9f889083ae1a409a134e8017a044701310948f\",\"license\":\"MIT\"},\"src/arbitration/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Address of the juror.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event Justification(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x64acb1fb52ebc6f7b61282e0c2781319a7a9a3ff4e460b6513048c34b6e4ba32\",\"license\":\"MIT\"},\"src/arbitration/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n enum preStakeHookResult {\\n ok,\\n delayed,\\n failed\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(address _account, uint96 _courtID, uint256 _value) external;\\n\\n function setJurorInactive(address _account) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _voteID) external view returns (address);\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external returns (preStakeHookResult);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x28911aa78669746f40c4c3bce723db21600a49a74142c0fe378680b1b356d633\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrator.sol\\\";\\nimport \\\"./IDisputeKit.sol\\\";\\nimport \\\"./ISortitionModule.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the token and the dispute kit contracts.\\ncontract KlerosCore is IArbitrator {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum tokens needed to stake in the court.\\n uint256 alpha; // Basis point of tokens that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrable arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 tokensAtStakePerJuror; // The amount of tokens at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 penalties; // The amount of tokens collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumTokenRewardPaid; // Total sum of tokens paid to coherent jurors as a reward in this round.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n mapping(uint96 => uint256) stakedTokens; // The number of tokens the juror has staked in the court in the form `stakedTokens[courtID]`.\\n mapping(uint96 => uint256) lockedTokens; // The number of tokens the juror has locked in the court in the form `lockedTokens[courtID]`.\\n }\\n\\n struct DisputeKitNode {\\n uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root.\\n uint256[] children; // List of child dispute kits.\\n IDisputeKit disputeKit; // The dispute kit implementation.\\n uint256 depthLevel; // How far this DK is from the root. 0 for root DK.\\n bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 penaltiesInRound; // The amount of tokens collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n // TODO: interactions with jurorProsecutionModule.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n\\n Court[] public courts; // The courts.\\n DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID.\\n Dispute[] public disputes; // The disputes.\\n\\n mapping(address => Juror) internal jurors; // The jurors.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty);\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(uint96 indexed _courtID, string _param);\\n event DisputeKitCreated(\\n uint256 indexed _disputeKitID,\\n IDisputeKit indexed _disputeKitAddress,\\n uint256 indexed _parent\\n );\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _tokenAmount,\\n int256 _ethAmount\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _tokenAmount,\\n uint256 _ethAmount\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent.\\n disputeKitNodes.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: NULL_DISPUTE_KIT,\\n children: new uint256[](0),\\n disputeKit: _disputeKit,\\n depthLevel: 0,\\n disabled: false\\n })\\n );\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit, NULL_DISPUTE_KIT);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created.\\n /// Note that the root DK must be supported by the general court.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor {\\n uint256 disputeKitID = disputeKitNodes.length;\\n require(_parent < disputeKitID, \\\"!Parent\\\");\\n uint256 depthLevel;\\n if (_parent != NULL_DISPUTE_KIT) {\\n depthLevel = disputeKitNodes[_parent].depthLevel + 1;\\n // It should be always possible to reach the root from the leaf with the defined number of search iterations.\\n require(depthLevel < SEARCH_ITERATIONS, \\\"Depth level max\\\");\\n }\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: _parent,\\n children: new uint256[](0),\\n disputeKit: _disputeKitAddress,\\n depthLevel: depthLevel,\\n disabled: false\\n })\\n );\\n\\n disputeKitNodes[_parent].children.push(disputeKitID);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent);\\n if (_parent == NULL_DISPUTE_KIT) {\\n // A new dispute kit tree root should always be supported by the General court.\\n _enableDisputeKit(GENERAL_COURT, disputeKitID, true);\\n }\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n require(courts[_parent].minStake <= _minStake, \\\"MinStake lower than parent court\\\");\\n require(_supportedDisputeKits.length > 0, \\\"!Supported DK\\\");\\n require(_parent != FORKING_COURT, \\\"Invalid: Forking court as parent\\\");\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n require(\\n _supportedDisputeKits[i] > 0 && _supportedDisputeKits[i] < disputeKitNodes.length,\\n \\\"Wrong DK index\\\"\\n );\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n /// @dev Changes the `minStake` property value of a specified court. Don't set to a value lower than its parent's `minStake` property value.\\n /// @param _courtID The ID of the court.\\n /// @param _minStake The new value for the `minStake` property value.\\n function changeCourtMinStake(uint96 _courtID, uint256 _minStake) external onlyByGovernor {\\n require(\\n _courtID == GENERAL_COURT || courts[courts[_courtID].parent].minStake <= _minStake,\\n \\\"MinStake lower than parent court\\\"\\n );\\n for (uint256 i = 0; i < courts[_courtID].children.length; i++) {\\n require(courts[courts[_courtID].children[i]].minStake >= _minStake, \\\"MinStake lower than parent court\\\");\\n }\\n\\n courts[_courtID].minStake = _minStake;\\n emit CourtModified(_courtID, \\\"minStake\\\");\\n }\\n\\n /// @dev Changes the `alpha` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _alpha The new value for the `alpha` property value.\\n function changeCourtAlpha(uint96 _courtID, uint256 _alpha) external onlyByGovernor {\\n courts[_courtID].alpha = _alpha;\\n emit CourtModified(_courtID, \\\"alpha\\\");\\n }\\n\\n /// @dev Changes the `feeForJuror` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _feeForJuror The new value for the `feeForJuror` property value.\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n courts[_courtID].feeForJuror = _feeForJuror;\\n emit CourtModified(_courtID, \\\"feeForJuror\\\");\\n }\\n\\n /// @dev Changes the `jurorsForCourtJump` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _jurorsForCourtJump The new value for the `jurorsForCourtJump` property value.\\n function changeCourtJurorsForJump(uint96 _courtID, uint256 _jurorsForCourtJump) external onlyByGovernor {\\n courts[_courtID].jurorsForCourtJump = _jurorsForCourtJump;\\n emit CourtModified(_courtID, \\\"jurorsForCourtJump\\\");\\n }\\n\\n /// @dev Changes the `hiddenVotes` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _hiddenVotes The new value for the `hiddenVotes` property value.\\n function changeCourtHiddenVotes(uint96 _courtID, bool _hiddenVotes) external onlyByGovernor {\\n courts[_courtID].hiddenVotes = _hiddenVotes;\\n emit CourtModified(_courtID, \\\"hiddenVotes\\\");\\n }\\n\\n /// @dev Changes the `timesPerPeriod` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _timesPerPeriod The new value for the `timesPerPeriod` property value.\\n function changeCourtTimesPerPeriod(uint96 _courtID, uint256[4] memory _timesPerPeriod) external onlyByGovernor {\\n courts[_courtID].timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(_courtID, \\\"timesPerPeriod\\\");\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n require(_disputeKitIDs[i] > 0 && _disputeKitIDs[i] < disputeKitNodes.length, \\\"Wrong DK index\\\");\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n require(\\n !(_courtID == GENERAL_COURT && disputeKitNodes[_disputeKitIDs[i]].parent == NULL_DISPUTE_KIT),\\n \\\"Can't disable Root DK in General\\\"\\n );\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n function setStake(uint96 _courtID, uint256 _stake) external {\\n require(_setStakeForAccount(msg.sender, _courtID, _stake, 0), \\\"Staking failed\\\");\\n }\\n\\n function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _stake, uint256 _penalty) external {\\n require(msg.sender == address(sortitionModule), \\\"Wrong caller\\\");\\n _setStakeForAccount(_account, _courtID, _stake, _penalty);\\n }\\n\\n /// @dev Creates a dispute. Must be called by the arbitrable contract.\\n /// @param _numberOfChoices Number of choices for the jurors to choose from.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes),\\n /// the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The ID of the created dispute.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"ETH too low for arbitration cost\\\");\\n\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n require(courts[courtID].supportedDisputeKits[disputeKitID], \\\"DK unsupported by court\\\");\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrable(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit;\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = msg.value / court.feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.tokensAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = msg.value;\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n require(\\n currentRound > 0 ||\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)],\\n \\\"Evidence not passed && !Appeal\\\"\\n );\\n require(round.drawnJurors.length == round.nbVotes, \\\"Dispute still drawing\\\");\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)] ||\\n disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID),\\n \\\"Commit period not passed\\\"\\n );\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)] ||\\n disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID),\\n \\\"Vote period not passed\\\"\\n );\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n require(\\n block.timestamp - dispute.lastPeriodChange >= court.timesPerPeriod[uint256(dispute.period)],\\n \\\"Appeal period not passed\\\"\\n );\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert(\\\"Dispute period is final\\\");\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n require(dispute.period == Period.evidence, \\\"!Evidence period\\\");\\n\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= round.nbVotes ? startIndex + _iterations : round.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n jurors[drawnAddress].lockedTokens[dispute.courtID] += round.tokensAtStakePerJuror;\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n }\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n require(msg.value >= appealCost(_disputeID), \\\"ETH too low for appeal cost\\\");\\n\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.appeal, \\\"Dispute not appealable\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n require(msg.sender == address(disputeKitNodes[round.disputeKitID].disputeKit), \\\"Dispute Kit only\\\");\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) {\\n if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n break;\\n } else if (disputeKitNodes[newDisputeKitID].parent != NULL_DISPUTE_KIT) {\\n newDisputeKitID = disputeKitNodes[newDisputeKitID].parent;\\n } else {\\n // DK's parent has 0 index, that means we reached the root DK (0 depth level).\\n // Jump to the next parent court if the current court doesn't support any DK from this tree.\\n // Note that we don't reset newDisputeKitID in this case as, a precaution.\\n newCourtID = courts[newCourtID].parent;\\n }\\n }\\n // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court.\\n // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default.\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n newCourtID = GENERAL_COURT;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.tokensAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n IDisputeKit disputeKit = disputeKitNodes[extraRound.disputeKitID].disputeKit;\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKit.createDispute(_disputeID, _numberOfChoices, _extraData, extraRound.nbVotes);\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute tokens and ETH for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"!Execution period\\\");\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 penaltiesInRoundCache = round.penalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n penaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, penaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, penaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.penalties != penaltiesInRoundCache) {\\n round.penalties = penaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the tokens and ETH for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return penaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.tokensAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.penaltiesInRound += penalty;\\n\\n // Unlock the tokens affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n jurors[account].lockedTokens[dispute.courtID] -= penalty;\\n\\n // Apply the penalty to the staked tokens\\n if (jurors[account].stakedTokens[dispute.courtID] >= courts[dispute.courtID].minStake + penalty) {\\n // The juror still has enough staked token after penalty for this court.\\n uint256 newStake = jurors[account].stakedTokens[dispute.courtID] - penalty;\\n _setStakeForAccount(account, dispute.courtID, newStake, penalty);\\n } else if (jurors[account].stakedTokens[dispute.courtID] != 0) {\\n // The juror does not have enough staked tokens after penalty for this court, unstake them.\\n _setStakeForAccount(account, dispute.courtID, 0, penalty);\\n }\\n emit TokenAndETHShift(account, _params.disputeID, _params.round, degreeOfCoherence, -int256(penalty), 0);\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n payable(governor).send(round.totalFeesForJurors);\\n _safeTransfer(governor, _params.penaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.penaltiesInRound,\\n round.totalFeesForJurors\\n );\\n }\\n return _params.penaltiesInRound;\\n }\\n\\n /// @dev Distribute the tokens and ETH for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 tokenLocked = (round.tokensAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the tokens of the juror for this round.\\n jurors[account].lockedTokens[dispute.courtID] -= tokenLocked;\\n\\n // Give back the locked tokens in case the juror fully unstaked earlier.\\n if (jurors[account].stakedTokens[dispute.courtID] == 0) {\\n _safeTransfer(account, tokenLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 tokenReward = ((_params.penaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumTokenRewardPaid += tokenReward;\\n uint256 ethReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumRewardPaid += ethReward;\\n _safeTransfer(account, tokenReward);\\n payable(account).send(ethReward);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(tokenReward),\\n int256(ethReward)\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverTokenReward = _params.penaltiesInRound - round.sumTokenRewardPaid;\\n uint256 leftoverReward = round.totalFeesForJurors - round.sumRewardPaid;\\n if (leftoverTokenReward != 0 || leftoverReward != 0) {\\n if (leftoverTokenReward != 0) {\\n _safeTransfer(governor, leftoverTokenReward);\\n }\\n if (leftoverReward != 0) {\\n payable(governor).send(leftoverReward);\\n }\\n emit LeftoverRewardSent(_params.disputeID, _params.round, leftoverTokenReward, leftoverReward);\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling. UNTRUSTED.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"!Execution period\\\");\\n require(!dispute.ruled, \\\"Ruling already executed\\\");\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the cost of arbitration in a specified court.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the court to create the dispute in (first 32 bytes)\\n /// and the minimum number of jurors required (next 32 bytes).\\n /// @return cost The arbitration cost.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round\\n )\\n external\\n view\\n returns (\\n uint256 tokensAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 repartitions,\\n uint256 penalties,\\n address[] memory drawnJurors,\\n uint256 disputeKitID,\\n uint256 sumRewardPaid,\\n uint256 sumTokenRewardPaid\\n )\\n {\\n Round storage round = disputes[_disputeID].rounds[_round];\\n return (\\n round.tokensAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.repartitions,\\n round.penalties,\\n round.drawnJurors,\\n round.disputeKitID,\\n round.sumRewardPaid,\\n round.sumTokenRewardPaid\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 staked, uint256 locked, uint256 nbCourts) {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedTokens[_courtID];\\n locked = juror.lockedTokens[_courtID];\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets non-primitive properties of a specified dispute kit node.\\n /// @param _disputeKitID The ID of the dispute kit.\\n /// @return children Indexes of children of this DK.\\n function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) {\\n return disputeKitNodes[_disputeKitID].children;\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_courtID];\\n timesPerPeriod = court.timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitNodesLength() external view returns (uint256) {\\n return disputeKitNodes.length;\\n }\\n\\n /// @dev Gets the dispute kit for a specific `_disputeKitID`.\\n /// @param _disputeKitID The ID of the dispute kit.\\n function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) {\\n return disputeKitNodes[_disputeKitID].disputeKit;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n /// @param _penalty Penalized amount won't be transferred back to juror when the stake is lowered.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function _setStakeForAccount(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) return false;\\n\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = juror.stakedTokens[_courtID];\\n\\n if (_stake != 0) {\\n // Check against locked tokens in case the min stake was lowered.\\n if (_stake < courts[_courtID].minStake || _stake < juror.lockedTokens[_courtID]) return false;\\n }\\n\\n ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _stake, _penalty);\\n if (result == ISortitionModule.preStakeHookResult.failed) {\\n return false;\\n } else if (result == ISortitionModule.preStakeHookResult.delayed) {\\n emit StakeDelayed(_account, _courtID, _stake, _penalty);\\n return true;\\n }\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (_safeTransferFrom(_account, address(this), transferredAmount)) {\\n if (currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n if (_stake == 0) {\\n // Keep locked tokens in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedTokens[_courtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (_safeTransfer(_account, transferredAmount)) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!_safeTransfer(_account, transferredAmount)) {\\n return false;\\n }\\n }\\n }\\n }\\n\\n // Update juror's records.\\n juror.stakedTokens[_courtID] = _stake;\\n\\n sortitionModule.setStake(_account, _courtID, _stake);\\n emit StakeSet(_account, _courtID, _stake);\\n return true;\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = MIN_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = MIN_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function _safeTransfer(address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(pinakion).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function _safeTransferFrom(address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(pinakion).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x40ea2ff69298920e83a2f4817bbc742127c35b0fc3ecdf552f33b33f7dc72a84\",\"license\":\"MIT\"},\"src/arbitration/SortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../arbitration/KlerosCore.sol\\\";\\nimport \\\"./ISortitionModule.sol\\\";\\nimport \\\"../arbitration/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\n\\n/// @title SortitionModule\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModule is ISortitionModule {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n uint256 penalty; // Penalty value, in case the stake was set during execution.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant DEFAULT_K = 6; // Default number of children per node.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex = 1; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor.\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n constructor(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.penalty\\n );\\n delete delayedStakes[i];\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external override onlyByCore returns (preStakeHookResult) {\\n (uint256 currentStake, , uint256 nbCourts) = core.getJurorBalance(_account, _courtID);\\n if (currentStake == 0 && nbCourts >= MAX_STAKE_PATHS) {\\n // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n return preStakeHookResult.failed;\\n } else {\\n if (phase != Phase.staking) {\\n delayedStakes[++delayedStakeWriteIndex] = DelayedStake({\\n account: _account,\\n courtID: _courtID,\\n stake: _stake,\\n penalty: _penalty\\n });\\n return preStakeHookResult.delayed;\\n }\\n }\\n return preStakeHookResult.ok;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the value for a particular court and its parent courts.\\n /// @param _courtID ID of the court.\\n /// @param _value The new value.\\n /// @param _account Address of the juror.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function setStake(address _account, uint96 _courtID, uint256 _value) external override onlyByCore {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _value, stakePathID);\\n if (currenCourtID == core.GENERAL_COURT()) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID);\\n }\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = core.getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, 0);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _voteID ID of the voter.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _voteID\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 treeIndex = 0;\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _voteID))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd493862b86138a5d3bbbe343e0d6a70126723e37fa68889cf00fb55c14e91eaa\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040526001600b553480156200001657600080fd5b5060405162001ddf38038062001ddf8339810160408190526200003991620000a9565b600080546001600160a01b03199081166001600160a01b039889161790915560018054821696881696909617909555600293909355600391909155426004556007805490931693169290921790556009556200011a565b6001600160a01b0381168114620000a657600080fd5b50565b60008060008060008060c08789031215620000c357600080fd5b8651620000d08162000090565b6020880151909650620000e38162000090565b8095505060408701519350606087015192506080870151620001058162000090565b8092505060a087015190509295509295509295565b611cb5806200012a6000396000f3fe608060405234801561001057600080fd5b506004361061018f5760003560e01c80635d2d7846116100e4578063c057eca711610092578063c057eca7146102ff578063c157261814610308578063ccbac9f514610311578063d09f392d1461031a578063d605787b1461032d578063dd5e5cb514610340578063f2f4eb2614610353578063f6b4d82d1461036657600080fd5b80635d2d7846146102985780637dc38f14146102ab578063823cfd70146102b4578063b1c9fe6e146102c7578063b4a61608146102db578063b5d69e99146102e3578063b888adfa146102f657600080fd5b806335975f4a1161014157806335975f4a1461021057806341334e2e1461022357806345988e2c14610243578063477a655c146102565780634c70a0d6146102695780634dbbebbc1461027c57806356acb0501461028f57600080fd5b806303432744146101945780630b274f2e146101b05780630b51806d146101ba5780630c340a24146101c25780630e083ec9146101ed5780631b92bbbe146101f657806321ea9b3f146101ff575b600080fd5b61019d60065481565b6040519081526020015b60405180910390f35b6101b86103c0565b005b61019d600681565b6000546101d5906001600160a01b031681565b6040516001600160a01b0390911681526020016101a7565b61019d600a5481565b61019d60035481565b6101b861020d3660046116b0565b50565b6101b861021e3660046116b0565b610798565b6102366102313660046116f3565b610937565b6040516101a7919061176d565b6101b8610251366004611780565b610ae5565b6101b8610264366004611808565b610c5e565b6101d56102773660046118a7565b610d55565b6101b861028a3660046118d3565b610f05565b61019d600b5481565b6101b86102a63660046118ff565b610fee565b61019d60095481565b6101b86102c23660046116b0565b611031565b60015461023690600160a01b900460ff1681565b61019d600481565b6101b86102f1366004611921565b611060565b61019d60045481565b61019d60025481565b61019d60055481565b61019d60085481565b6101b86103283660046118ff565b6111af565b6007546101d5906001600160a01b031681565b6101b861034e3660046116b0565b6111e9565b6001546101d5906001600160a01b031681565b6103b06103743660046116b0565b600d602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919084565b6040516101a79493929190611945565b6000600154600160a01b900460ff1660028111156103e0576103e0611739565b03610553576002546004546103f5904261198a565b101561045d5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116104bf5760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b6064820152608401610454565b6007546009546001600160a01b0390911690637363ae1f906104e190436119a3565b6040518263ffffffff1660e01b81526004016104ff91815260200190565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b021790555061074d565b60018054600160a01b900460ff16600281111561057257610572611739565b0361066a576007546009546005546001600160a01b03909216916313cf90549161059b916119a3565b6040518263ffffffff1660e01b81526004016105b991815260200190565b6020604051808303816000875af11580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc91906119b6565b60088190556000036106505760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f742072656164792079657400006044820152606401610454565b600180546002919060ff60a01b1916600160a01b83610549565b6002600154600160a01b900460ff16600281111561068a5761068a611739565b0361074d5760065415806106ac57506003546004546106a9904261198a565b10155b61073f5760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a401610454565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b939161078e91600160a01b90910460ff169061176d565b60405180910390a1565b6000600154600160a01b900460ff1660028111156107b8576107b8611739565b146108055760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e00000000006044820152606401610454565b6000600a54600183600b5461081a91906119a3565b610824919061198a565b1161082f578161084a565b600b54600a5461083f919061198a565b61084a9060016119a3565b9050600081600b5461085c91906119a3565b600b549091505b8181101561092f576000818152600d602052604090819020600180548254918301546002840154945163f56f072560e01b815293946001600160a01b039283169463f56f0725946108cd94811693600160a01b9091046001600160601b0316929091600401611945565b600060405180830381600087803b1580156108e757600080fd5b505af11580156108fb573d6000803e3d6000fd5b5050506000838152600d60205260408120818155600181018290556002015550819050610927816119cf565b915050610863565b50600b555050565b6001546000906001600160a01b031633146109645760405162461bcd60e51b8152600401610454906119e8565b600154604051631a383be960e31b81526001600160a01b0387811660048301526001600160601b0387166024830152600092839291169063d1c1df4890604401606060405180830381865afa1580156109c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e59190611a2c565b92505091508160001480156109fb575060048110155b15610a0b57600292505050610add565b6000600154600160a01b900460ff166002811115610a2b57610a2b611739565b14610ad6576040518060800160405280886001600160a01b03168152602001876001600160601b0316815260200186815260200185815250600d6000600a60008154610a76906119cf565b9182905550815260208082019290925260409081016000208351928401516001600160601b0316600160a01b026001600160a01b039093169290921782558201516001808301919091556060909201516002909101559250610add915050565b6000925050505b949350505050565b6001546001600160a01b03163314610b0f5760405162461bcd60e51b8152600401610454906119e8565b6000610b1b8484611218565b90506000835b81610c5657610b3a6001600160601b0382168585611260565b600160009054906101000a90046001600160a01b03166001600160a01b03166334d5fb316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611a5a565b6001600160601b0316816001600160601b031603610bd25760019150610b21565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015610c23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c479190611a87565b50949550610b21945050505050565b505050505050565b6001546001600160a01b03163314610c885760405162461bcd60e51b8152600401610454906119e8565b6000828152600c6020526040812090610ca0836115b4565b825490915015610ce95760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b6044820152606401610454565b60018111610d395760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e00000000006044820152606401610454565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610d7757610d77611739565b14610db35760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b6044820152606401610454565b6000848152600c602052604081206002810180549192918291908290610ddb57610ddb611af3565b90600052602060002001546008548787604051602001610e0e939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c610e319190611b1f565b90505b60028301548354610e46908490611b33565b610e519060016119a3565b1015610ee05760015b83548111610eda57600081848660000154610e759190611b33565b610e7f91906119a3565b90506000856002018281548110610e9857610e98611af3565b90600052602060002001549050808410610ebd57610eb6818561198a565b9350610ec5565b509250610eda565b50508080610ed2906119cf565b915050610e5a565b50610e34565b6000828152600484016020526040902054610efa906115d0565b979650505050505050565b6000546001600160a01b03163314610f2f5760405162461bcd60e51b815260040161045490611b4a565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff166002811115610f6e57610f6e611739565b03610fea576007546009546001600160a01b0390911690637363ae1f90610f9590436119a3565b6040518263ffffffff1660e01b8152600401610fb391815260200190565b600060405180830381600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b50504360055550505b5050565b6001546001600160a01b031633146110185760405162461bcd60e51b8152600401610454906119e8565b6006805490600061102883611b8c565b91905055505050565b6000546001600160a01b0316331461105b5760405162461bcd60e51b815260040161045490611b4a565b600255565b6001546001600160a01b0316331461108a5760405162461bcd60e51b8152600401610454906119e8565b600154604051632a1fc51b60e11b81526001600160a01b038381166004830152600092169063543f8a3690602401600060405180830381865afa1580156110d5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110fd9190810190611ba3565b80519091505b80156111aa57600180546001600160a01b03169063f56f0725908590859061112b908661198a565b8151811061113b5761113b611af3565b60200260200101516000806040518563ffffffff1660e01b81526004016111659493929190611945565b600060405180830381600087803b15801561117f57600080fd5b505af1158015611193573d6000803e3d6000fd5b5050505080806111a290611b8c565b915050611103565b505050565b6001546001600160a01b031633146111d95760405162461bcd60e51b8152600401610454906119e8565b60068054906000611028836119cf565b6000546001600160a01b031633146112135760405162461bcd60e51b815260040161045490611b4a565b600355565b600060405160005b601481101561123b578481600c011a81830153600101611220565b5060145b60208110156112575783811a8183015360010161123f565b50519392505050565b6000838152600c6020908152604080832084845260038101909252822054909181900361142d57831561142857600182015460000361137b5750600281018054600180820183556000928352602090922081018590559081148015906112da575081546112ce60018361198a565b6112d89190611b1f565b155b156113765781546000906112ee9083611c55565b600081815260048501602052604081205491925061130d8460016119a3565b90508460020185600201848154811061132857611328611af3565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6113f6565b60018083018054909161138d9161198a565b8154811061139d5761139d611af3565b90600052602060002001549050816001018054806113bd576113bd611c69565b60019003818190600052602060002001600090559055838260020182815481106113e9576113e9611af3565b6000918252602090912001555b6000838152600383016020908152604080832084905583835260048501909152902083905561142885826001876115fb565b6115ad565b836000036114cb57600082600201828154811061144c5761144c611af3565b90600052602060002001549050600083600201838154811061147057611470611af3565b60009182526020808320909101929092556001808601805491820181558252828220018490558581526003850182526040808220829055848252600486019092529081208190556114c59087908490846115fb565b506115ad565b8160020181815481106114e0576114e0611af3565b906000526020600020015484146115ad5760008483600201838154811061150957611509611af3565b90600052602060002001541115905060008161154f578584600201848154811061153557611535611af3565b906000526020600020015461154a919061198a565b61157a565b83600201838154811061156457611564611af3565b90600052602060002001548661157a919061198a565b90508584600201848154811061159257611592611af3565b6000918252602090912001556115aa878484846115fb565b50505b5050505050565b600060208251106115c757506020015190565b5060065b919050565b600060405160005b60148110156115f35783811a81600c840101536001016115d8565b505192915050565b6000848152600c60205260409020835b8015610c5657815461161e60018361198a565b6116289190611c55565b90508361165f578282600201828154811061164557611645611af3565b906000526020600020015461165a919061198a565b61168a565b8282600201828154811061167557611675611af3565b906000526020600020015461168a91906119a3565b82600201828154811061169f5761169f611af3565b60009182526020909120015561160b565b6000602082840312156116c257600080fd5b5035919050565b6001600160a01b038116811461020d57600080fd5b6001600160601b038116811461020d57600080fd5b6000806000806080858703121561170957600080fd5b8435611714816116c9565b93506020850135611724816116de565b93969395505050506040820135916060013590565b634e487b7160e01b600052602160045260246000fd5b6003811061020d57634e487b7160e01b600052602160045260246000fd5b6020810161177a8361174f565b91905290565b60008060006060848603121561179557600080fd5b83356117a0816116c9565b925060208401356117b0816116de565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611800576118006117c1565b604052919050565b6000806040838503121561181b57600080fd5b8235915060208084013567ffffffffffffffff8082111561183b57600080fd5b818601915086601f83011261184f57600080fd5b813581811115611861576118616117c1565b611873601f8201601f191685016117d7565b9150808252878482850101111561188957600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806000606084860312156118bc57600080fd5b505081359360208301359350604090920135919050565b600080604083850312156118e657600080fd5b82356118f1816116c9565b946020939093013593505050565b6000806040838503121561191257600080fd5b50508035926020909101359150565b60006020828403121561193357600080fd5b813561193e816116c9565b9392505050565b6001600160a01b039490941684526001600160601b039290921660208401526040830152606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561199d5761199d611974565b92915050565b8082018082111561199d5761199d611974565b6000602082840312156119c857600080fd5b5051919050565b6000600182016119e1576119e1611974565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600080600060608486031215611a4157600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6c57600080fd5b815161193e816116de565b805180151581146115cb57600080fd5b600080600080600080600060e0888a031215611aa257600080fd5b8751611aad816116de565b9650611abb60208901611a77565b955060408801519450606088015193506080880151925060a08801519150611ae560c08901611a77565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082611b2e57611b2e611b09565b500690565b808202811582820484141761199d5761199d611974565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600081611b9b57611b9b611974565b506000190190565b60006020808385031215611bb657600080fd5b825167ffffffffffffffff80821115611bce57600080fd5b818501915085601f830112611be257600080fd5b815181811115611bf457611bf46117c1565b8060051b9150611c058483016117d7565b8181529183018401918481019088841115611c1f57600080fd5b938501935b83851015611c495784519250611c39836116de565b8282529385019390850190611c24565b98975050505050505050565b600082611c6457611c64611b09565b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ad730503f148b4366222925bfe4e30ff5a202de5c73d4348d420aa88ac16694364736f6c63430008120033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018f5760003560e01c80635d2d7846116100e4578063c057eca711610092578063c057eca7146102ff578063c157261814610308578063ccbac9f514610311578063d09f392d1461031a578063d605787b1461032d578063dd5e5cb514610340578063f2f4eb2614610353578063f6b4d82d1461036657600080fd5b80635d2d7846146102985780637dc38f14146102ab578063823cfd70146102b4578063b1c9fe6e146102c7578063b4a61608146102db578063b5d69e99146102e3578063b888adfa146102f657600080fd5b806335975f4a1161014157806335975f4a1461021057806341334e2e1461022357806345988e2c14610243578063477a655c146102565780634c70a0d6146102695780634dbbebbc1461027c57806356acb0501461028f57600080fd5b806303432744146101945780630b274f2e146101b05780630b51806d146101ba5780630c340a24146101c25780630e083ec9146101ed5780631b92bbbe146101f657806321ea9b3f146101ff575b600080fd5b61019d60065481565b6040519081526020015b60405180910390f35b6101b86103c0565b005b61019d600681565b6000546101d5906001600160a01b031681565b6040516001600160a01b0390911681526020016101a7565b61019d600a5481565b61019d60035481565b6101b861020d3660046116b0565b50565b6101b861021e3660046116b0565b610798565b6102366102313660046116f3565b610937565b6040516101a7919061176d565b6101b8610251366004611780565b610ae5565b6101b8610264366004611808565b610c5e565b6101d56102773660046118a7565b610d55565b6101b861028a3660046118d3565b610f05565b61019d600b5481565b6101b86102a63660046118ff565b610fee565b61019d60095481565b6101b86102c23660046116b0565b611031565b60015461023690600160a01b900460ff1681565b61019d600481565b6101b86102f1366004611921565b611060565b61019d60045481565b61019d60025481565b61019d60055481565b61019d60085481565b6101b86103283660046118ff565b6111af565b6007546101d5906001600160a01b031681565b6101b861034e3660046116b0565b6111e9565b6001546101d5906001600160a01b031681565b6103b06103743660046116b0565b600d602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919084565b6040516101a79493929190611945565b6000600154600160a01b900460ff1660028111156103e0576103e0611739565b03610553576002546004546103f5904261198a565b101561045d5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116104bf5760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b6064820152608401610454565b6007546009546001600160a01b0390911690637363ae1f906104e190436119a3565b6040518263ffffffff1660e01b81526004016104ff91815260200190565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b021790555061074d565b60018054600160a01b900460ff16600281111561057257610572611739565b0361066a576007546009546005546001600160a01b03909216916313cf90549161059b916119a3565b6040518263ffffffff1660e01b81526004016105b991815260200190565b6020604051808303816000875af11580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc91906119b6565b60088190556000036106505760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f742072656164792079657400006044820152606401610454565b600180546002919060ff60a01b1916600160a01b83610549565b6002600154600160a01b900460ff16600281111561068a5761068a611739565b0361074d5760065415806106ac57506003546004546106a9904261198a565b10155b61073f5760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a401610454565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b939161078e91600160a01b90910460ff169061176d565b60405180910390a1565b6000600154600160a01b900460ff1660028111156107b8576107b8611739565b146108055760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e00000000006044820152606401610454565b6000600a54600183600b5461081a91906119a3565b610824919061198a565b1161082f578161084a565b600b54600a5461083f919061198a565b61084a9060016119a3565b9050600081600b5461085c91906119a3565b600b549091505b8181101561092f576000818152600d602052604090819020600180548254918301546002840154945163f56f072560e01b815293946001600160a01b039283169463f56f0725946108cd94811693600160a01b9091046001600160601b0316929091600401611945565b600060405180830381600087803b1580156108e757600080fd5b505af11580156108fb573d6000803e3d6000fd5b5050506000838152600d60205260408120818155600181018290556002015550819050610927816119cf565b915050610863565b50600b555050565b6001546000906001600160a01b031633146109645760405162461bcd60e51b8152600401610454906119e8565b600154604051631a383be960e31b81526001600160a01b0387811660048301526001600160601b0387166024830152600092839291169063d1c1df4890604401606060405180830381865afa1580156109c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e59190611a2c565b92505091508160001480156109fb575060048110155b15610a0b57600292505050610add565b6000600154600160a01b900460ff166002811115610a2b57610a2b611739565b14610ad6576040518060800160405280886001600160a01b03168152602001876001600160601b0316815260200186815260200185815250600d6000600a60008154610a76906119cf565b9182905550815260208082019290925260409081016000208351928401516001600160601b0316600160a01b026001600160a01b039093169290921782558201516001808301919091556060909201516002909101559250610add915050565b6000925050505b949350505050565b6001546001600160a01b03163314610b0f5760405162461bcd60e51b8152600401610454906119e8565b6000610b1b8484611218565b90506000835b81610c5657610b3a6001600160601b0382168585611260565b600160009054906101000a90046001600160a01b03166001600160a01b03166334d5fb316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611a5a565b6001600160601b0316816001600160601b031603610bd25760019150610b21565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015610c23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c479190611a87565b50949550610b21945050505050565b505050505050565b6001546001600160a01b03163314610c885760405162461bcd60e51b8152600401610454906119e8565b6000828152600c6020526040812090610ca0836115b4565b825490915015610ce95760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b6044820152606401610454565b60018111610d395760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e00000000006044820152606401610454565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610d7757610d77611739565b14610db35760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b6044820152606401610454565b6000848152600c602052604081206002810180549192918291908290610ddb57610ddb611af3565b90600052602060002001546008548787604051602001610e0e939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c610e319190611b1f565b90505b60028301548354610e46908490611b33565b610e519060016119a3565b1015610ee05760015b83548111610eda57600081848660000154610e759190611b33565b610e7f91906119a3565b90506000856002018281548110610e9857610e98611af3565b90600052602060002001549050808410610ebd57610eb6818561198a565b9350610ec5565b509250610eda565b50508080610ed2906119cf565b915050610e5a565b50610e34565b6000828152600484016020526040902054610efa906115d0565b979650505050505050565b6000546001600160a01b03163314610f2f5760405162461bcd60e51b815260040161045490611b4a565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff166002811115610f6e57610f6e611739565b03610fea576007546009546001600160a01b0390911690637363ae1f90610f9590436119a3565b6040518263ffffffff1660e01b8152600401610fb391815260200190565b600060405180830381600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b50504360055550505b5050565b6001546001600160a01b031633146110185760405162461bcd60e51b8152600401610454906119e8565b6006805490600061102883611b8c565b91905055505050565b6000546001600160a01b0316331461105b5760405162461bcd60e51b815260040161045490611b4a565b600255565b6001546001600160a01b0316331461108a5760405162461bcd60e51b8152600401610454906119e8565b600154604051632a1fc51b60e11b81526001600160a01b038381166004830152600092169063543f8a3690602401600060405180830381865afa1580156110d5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110fd9190810190611ba3565b80519091505b80156111aa57600180546001600160a01b03169063f56f0725908590859061112b908661198a565b8151811061113b5761113b611af3565b60200260200101516000806040518563ffffffff1660e01b81526004016111659493929190611945565b600060405180830381600087803b15801561117f57600080fd5b505af1158015611193573d6000803e3d6000fd5b5050505080806111a290611b8c565b915050611103565b505050565b6001546001600160a01b031633146111d95760405162461bcd60e51b8152600401610454906119e8565b60068054906000611028836119cf565b6000546001600160a01b031633146112135760405162461bcd60e51b815260040161045490611b4a565b600355565b600060405160005b601481101561123b578481600c011a81830153600101611220565b5060145b60208110156112575783811a8183015360010161123f565b50519392505050565b6000838152600c6020908152604080832084845260038101909252822054909181900361142d57831561142857600182015460000361137b5750600281018054600180820183556000928352602090922081018590559081148015906112da575081546112ce60018361198a565b6112d89190611b1f565b155b156113765781546000906112ee9083611c55565b600081815260048501602052604081205491925061130d8460016119a3565b90508460020185600201848154811061132857611328611af3565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6113f6565b60018083018054909161138d9161198a565b8154811061139d5761139d611af3565b90600052602060002001549050816001018054806113bd576113bd611c69565b60019003818190600052602060002001600090559055838260020182815481106113e9576113e9611af3565b6000918252602090912001555b6000838152600383016020908152604080832084905583835260048501909152902083905561142885826001876115fb565b6115ad565b836000036114cb57600082600201828154811061144c5761144c611af3565b90600052602060002001549050600083600201838154811061147057611470611af3565b60009182526020808320909101929092556001808601805491820181558252828220018490558581526003850182526040808220829055848252600486019092529081208190556114c59087908490846115fb565b506115ad565b8160020181815481106114e0576114e0611af3565b906000526020600020015484146115ad5760008483600201838154811061150957611509611af3565b90600052602060002001541115905060008161154f578584600201848154811061153557611535611af3565b906000526020600020015461154a919061198a565b61157a565b83600201838154811061156457611564611af3565b90600052602060002001548661157a919061198a565b90508584600201848154811061159257611592611af3565b6000918252602090912001556115aa878484846115fb565b50505b5050505050565b600060208251106115c757506020015190565b5060065b919050565b600060405160005b60148110156115f35783811a81600c840101536001016115d8565b505192915050565b6000848152600c60205260409020835b8015610c5657815461161e60018361198a565b6116289190611c55565b90508361165f578282600201828154811061164557611645611af3565b906000526020600020015461165a919061198a565b61168a565b8282600201828154811061167557611675611af3565b906000526020600020015461168a91906119a3565b82600201828154811061169f5761169f611af3565b60009182526020909120015561160b565b6000602082840312156116c257600080fd5b5035919050565b6001600160a01b038116811461020d57600080fd5b6001600160601b038116811461020d57600080fd5b6000806000806080858703121561170957600080fd5b8435611714816116c9565b93506020850135611724816116de565b93969395505050506040820135916060013590565b634e487b7160e01b600052602160045260246000fd5b6003811061020d57634e487b7160e01b600052602160045260246000fd5b6020810161177a8361174f565b91905290565b60008060006060848603121561179557600080fd5b83356117a0816116c9565b925060208401356117b0816116de565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611800576118006117c1565b604052919050565b6000806040838503121561181b57600080fd5b8235915060208084013567ffffffffffffffff8082111561183b57600080fd5b818601915086601f83011261184f57600080fd5b813581811115611861576118616117c1565b611873601f8201601f191685016117d7565b9150808252878482850101111561188957600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806000606084860312156118bc57600080fd5b505081359360208301359350604090920135919050565b600080604083850312156118e657600080fd5b82356118f1816116c9565b946020939093013593505050565b6000806040838503121561191257600080fd5b50508035926020909101359150565b60006020828403121561193357600080fd5b813561193e816116c9565b9392505050565b6001600160a01b039490941684526001600160601b039290921660208401526040830152606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561199d5761199d611974565b92915050565b8082018082111561199d5761199d611974565b6000602082840312156119c857600080fd5b5051919050565b6000600182016119e1576119e1611974565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600080600060608486031215611a4157600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6c57600080fd5b815161193e816116de565b805180151581146115cb57600080fd5b600080600080600080600060e0888a031215611aa257600080fd5b8751611aad816116de565b9650611abb60208901611a77565b955060408801519450606088015193506080880151925060a08801519150611ae560c08901611a77565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082611b2e57611b2e611b09565b500690565b808202811582820484141761199d5761199d611974565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600081611b9b57611b9b611974565b506000190190565b60006020808385031215611bb657600080fd5b825167ffffffffffffffff80821115611bce57600080fd5b818501915085601f830112611be257600080fd5b815181811115611bf457611bf46117c1565b8060051b9150611c058483016117d7565b8181529183018401918481019088841115611c1f57600080fd5b938501935b83851015611c495784519250611c39836116de565b8282529385019390850190611c24565b98975050505050505050565b600082611c6457611c64611b09565b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ad730503f148b4366222925bfe4e30ff5a202de5c73d4348d420aa88ac16694364736f6c63430008120033", + "numDeployments": 3, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"penalty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_penalty\",\"type\":\"uint256\"}],\"name\":\"preStakeHook\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.preStakeHookResult\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_core\":\"The KlerosCore.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_voteID\":\"ID of the voter.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256)\":{\"details\":\"Sets the value for a particular court and its parent courts.\",\"params\":{\"_account\":\"Address of the juror. `O(log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\",\"_courtID\":\"ID of the court.\",\"_value\":\"The new value.\"}}},\"title\":\"SortitionModule\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModule.sol\":\"SortitionModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"../libraries/SafeERC20.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n mapping(uint96 => uint256) stakedPnk; // The amount of PNKs the juror has staked in the court in the form `stakedPnk[courtID]`.\\n mapping(uint96 => uint256) lockedPnk; // The amount of PNKs the juror has locked in the court in the form `lockedPnk[courtID]`.\\n }\\n\\n struct DisputeKitNode {\\n uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root.\\n uint256[] children; // List of child dispute kits.\\n IDisputeKit disputeKit; // The dispute kit implementation.\\n uint256 depthLevel; // How far this DK is from the root. 0 for root DK.\\n bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n // TODO: interactions with jurorProsecutionModule.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID.\\n Dispute[] public disputes; // The disputes.\\n mapping(address => Juror) internal jurors; // The jurors.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount, uint256 _penalty);\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(\\n uint256 indexed _disputeKitID,\\n IDisputeKit indexed _disputeKitAddress,\\n uint256 indexed _parent\\n );\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n /// @dev Constructor.\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent.\\n disputeKitNodes.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: NULL_DISPUTE_KIT,\\n children: new uint256[](0),\\n disputeKit: _disputeKit,\\n depthLevel: 0,\\n disabled: false\\n })\\n );\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit, NULL_DISPUTE_KIT);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created.\\n /// Note that the root DK must be supported by the general court.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor {\\n uint256 disputeKitID = disputeKitNodes.length;\\n if (_parent >= disputeKitID) revert InvalidDisputKitParent();\\n uint256 depthLevel;\\n if (_parent != NULL_DISPUTE_KIT) {\\n depthLevel = disputeKitNodes[_parent].depthLevel + 1;\\n // It should be always possible to reach the root from the leaf with the defined number of search iterations.\\n if (depthLevel >= SEARCH_ITERATIONS) revert DepthLevelMax();\\n }\\n disputeKitNodes.push(\\n DisputeKitNode({\\n parent: _parent,\\n children: new uint256[](0),\\n disputeKit: _disputeKitAddress,\\n depthLevel: depthLevel,\\n disabled: false\\n })\\n );\\n\\n disputeKitNodes[_parent].children.push(disputeKitID);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent);\\n if (_parent == NULL_DISPUTE_KIT) {\\n // A new dispute kit tree root should always be supported by the General court.\\n _enableDisputeKit(GENERAL_COURT, disputeKitID, true);\\n }\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKitNodes.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n if (_courtID != GENERAL_COURT && courts[courts[_courtID].parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < courts[_courtID].children.length; i++) {\\n if (courts[courts[_courtID].children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n courts[_courtID].minStake = _minStake;\\n courts[_courtID].hiddenVotes = _hiddenVotes;\\n courts[_courtID].alpha = _alpha;\\n courts[_courtID].feeForJuror = _feeForJuror;\\n courts[_courtID].jurorsForCourtJump = _jurorsForCourtJump;\\n courts[_courtID].timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKitNodes.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n if (_courtID == GENERAL_COURT && disputeKitNodes[_disputeKitIDs[i]].parent == NULL_DISPUTE_KIT) {\\n revert CannotDisableRootDKInGeneral();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n CurrencyRate storage rate = currencyRates[_feeToken];\\n rate.rateInEth = _rateInEth;\\n rate.rateDecimals = _rateDecimals;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n function setStake(uint96 _courtID, uint256 _stake) external {\\n if (!_setStakeForAccount(msg.sender, _courtID, _stake, 0)) revert StakingFailed();\\n }\\n\\n function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _stake, uint256 _penalty) external {\\n if (msg.sender != address(sortitionModule)) revert WrongCaller();\\n _setStakeForAccount(_account, _courtID, _stake, _penalty);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n require(_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount), \\\"Transfer failed\\\");\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit;\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= round.nbVotes ? startIndex + _iterations : round.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n jurors[drawnAddress].lockedPnk[dispute.courtID] += round.pnkAtStakePerJuror;\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n }\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKitNodes[round.disputeKitID].disputeKit)) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) {\\n if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n break;\\n } else if (disputeKitNodes[newDisputeKitID].parent != NULL_DISPUTE_KIT) {\\n newDisputeKitID = disputeKitNodes[newDisputeKitID].parent;\\n } else {\\n // DK's parent has 0 index, that means we reached the root DK (0 depth level).\\n // Jump to the next parent court if the current court doesn't support any DK from this tree.\\n // Note that we don't reset newDisputeKitID in this case as, a precaution.\\n newCourtID = courts[newCourtID].parent;\\n }\\n }\\n // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court.\\n // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default.\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n newCourtID = GENERAL_COURT;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n IDisputeKit disputeKit = disputeKitNodes[extraRound.disputeKitID].disputeKit;\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKit.createDispute(_disputeID, _numberOfChoices, _extraData, extraRound.nbVotes);\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n jurors[account].lockedPnk[dispute.courtID] -= penalty;\\n\\n // Apply the penalty to the staked PNKs\\n if (jurors[account].stakedPnk[dispute.courtID] >= courts[dispute.courtID].minStake + penalty) {\\n // The juror still has enough staked PNKs after penalty for this court.\\n uint256 newStake = jurors[account].stakedPnk[dispute.courtID] - penalty;\\n _setStakeForAccount(account, dispute.courtID, newStake, penalty);\\n } else if (jurors[account].stakedPnk[dispute.courtID] != 0) {\\n // The juror does not have enough staked PNKs after penalty for this court, unstake them.\\n _setStakeForAccount(account, dispute.courtID, 0, penalty);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n // TODO Change me\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n jurors[account].lockedPnk[dispute.courtID] -= pnkLocked;\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (jurors[account].stakedPnk[dispute.courtID] == 0) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit;\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round\\n )\\n external\\n view\\n returns (\\n uint256 disputeKitID,\\n uint256 pnkAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 nbVotes,\\n uint256 repartitions,\\n uint256 pnkPenalties,\\n address[] memory drawnJurors,\\n uint256 sumFeeRewardPaid,\\n uint256 sumPnkRewardPaid,\\n IERC20 feeToken\\n )\\n {\\n Round storage round = disputes[_disputeID].rounds[_round];\\n return (\\n round.disputeKitID,\\n round.pnkAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.nbVotes,\\n round.repartitions,\\n round.pnkPenalties,\\n round.drawnJurors,\\n round.sumFeeRewardPaid,\\n round.sumPnkRewardPaid,\\n round.feeToken\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 staked, uint256 locked, uint256 nbCourts) {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedPnk[_courtID];\\n locked = juror.lockedPnk[_courtID];\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets non-primitive properties of a specified dispute kit node.\\n /// @param _disputeKitID The ID of the dispute kit.\\n /// @return children Indexes of children of this DK.\\n function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) {\\n return disputeKitNodes[_disputeKitID].children;\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_courtID];\\n timesPerPeriod = court.timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitNodesLength() external view returns (uint256) {\\n return disputeKitNodes.length;\\n }\\n\\n /// @dev Gets the dispute kit for a specific `_disputeKitID`.\\n /// @param _disputeKitID The ID of the dispute kit.\\n function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) {\\n return disputeKitNodes[_disputeKitID].disputeKit;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n CurrencyRate storage rate = currencyRates[_toToken];\\n return (_amountInEth * 10 ** rate.rateDecimals) / rate.rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _stake The new stake.\\n /// @param _penalty Penalized amount won't be transferred back to juror when the stake is lowered.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function _setStakeForAccount(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) return false;\\n\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = juror.stakedPnk[_courtID];\\n\\n if (_stake != 0) {\\n // Check against locked PNKs in case the min stake was lowered.\\n if (_stake < courts[_courtID].minStake || _stake < juror.lockedPnk[_courtID]) return false;\\n }\\n\\n ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _stake, _penalty);\\n if (result == ISortitionModule.preStakeHookResult.failed) {\\n return false;\\n } else if (result == ISortitionModule.preStakeHookResult.delayed) {\\n emit StakeDelayed(_account, _courtID, _stake, _penalty);\\n return true;\\n }\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (pinakion.safeTransferFrom(_account, address(this), transferredAmount)) {\\n if (currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n if (_stake == 0) {\\n // Keep locked PNKs in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedPnk[_courtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (pinakion.safeTransfer(_account, transferredAmount)) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n } else {\\n return false;\\n }\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!pinakion.safeTransfer(_account, transferredAmount)) {\\n return false;\\n }\\n }\\n }\\n }\\n\\n // Update juror's records.\\n juror.stakedPnk[_courtID] = _stake;\\n\\n sortitionModule.setStake(_account, _courtID, _stake);\\n emit StakeSet(_account, _courtID, _stake);\\n return true;\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableRootDKInGeneral();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error WrongCaller();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error DisputeKitOnly();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n}\\n\",\"keccak256\":\"0xe57e56a2886c61842b0ab35e8e8b54eac1d1213fa002c8f263305b80d3f702bf\",\"license\":\"MIT\"},\"src/arbitration/SortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\n\\n/// @title SortitionModule\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModule is ISortitionModule {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n uint256 penalty; // Penalty value, in case the stake was set during execution.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant DEFAULT_K = 6; // Default number of children per node.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex = 1; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor.\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n constructor(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.penalty\\n );\\n delete delayedStakes[i];\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external override onlyByCore returns (preStakeHookResult) {\\n (uint256 currentStake, , uint256 nbCourts) = core.getJurorBalance(_account, _courtID);\\n if (currentStake == 0 && nbCourts >= MAX_STAKE_PATHS) {\\n // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n return preStakeHookResult.failed;\\n } else {\\n if (phase != Phase.staking) {\\n delayedStakes[++delayedStakeWriteIndex] = DelayedStake({\\n account: _account,\\n courtID: _courtID,\\n stake: _stake,\\n penalty: _penalty\\n });\\n return preStakeHookResult.delayed;\\n }\\n }\\n return preStakeHookResult.ok;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the value for a particular court and its parent courts.\\n /// @param _courtID ID of the court.\\n /// @param _value The new value.\\n /// @param _account Address of the juror.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function setStake(address _account, uint96 _courtID, uint256 _value) external override onlyByCore {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _value, stakePathID);\\n if (currenCourtID == core.GENERAL_COURT()) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID);\\n }\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = core.getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, 0);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _voteID ID of the voter.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _voteID\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 treeIndex = 0;\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _voteID))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7cf6a006b7aaa07754dfc13b75a42912e403ec97a726e102e4963c9691f63425\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7a259401627ba5546d9eb0264275aa1be9762f8a514545ae99d8c356ebf41f4f\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x9001274313a4e7eeda92332bbeeac8972f55e6378874babfaccd56eb283816f0\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Address of the juror.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event Justification(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0xd51cc7a11480d19abbd810733ddd5bf84f998e8b855ef8dd826a4b76a97ddd36\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n enum preStakeHookResult {\\n ok,\\n delayed,\\n failed\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(address _account, uint96 _courtID, uint256 _value) external;\\n\\n function setJurorInactive(address _account) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _voteID) external view returns (address);\\n\\n function preStakeHook(\\n address _account,\\n uint96 _courtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) external returns (preStakeHookResult);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x28911aa78669746f40c4c3bce723db21600a49a74142c0fe378680b1b356d633\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526001600b553480156200001657600080fd5b5060405162001ddf38038062001ddf8339810160408190526200003991620000a9565b600080546001600160a01b03199081166001600160a01b039889161790915560018054821696881696909617909555600293909355600391909155426004556007805490931693169290921790556009556200011a565b6001600160a01b0381168114620000a657600080fd5b50565b60008060008060008060c08789031215620000c357600080fd5b8651620000d08162000090565b6020880151909650620000e38162000090565b8095505060408701519350606087015192506080870151620001058162000090565b8092505060a087015190509295509295509295565b611cb5806200012a6000396000f3fe608060405234801561001057600080fd5b506004361061018f5760003560e01c80635d2d7846116100e4578063c057eca711610092578063c057eca7146102ff578063c157261814610308578063ccbac9f514610311578063d09f392d1461031a578063d605787b1461032d578063dd5e5cb514610340578063f2f4eb2614610353578063f6b4d82d1461036657600080fd5b80635d2d7846146102985780637dc38f14146102ab578063823cfd70146102b4578063b1c9fe6e146102c7578063b4a61608146102db578063b5d69e99146102e3578063b888adfa146102f657600080fd5b806335975f4a1161014157806335975f4a1461021057806341334e2e1461022357806345988e2c14610243578063477a655c146102565780634c70a0d6146102695780634dbbebbc1461027c57806356acb0501461028f57600080fd5b806303432744146101945780630b274f2e146101b05780630b51806d146101ba5780630c340a24146101c25780630e083ec9146101ed5780631b92bbbe146101f657806321ea9b3f146101ff575b600080fd5b61019d60065481565b6040519081526020015b60405180910390f35b6101b86103c0565b005b61019d600681565b6000546101d5906001600160a01b031681565b6040516001600160a01b0390911681526020016101a7565b61019d600a5481565b61019d60035481565b6101b861020d3660046116b0565b50565b6101b861021e3660046116b0565b610798565b6102366102313660046116f3565b610937565b6040516101a7919061176d565b6101b8610251366004611780565b610ae5565b6101b8610264366004611808565b610c5e565b6101d56102773660046118a7565b610d55565b6101b861028a3660046118d3565b610f05565b61019d600b5481565b6101b86102a63660046118ff565b610fee565b61019d60095481565b6101b86102c23660046116b0565b611031565b60015461023690600160a01b900460ff1681565b61019d600481565b6101b86102f1366004611921565b611060565b61019d60045481565b61019d60025481565b61019d60055481565b61019d60085481565b6101b86103283660046118ff565b6111af565b6007546101d5906001600160a01b031681565b6101b861034e3660046116b0565b6111e9565b6001546101d5906001600160a01b031681565b6103b06103743660046116b0565b600d602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919084565b6040516101a79493929190611945565b6000600154600160a01b900460ff1660028111156103e0576103e0611739565b03610553576002546004546103f5904261198a565b101561045d5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116104bf5760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b6064820152608401610454565b6007546009546001600160a01b0390911690637363ae1f906104e190436119a3565b6040518263ffffffff1660e01b81526004016104ff91815260200190565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b021790555061074d565b60018054600160a01b900460ff16600281111561057257610572611739565b0361066a576007546009546005546001600160a01b03909216916313cf90549161059b916119a3565b6040518263ffffffff1660e01b81526004016105b991815260200190565b6020604051808303816000875af11580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc91906119b6565b60088190556000036106505760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f742072656164792079657400006044820152606401610454565b600180546002919060ff60a01b1916600160a01b83610549565b6002600154600160a01b900460ff16600281111561068a5761068a611739565b0361074d5760065415806106ac57506003546004546106a9904261198a565b10155b61073f5760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a401610454565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b939161078e91600160a01b90910460ff169061176d565b60405180910390a1565b6000600154600160a01b900460ff1660028111156107b8576107b8611739565b146108055760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e00000000006044820152606401610454565b6000600a54600183600b5461081a91906119a3565b610824919061198a565b1161082f578161084a565b600b54600a5461083f919061198a565b61084a9060016119a3565b9050600081600b5461085c91906119a3565b600b549091505b8181101561092f576000818152600d602052604090819020600180548254918301546002840154945163f56f072560e01b815293946001600160a01b039283169463f56f0725946108cd94811693600160a01b9091046001600160601b0316929091600401611945565b600060405180830381600087803b1580156108e757600080fd5b505af11580156108fb573d6000803e3d6000fd5b5050506000838152600d60205260408120818155600181018290556002015550819050610927816119cf565b915050610863565b50600b555050565b6001546000906001600160a01b031633146109645760405162461bcd60e51b8152600401610454906119e8565b600154604051631a383be960e31b81526001600160a01b0387811660048301526001600160601b0387166024830152600092839291169063d1c1df4890604401606060405180830381865afa1580156109c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e59190611a2c565b92505091508160001480156109fb575060048110155b15610a0b57600292505050610add565b6000600154600160a01b900460ff166002811115610a2b57610a2b611739565b14610ad6576040518060800160405280886001600160a01b03168152602001876001600160601b0316815260200186815260200185815250600d6000600a60008154610a76906119cf565b9182905550815260208082019290925260409081016000208351928401516001600160601b0316600160a01b026001600160a01b039093169290921782558201516001808301919091556060909201516002909101559250610add915050565b6000925050505b949350505050565b6001546001600160a01b03163314610b0f5760405162461bcd60e51b8152600401610454906119e8565b6000610b1b8484611218565b90506000835b81610c5657610b3a6001600160601b0382168585611260565b600160009054906101000a90046001600160a01b03166001600160a01b03166334d5fb316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611a5a565b6001600160601b0316816001600160601b031603610bd25760019150610b21565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015610c23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c479190611a87565b50949550610b21945050505050565b505050505050565b6001546001600160a01b03163314610c885760405162461bcd60e51b8152600401610454906119e8565b6000828152600c6020526040812090610ca0836115b4565b825490915015610ce95760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b6044820152606401610454565b60018111610d395760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e00000000006044820152606401610454565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610d7757610d77611739565b14610db35760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b6044820152606401610454565b6000848152600c602052604081206002810180549192918291908290610ddb57610ddb611af3565b90600052602060002001546008548787604051602001610e0e939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c610e319190611b1f565b90505b60028301548354610e46908490611b33565b610e519060016119a3565b1015610ee05760015b83548111610eda57600081848660000154610e759190611b33565b610e7f91906119a3565b90506000856002018281548110610e9857610e98611af3565b90600052602060002001549050808410610ebd57610eb6818561198a565b9350610ec5565b509250610eda565b50508080610ed2906119cf565b915050610e5a565b50610e34565b6000828152600484016020526040902054610efa906115d0565b979650505050505050565b6000546001600160a01b03163314610f2f5760405162461bcd60e51b815260040161045490611b4a565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff166002811115610f6e57610f6e611739565b03610fea576007546009546001600160a01b0390911690637363ae1f90610f9590436119a3565b6040518263ffffffff1660e01b8152600401610fb391815260200190565b600060405180830381600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b50504360055550505b5050565b6001546001600160a01b031633146110185760405162461bcd60e51b8152600401610454906119e8565b6006805490600061102883611b8c565b91905055505050565b6000546001600160a01b0316331461105b5760405162461bcd60e51b815260040161045490611b4a565b600255565b6001546001600160a01b0316331461108a5760405162461bcd60e51b8152600401610454906119e8565b600154604051632a1fc51b60e11b81526001600160a01b038381166004830152600092169063543f8a3690602401600060405180830381865afa1580156110d5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110fd9190810190611ba3565b80519091505b80156111aa57600180546001600160a01b03169063f56f0725908590859061112b908661198a565b8151811061113b5761113b611af3565b60200260200101516000806040518563ffffffff1660e01b81526004016111659493929190611945565b600060405180830381600087803b15801561117f57600080fd5b505af1158015611193573d6000803e3d6000fd5b5050505080806111a290611b8c565b915050611103565b505050565b6001546001600160a01b031633146111d95760405162461bcd60e51b8152600401610454906119e8565b60068054906000611028836119cf565b6000546001600160a01b031633146112135760405162461bcd60e51b815260040161045490611b4a565b600355565b600060405160005b601481101561123b578481600c011a81830153600101611220565b5060145b60208110156112575783811a8183015360010161123f565b50519392505050565b6000838152600c6020908152604080832084845260038101909252822054909181900361142d57831561142857600182015460000361137b5750600281018054600180820183556000928352602090922081018590559081148015906112da575081546112ce60018361198a565b6112d89190611b1f565b155b156113765781546000906112ee9083611c55565b600081815260048501602052604081205491925061130d8460016119a3565b90508460020185600201848154811061132857611328611af3565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6113f6565b60018083018054909161138d9161198a565b8154811061139d5761139d611af3565b90600052602060002001549050816001018054806113bd576113bd611c69565b60019003818190600052602060002001600090559055838260020182815481106113e9576113e9611af3565b6000918252602090912001555b6000838152600383016020908152604080832084905583835260048501909152902083905561142885826001876115fb565b6115ad565b836000036114cb57600082600201828154811061144c5761144c611af3565b90600052602060002001549050600083600201838154811061147057611470611af3565b60009182526020808320909101929092556001808601805491820181558252828220018490558581526003850182526040808220829055848252600486019092529081208190556114c59087908490846115fb565b506115ad565b8160020181815481106114e0576114e0611af3565b906000526020600020015484146115ad5760008483600201838154811061150957611509611af3565b90600052602060002001541115905060008161154f578584600201848154811061153557611535611af3565b906000526020600020015461154a919061198a565b61157a565b83600201838154811061156457611564611af3565b90600052602060002001548661157a919061198a565b90508584600201848154811061159257611592611af3565b6000918252602090912001556115aa878484846115fb565b50505b5050505050565b600060208251106115c757506020015190565b5060065b919050565b600060405160005b60148110156115f35783811a81600c840101536001016115d8565b505192915050565b6000848152600c60205260409020835b8015610c5657815461161e60018361198a565b6116289190611c55565b90508361165f578282600201828154811061164557611645611af3565b906000526020600020015461165a919061198a565b61168a565b8282600201828154811061167557611675611af3565b906000526020600020015461168a91906119a3565b82600201828154811061169f5761169f611af3565b60009182526020909120015561160b565b6000602082840312156116c257600080fd5b5035919050565b6001600160a01b038116811461020d57600080fd5b6001600160601b038116811461020d57600080fd5b6000806000806080858703121561170957600080fd5b8435611714816116c9565b93506020850135611724816116de565b93969395505050506040820135916060013590565b634e487b7160e01b600052602160045260246000fd5b6003811061020d57634e487b7160e01b600052602160045260246000fd5b6020810161177a8361174f565b91905290565b60008060006060848603121561179557600080fd5b83356117a0816116c9565b925060208401356117b0816116de565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611800576118006117c1565b604052919050565b6000806040838503121561181b57600080fd5b8235915060208084013567ffffffffffffffff8082111561183b57600080fd5b818601915086601f83011261184f57600080fd5b813581811115611861576118616117c1565b611873601f8201601f191685016117d7565b9150808252878482850101111561188957600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806000606084860312156118bc57600080fd5b505081359360208301359350604090920135919050565b600080604083850312156118e657600080fd5b82356118f1816116c9565b946020939093013593505050565b6000806040838503121561191257600080fd5b50508035926020909101359150565b60006020828403121561193357600080fd5b813561193e816116c9565b9392505050565b6001600160a01b039490941684526001600160601b039290921660208401526040830152606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561199d5761199d611974565b92915050565b8082018082111561199d5761199d611974565b6000602082840312156119c857600080fd5b5051919050565b6000600182016119e1576119e1611974565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600080600060608486031215611a4157600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6c57600080fd5b815161193e816116de565b805180151581146115cb57600080fd5b600080600080600080600060e0888a031215611aa257600080fd5b8751611aad816116de565b9650611abb60208901611a77565b955060408801519450606088015193506080880151925060a08801519150611ae560c08901611a77565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082611b2e57611b2e611b09565b500690565b808202811582820484141761199d5761199d611974565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600081611b9b57611b9b611974565b506000190190565b60006020808385031215611bb657600080fd5b825167ffffffffffffffff80821115611bce57600080fd5b818501915085601f830112611be257600080fd5b815181811115611bf457611bf46117c1565b8060051b9150611c058483016117d7565b8181529183018401918481019088841115611c1f57600080fd5b938501935b83851015611c495784519250611c39836116de565b8282529385019390850190611c24565b98975050505050505050565b600082611c6457611c64611b09565b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220321564f2b444714b30ad203dc138ead38255b626f347ea1f2a2c9ec60dd0ab6f64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018f5760003560e01c80635d2d7846116100e4578063c057eca711610092578063c057eca7146102ff578063c157261814610308578063ccbac9f514610311578063d09f392d1461031a578063d605787b1461032d578063dd5e5cb514610340578063f2f4eb2614610353578063f6b4d82d1461036657600080fd5b80635d2d7846146102985780637dc38f14146102ab578063823cfd70146102b4578063b1c9fe6e146102c7578063b4a61608146102db578063b5d69e99146102e3578063b888adfa146102f657600080fd5b806335975f4a1161014157806335975f4a1461021057806341334e2e1461022357806345988e2c14610243578063477a655c146102565780634c70a0d6146102695780634dbbebbc1461027c57806356acb0501461028f57600080fd5b806303432744146101945780630b274f2e146101b05780630b51806d146101ba5780630c340a24146101c25780630e083ec9146101ed5780631b92bbbe146101f657806321ea9b3f146101ff575b600080fd5b61019d60065481565b6040519081526020015b60405180910390f35b6101b86103c0565b005b61019d600681565b6000546101d5906001600160a01b031681565b6040516001600160a01b0390911681526020016101a7565b61019d600a5481565b61019d60035481565b6101b861020d3660046116b0565b50565b6101b861021e3660046116b0565b610798565b6102366102313660046116f3565b610937565b6040516101a7919061176d565b6101b8610251366004611780565b610ae5565b6101b8610264366004611808565b610c5e565b6101d56102773660046118a7565b610d55565b6101b861028a3660046118d3565b610f05565b61019d600b5481565b6101b86102a63660046118ff565b610fee565b61019d60095481565b6101b86102c23660046116b0565b611031565b60015461023690600160a01b900460ff1681565b61019d600481565b6101b86102f1366004611921565b611060565b61019d60045481565b61019d60025481565b61019d60055481565b61019d60085481565b6101b86103283660046118ff565b6111af565b6007546101d5906001600160a01b031681565b6101b861034e3660046116b0565b6111e9565b6001546101d5906001600160a01b031681565b6103b06103743660046116b0565b600d602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919084565b6040516101a79493929190611945565b6000600154600160a01b900460ff1660028111156103e0576103e0611739565b03610553576002546004546103f5904261198a565b101561045d5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116104bf5760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b6064820152608401610454565b6007546009546001600160a01b0390911690637363ae1f906104e190436119a3565b6040518263ffffffff1660e01b81526004016104ff91815260200190565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b021790555061074d565b60018054600160a01b900460ff16600281111561057257610572611739565b0361066a576007546009546005546001600160a01b03909216916313cf90549161059b916119a3565b6040518263ffffffff1660e01b81526004016105b991815260200190565b6020604051808303816000875af11580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc91906119b6565b60088190556000036106505760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f742072656164792079657400006044820152606401610454565b600180546002919060ff60a01b1916600160a01b83610549565b6002600154600160a01b900460ff16600281111561068a5761068a611739565b0361074d5760065415806106ac57506003546004546106a9904261198a565b10155b61073f5760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a401610454565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b939161078e91600160a01b90910460ff169061176d565b60405180910390a1565b6000600154600160a01b900460ff1660028111156107b8576107b8611739565b146108055760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e00000000006044820152606401610454565b6000600a54600183600b5461081a91906119a3565b610824919061198a565b1161082f578161084a565b600b54600a5461083f919061198a565b61084a9060016119a3565b9050600081600b5461085c91906119a3565b600b549091505b8181101561092f576000818152600d602052604090819020600180548254918301546002840154945163f56f072560e01b815293946001600160a01b039283169463f56f0725946108cd94811693600160a01b9091046001600160601b0316929091600401611945565b600060405180830381600087803b1580156108e757600080fd5b505af11580156108fb573d6000803e3d6000fd5b5050506000838152600d60205260408120818155600181018290556002015550819050610927816119cf565b915050610863565b50600b555050565b6001546000906001600160a01b031633146109645760405162461bcd60e51b8152600401610454906119e8565b600154604051631a383be960e31b81526001600160a01b0387811660048301526001600160601b0387166024830152600092839291169063d1c1df4890604401606060405180830381865afa1580156109c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e59190611a2c565b92505091508160001480156109fb575060048110155b15610a0b57600292505050610add565b6000600154600160a01b900460ff166002811115610a2b57610a2b611739565b14610ad6576040518060800160405280886001600160a01b03168152602001876001600160601b0316815260200186815260200185815250600d6000600a60008154610a76906119cf565b9182905550815260208082019290925260409081016000208351928401516001600160601b0316600160a01b026001600160a01b039093169290921782558201516001808301919091556060909201516002909101559250610add915050565b6000925050505b949350505050565b6001546001600160a01b03163314610b0f5760405162461bcd60e51b8152600401610454906119e8565b6000610b1b8484611218565b90506000835b81610c5657610b3a6001600160601b0382168585611260565b600160009054906101000a90046001600160a01b03166001600160a01b03166334d5fb316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611a5a565b6001600160601b0316816001600160601b031603610bd25760019150610b21565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015610c23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c479190611a87565b50949550610b21945050505050565b505050505050565b6001546001600160a01b03163314610c885760405162461bcd60e51b8152600401610454906119e8565b6000828152600c6020526040812090610ca0836115b4565b825490915015610ce95760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b6044820152606401610454565b60018111610d395760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e00000000006044820152606401610454565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610d7757610d77611739565b14610db35760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b6044820152606401610454565b6000848152600c602052604081206002810180549192918291908290610ddb57610ddb611af3565b90600052602060002001546008548787604051602001610e0e939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c610e319190611b1f565b90505b60028301548354610e46908490611b33565b610e519060016119a3565b1015610ee05760015b83548111610eda57600081848660000154610e759190611b33565b610e7f91906119a3565b90506000856002018281548110610e9857610e98611af3565b90600052602060002001549050808410610ebd57610eb6818561198a565b9350610ec5565b509250610eda565b50508080610ed2906119cf565b915050610e5a565b50610e34565b6000828152600484016020526040902054610efa906115d0565b979650505050505050565b6000546001600160a01b03163314610f2f5760405162461bcd60e51b815260040161045490611b4a565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff166002811115610f6e57610f6e611739565b03610fea576007546009546001600160a01b0390911690637363ae1f90610f9590436119a3565b6040518263ffffffff1660e01b8152600401610fb391815260200190565b600060405180830381600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b50504360055550505b5050565b6001546001600160a01b031633146110185760405162461bcd60e51b8152600401610454906119e8565b6006805490600061102883611b8c565b91905055505050565b6000546001600160a01b0316331461105b5760405162461bcd60e51b815260040161045490611b4a565b600255565b6001546001600160a01b0316331461108a5760405162461bcd60e51b8152600401610454906119e8565b600154604051632a1fc51b60e11b81526001600160a01b038381166004830152600092169063543f8a3690602401600060405180830381865afa1580156110d5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110fd9190810190611ba3565b80519091505b80156111aa57600180546001600160a01b03169063f56f0725908590859061112b908661198a565b8151811061113b5761113b611af3565b60200260200101516000806040518563ffffffff1660e01b81526004016111659493929190611945565b600060405180830381600087803b15801561117f57600080fd5b505af1158015611193573d6000803e3d6000fd5b5050505080806111a290611b8c565b915050611103565b505050565b6001546001600160a01b031633146111d95760405162461bcd60e51b8152600401610454906119e8565b60068054906000611028836119cf565b6000546001600160a01b031633146112135760405162461bcd60e51b815260040161045490611b4a565b600355565b600060405160005b601481101561123b578481600c011a81830153600101611220565b5060145b60208110156112575783811a8183015360010161123f565b50519392505050565b6000838152600c6020908152604080832084845260038101909252822054909181900361142d57831561142857600182015460000361137b5750600281018054600180820183556000928352602090922081018590559081148015906112da575081546112ce60018361198a565b6112d89190611b1f565b155b156113765781546000906112ee9083611c55565b600081815260048501602052604081205491925061130d8460016119a3565b90508460020185600201848154811061132857611328611af3565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6113f6565b60018083018054909161138d9161198a565b8154811061139d5761139d611af3565b90600052602060002001549050816001018054806113bd576113bd611c69565b60019003818190600052602060002001600090559055838260020182815481106113e9576113e9611af3565b6000918252602090912001555b6000838152600383016020908152604080832084905583835260048501909152902083905561142885826001876115fb565b6115ad565b836000036114cb57600082600201828154811061144c5761144c611af3565b90600052602060002001549050600083600201838154811061147057611470611af3565b60009182526020808320909101929092556001808601805491820181558252828220018490558581526003850182526040808220829055848252600486019092529081208190556114c59087908490846115fb565b506115ad565b8160020181815481106114e0576114e0611af3565b906000526020600020015484146115ad5760008483600201838154811061150957611509611af3565b90600052602060002001541115905060008161154f578584600201848154811061153557611535611af3565b906000526020600020015461154a919061198a565b61157a565b83600201838154811061156457611564611af3565b90600052602060002001548661157a919061198a565b90508584600201848154811061159257611592611af3565b6000918252602090912001556115aa878484846115fb565b50505b5050505050565b600060208251106115c757506020015190565b5060065b919050565b600060405160005b60148110156115f35783811a81600c840101536001016115d8565b505192915050565b6000848152600c60205260409020835b8015610c5657815461161e60018361198a565b6116289190611c55565b90508361165f578282600201828154811061164557611645611af3565b906000526020600020015461165a919061198a565b61168a565b8282600201828154811061167557611675611af3565b906000526020600020015461168a91906119a3565b82600201828154811061169f5761169f611af3565b60009182526020909120015561160b565b6000602082840312156116c257600080fd5b5035919050565b6001600160a01b038116811461020d57600080fd5b6001600160601b038116811461020d57600080fd5b6000806000806080858703121561170957600080fd5b8435611714816116c9565b93506020850135611724816116de565b93969395505050506040820135916060013590565b634e487b7160e01b600052602160045260246000fd5b6003811061020d57634e487b7160e01b600052602160045260246000fd5b6020810161177a8361174f565b91905290565b60008060006060848603121561179557600080fd5b83356117a0816116c9565b925060208401356117b0816116de565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611800576118006117c1565b604052919050565b6000806040838503121561181b57600080fd5b8235915060208084013567ffffffffffffffff8082111561183b57600080fd5b818601915086601f83011261184f57600080fd5b813581811115611861576118616117c1565b611873601f8201601f191685016117d7565b9150808252878482850101111561188957600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806000606084860312156118bc57600080fd5b505081359360208301359350604090920135919050565b600080604083850312156118e657600080fd5b82356118f1816116c9565b946020939093013593505050565b6000806040838503121561191257600080fd5b50508035926020909101359150565b60006020828403121561193357600080fd5b813561193e816116c9565b9392505050565b6001600160a01b039490941684526001600160601b039290921660208401526040830152606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561199d5761199d611974565b92915050565b8082018082111561199d5761199d611974565b6000602082840312156119c857600080fd5b5051919050565b6000600182016119e1576119e1611974565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600080600060608486031215611a4157600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6c57600080fd5b815161193e816116de565b805180151581146115cb57600080fd5b600080600080600080600060e0888a031215611aa257600080fd5b8751611aad816116de565b9650611abb60208901611a77565b955060408801519450606088015193506080880151925060a08801519150611ae560c08901611a77565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082611b2e57611b2e611b09565b500690565b808202811582820484141761199d5761199d611974565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600081611b9b57611b9b611974565b506000190190565b60006020808385031215611bb657600080fd5b825167ffffffffffffffff80821115611bce57600080fd5b818501915085601f830112611be257600080fd5b815181811115611bf457611bf46117c1565b8060051b9150611c058483016117d7565b8181529183018401918481019088841115611c1f57600080fd5b938501935b83851015611c495784519250611c39836116de565b8282529385019390850190611c24565b98975050505050505050565b600082611c6457611c64611b09565b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220321564f2b444714b30ad203dc138ead38255b626f347ea1f2a2c9ec60dd0ab6f64736f6c63430008120033", "devdoc": { "details": "A factory of trees that keeps track of staked values for sortition.", "kind": "dev", @@ -628,7 +628,7 @@ "storageLayout": { "storage": [ { - "astId": 5568, + "astId": 8096, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "governor", "offset": 0, @@ -636,23 +636,23 @@ "type": "t_address" }, { - "astId": 5571, + "astId": 8099, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "core", "offset": 0, "slot": "1", - "type": "t_contract(KlerosCore)5505" + "type": "t_contract(KlerosCore)6601" }, { - "astId": 5574, + "astId": 8102, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "phase", "offset": 20, "slot": "1", - "type": "t_enum(Phase)1741" + "type": "t_enum(Phase)15309" }, { - "astId": 5576, + "astId": 8104, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "minStakingTime", "offset": 0, @@ -660,7 +660,7 @@ "type": "t_uint256" }, { - "astId": 5578, + "astId": 8106, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "maxDrawingTime", "offset": 0, @@ -668,7 +668,7 @@ "type": "t_uint256" }, { - "astId": 5580, + "astId": 8108, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "lastPhaseChange", "offset": 0, @@ -676,7 +676,7 @@ "type": "t_uint256" }, { - "astId": 5582, + "astId": 8110, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "randomNumberRequestBlock", "offset": 0, @@ -684,7 +684,7 @@ "type": "t_uint256" }, { - "astId": 5584, + "astId": 8112, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "disputesWithoutJurors", "offset": 0, @@ -692,15 +692,15 @@ "type": "t_uint256" }, { - "astId": 5587, + "astId": 8115, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "rng", "offset": 0, "slot": "7", - "type": "t_contract(RNG)14743" + "type": "t_contract(RNG)21373" }, { - "astId": 5589, + "astId": 8117, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "randomNumber", "offset": 0, @@ -708,7 +708,7 @@ "type": "t_uint256" }, { - "astId": 5591, + "astId": 8119, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "rngLookahead", "offset": 0, @@ -716,7 +716,7 @@ "type": "t_uint256" }, { - "astId": 5593, + "astId": 8121, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "delayedStakeWriteIndex", "offset": 0, @@ -724,7 +724,7 @@ "type": "t_uint256" }, { - "astId": 5596, + "astId": 8124, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "delayedStakeReadIndex", "offset": 0, @@ -732,20 +732,20 @@ "type": "t_uint256" }, { - "astId": 5601, + "astId": 8129, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "sortitionSumTrees", "offset": 0, "slot": "12", - "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)5551_storage)" + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)8079_storage)" }, { - "astId": 5606, + "astId": 8134, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "delayedStakes", "offset": 0, "slot": "13", - "type": "t_mapping(t_uint256,t_struct(DelayedStake)5560_storage)" + "type": "t_mapping(t_uint256,t_struct(DelayedStake)8088_storage)" } ], "types": { @@ -765,27 +765,27 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(KlerosCore)5505": { + "t_contract(KlerosCore)6601": { "encoding": "inplace", "label": "contract KlerosCore", "numberOfBytes": "20" }, - "t_contract(RNG)14743": { + "t_contract(RNG)21373": { "encoding": "inplace", "label": "contract RNG", "numberOfBytes": "20" }, - "t_enum(Phase)1741": { + "t_enum(Phase)15309": { "encoding": "inplace", "label": "enum ISortitionModule.Phase", "numberOfBytes": "1" }, - "t_mapping(t_bytes32,t_struct(SortitionSumTree)5551_storage)": { + "t_mapping(t_bytes32,t_struct(SortitionSumTree)8079_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct SortitionModule.SortitionSumTree)", "numberOfBytes": "32", - "value": "t_struct(SortitionSumTree)5551_storage" + "value": "t_struct(SortitionSumTree)8079_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -801,19 +801,19 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_uint256,t_struct(DelayedStake)5560_storage)": { + "t_mapping(t_uint256,t_struct(DelayedStake)8088_storage)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => struct SortitionModule.DelayedStake)", "numberOfBytes": "32", - "value": "t_struct(DelayedStake)5560_storage" + "value": "t_struct(DelayedStake)8088_storage" }, - "t_struct(DelayedStake)5560_storage": { + "t_struct(DelayedStake)8088_storage": { "encoding": "inplace", "label": "struct SortitionModule.DelayedStake", "members": [ { - "astId": 5553, + "astId": 8081, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "account", "offset": 0, @@ -821,7 +821,7 @@ "type": "t_address" }, { - "astId": 5555, + "astId": 8083, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "courtID", "offset": 20, @@ -829,7 +829,7 @@ "type": "t_uint96" }, { - "astId": 5557, + "astId": 8085, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "stake", "offset": 0, @@ -837,7 +837,7 @@ "type": "t_uint256" }, { - "astId": 5559, + "astId": 8087, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "penalty", "offset": 0, @@ -847,12 +847,12 @@ ], "numberOfBytes": "96" }, - "t_struct(SortitionSumTree)5551_storage": { + "t_struct(SortitionSumTree)8079_storage": { "encoding": "inplace", "label": "struct SortitionModule.SortitionSumTree", "members": [ { - "astId": 5536, + "astId": 8064, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "K", "offset": 0, @@ -860,7 +860,7 @@ "type": "t_uint256" }, { - "astId": 5539, + "astId": 8067, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "stack", "offset": 0, @@ -868,7 +868,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 5542, + "astId": 8070, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "nodes", "offset": 0, @@ -876,7 +876,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 5546, + "astId": 8074, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "IDsToNodeIndexes", "offset": 0, @@ -884,7 +884,7 @@ "type": "t_mapping(t_bytes32,t_uint256)" }, { - "astId": 5550, + "astId": 8078, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "nodeIndexesToIDs", "offset": 0, diff --git a/contracts/deployments/arbitrumGoerli/WETH.json b/contracts/deployments/arbitrumGoerli/WETH.json new file mode 100644 index 000000000..1c2387344 --- /dev/null +++ b/contracts/deployments/arbitrumGoerli/WETH.json @@ -0,0 +1,458 @@ +{ + "address": "0xddE1b84E43505432Fdf5F810ebB9373dD37e9230", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xc0fb71dd0d40302b09e288bf543d404775ec72a9a6e665d9a4960873121221f6", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0xddE1b84E43505432Fdf5F810ebB9373dD37e9230", + "transactionIndex": 1, + "gasUsed": "621542", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000200000000010000000000000000000000000000000000000004000000000000000000000000000008000000000000000000000000000000000001000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4516a75e16cb97febe76fa4c3b2666846f615e0f567128f24f881ae3e13c7ecf", + "transactionHash": "0xc0fb71dd0d40302b09e288bf543d404775ec72a9a6e665d9a4960873121221f6", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 27808404, + "transactionHash": "0xc0fb71dd0d40302b09e288bf543d404775ec72a9a6e665d9a4960873121221f6", + "address": "0xddE1b84E43505432Fdf5F810ebB9373dD37e9230", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f50e77f2a2b6138d16c6c7511562e5c33c4b15a3" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0x4516a75e16cb97febe76fa4c3b2666846f615e0f567128f24f881ae3e13c7ecf" + } + ], + "blockNumber": 27808404, + "cumulativeGasUsed": "621542", + "status": 1, + "byzantium": true + }, + "args": [ + "WETH", + "WETH" + ], + "numDeployments": 1, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC20.sol\":\"TestERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"src/token/TestERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestERC20 is ERC20 {\\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x9f67e6b63ca87e6c98b2986364ce16a747ce4098e9146fffb17ea13863c0b7e4\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000c5838038062000c5883398101604081905262000034916200020a565b8181600362000044838262000302565b50600462000053828262000302565b505050620000723369d3c21bcecceda10000006200007a60201b60201c565b5050620003f6565b6001600160a01b038216620000d55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e99190620003ce565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016d57600080fd5b81516001600160401b03808211156200018a576200018a62000145565b604051601f8301601f19908116603f01168101908282118183101715620001b557620001b562000145565b81604052838152602092508683858801011115620001d257600080fd5b600091505b83821015620001f65785820183015181830184015290820190620001d7565b600093810190920192909252949350505050565b600080604083850312156200021e57600080fd5b82516001600160401b03808211156200023657600080fd5b62000244868387016200015b565b935060208501519150808211156200025b57600080fd5b506200026a858286016200015b565b9150509250929050565b600181811c908216806200028957607f821691505b602082108103620002aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c81016020861015620002d95750805b601f850160051c820191505b81811015620002fa57828155600101620002e5565b505050505050565b81516001600160401b038111156200031e576200031e62000145565b62000336816200032f845462000274565b84620002b0565b602080601f8311600181146200036e5760008415620003555750858301515b600019600386901b1c1916600185901b178555620002fa565b600085815260208120601f198616915b828110156200039f578886015182559484019460019091019084016200037e565b5085821015620003be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003f057634e487b7160e01b600052601160045260246000fd5b92915050565b61085280620004066000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea2646970667358221220c4d9cff0468928ae77b92a978647e277561af91e75ca535aba25c3cd49cba40564736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea2646970667358221220c4d9cff0468928ae77b92a978647e277561af91e75ca535aba25c3cd49cba40564736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 280, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 286, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 288, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 290, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 292, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/chiado/ArbitrableExample.json b/contracts/deployments/chiado/ArbitrableExample.json index 1b0af8142..dd455cf66 100644 --- a/contracts/deployments/chiado/ArbitrableExample.json +++ b/contracts/deployments/chiado/ArbitrableExample.json @@ -1,25 +1,25 @@ { - "address": "0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b", + "address": "0x6BC234359c2Bc212B81A5cF2dfE504940e98d4cC", "abi": [ { "inputs": [ { - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" }, - { - "internalType": "uint256", - "name": "_metaEvidenceID", - "type": "uint256" - }, { "internalType": "string", - "name": "_metaEvidence", + "name": "_templateData", "type": "string" }, { - "internalType": "contract ERC20", + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", "name": "_weth", "type": "address" } @@ -32,30 +32,49 @@ "inputs": [ { "indexed": true, - "internalType": "contract IArbitrator", + "internalType": "string", + "name": "_action", + "type": "string" + } + ], + "name": "Action", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" }, { "indexed": true, "internalType": "uint256", - "name": "_disputeID", + "name": "_arbitrableDisputeID", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "_metaEvidenceID", + "name": "_externalDisputeID", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "_evidenceGroupID", + "name": "_templateId", "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" } ], - "name": "Dispute", + "name": "DisputeRequest", "type": "event" }, { @@ -64,17 +83,23 @@ { "indexed": true, "internalType": "uint256", - "name": "_metaEvidenceID", + "name": "_templateId", "type": "uint256" }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, { "indexed": false, "internalType": "string", - "name": "_evidence", + "name": "_templateData", "type": "string" } ], - "name": "MetaEvidence", + "name": "DisputeTemplate", "type": "event" }, { @@ -82,7 +107,7 @@ "inputs": [ { "indexed": true, - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" }, @@ -107,7 +132,7 @@ "name": "arbitrator", "outputs": [ { - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "", "type": "address" } @@ -115,10 +140,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { - "internalType": "contract IArbitrator", + "internalType": "contract IArbitratorV2", "name": "_arbitrator", "type": "address" } @@ -131,17 +169,25 @@ { "inputs": [ { - "internalType": "uint256", - "name": "_metaEvidenceID", - "type": "uint256" - }, + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + } + ], + "name": "changeArbitratorExtraData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "string", - "name": "_metaEvidence", + "name": "_templateData", "type": "string" } ], - "name": "changeMetaEvidence", + "name": "changeDisputeTemplate", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -149,29 +195,33 @@ { "inputs": [ { - "internalType": "uint256", - "name": "_numberOfRulingOptions", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_arbitratorExtraData", - "type": "bytes" + "internalType": "string", + "name": "_action", + "type": "string" }, { "internalType": "uint256", - "name": "_metaEvidenceID", + "name": "_feeInWeth", "type": "uint256" - }, + } + ], + "name": "createDispute", + "outputs": [ { "internalType": "uint256", - "name": "_evidenceGroupID", + "name": "disputeID", "type": "uint256" - }, + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ { - "internalType": "uint256", - "name": "_feeInWeth", - "type": "uint256" + "internalType": "string", + "name": "_action", + "type": "string" } ], "name": "createDispute", @@ -185,6 +235,19 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [], + "name": "disputeTemplates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -269,7 +332,7 @@ "name": "weth", "outputs": [ { - "internalType": "contract ERC20", + "internalType": "contract IERC20", "name": "", "type": "address" } @@ -278,66 +341,123 @@ "type": "function" } ], - "transactionHash": "0xf2d0c797180c8a2d584c028d976b74ce173ce7ad0d596cad759b4a056424696b", + "transactionHash": "0xd935094505fae1f746aa9afd38e1f2c94dff4b12af22d101ec05807b053263d5", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b", - "transactionIndex": 0, - "gasUsed": "720021", - "logsBloom": "0x00000000002000000000000000000000000000000000000001000004000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000800000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x02e428fc734e5034ff6abf8133f61f6ab116750329a695cd2da8b49a43be841f", - "transactionHash": "0xf2d0c797180c8a2d584c028d976b74ce173ce7ad0d596cad759b4a056424696b", + "contractAddress": "0x6BC234359c2Bc212B81A5cF2dfE504940e98d4cC", + "transactionIndex": 1, + "gasUsed": "1269889", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000040008000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000020000000000000000000800000000000000000000000000000000000000080080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000400000000000000000000004000000000000000100000000000", + "blockHash": "0xf645506440ed5fdf35d2a0320f54216588bddc758de7465b03e75b5d04014581", + "transactionHash": "0xd935094505fae1f746aa9afd38e1f2c94dff4b12af22d101ec05807b053263d5", "logs": [ { - "transactionIndex": 0, - "blockNumber": 2322269, - "transactionHash": "0xf2d0c797180c8a2d584c028d976b74ce173ce7ad0d596cad759b4a056424696b", - "address": "0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b", + "transactionIndex": 1, + "blockNumber": 4620754, + "transactionHash": "0xd935094505fae1f746aa9afd38e1f2c94dff4b12af22d101ec05807b053263d5", + "address": "0x6BC234359c2Bc212B81A5cF2dfE504940e98d4cC", "topics": [ - "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba97840", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ], - "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000412f697066732f6261666b7265696674656d65367475736e6a77797a616a6b37356679767a646d747979637863746637796866696a6236726669677a336e346c767100000000000000000000000000000000000000000000000000000000000000", + "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", "logIndex": 0, - "blockHash": "0x02e428fc734e5034ff6abf8133f61f6ab116750329a695cd2da8b49a43be841f" + "blockHash": "0xf645506440ed5fdf35d2a0320f54216588bddc758de7465b03e75b5d04014581" } ], - "blockNumber": 2322269, - "cumulativeGasUsed": "720021", + "blockNumber": 4620754, + "cumulativeGasUsed": "1297725", "status": 1, "byzantium": true }, "args": [ - "0x34E520dc1d2Db660113b64724e14CEdCD01Ee879", - 0, - "/ipfs/bafkreifteme6tusnjwyzajk75fyvzdmtyycxctf7yhfijb6rfigz3n4lvq", - "0x014A442480DbAD767b7615E55E271799889FA1a7" + "0x2357ef115E98d171b083105E9b398231206989A3", + { + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Let's do this", + "description": "We want to do this: %s", + "question": "Does it comply with the policy?", + "answers": [ + { + "title": "Yes", + "description": "Select this if you agree that it must be done." + }, + { + "title": "No", + "description": "Select this if you do not agree that it must be done." + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitratorChainID": "421613", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", + "category": "Others", + "specification": "KIP001", + "lang": "en_US" + }, + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", + "0x2DFC9c3141268e6eac04a7D6d98Fbf64BDe836a8" ], - "numDeployments": 1, - "solcInputHash": "4b623c26d5aed7e40200b7f423c318df", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"},{\"internalType\":\"contract ERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"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\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"}],\"name\":\"changeMetaEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeInWeth\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_metaEvidence\":\"The URI of the meta evidence object for evidence submissions requests.\",\"_metaEvidenceID\":\"Unique identifier of meta-evidence.\"}},\"createDispute(uint256,bytes,uint256,uint256,uint256)\":{\"details\":\"TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group that is linked to this dispute.\",\"_feeInWeth\":\"Amount of fees in WETH for the arbitrator.\",\"_metaEvidenceID\":\"Unique identifier of meta-evidence.\",\"_numberOfRulingOptions\":\"Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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, uint256 indexed _disputeID, uint256 _ruling);\\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 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(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). 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).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\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(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrable The arbitrable receiving 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(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay 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(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\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 Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x2264bc7cb975d89776b9bf3e35cecd4dec7d601604601ca4822d8bfc0886c379\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"../IArbitrable.sol\\\";\\nimport \\\"../../evidence/IMetaEvidence.sol\\\";\\n\\n/**\\n * @title ArbitrableExample\\n * An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\n */\\ncontract ArbitrableExample is IArbitrable, IMetaEvidence {\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n address public immutable governor;\\n IArbitrator public arbitrator; // Arbitrator is set in constructor and never changed.\\n ERC20 public immutable weth; // The WETH token.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n /** @dev Constructor\\n * @param _arbitrator The arbitrator to rule on created disputes.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _metaEvidence The URI of the meta evidence object for evidence submissions requests.\\n */\\n constructor(IArbitrator _arbitrator, uint256 _metaEvidenceID,string memory _metaEvidence, ERC20 _weth) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n weth = _weth;\\n emit MetaEvidence(_metaEvidenceID, _metaEvidence);\\n }\\n\\n /** @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute.\\n Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n * @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\\n * @param _arbitratorExtraData Extra data for the arbitrator.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n * @param _feeInWeth Amount of fees in WETH for the arbitrator.\\n * @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n */\\n function createDispute(\\n uint256 _numberOfRulingOptions,\\n bytes calldata _arbitratorExtraData,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID,\\n uint256 _feeInWeth\\n ) external payable returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Incorrect number of choices\\\");\\n\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: _numberOfRulingOptions}));\\n\\n require(weth.transferFrom(msg.sender, address(this), _feeInWeth), \\\"Not enough WETH for arbitration\\\");\\n weth.increaseAllowance(address(arbitrator), _feeInWeth);\\n disputeID = arbitrator.createDispute(_numberOfRulingOptions, _arbitratorExtraData);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n emit Dispute(arbitrator, disputeID, _metaEvidenceID, _evidenceGroupID);\\n }\\n\\n /** @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n * @param _externalDisputeID ID of the dispute in arbitrator contract.\\n * @param _ruling The ruling choice of the arbitration.\\n */\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n function changeMetaEvidence(uint256 _metaEvidenceID, string memory _metaEvidence) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n emit MetaEvidence(_metaEvidenceID, _metaEvidence);\\n }\\n\\n function changeArbitrator(IArbitrator _arbitrator) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n}\\n\",\"keccak256\":\"0x4959a805fe137ef2bf74e49c343d4ecfd89129d7437e90e1b02f28461bed385c\",\"license\":\"MIT\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/** @title IMetaEvidence\\n * ERC-1497: Evidence Standard excluding evidence emission as it will be handled by the arbitrator.\\n */\\ninterface IMetaEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\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(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0xb87dec548b7c41bb2e2bd25ef3b2159d014c14cdd1e47ca4bec7894817cb8998\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c06040523480156200001157600080fd5b5060405162000de738038062000de7833981016040819052620000349162000117565b33608052600080546001600160a01b0319166001600160a01b0386811691909117909155811660a05260405183907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906200009190859062000203565b60405180910390a25050505062000238565b6001600160a01b0381168114620000b957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620000ef578181015183820152602001620000d5565b83811115620000ff576000848401525b50505050565b80516200011281620000a3565b919050565b600080600080608085870312156200012e57600080fd5b84516200013b81620000a3565b6020860151604087015191955093506001600160401b03808211156200016057600080fd5b818701915087601f8301126200017557600080fd5b8151818111156200018a576200018a620000bc565b604051601f8201601f19908116603f01168101908382118183101715620001b557620001b5620000bc565b816040528281528a6020848701011115620001cf57600080fd5b620001e2836020830160208801620000d2565b8096505050505050620001f86060860162000105565b905092959194509250565b602081526000825180602084015262000224816040850160208701620000d2565b601f01601f19169190910160400192915050565b60805160a051610b6e62000279600039600081816101000152818161050401526105fd015260008181608d0152818161077301526107f70152610b6e6000f3fe6080604052600436106100765760003560e01c80630c340a241461007b578063311a6c56146100cc5780633fc8cef3146100ee578063564a565d146101225780635b13a8a01461015f5780636cc6cde114610180578063c21ae061146101a0578063e98e3a64146101cd578063fc548f08146101ed575b600080fd5b34801561008757600080fd5b506100af7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100d857600080fd5b506100ec6100e7366004610856565b61020d565b005b3480156100fa57600080fd5b506100af7f000000000000000000000000000000000000000000000000000000000000000081565b34801561012e57600080fd5b5061014261013d366004610878565b6103a6565b6040805193151584526020840192909252908201526060016100c3565b61017261016d366004610891565b6103dd565b6040519081526020016100c3565b34801561018c57600080fd5b506000546100af906001600160a01b031681565b3480156101ac57600080fd5b506101726101bb366004610878565b60016020526000908152604090205481565b3480156101d957600080fd5b506100ec6101e836600461093a565b610768565b3480156101f957600080fd5b506100ec6102083660046109f5565b6107ec565b600082815260016020526040812054600280549192918390811061023357610233610a25565b600091825260208220915460039190910290910191506001600160a01b031633146102b35760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156102f95760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102aa565b805460ff16156103575760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102aa565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103b657600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b60006001871161042f5760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f69636573000000000060448201526064016102aa565b60028054604080516060810182526000808252602082018181528284018d81526001860187559590915290517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace60038502908101805460ff19169215159290921790915590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf82015592517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad09093019290925590516323b872dd60e01b8152336004820152306024820152604481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401602060405180830381600087803b15801561055057600080fd5b505af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610a3b565b6105d45760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f756768205745544820666f72206172626974726174696f6e0060448201526064016102aa565b600054604051633950935160e01b81526001600160a01b039182166004820152602481018590527f000000000000000000000000000000000000000000000000000000000000000090911690633950935190604401602060405180830381600087803b15801561064357600080fd5b505af1158015610657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067b9190610a3b565b5060005460405163c13517e160e01b81526001600160a01b039091169063c13517e1906106b0908b908b908b90600401610a5d565b602060405180830381600087803b1580156106ca57600080fd5b505af11580156106de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107029190610a93565b60008181526001602090815260408083208590559154825189815291820188905292945084926001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a3509695505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107b05760405162461bcd60e51b81526004016102aa90610aac565b817f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040516107e09190610ae3565b60405180910390a25050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108345760405162461bcd60e51b81526004016102aa90610aac565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806040838503121561086957600080fd5b50508035926020909101359150565b60006020828403121561088a57600080fd5b5035919050565b60008060008060008060a087890312156108aa57600080fd5b86359550602087013567ffffffffffffffff808211156108c957600080fd5b818901915089601f8301126108dd57600080fd5b8135818111156108ec57600080fd5b8a60208285010111156108fe57600080fd5b979a60209290920199509697604081013597506060810135965060800135945092505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561094d57600080fd5b82359150602083013567ffffffffffffffff8082111561096c57600080fd5b818501915085601f83011261098057600080fd5b81358181111561099257610992610924565b604051601f8201601f19908116603f011681019083821181831017156109ba576109ba610924565b816040528281528860208487010111156109d357600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a0757600080fd5b81356001600160a01b0381168114610a1e57600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610a4d57600080fd5b81518015158114610a1e57600080fd5b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610aa557600080fd5b5051919050565b6020808252601e908201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e0000604082015260600190565b600060208083528351808285015260005b81811015610b1057858101830151858201604001528201610af4565b81811115610b22576000604083870101525b50601f01601f191692909201604001939250505056fea2646970667358221220ce8d35b0c825ffb680b17cdb56af41b1d0187ceb066d7adeca526f2f5682e8dd64736f6c63430008090033", - "deployedBytecode": "0x6080604052600436106100765760003560e01c80630c340a241461007b578063311a6c56146100cc5780633fc8cef3146100ee578063564a565d146101225780635b13a8a01461015f5780636cc6cde114610180578063c21ae061146101a0578063e98e3a64146101cd578063fc548f08146101ed575b600080fd5b34801561008757600080fd5b506100af7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100d857600080fd5b506100ec6100e7366004610856565b61020d565b005b3480156100fa57600080fd5b506100af7f000000000000000000000000000000000000000000000000000000000000000081565b34801561012e57600080fd5b5061014261013d366004610878565b6103a6565b6040805193151584526020840192909252908201526060016100c3565b61017261016d366004610891565b6103dd565b6040519081526020016100c3565b34801561018c57600080fd5b506000546100af906001600160a01b031681565b3480156101ac57600080fd5b506101726101bb366004610878565b60016020526000908152604090205481565b3480156101d957600080fd5b506100ec6101e836600461093a565b610768565b3480156101f957600080fd5b506100ec6102083660046109f5565b6107ec565b600082815260016020526040812054600280549192918390811061023357610233610a25565b600091825260208220915460039190910290910191506001600160a01b031633146102b35760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156102f95760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102aa565b805460ff16156103575760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102aa565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b600281815481106103b657600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b60006001871161042f5760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f69636573000000000060448201526064016102aa565b60028054604080516060810182526000808252602082018181528284018d81526001860187559590915290517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace60038502908101805460ff19169215159290921790915590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf82015592517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad09093019290925590516323b872dd60e01b8152336004820152306024820152604481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401602060405180830381600087803b15801561055057600080fd5b505af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610a3b565b6105d45760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f756768205745544820666f72206172626974726174696f6e0060448201526064016102aa565b600054604051633950935160e01b81526001600160a01b039182166004820152602481018590527f000000000000000000000000000000000000000000000000000000000000000090911690633950935190604401602060405180830381600087803b15801561064357600080fd5b505af1158015610657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067b9190610a3b565b5060005460405163c13517e160e01b81526001600160a01b039091169063c13517e1906106b0908b908b908b90600401610a5d565b602060405180830381600087803b1580156106ca57600080fd5b505af11580156106de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107029190610a93565b60008181526001602090815260408083208590559154825189815291820188905292945084926001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a3509695505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107b05760405162461bcd60e51b81526004016102aa90610aac565b817f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040516107e09190610ae3565b60405180910390a25050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108345760405162461bcd60e51b81526004016102aa90610aac565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806040838503121561086957600080fd5b50508035926020909101359150565b60006020828403121561088a57600080fd5b5035919050565b60008060008060008060a087890312156108aa57600080fd5b86359550602087013567ffffffffffffffff808211156108c957600080fd5b818901915089601f8301126108dd57600080fd5b8135818111156108ec57600080fd5b8a60208285010111156108fe57600080fd5b979a60209290920199509697604081013597506060810135965060800135945092505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561094d57600080fd5b82359150602083013567ffffffffffffffff8082111561096c57600080fd5b818501915085601f83011261098057600080fd5b81358181111561099257610992610924565b604051601f8201601f19908116603f011681019083821181831017156109ba576109ba610924565b816040528281528860208487010111156109d357600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a0757600080fd5b81356001600160a01b0381168114610a1e57600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610a4d57600080fd5b81518015158114610a1e57600080fd5b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610aa557600080fd5b5051919050565b6020808252601e908201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e0000604082015260600190565b600060208083528351808285015260005b81811015610b1057858101830151858201604001528201610af4565b81811115610b22576000604083870101525b50601f01601f191692909201604001939250505056fea2646970667358221220ce8d35b0c825ffb680b17cdb56af41b1d0187ceb066d7adeca526f2f5682e8dd64736f6c63430008090033", + "numDeployments": 2, + "solcInputHash": "607c490ba4a496423451de6780d6037d", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"}],\"name\":\"Action\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_feeInWeth\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputeTemplates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"DisputeTemplate(uint256,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateData\":\"The template data.\",\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_templateData\":\"The dispute template data.\",\"_weth\":\"The WETH token.\"}},\"createDispute(string)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_action\":\"The action that requires arbitration.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"createDispute(string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_action\":\"The action that requires arbitration.\",\"_feeInWeth\":\"Amount of fees in WETH for the arbitrator.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../../libraries/SafeERC20.sol\\\";\\n\\n/// @title ArbitrableExample\\n/// An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\ncontract ArbitrableExample is IArbitrableV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n event Action(string indexed _action);\\n\\n address public immutable governor;\\n IArbitratorV2 public arbitrator; // Arbitrator is set in constructor.\\n uint256 public disputeTemplates; // The number of dispute templates created.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IERC20 public immutable weth; // The WETH token.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator The arbitrator to rule on created disputes.\\n /// @param _templateData The dispute template data.\\n /// @param _weth The WETH token.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n string memory _templateData,\\n bytes memory _arbitratorExtraData,\\n IERC20 _weth\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n weth = _weth;\\n emit DisputeTemplate(disputeTemplates++, \\\"\\\", _templateData);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeDisputeTemplate(string memory _templateData) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n emit DisputeTemplate(disputeTemplates++, \\\"\\\", _templateData);\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _action The action that requires arbitration.\\n /// @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n function createDispute(string calldata _action) external payable returns (uint256 disputeID) {\\n emit Action(_action);\\n\\n uint256 numberOfRulingOptions = 2;\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions}));\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, arbitratorExtraData);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));\\n emit DisputeRequest(arbitrator, disputeID, externalDisputeID, disputeTemplates - 1, \\\"\\\");\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _action The action that requires arbitration.\\n /// @param _feeInWeth Amount of fees in WETH for the arbitrator.\\n /// @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n function createDispute(string calldata _action, uint256 _feeInWeth) external payable returns (uint256 disputeID) {\\n emit Action(_action);\\n\\n uint256 numberOfRulingOptions = 2;\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions}));\\n\\n require(weth.safeTransferFrom(msg.sender, address(this), _feeInWeth), \\\"Transfer failed\\\");\\n require(weth.increaseAllowance(address(arbitrator), _feeInWeth), \\\"Allowance increase failed\\\");\\n\\n disputeID = arbitrator.createDispute(numberOfRulingOptions, arbitratorExtraData, weth, _feeInWeth);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));\\n emit DisputeRequest(arbitrator, disputeID, externalDisputeID, disputeTemplates - 1, \\\"\\\");\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n}\\n\",\"keccak256\":\"0xc436251c641063d81268045a206b65ba1ecc677bc8572a452c38108689f087e0\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7a259401627ba5546d9eb0264275aa1be9762f8a514545ae99d8c356ebf41f4f\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x9001274313a4e7eeda92332bbeeac8972f55e6378874babfaccd56eb283816f0\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b5060405162001836380380620018368339810160408190526200003491620001cc565b33608052600080546001600160a01b0319166001600160a01b03861617905560026200006183826200031a565b506001600160a01b03811660a052600180547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470916000620000a283620003e6565b919050557f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba9784085604051620000d791906200040e565b60405180910390a35050505062000443565b6001600160a01b0381168114620000ff57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001355781810151838201526020016200011b565b50506000910152565b60006001600160401b03808411156200015b576200015b62000102565b604051601f8501601f19908116603f0116810190828211818310171562000186576200018662000102565b81604052809350858152868686011115620001a057600080fd5b620001b086602083018762000118565b5050509392505050565b8051620001c781620000e9565b919050565b60008060008060808587031215620001e357600080fd5b8451620001f081620000e9565b60208601519094506001600160401b03808211156200020e57600080fd5b818701915087601f8301126200022357600080fd5b62000234888351602085016200013e565b945060408701519150808211156200024b57600080fd5b508501601f810187136200025e57600080fd5b6200026f878251602084016200013e565b9250506200028060608601620001ba565b905092959194509250565b600181811c90821680620002a057607f821691505b602082108103620002c157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200031557600081815260208120601f850160051c81016020861015620002f05750805b601f850160051c820191505b818110156200031157828155600101620002fc565b5050505b505050565b81516001600160401b0381111562000336576200033662000102565b6200034e816200034784546200028b565b84620002c7565b602080601f8311600181146200038657600084156200036d5750858301515b600019600386901b1c1916600185901b17855562000311565b600085815260208120601f198616915b82811015620003b75788860151825594840194600190910190840162000396565b5085821015620003d65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016200040757634e487b7160e01b600052601160045260246000fd5b5060010190565b60208152600082518060208401526200042f81604085016020870162000118565b601f01601f19169190910160400192915050565b60805160a0516113a4620004926000396000818161017e01528181610669015281816106e8015261078601526000818160c9015281816104e601528181610ae10152610b9801526113a46000f3fe6080604052600436106100b25760003560e01c8063654692871161006f57806365469287146101dd57806368175996146101fe5780636cc6cde114610211578063c21ae06114610231578063dd9a523f1461025e578063f85c29bd1461027e578063fc548f081461029457600080fd5b80630c340a24146100b75780630c7ac7b614610108578063311a6c561461012a57806334e2672d1461014c5780633fc8cef31461016c578063564a565d146101a0575b600080fd5b3480156100c357600080fd5b506100eb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011457600080fd5b5061011d6102b4565b6040516100ff9190610e27565b34801561013657600080fd5b5061014a610145366004610e41565b610342565b005b34801561015857600080fd5b5061014a610167366004610eac565b6104db565b34801561017857600080fd5b506100eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101ac57600080fd5b506101c06101bb366004610eee565b610535565b6040805193151584526020840192909252908201526060016100ff565b6101f06101eb366004610f07565b61056c565b6040519081526020016100ff565b6101f061020c366004610eac565b6108b1565b34801561021d57600080fd5b506000546100eb906001600160a01b031681565b34801561023d57600080fd5b506101f061024c366004610eee565b60036020526000908152604090205481565b34801561026a57600080fd5b5061014a610279366004610f69565b610ad6565b34801561028a57600080fd5b506101f060015481565b3480156102a057600080fd5b5061014a6102af36600461101a565b610b8d565b600280546102c190611043565b80601f01602080910402602001604051908101604052809291908181526020018280546102ed90611043565b801561033a5780601f1061030f5761010080835404028352916020019161033a565b820191906000526020600020905b81548152906001019060200180831161031d57829003601f168201915b505050505081565b60008281526003602052604081205460048054919291839081106103685761036861107d565b600091825260208220915460039190910290910191506001600160a01b031633146103e85760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806002015483111561042e5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016103df565b805460ff161561048c5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016103df565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105235760405162461bcd60e51b81526004016103df90611093565b6002610530828483611118565b505050565b6004818154811061054557600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000838360405161057e9291906111d9565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a2600480546040805160608101825260008082526020820181815260029383018481526001860187559590915290517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60038502908101805460ff19169215159290921790915590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909301929092556106997f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087610bf7565b6106d75760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016103df565b600054610711906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686610cd3565b6107595760405162461bcd60e51b8152602060048201526019602482015278105b1b1bddd85b98d9481a5b98dc99585cd94819985a5b1959603a1b60448201526064016103df565b600054604051633d941b6d60e21b81526001600160a01b039091169063f6506db4906107b09085906002907f0000000000000000000000000000000000000000000000000000000000000000908a90600401611266565b6020604051808303816000875af11580156107cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f3919061129b565b600081815260036020908152604080832085905551929550909161081b9189918991016111d9565b60408051601f1981840301815291905280516020909101206000546001805492935086926001600160a01b03909216917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e2718691859161087991906112ca565b60405161089f929190918252602082015260606040820181905260009082015260800190565b60405180910390a35050509392505050565b600082826040516108c39291906111d9565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a26004805460408051606081018252600080825260208201818152600283850181815260018701885587845293517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60038802908101805460ff19169215159290921790915591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c83015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d9091015554915163c13517e160e01b815290936001600160a01b039092169163c13517e19134916109d69187918291016112e3565b60206040518083038185885af11580156109f4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a19919061129b565b6000818152600360209081526040808320859055519295509091610a419188918891016111d9565b60408051601f1981840301815291905280516020909101206000546001805492935086926001600160a01b03909216917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186918591610a9f91906112ca565b604051610ac5929190918252602082015260606040820181905260009082015260800190565b60405180910390a350505092915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b1e5760405162461bcd60e51b81526004016103df90611093565b600180547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470916000610b4f83611304565b919050557f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba9784083604051610b829190610e27565b60405180910390a350565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bd55760405162461bcd60e51b81526004016103df90611093565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610c5c919061131d565b6000604051808303816000865af19150503d8060008114610c99576040519150601f19603f3d011682016040523d82523d6000602084013e610c9e565b606091505b5091509150818015610cc8575080511580610cc8575080806020019051810190610cc89190611339565b979650505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063095ea7b39085908590849063dd62ed3e90604401602060405180830381865afa158015610d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d53919061129b565b610d5d919061135b565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610da8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcc9190611339565b506001949350505050565b60005b83811015610df2578181015183820152602001610dda565b50506000910152565b60008151808452610e13816020860160208601610dd7565b601f01601f19169290920160200192915050565b602081526000610e3a6020830184610dfb565b9392505050565b60008060408385031215610e5457600080fd5b50508035926020909101359150565b60008083601f840112610e7557600080fd5b50813567ffffffffffffffff811115610e8d57600080fd5b602083019150836020828501011115610ea557600080fd5b9250929050565b60008060208385031215610ebf57600080fd5b823567ffffffffffffffff811115610ed657600080fd5b610ee285828601610e63565b90969095509350505050565b600060208284031215610f0057600080fd5b5035919050565b600080600060408486031215610f1c57600080fd5b833567ffffffffffffffff811115610f3357600080fd5b610f3f86828701610e63565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610f7b57600080fd5b813567ffffffffffffffff80821115610f9357600080fd5b818401915084601f830112610fa757600080fd5b813581811115610fb957610fb9610f53565b604051601f8201601f19908116603f01168101908382118183101715610fe157610fe1610f53565b81604052828152876020848701011115610ffa57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561102c57600080fd5b81356001600160a01b0381168114610e3a57600080fd5b600181811c9082168061105757607f821691505b60208210810361107757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6020808252601e908201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e0000604082015260600190565b601f82111561053057600081815260208120601f850160051c810160208610156110f15750805b601f850160051c820191505b81811015611110578281556001016110fd565b505050505050565b67ffffffffffffffff83111561113057611130610f53565b6111448361113e8354611043565b836110ca565b6000601f84116001811461117857600085156111605750838201355b600019600387901b1c1916600186901b1783556111d2565b600083815260209020601f19861690835b828110156111a95786850135825560209485019460019092019101611189565b50868210156111c65760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183823760009101908152919050565b600081546111f681611043565b808552602060018381168015611213576001811461122d5761125b565b60ff1985168884015283151560051b88018301955061125b565b866000528260002060005b858110156112535781548a8201860152908301908401611238565b890184019650505b505050505092915050565b84815260806020820152600061127f60808301866111e9565b6001600160a01b03949094166040830152506060015292915050565b6000602082840312156112ad57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112dd576112dd6112b4565b92915050565b8281526040602082015260006112fc60408301846111e9565b949350505050565b600060018201611316576113166112b4565b5060010190565b6000825161132f818460208701610dd7565b9190910192915050565b60006020828403121561134b57600080fd5b81518015158114610e3a57600080fd5b808201808211156112dd576112dd6112b456fea26469706673582212201389facf5400659d9285f5abaaf2609dba734f1a1ce93f460cbed4f818488c9864736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100b25760003560e01c8063654692871161006f57806365469287146101dd57806368175996146101fe5780636cc6cde114610211578063c21ae06114610231578063dd9a523f1461025e578063f85c29bd1461027e578063fc548f081461029457600080fd5b80630c340a24146100b75780630c7ac7b614610108578063311a6c561461012a57806334e2672d1461014c5780633fc8cef31461016c578063564a565d146101a0575b600080fd5b3480156100c357600080fd5b506100eb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011457600080fd5b5061011d6102b4565b6040516100ff9190610e27565b34801561013657600080fd5b5061014a610145366004610e41565b610342565b005b34801561015857600080fd5b5061014a610167366004610eac565b6104db565b34801561017857600080fd5b506100eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101ac57600080fd5b506101c06101bb366004610eee565b610535565b6040805193151584526020840192909252908201526060016100ff565b6101f06101eb366004610f07565b61056c565b6040519081526020016100ff565b6101f061020c366004610eac565b6108b1565b34801561021d57600080fd5b506000546100eb906001600160a01b031681565b34801561023d57600080fd5b506101f061024c366004610eee565b60036020526000908152604090205481565b34801561026a57600080fd5b5061014a610279366004610f69565b610ad6565b34801561028a57600080fd5b506101f060015481565b3480156102a057600080fd5b5061014a6102af36600461101a565b610b8d565b600280546102c190611043565b80601f01602080910402602001604051908101604052809291908181526020018280546102ed90611043565b801561033a5780601f1061030f5761010080835404028352916020019161033a565b820191906000526020600020905b81548152906001019060200180831161031d57829003601f168201915b505050505081565b60008281526003602052604081205460048054919291839081106103685761036861107d565b600091825260208220915460039190910290910191506001600160a01b031633146103e85760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806002015483111561042e5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016103df565b805460ff161561048c5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016103df565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105235760405162461bcd60e51b81526004016103df90611093565b6002610530828483611118565b505050565b6004818154811061054557600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000838360405161057e9291906111d9565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a2600480546040805160608101825260008082526020820181815260029383018481526001860187559590915290517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60038502908101805460ff19169215159290921790915590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909301929092556106997f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087610bf7565b6106d75760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016103df565b600054610711906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686610cd3565b6107595760405162461bcd60e51b8152602060048201526019602482015278105b1b1bddd85b98d9481a5b98dc99585cd94819985a5b1959603a1b60448201526064016103df565b600054604051633d941b6d60e21b81526001600160a01b039091169063f6506db4906107b09085906002907f0000000000000000000000000000000000000000000000000000000000000000908a90600401611266565b6020604051808303816000875af11580156107cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f3919061129b565b600081815260036020908152604080832085905551929550909161081b9189918991016111d9565b60408051601f1981840301815291905280516020909101206000546001805492935086926001600160a01b03909216917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e2718691859161087991906112ca565b60405161089f929190918252602082015260606040820181905260009082015260800190565b60405180910390a35050509392505050565b600082826040516108c39291906111d9565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a26004805460408051606081018252600080825260208201818152600283850181815260018701885587845293517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60038802908101805460ff19169215159290921790915591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c83015592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d9091015554915163c13517e160e01b815290936001600160a01b039092169163c13517e19134916109d69187918291016112e3565b60206040518083038185885af11580156109f4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a19919061129b565b6000818152600360209081526040808320859055519295509091610a419188918891016111d9565b60408051601f1981840301815291905280516020909101206000546001805492935086926001600160a01b03909216917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186918591610a9f91906112ca565b604051610ac5929190918252602082015260606040820181905260009082015260800190565b60405180910390a350505092915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b1e5760405162461bcd60e51b81526004016103df90611093565b600180547fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470916000610b4f83611304565b919050557f9684b36e8ac6332c160d4d4e14a78ea2679b6484c08726432cf097c99ba9784083604051610b829190610e27565b60405180910390a350565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bd55760405162461bcd60e51b81526004016103df90611093565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610c5c919061131d565b6000604051808303816000865af19150503d8060008114610c99576040519150601f19603f3d011682016040523d82523d6000602084013e610c9e565b606091505b5091509150818015610cc8575080511580610cc8575080806020019051810190610cc89190611339565b979650505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063095ea7b39085908590849063dd62ed3e90604401602060405180830381865afa158015610d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d53919061129b565b610d5d919061135b565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610da8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcc9190611339565b506001949350505050565b60005b83811015610df2578181015183820152602001610dda565b50506000910152565b60008151808452610e13816020860160208601610dd7565b601f01601f19169290920160200192915050565b602081526000610e3a6020830184610dfb565b9392505050565b60008060408385031215610e5457600080fd5b50508035926020909101359150565b60008083601f840112610e7557600080fd5b50813567ffffffffffffffff811115610e8d57600080fd5b602083019150836020828501011115610ea557600080fd5b9250929050565b60008060208385031215610ebf57600080fd5b823567ffffffffffffffff811115610ed657600080fd5b610ee285828601610e63565b90969095509350505050565b600060208284031215610f0057600080fd5b5035919050565b600080600060408486031215610f1c57600080fd5b833567ffffffffffffffff811115610f3357600080fd5b610f3f86828701610e63565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610f7b57600080fd5b813567ffffffffffffffff80821115610f9357600080fd5b818401915084601f830112610fa757600080fd5b813581811115610fb957610fb9610f53565b604051601f8201601f19908116603f01168101908382118183101715610fe157610fe1610f53565b81604052828152876020848701011115610ffa57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561102c57600080fd5b81356001600160a01b0381168114610e3a57600080fd5b600181811c9082168061105757607f821691505b60208210810361107757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6020808252601e908201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e0000604082015260600190565b601f82111561053057600081815260208120601f850160051c810160208610156110f15750805b601f850160051c820191505b81811015611110578281556001016110fd565b505050505050565b67ffffffffffffffff83111561113057611130610f53565b6111448361113e8354611043565b836110ca565b6000601f84116001811461117857600085156111605750838201355b600019600387901b1c1916600186901b1783556111d2565b600083815260209020601f19861690835b828110156111a95786850135825560209485019460019092019101611189565b50868210156111c65760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183823760009101908152919050565b600081546111f681611043565b808552602060018381168015611213576001811461122d5761125b565b60ff1985168884015283151560051b88018301955061125b565b866000528260002060005b858110156112535781548a8201860152908301908401611238565b890184019650505b505050505092915050565b84815260806020820152600061127f60808301866111e9565b6001600160a01b03949094166040830152506060015292915050565b6000602082840312156112ad57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112dd576112dd6112b4565b92915050565b8281526040602082015260006112fc60408301846111e9565b949350505050565b600060018201611316576113166112b4565b5060010190565b6000825161132f818460208701610dd7565b9190910192915050565b60006020828403121561134b57600080fd5b81518015158114610e3a57600080fd5b808201808211156112dd576112dd6112b456fea26469706673582212201389facf5400659d9285f5abaaf2609dba734f1a1ce93f460cbed4f818488c9864736f6c63430008120033", "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "DisputeTemplate(uint256,string,string)": { + "details": "To be emitted when a new dispute template is created.", + "params": { + "_templateData": "The template data.", + "_templateId": "The identifier of the dispute template.", + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\"." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, "kind": "dev", "methods": { "constructor": { "details": "Constructor", "params": { "_arbitrator": "The arbitrator to rule on created disputes.", - "_metaEvidence": "The URI of the meta evidence object for evidence submissions requests.", - "_metaEvidenceID": "Unique identifier of meta-evidence." + "_templateData": "The dispute template data.", + "_weth": "The WETH token." } }, - "createDispute(uint256,bytes,uint256,uint256,uint256)": { - "details": "TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "createDispute(string)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", "params": { - "_arbitratorExtraData": "Extra data for the arbitrator.", - "_evidenceGroupID": "Unique identifier of the evidence group that is linked to this dispute.", - "_feeInWeth": "Amount of fees in WETH for the arbitrator.", - "_metaEvidenceID": "Unique identifier of meta-evidence.", - "_numberOfRulingOptions": "Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from." + "_action": "The action that requires arbitration." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "createDispute(string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_action": "The action that requires arbitration.", + "_feeInWeth": "Amount of fees in WETH for the arbitrator." }, "returns": { "disputeID": "Dispute id (on arbitrator side) of the dispute created." @@ -351,7 +471,7 @@ } } }, - "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", + "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", "version": 1 }, "userdoc": { @@ -362,33 +482,49 @@ "storageLayout": { "storage": [ { - "astId": 797, + "astId": 153, "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", "label": "arbitrator", "offset": 0, "slot": "0", - "type": "t_contract(IArbitrator)775" + "type": "t_contract(IArbitratorV2)641" }, { - "astId": 804, + "astId": 155, "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "externalIDtoLocalID", + "label": "disputeTemplates", "offset": 0, "slot": "1", + "type": "t_uint256" + }, + { + "astId": 157, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 164, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "externalIDtoLocalID", + "offset": 0, + "slot": "3", "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 808, + "astId": 168, "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", "label": "disputes", "offset": 0, - "slot": "2", - "type": "t_array(t_struct(DisputeStruct)792_storage)dyn_storage" + "slot": "4", + "type": "t_array(t_struct(DisputeStruct)144_storage)dyn_storage" } ], "types": { - "t_array(t_struct(DisputeStruct)792_storage)dyn_storage": { - "base": "t_struct(DisputeStruct)792_storage", + "t_array(t_struct(DisputeStruct)144_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)144_storage", "encoding": "dynamic_array", "label": "struct ArbitrableExample.DisputeStruct[]", "numberOfBytes": "32" @@ -398,9 +534,14 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IArbitrator)775": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)641": { "encoding": "inplace", - "label": "contract IArbitrator", + "label": "contract IArbitratorV2", "numberOfBytes": "20" }, "t_mapping(t_uint256,t_uint256)": { @@ -410,12 +551,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(DisputeStruct)792_storage": { + "t_struct(DisputeStruct)144_storage": { "encoding": "inplace", "label": "struct ArbitrableExample.DisputeStruct", "members": [ { - "astId": 787, + "astId": 139, "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", "label": "isRuled", "offset": 0, @@ -423,7 +564,7 @@ "type": "t_bool" }, { - "astId": 789, + "astId": 141, "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", "label": "ruling", "offset": 0, @@ -431,7 +572,7 @@ "type": "t_uint256" }, { - "astId": 791, + "astId": 143, "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", "label": "numberOfRulingOptions", "offset": 0, diff --git a/contracts/deployments/chiado/ForeignGatewayOnGnosis.json b/contracts/deployments/chiado/ForeignGatewayOnGnosis.json index 81a2b73f7..2bdda9605 100644 --- a/contracts/deployments/chiado/ForeignGatewayOnGnosis.json +++ b/contracts/deployments/chiado/ForeignGatewayOnGnosis.json @@ -1,5 +1,5 @@ { - "address": "0x573bcD6ee4aEe152eCC9Cafd2c0820Dc548AF6cC", + "address": "0x2357ef115E98d171b083105E9b398231206989A3", "abi": [ { "inputs": [ @@ -13,19 +13,14 @@ "name": "_veaOutbox", "type": "address" }, - { - "internalType": "address", - "name": "_senderGateway", - "type": "address" - }, { "internalType": "uint256", - "name": "_senderChainID", + "name": "_homeChainID", "type": "uint256" }, { - "internalType": "contract IERC20", - "name": "_weth", + "internalType": "address", + "name": "_homeGateway", "type": "address" } ], @@ -37,18 +32,18 @@ "inputs": [ { "indexed": true, - "internalType": "uint96", - "name": "_courtID", - "type": "uint96" + "internalType": "contract IERC20", + "name": "_token", + "type": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "_feeForJuror", - "type": "uint256" + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" } ], - "name": "ArbitrationCostModified", + "name": "AcceptedFeeToken", "type": "event" }, { @@ -56,18 +51,18 @@ "inputs": [ { "indexed": true, - "internalType": "uint256", - "name": "_disputeID", - "type": "uint256" + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" }, { - "indexed": true, - "internalType": "contract IArbitrable", - "name": "_arbitrable", - "type": "address" + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" } ], - "name": "DisputeCreation", + "name": "ArbitrationCostModified", "type": "event" }, { @@ -76,19 +71,19 @@ { "indexed": false, "internalType": "bytes32", - "name": "disputeHash", + "name": "_foreignBlockHash", "type": "bytes32" }, { - "indexed": false, - "internalType": "bytes32", - "name": "blockhash", - "type": "bytes32" + "indexed": true, + "internalType": "address", + "name": "_foreignArbitrable", + "type": "address" }, { - "indexed": false, + "indexed": true, "internalType": "uint256", - "name": "localDisputeID", + "name": "_foreignDisputeID", "type": "uint256" }, { @@ -102,15 +97,28 @@ "internalType": "bytes", "name": "_extraData", "type": "bytes" + } + ], + "name": "CrossChainDisputeOutgoing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" }, { - "indexed": false, - "internalType": "address", - "name": "arbitrable", + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", "type": "address" } ], - "name": "OutgoingDispute", + "name": "DisputeCreation", "type": "event" }, { @@ -118,7 +126,7 @@ "inputs": [ { "indexed": true, - "internalType": "contract IArbitrable", + "internalType": "contract IArbitrableV2", "name": "_arbitrable", "type": "address" }, @@ -140,7 +148,7 @@ }, { "inputs": [], - "name": "MIN_JURORS", + "name": "DEFAULT_NB_OF_JURORS", "outputs": [ { "internalType": "uint256", @@ -151,6 +159,30 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, { "inputs": [ { @@ -205,11 +237,11 @@ "inputs": [ { "internalType": "address", - "name": "_senderGateway", + "name": "_homeGateway", "type": "address" } ], - "name": "changeReceiverGateway", + "name": "changeHomeGateway", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -236,12 +268,12 @@ "inputs": [ { "internalType": "uint256", - "name": "", + "name": "_choices", "type": "uint256" }, { "internalType": "bytes", - "name": "", + "name": "_extraData", "type": "bytes" } ], @@ -260,29 +292,63 @@ "inputs": [ { "internalType": "uint256", - "name": "_choices", + "name": "", "type": "uint256" }, { "internalType": "bytes", - "name": "_extraData", + "name": "", "type": "bytes" }, + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + }, { "internalType": "uint256", - "name": "_amount", + "name": "", "type": "uint256" } ], - "name": "createDisputeERC20", + "name": "createDispute", "outputs": [ { "internalType": "uint256", - "name": "disputeID", + "name": "", "type": "uint256" } ], - "stateMutability": "nonpayable", + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", "type": "function" }, { @@ -401,6 +467,32 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "homeChainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "homeGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -429,19 +521,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "senderChainID", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "senderGateway", @@ -468,19 +547,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "weth", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -495,48 +561,62 @@ "type": "function" } ], - "transactionHash": "0xca576cbc21daddf0555f9db80b8b382a86fad5d8034b1cce5d9b9490a1da293d", + "transactionHash": "0x90d4679d5b2d61dac87d2f1519299a223831d00eb162f4ef9a982d6558695740", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x573bcD6ee4aEe152eCC9Cafd2c0820Dc548AF6cC", + "contractAddress": "0x2357ef115E98d171b083105E9b398231206989A3", "transactionIndex": 0, - "gasUsed": "1061085", + "gasUsed": "1061402", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x96d208d64294072571cb837b9d5012a730cd06708e818920bb934e6fd618e200", - "transactionHash": "0xca576cbc21daddf0555f9db80b8b382a86fad5d8034b1cce5d9b9490a1da293d", + "blockHash": "0x1117c97e7b780726a2b910b7229e4fa2b82e40570a26af3a2473580e7aa77cf9", + "transactionHash": "0x90d4679d5b2d61dac87d2f1519299a223831d00eb162f4ef9a982d6558695740", "logs": [], - "blockNumber": 4423423, - "cumulativeGasUsed": "1061085", + "blockNumber": 4620678, + "cumulativeGasUsed": "1061402", "status": 1, "byzantium": true }, "args": [ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", "0xdFd7aDEb43d46FA3f16FB3e27F7fe85c3f5BD89D", - "0xD60CD2151e118Dd796efcb1ceFFcF892226F9b3a", "0x0000000000000000000000000000000000000000000000000000000000066eed", - "0x2DFC9c3141268e6eac04a7D6d98Fbf64BDe836a8" + "0xDecAae1d6eA668e70bf5657Ee2b2fAFB96a6692F" ], - "numDeployments": 3, - "solcInputHash": "36e3015201aa6368fd28e007dfb67b68", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_veaOutbox\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_senderGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_senderChainID\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"ArbitrationCostModified\",\"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\":false,\"internalType\":\"bytes32\",\"name\":\"disputeHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockhash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"localDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"}],\"name\":\"OutgoingDispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeCourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_senderGateway\",\"type\":\"address\"}],\"name\":\"changeReceiverGateway\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_veaOutbox\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gracePeriod\",\"type\":\"uint256\"}],\"name\":\"changeVea\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"createDisputeERC20\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deprecatedVeaOutbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deprecatedVeaOutboxExpiration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToForeignID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoDisputeData\",\"outputs\":[{\"internalType\":\"uint248\",\"name\":\"id\",\"type\":\"uint248\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"feeForJuror\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageSender\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"}],\"name\":\"relayRule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"veaOutbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"ID of the dispute.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"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.\",\"params\":{\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"cost\":\"Required cost of arbitration.\"}},\"changeCourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"changeReceiverGateway(address)\":{\"details\":\"Changes the sender gateway.\",\"params\":{\"_senderGateway\":\"The address of the new sender gateway.\"}},\"changeVea(address,uint256)\":{\"details\":\"Changes the outbox.\",\"params\":{\"_gracePeriod\":\"The duration to accept messages from the deprecated bridge (if at all).\",\"_veaOutbox\":\"The address of the new outbox.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"relayRule(address,bytes32,uint256,address)\":{\"notice\":\"Relay the rule call from the home gateway to the arbitrable.\"}},\"notice\":\"Foreign Gateway Counterpart of `HomeGateway`\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/ForeignGatewayOnGnosis.sol\":\"ForeignGatewayOnGnosis\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @shotaronowhere]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\ninterface IReceiverGateway {\\n function veaOutbox() external view returns (address);\\n\\n function senderGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0xde6bdbe57ced7c1e79d62dca23aa8c2322e031da91ceac22cefd185f1e3740ef\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/// @title IArbitrable\\n/// Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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);\\ninterface IArbitrable {\\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 event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _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 function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x2a5363c37d33749f6b53c288f6d1538f013c6efbb3df86e63eceaa8163a6b212\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitrator {\\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 event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Create a dispute. Must be called by the arbitrable contract.\\n /// Must pay 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 function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 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 Required cost of arbitration.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x8028f7d6a0fe07687f975fc51c9f889083ae1a409a134e8017a044701310948f\",\"license\":\"MIT\"},\"src/gateway/ForeignGatewayOnGnosis.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz, @unknownunknown1]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../arbitration/IArbitrable.sol\\\";\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// Foreign Gateway\\n/// Counterpart of `HomeGateway`\\ncontract ForeignGatewayOnGnosis is IForeignGateway {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeData {\\n uint248 id;\\n bool ruled;\\n address arbitrable;\\n uint256 paid;\\n address relayer;\\n }\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event OutgoingDispute(\\n bytes32 disputeHash,\\n bytes32 blockhash,\\n uint256 localDisputeID,\\n uint256 _choices,\\n bytes _extraData,\\n address arbitrable\\n );\\n\\n event ArbitrationCostModified(uint96 indexed _courtID, uint256 _feeForJuror);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n IERC20 public immutable weth; // WETH token on xDai.\\n uint256 internal localDisputeID = 1; // The disputeID must start from 1 as the KlerosV1 proxy governor depends on this implementation. We now also depend on localDisputeID not ever being zero.\\n mapping(uint96 => uint256) public feeForJuror; // feeForJuror[courtID], it mirrors the value on KlerosCore.\\n address public governor;\\n address public veaOutbox;\\n uint256 public immutable senderChainID;\\n address public override senderGateway;\\n address public deprecatedVeaOutbox;\\n uint256 public deprecatedVeaOutboxExpiration;\\n mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyFromVea(address _messageSender) {\\n require(\\n veaOutbox == msg.sender ||\\n (block.timestamp < deprecatedVeaOutboxExpiration && deprecatedVeaOutbox == msg.sender),\\n \\\"Access not allowed: Vea Outbox only.\\\"\\n );\\n require(_messageSender == senderGateway, \\\"Access not allowed: Sender Gateway only.\\\");\\n _;\\n }\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(address _governor, address _veaOutbox, address _senderGateway, uint256 _senderChainID, IERC20 _weth) {\\n governor = _governor;\\n veaOutbox = _veaOutbox;\\n senderGateway = _senderGateway;\\n senderChainID = _senderChainID;\\n weth = _weth;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n /// @dev Changes the outbox.\\n /// @param _veaOutbox The address of the new outbox.\\n /// @param _gracePeriod The duration to accept messages from the deprecated bridge (if at all).\\n function changeVea(address _veaOutbox, uint256 _gracePeriod) external onlyByGovernor {\\n // grace period to relay the remaining messages which are still going through the deprecated bridge.\\n deprecatedVeaOutboxExpiration = block.timestamp + _gracePeriod;\\n deprecatedVeaOutbox = veaOutbox;\\n veaOutbox = _veaOutbox;\\n }\\n\\n /// @dev Changes the sender gateway.\\n /// @param _senderGateway The address of the new sender gateway.\\n function changeReceiverGateway(address _senderGateway) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n senderGateway = _senderGateway;\\n }\\n\\n /// @dev Changes the `feeForJuror` property value of a specified court.\\n /// @param _courtID The ID of the court.\\n /// @param _feeForJuror The new value for the `feeForJuror` property value.\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n feeForJuror[_courtID] = _feeForJuror;\\n emit ArbitrationCostModified(_courtID, _feeForJuror);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function createDispute(\\n uint256 /*_choices*/,\\n bytes calldata /*_extraData*/\\n ) external payable override returns (uint256 disputeID) {\\n revert(\\\"Fees should be paid in WETH\\\");\\n }\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external override returns (uint256 disputeID) {\\n // This check is duplicated in xKlerosLiquid and transferred is done there as well.\\n require(_amount >= arbitrationCost(_extraData), \\\"Not paid enough for arbitration\\\");\\n\\n disputeID = localDisputeID++;\\n uint256 chainID;\\n assembly {\\n chainID := chainid()\\n }\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n chainID,\\n blockhash(block.number - 1),\\n \\\"createDispute\\\",\\n disputeID,\\n _choices,\\n _extraData,\\n msg.sender\\n )\\n );\\n\\n disputeHashtoDisputeData[disputeHash] = DisputeData({\\n id: uint248(disputeID),\\n arbitrable: msg.sender,\\n paid: _amount,\\n relayer: address(0),\\n ruled: false\\n });\\n\\n emit OutgoingDispute(disputeHash, blockhash(block.number - 1), disputeID, _choices, _extraData, msg.sender);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n function arbitrationCost(bytes calldata _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors) = extraDataToCourtIDMinJurors(_extraData);\\n cost = feeForJuror[courtID] * minJurors;\\n }\\n\\n /// Relay the rule call from the home gateway to the arbitrable.\\n function relayRule(\\n address _messageSender,\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _relayer\\n ) external override onlyFromVea(_messageSender) {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(!dispute.ruled, \\\"Cannot rule twice\\\");\\n\\n dispute.ruled = true;\\n dispute.relayer = _relayer;\\n\\n IArbitrable arbitrable = IArbitrable(dispute.arbitrable);\\n arbitrable.rule(dispute.id, _ruling);\\n }\\n\\n function withdrawFees(bytes32 _disputeHash) external override {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(dispute.ruled, \\\"Not ruled yet\\\");\\n\\n uint256 amount = dispute.paid;\\n dispute.paid = 0;\\n weth.transfer(dispute.relayer, amount);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view override returns (uint256) {\\n return disputeHashtoDisputeData[_disputeHash].id;\\n }\\n\\n // ************************ //\\n // * Internal * //\\n // ************************ //\\n\\n function extraDataToCourtIDMinJurors(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors) {\\n // Note that here we ignore DisputeKitID\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n }\\n if (feeForJuror[courtID] == 0) courtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n } else {\\n courtID = 0;\\n minJurors = MIN_JURORS;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5b2fe8b71160e0be6d07cbf73f04368cb899cc904de8c043da942654e559c020\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\nimport \\\"@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator, IReceiverGateway {\\n /// Relay the rule call from the home gateway to the arbitrable.\\n function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external returns (uint256 disputeID);\\n}\\n\",\"keccak256\":\"0xd081ed3d89ec00abb1c63b2e386b5b4486f02ddb00ed7c959adef3226e969fe9\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c0604052600160005534801561001557600080fd5b50604051620011bc380380620011bc8339810160408190526100369161009d565b600280546001600160a01b03199081166001600160a01b039788161790915560038054821695871695909517909455600480549094169285169290921790925560a09190915216608052610108565b6001600160a01b038116811461009a57600080fd5b50565b600080600080600060a086880312156100b557600080fd5b85516100c081610085565b60208701519095506100d181610085565b60408701519094506100e281610085565b6060870151608088015191945092506100fa81610085565b809150509295509295909350565b60805160a0516110876200013560003960006102500152600081816101ef0152610afa01526110876000f3fe60806040526004361061011f5760003560e01c8063979f8e65116100a0578063dea580b911610064578063dea580b9146103e7578063e4c0aaf414610407578063eaff425a14610427578063ebb711941461043c578063f7434ea91461045c57600080fd5b8063979f8e65146102d2578063a60a4db5146102f2578063c13517e114610312578063ce0aaf9514610325578063d3c617ff1461034557600080fd5b806345c90441116100e757806345c90441146102115780634def54551461023e57806367c519471461027257806369cd2cea1461029257806393626084146102b257600080fd5b80630c340a24146101245780631debaba6146101615780632e1db8901461018357806336e41d3d146101c75780633fc8cef3146101dd575b600080fd5b34801561013057600080fd5b50600254610144906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016d57600080fd5b5061018161017c366004610c6a565b61047c565b005b34801561018f57600080fd5b506101b961019e366004610c94565b6000908152600760205260409020546001600160f81b031690565b604051908152602001610158565b3480156101d357600080fd5b506101b960065481565b3480156101e957600080fd5b506101447f000000000000000000000000000000000000000000000000000000000000000081565b34801561021d57600080fd5b506101b961022c366004610cc4565b60016020526000908152604090205481565b34801561024a57600080fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561027e57600080fd5b5061018161028d366004610ce6565b6104ed565b34801561029e57600080fd5b506101816102ad366004610d02565b610570565b3480156102be57600080fd5b50600554610144906001600160a01b031681565b3480156102de57600080fd5b506101b96102ed366004610d66565b6105bc565b3480156102fe57600080fd5b5061018161030d366004610db9565b61078a565b6101b9610320366004610dff565b6109aa565b34801561033157600080fd5b50600454610144906001600160a01b031681565b34801561035157600080fd5b506103a9610360366004610c94565b60076020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a001610158565b3480156103f357600080fd5b50600354610144906001600160a01b031681565b34801561041357600080fd5b50610181610422366004610d02565b6109f5565b34801561043357600080fd5b506101b9600381565b34801561044857600080fd5b50610181610457366004610c94565b610a41565b34801561046857600080fd5b506101b9610477366004610e4b565b610b6f565b6002546001600160a01b031633146104af5760405162461bcd60e51b81526004016104a690610e8d565b60405180910390fd5b6104b98142610ee5565b6006555060038054600580546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b031633146105175760405162461bcd60e51b81526004016104a690610e8d565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c596906105649084815260200190565b60405180910390a25050565b6002546001600160a01b0316331461059a5760405162461bcd60e51b81526004016104a690610e8d565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006105c88484610b6f565b8210156106175760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e0060448201526064016104a6565b60008054908061062683610efe565b9091555090504660008161063b600143610f17565b4084898989336040516020016106579796959493929190610f2a565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038088168552600085840181815233878701908152606088018c815260808901848152868552600790975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d8869982469082906107329043610f17565b40858a8a8a3360405161074b9796959493929190610f8a565b60405180910390a1604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050949350505050565b60035484906001600160a01b03163314806107bb5750600654421080156107bb57506005546001600160a01b031633145b6108135760405162461bcd60e51b8152602060048201526024808201527f416363657373206e6f7420616c6c6f7765643a20566561204f7574626f78206f60448201526337363c9760e11b60648201526084016104a6565b6004546001600160a01b038281169116146108815760405162461bcd60e51b815260206004820152602860248201527f416363657373206e6f7420616c6c6f7765643a2053656e64657220476174657760448201526730bc9037b7363c9760c11b60648201526084016104a6565b6000848152600760205260408120805490916001600160f81b0390911690036108bc5760405162461bcd60e51b81526004016104a690610fe8565b8054600160f81b900460ff16156109095760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b60448201526064016104a6565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038681166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018790521690819063311a6c5690604401600060405180830381600087803b15801561098957600080fd5b505af115801561099d573d6000803e3d6000fd5b5050505050505050505050565b60405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e2057455448000000000060448201526000906064016104a6565b6002546001600160a01b03163314610a1f5760405162461bcd60e51b81526004016104a690610e8d565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600760205260408120805490916001600160f81b039091169003610a7c5760405162461bcd60e51b81526004016104a690610fe8565b8054600160f81b900460ff16610ac45760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b60448201526064016104a6565b6002810180546000909155600382015460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af1158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b699190611018565b50505050565b6000806000610bb385858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610be592505050565b6001600160601b0382166000908152600160205260409020549193509150610bdc90829061103a565b95945050505050565b6000806040835110610c4257602083015191506040830151905060016000836001600160601b03166001600160601b0316815260200190815260200160002054600003610c3157600091505b80600003610c3d575060035b915091565b50600090506003915091565b80356001600160a01b0381168114610c6557600080fd5b919050565b60008060408385031215610c7d57600080fd5b610c8683610c4e565b946020939093013593505050565b600060208284031215610ca657600080fd5b5035919050565b80356001600160601b0381168114610c6557600080fd5b600060208284031215610cd657600080fd5b610cdf82610cad565b9392505050565b60008060408385031215610cf957600080fd5b610c8683610cad565b600060208284031215610d1457600080fd5b610cdf82610c4e565b60008083601f840112610d2f57600080fd5b50813567ffffffffffffffff811115610d4757600080fd5b602083019150836020828501011115610d5f57600080fd5b9250929050565b60008060008060608587031215610d7c57600080fd5b84359350602085013567ffffffffffffffff811115610d9a57600080fd5b610da687828801610d1d565b9598909750949560400135949350505050565b60008060008060808587031215610dcf57600080fd5b610dd885610c4e565b93506020850135925060408501359150610df460608601610c4e565b905092959194509250565b600080600060408486031215610e1457600080fd5b83359250602084013567ffffffffffffffff811115610e3257600080fd5b610e3e86828701610d1d565b9497909650939450505050565b60008060208385031215610e5e57600080fd5b823567ffffffffffffffff811115610e7557600080fd5b610e8185828601610d1d565b90969095509350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ef857610ef8610ecf565b92915050565b600060018201610f1057610f10610ecf565b5060010190565b81810381811115610ef857610ef8610ecf565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b60006020828403121561102a57600080fd5b81518015158114610cdf57600080fd5b8082028115828204841417610ef857610ef8610ecf56fea26469706673582212207e42e3113b83e97e687ffe3c7ff24a863b4ac22439b2f1f664e755e044a3cc0164736f6c63430008120033", - "deployedBytecode": "0x60806040526004361061011f5760003560e01c8063979f8e65116100a0578063dea580b911610064578063dea580b9146103e7578063e4c0aaf414610407578063eaff425a14610427578063ebb711941461043c578063f7434ea91461045c57600080fd5b8063979f8e65146102d2578063a60a4db5146102f2578063c13517e114610312578063ce0aaf9514610325578063d3c617ff1461034557600080fd5b806345c90441116100e757806345c90441146102115780634def54551461023e57806367c519471461027257806369cd2cea1461029257806393626084146102b257600080fd5b80630c340a24146101245780631debaba6146101615780632e1db8901461018357806336e41d3d146101c75780633fc8cef3146101dd575b600080fd5b34801561013057600080fd5b50600254610144906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016d57600080fd5b5061018161017c366004610c6a565b61047c565b005b34801561018f57600080fd5b506101b961019e366004610c94565b6000908152600760205260409020546001600160f81b031690565b604051908152602001610158565b3480156101d357600080fd5b506101b960065481565b3480156101e957600080fd5b506101447f000000000000000000000000000000000000000000000000000000000000000081565b34801561021d57600080fd5b506101b961022c366004610cc4565b60016020526000908152604090205481565b34801561024a57600080fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561027e57600080fd5b5061018161028d366004610ce6565b6104ed565b34801561029e57600080fd5b506101816102ad366004610d02565b610570565b3480156102be57600080fd5b50600554610144906001600160a01b031681565b3480156102de57600080fd5b506101b96102ed366004610d66565b6105bc565b3480156102fe57600080fd5b5061018161030d366004610db9565b61078a565b6101b9610320366004610dff565b6109aa565b34801561033157600080fd5b50600454610144906001600160a01b031681565b34801561035157600080fd5b506103a9610360366004610c94565b60076020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a001610158565b3480156103f357600080fd5b50600354610144906001600160a01b031681565b34801561041357600080fd5b50610181610422366004610d02565b6109f5565b34801561043357600080fd5b506101b9600381565b34801561044857600080fd5b50610181610457366004610c94565b610a41565b34801561046857600080fd5b506101b9610477366004610e4b565b610b6f565b6002546001600160a01b031633146104af5760405162461bcd60e51b81526004016104a690610e8d565b60405180910390fd5b6104b98142610ee5565b6006555060038054600580546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b031633146105175760405162461bcd60e51b81526004016104a690610e8d565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c596906105649084815260200190565b60405180910390a25050565b6002546001600160a01b0316331461059a5760405162461bcd60e51b81526004016104a690610e8d565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006105c88484610b6f565b8210156106175760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e0060448201526064016104a6565b60008054908061062683610efe565b9091555090504660008161063b600143610f17565b4084898989336040516020016106579796959493929190610f2a565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038088168552600085840181815233878701908152606088018c815260808901848152868552600790975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d8869982469082906107329043610f17565b40858a8a8a3360405161074b9796959493929190610f8a565b60405180910390a1604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050949350505050565b60035484906001600160a01b03163314806107bb5750600654421080156107bb57506005546001600160a01b031633145b6108135760405162461bcd60e51b8152602060048201526024808201527f416363657373206e6f7420616c6c6f7765643a20566561204f7574626f78206f60448201526337363c9760e11b60648201526084016104a6565b6004546001600160a01b038281169116146108815760405162461bcd60e51b815260206004820152602860248201527f416363657373206e6f7420616c6c6f7765643a2053656e64657220476174657760448201526730bc9037b7363c9760c11b60648201526084016104a6565b6000848152600760205260408120805490916001600160f81b0390911690036108bc5760405162461bcd60e51b81526004016104a690610fe8565b8054600160f81b900460ff16156109095760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b60448201526064016104a6565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038681166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018790521690819063311a6c5690604401600060405180830381600087803b15801561098957600080fd5b505af115801561099d573d6000803e3d6000fd5b5050505050505050505050565b60405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e2057455448000000000060448201526000906064016104a6565b6002546001600160a01b03163314610a1f5760405162461bcd60e51b81526004016104a690610e8d565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600760205260408120805490916001600160f81b039091169003610a7c5760405162461bcd60e51b81526004016104a690610fe8565b8054600160f81b900460ff16610ac45760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b60448201526064016104a6565b6002810180546000909155600382015460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af1158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b699190611018565b50505050565b6000806000610bb385858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610be592505050565b6001600160601b0382166000908152600160205260409020549193509150610bdc90829061103a565b95945050505050565b6000806040835110610c4257602083015191506040830151905060016000836001600160601b03166001600160601b0316815260200190815260200160002054600003610c3157600091505b80600003610c3d575060035b915091565b50600090506003915091565b80356001600160a01b0381168114610c6557600080fd5b919050565b60008060408385031215610c7d57600080fd5b610c8683610c4e565b946020939093013593505050565b600060208284031215610ca657600080fd5b5035919050565b80356001600160601b0381168114610c6557600080fd5b600060208284031215610cd657600080fd5b610cdf82610cad565b9392505050565b60008060408385031215610cf957600080fd5b610c8683610cad565b600060208284031215610d1457600080fd5b610cdf82610c4e565b60008083601f840112610d2f57600080fd5b50813567ffffffffffffffff811115610d4757600080fd5b602083019150836020828501011115610d5f57600080fd5b9250929050565b60008060008060608587031215610d7c57600080fd5b84359350602085013567ffffffffffffffff811115610d9a57600080fd5b610da687828801610d1d565b9598909750949560400135949350505050565b60008060008060808587031215610dcf57600080fd5b610dd885610c4e565b93506020850135925060408501359150610df460608601610c4e565b905092959194509250565b600080600060408486031215610e1457600080fd5b83359250602084013567ffffffffffffffff811115610e3257600080fd5b610e3e86828701610d1d565b9497909650939450505050565b60008060208385031215610e5e57600080fd5b823567ffffffffffffffff811115610e7557600080fd5b610e8185828601610d1d565b90969095509350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ef857610ef8610ecf565b92915050565b600060018201610f1057610f10610ecf565b5060010190565b81810381811115610ef857610ef8610ecf565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b60006020828403121561102a57600080fd5b81518015158114610cdf57600080fd5b8082028115828204841417610ef857610ef8610ecf56fea26469706673582212207e42e3113b83e97e687ffe3c7ff24a863b4ac22439b2f1f664e755e044a3cc0164736f6c63430008120033", + "numDeployments": 4, + "solcInputHash": "961befc2fb36daa22c7c449f4b260d32", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_veaOutbox\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_homeChainID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_homeGateway\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"AcceptedFeeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"ArbitrationCostModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_foreignBlockHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_foreignArbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_foreignDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"CrossChainDisputeOutgoing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_NB_OF_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeCourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_homeGateway\",\"type\":\"address\"}],\"name\":\"changeHomeGateway\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_veaOutbox\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gracePeriod\",\"type\":\"uint256\"}],\"name\":\"changeVea\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deprecatedVeaOutbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deprecatedVeaOutboxExpiration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToForeignID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoDisputeData\",\"outputs\":[{\"internalType\":\"uint248\",\"name\":\"id\",\"type\":\"uint248\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"feeForJuror\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"homeChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"homeGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageSender\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"}],\"name\":\"relayRule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"veaOutbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"AcceptedFeeToken(address,bool)\":{\"details\":\"To be emitted when an ERC20 token is added or removed as a method to pay fees.\",\"params\":{\"_accepted\":\"Whether the token is accepted or not.\",\"_token\":\"The ERC20 token.\"}},\"CrossChainDisputeOutgoing(bytes32,address,uint256,uint256,bytes)\":{\"details\":\"To be emitted when a dispute is sent to the IHomeGateway.\",\"params\":{\"_foreignArbitrable\":\"The address of the Arbitrable contract.\",\"_foreignBlockHash\":\"foreignBlockHash\",\"_foreignDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\"}},\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration denominated in the native currency, typically ETH. 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.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost in ETH.\"}},\"arbitrationCost(bytes,address)\":{\"details\":\"Compute the cost of arbitration denominated in `_feeToken`. 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.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeToken\":\"The ERC20 token used to pay fees.\"},\"returns\":{\"_0\":\"The arbitration cost in `_feeToken`.\"}},\"changeCourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court on the v2 arbitrator. Not to be confused with the courtID on KlerosLiquid.\",\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"changeHomeGateway(address)\":{\"details\":\"Changes the home gateway.\",\"params\":{\"_homeGateway\":\"The address of the new home gateway.\"}},\"changeVea(address,uint256)\":{\"details\":\"Changes the outbox.\",\"params\":{\"_gracePeriod\":\"The duration to accept messages from the deprecated bridge (if at all).\",\"_veaOutbox\":\"The address of the new outbox.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"createDispute(uint256,bytes,address,uint256)\":{\"details\":\"Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeAmount\":\"Amount of the ERC20 token used to pay fees.\",\"_feeToken\":\"The ERC20 token used to pay fees.\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"_0\":\"The identifier of the dispute created.\"}},\"disputeHashToForeignID(bytes32)\":{\"details\":\"Looks up the local foreign disputeID for a disputeHash\",\"params\":{\"_disputeHash\":\"dispute hash\"}},\"withdrawFees(bytes32)\":{\"params\":{\"_disputeHash\":\"The dispute hash for which to withdraw the fees.\"}}},\"stateVariables\":{\"homeChainID\":{\"return\":\"The chain ID where the corresponding home gateway is deployed.\",\"returns\":{\"_0\":\"The chain ID where the corresponding home gateway is deployed.\"}},\"homeGateway\":{\"return\":\"The address of the corresponding home gateway.\",\"returns\":{\"_0\":\"The address of the corresponding home gateway.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"relayRule(address,bytes32,uint256,address)\":{\"notice\":\"Relay the rule call from the home gateway to the arbitrable.\"},\"withdrawFees(bytes32)\":{\"notice\":\"Reimburses the dispute fees to the relayer who paid for these fees on the home chain.\"}},\"notice\":\"Foreign Gateway Counterpart of `HomeGateway`\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/ForeignGateway.sol\":\"ForeignGateway\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @shotaronowhere]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\ninterface IReceiverGateway {\\n function veaOutbox() external view returns (address);\\n\\n function senderGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0xde6bdbe57ced7c1e79d62dca23aa8c2322e031da91ceac22cefd185f1e3740ef\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice 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);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n event DisputeTemplate(uint256 indexed _templateId, string indexed _templateTag, string _templateData);\\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 _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// 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 The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7a259401627ba5546d9eb0264275aa1be9762f8a514545ae99d8c356ebf41f4f\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). 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).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// 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 Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x9001274313a4e7eeda92332bbeeac8972f55e6378874babfaccd56eb283816f0\",\"license\":\"MIT\"},\"src/gateway/ForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\n\\n/// Foreign Gateway\\n/// Counterpart of `HomeGateway`\\ncontract ForeignGateway is IForeignGateway {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeData {\\n uint248 id;\\n bool ruled;\\n address arbitrable;\\n uint256 paid;\\n address relayer;\\n }\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event ArbitrationCostModified(uint96 indexed _courtID, uint256 _feeForJuror);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n uint256 internal localDisputeID = 1; // The disputeID must start from 1 as the KlerosV1 proxy governor depends on this implementation. We now also depend on localDisputeID not ever being zero.\\n mapping(uint96 => uint256) public feeForJuror; // feeForJuror[v2CourtID], it mirrors the value on KlerosCore.\\n address public governor;\\n address public veaOutbox;\\n uint256 public immutable override homeChainID;\\n address public override homeGateway;\\n address public deprecatedVeaOutbox;\\n uint256 public deprecatedVeaOutboxExpiration;\\n mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyFromVea(address _messageSender) {\\n require(\\n veaOutbox == msg.sender ||\\n (block.timestamp < deprecatedVeaOutboxExpiration && deprecatedVeaOutbox == msg.sender),\\n \\\"Access not allowed: Vea Outbox only.\\\"\\n );\\n require(_messageSender == homeGateway, \\\"Access not allowed: HomeGateway only.\\\");\\n _;\\n }\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(address _governor, address _veaOutbox, uint256 _homeChainID, address _homeGateway) {\\n governor = _governor;\\n veaOutbox = _veaOutbox;\\n homeChainID = _homeChainID;\\n homeGateway = _homeGateway;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n /// @dev Changes the outbox.\\n /// @param _veaOutbox The address of the new outbox.\\n /// @param _gracePeriod The duration to accept messages from the deprecated bridge (if at all).\\n function changeVea(address _veaOutbox, uint256 _gracePeriod) external onlyByGovernor {\\n // grace period to relay the remaining messages which are still going through the deprecated bridge.\\n deprecatedVeaOutboxExpiration = block.timestamp + _gracePeriod;\\n deprecatedVeaOutbox = veaOutbox;\\n veaOutbox = _veaOutbox;\\n }\\n\\n /// @dev Changes the home gateway.\\n /// @param _homeGateway The address of the new home gateway.\\n function changeHomeGateway(address _homeGateway) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n homeGateway = _homeGateway;\\n }\\n\\n /// @dev Changes the `feeForJuror` property value of a specified court.\\n /// @param _courtID The ID of the court on the v2 arbitrator. Not to be confused with the courtID on KlerosLiquid.\\n /// @param _feeForJuror The new value for the `feeForJuror` property value.\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n feeForJuror[_courtID] = _feeForJuror;\\n emit ArbitrationCostModified(_courtID, _feeForJuror);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _choices,\\n bytes calldata _extraData\\n ) external payable override returns (uint256 disputeID) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"Not paid enough for arbitration\\\");\\n\\n disputeID = localDisputeID++;\\n uint256 chainID;\\n assembly {\\n chainID := chainid()\\n }\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n \\\"createDispute\\\",\\n blockhash(block.number - 1),\\n chainID,\\n msg.sender,\\n disputeID,\\n _choices,\\n _extraData\\n )\\n );\\n\\n disputeHashtoDisputeData[disputeHash] = DisputeData({\\n id: uint248(disputeID),\\n arbitrable: msg.sender,\\n paid: msg.value,\\n relayer: address(0),\\n ruled: false\\n });\\n\\n emit CrossChainDisputeOutgoing(blockhash(block.number - 1), msg.sender, disputeID, _choices, _extraData);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 /*_choices*/,\\n bytes calldata /*_extraData*/,\\n IERC20 /*_feeToken*/,\\n uint256 /*_feeAmount*/\\n ) external pure override returns (uint256) {\\n revert(\\\"Not supported\\\");\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function arbitrationCost(bytes calldata _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors) = extraDataToCourtIDMinJurors(_extraData);\\n cost = feeForJuror[courtID] * minJurors;\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function arbitrationCost(\\n bytes calldata /*_extraData*/,\\n IERC20 /*_feeToken*/\\n ) public pure override returns (uint256 /*cost*/) {\\n revert(\\\"Not supported\\\");\\n }\\n\\n /// @inheritdoc IForeignGateway\\n function relayRule(\\n address _messageSender,\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _relayer\\n ) external override onlyFromVea(_messageSender) {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(!dispute.ruled, \\\"Cannot rule twice\\\");\\n\\n dispute.ruled = true;\\n dispute.relayer = _relayer;\\n\\n IArbitrableV2 arbitrable = IArbitrableV2(dispute.arbitrable);\\n arbitrable.rule(dispute.id, _ruling);\\n }\\n\\n /// @inheritdoc IForeignGateway\\n function withdrawFees(bytes32 _disputeHash) external override {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(dispute.ruled, \\\"Not ruled yet\\\");\\n\\n uint256 amount = dispute.paid;\\n dispute.paid = 0;\\n payable(dispute.relayer).transfer(amount);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @inheritdoc IForeignGateway\\n function disputeHashToForeignID(bytes32 _disputeHash) external view override returns (uint256) {\\n return disputeHashtoDisputeData[_disputeHash].id;\\n }\\n\\n /// @inheritdoc IReceiverGateway\\n function senderGateway() external view override returns (address) {\\n return homeGateway;\\n }\\n\\n function currentRuling(\\n uint256 /*_disputeID*/\\n ) public pure returns (uint256 /*ruling*/, bool /*tied*/, bool /*overridden*/) {\\n revert(\\\"Not supported\\\");\\n }\\n\\n // ************************ //\\n // * Internal * //\\n // ************************ //\\n\\n function extraDataToCourtIDMinJurors(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors) {\\n // Note that here we ignore DisputeKitID\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n }\\n if (feeForJuror[courtID] == 0) courtID = 0;\\n if (minJurors == 0) minJurors = DEFAULT_NB_OF_JURORS;\\n } else {\\n courtID = 0;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x22ebbed56967cbb41908e6636be3c06b4c528bcb9f1f7556fecdf98945d717a8\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../../arbitration/interfaces/IArbitratorV2.sol\\\";\\nimport \\\"@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol\\\";\\n\\ninterface IForeignGateway is IArbitratorV2, IReceiverGateway {\\n /// @dev To be emitted when a dispute is sent to the IHomeGateway.\\n /// @param _foreignBlockHash foreignBlockHash\\n /// @param _foreignArbitrable The address of the Arbitrable contract.\\n /// @param _foreignDisputeID The identifier of the dispute in the Arbitrable contract.\\n event CrossChainDisputeOutgoing(\\n bytes32 _foreignBlockHash,\\n address indexed _foreignArbitrable,\\n uint256 indexed _foreignDisputeID,\\n uint256 _choices,\\n bytes _extraData\\n );\\n\\n /// Relay the rule call from the home gateway to the arbitrable.\\n function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;\\n\\n /// Reimburses the dispute fees to the relayer who paid for these fees on the home chain.\\n /// @param _disputeHash The dispute hash for which to withdraw the fees.\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n /// @dev Looks up the local foreign disputeID for a disputeHash\\n /// @param _disputeHash dispute hash\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n /// @return The chain ID where the corresponding home gateway is deployed.\\n function homeChainID() external view returns (uint256);\\n\\n /// @return The address of the corresponding home gateway.\\n function homeGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x7c403fdd397da09f8ce1a61424f40b0710937ca147c32a6b4f5e4643188abfda\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052600160005534801561001557600080fd5b5060405161118b38038061118b83398101604081905261003491610098565b600280546001600160a01b039586166001600160a01b0319918216179091556003805494861694821694909417909355608091909152600480549190931691161790556100e5565b80516001600160a01b038116811461009357600080fd5b919050565b600080600080608085870312156100ae57600080fd5b6100b78561007c565b93506100c56020860161007c565b9250604085015191506100da6060860161007c565b905092959194509250565b60805161108b61010060003960006101e8015261108b6000f3fe6080604052600436106101355760003560e01c8063a60a4db5116100ab578063d98493f61161006f578063d98493f614610419578063dea580b914610439578063e4c0aaf414610459578063ebb7119414610479578063f6506db414610499578063f7434ea9146104b457600080fd5b8063a60a4db514610311578063bcb1a16614610331578063c13517e114610346578063ce0aaf9514610359578063d3c617ff1461037757600080fd5b806336e41d3d116100fd57806336e41d3d1461024e57806345c9044114610264578063492d85d4146102915780634d53c2a5146102b157806367c51947146102d157806393626084146102f157600080fd5b80630c340a241461013a5780631c3db16d146101775780631debaba6146101b45780631fc6b556146101d65780632e1db89014610218575b600080fd5b34801561014657600080fd5b5060025461015a906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018357600080fd5b50610197610192366004610c01565b6104d4565b60408051938452911515602084015215159082015260600161016e565b3480156101c057600080fd5b506101d46101cf366004610c32565b6104fa565b005b3480156101e257600080fd5b5061020a7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161016e565b34801561022457600080fd5b5061020a610233366004610c01565b6000908152600760205260409020546001600160f81b031690565b34801561025a57600080fd5b5061020a60065481565b34801561027057600080fd5b5061020a61027f366004610c7a565b60016020526000908152604090205481565b34801561029d57600080fd5b506101d46102ac366004610c9c565b610562565b3480156102bd57600080fd5b5060045461015a906001600160a01b031681565b3480156102dd57600080fd5b506101d46102ec366004610cb9565b6105ae565b3480156102fd57600080fd5b5060055461015a906001600160a01b031681565b34801561031d57600080fd5b506101d461032c366004610cd5565b610631565b34801561033d57600080fd5b5061020a600381565b61020a610354366004610d68565b61084e565b34801561036557600080fd5b506004546001600160a01b031661015a565b34801561038357600080fd5b506103db610392366004610c01565b60076020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a00161016e565b34801561042557600080fd5b5061020a610434366004610db4565b6109ea565b34801561044557600080fd5b5060035461015a906001600160a01b031681565b34801561046557600080fd5b506101d4610474366004610c9c565b610a04565b34801561048557600080fd5b506101d4610494366004610c01565b610a50565b3480156104a557600080fd5b5061020a610434366004610e0b565b3480156104c057600080fd5b5061020a6104cf366004610e72565b610b22565b600080600060405162461bcd60e51b81526004016104f190610eb4565b60405180910390fd5b6002546001600160a01b031633146105245760405162461bcd60e51b81526004016104f190610edb565b61052e8142610f33565b6006555060038054600580546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b0316331461058c5760405162461bcd60e51b81526004016104f190610edb565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146105d85760405162461bcd60e51b81526004016104f190610edb565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c596906106259084815260200190565b60405180910390a25050565b60035484906001600160a01b031633148061066257506006544210801561066257506005546001600160a01b031633145b6106ba5760405162461bcd60e51b8152602060048201526024808201527f416363657373206e6f7420616c6c6f7765643a20566561204f7574626f78206f60448201526337363c9760e11b60648201526084016104f1565b6004546001600160a01b038281169116146107255760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a20486f6d65476174657761792060448201526437b7363c9760d91b60648201526084016104f1565b6000848152600760205260408120805490916001600160f81b0390911690036107605760405162461bcd60e51b81526004016104f190610f4c565b8054600160f81b900460ff16156107ad5760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b60448201526064016104f1565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038681166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018790521690819063311a6c5690604401600060405180830381600087803b15801561082d57600080fd5b505af1158015610841573d6000803e3d6000fd5b5050505050505050505050565b600061085a8383610b22565b3410156108a95760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e0060448201526064016104f1565b6000805490806108b883610f7c565b9091555090504660006108cc600143610f95565b408233858989896040516020016108e99796959493929190610fa8565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b0380881685526000858401818152338787018181523460608a0190815260808a01858152878652600790985297909320975191511515600160f81b029190931617865551600186810180546001600160a01b039384166001600160a01b031991821617909155955160028801559351600390960180549690911695909416949094179092559092508491907f03e54fa10baada663d819e5d7e4533535bfb6d4407abe51045be84e6c8de0203906109c59043610f95565b408989896040516109d99493929190611001565b60405180910390a350509392505050565b600060405162461bcd60e51b81526004016104f190610eb4565b6002546001600160a01b03163314610a2e5760405162461bcd60e51b81526004016104f190610edb565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600760205260408120805490916001600160f81b039091169003610a8b5760405162461bcd60e51b81526004016104f190610f4c565b8054600160f81b900460ff16610ad35760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b60448201526064016104f1565b600281018054600091829055600383015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015610b1c573d6000803e3d6000fd5b50505050565b6000806000610b6685858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b9892505050565b6001600160601b0382166000908152600160205260409020549193509150610b8f90829061103e565b95945050505050565b6000806040835110610bf557602083015191506040830151905060016000836001600160601b03166001600160601b0316815260200190815260200160002054600003610be457600091505b80600003610bf0575060035b915091565b50600090506003915091565b600060208284031215610c1357600080fd5b5035919050565b6001600160a01b0381168114610c2f57600080fd5b50565b60008060408385031215610c4557600080fd5b8235610c5081610c1a565b946020939093013593505050565b80356001600160601b0381168114610c7557600080fd5b919050565b600060208284031215610c8c57600080fd5b610c9582610c5e565b9392505050565b600060208284031215610cae57600080fd5b8135610c9581610c1a565b60008060408385031215610ccc57600080fd5b610c5083610c5e565b60008060008060808587031215610ceb57600080fd5b8435610cf681610c1a565b935060208501359250604085013591506060850135610d1481610c1a565b939692955090935050565b60008083601f840112610d3157600080fd5b50813567ffffffffffffffff811115610d4957600080fd5b602083019150836020828501011115610d6157600080fd5b9250929050565b600080600060408486031215610d7d57600080fd5b83359250602084013567ffffffffffffffff811115610d9b57600080fd5b610da786828701610d1f565b9497909650939450505050565b600080600060408486031215610dc957600080fd5b833567ffffffffffffffff811115610de057600080fd5b610dec86828701610d1f565b9094509250506020840135610e0081610c1a565b809150509250925092565b600080600080600060808688031215610e2357600080fd5b85359450602086013567ffffffffffffffff811115610e4157600080fd5b610e4d88828901610d1f565b9095509350506040860135610e6181610c1a565b949793965091946060013592915050565b60008060208385031215610e8557600080fd5b823567ffffffffffffffff811115610e9c57600080fd5b610ea885828601610d1f565b90969095509350505050565b6020808252600d908201526c139bdd081cdd5c1c1bdc9d1959609a1b604082015260600190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610f4657610f46610f1d565b92915050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b600060018201610f8e57610f8e610f1d565b5060010190565b81810381811115610f4657610f46610f1d565b6c6372656174654469737075746560981b815287600d82015286602d8201526001600160601b03198660601b16604d820152846061820152836081820152818360a18301376000910160a1019081529695505050505050565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b8082028115828204841417610f4657610f46610f1d56fea2646970667358221220931fd4fe4e99c0813be39446a3a954d163acc18576c61647f74ca12dc071ede964736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101355760003560e01c8063a60a4db5116100ab578063d98493f61161006f578063d98493f614610419578063dea580b914610439578063e4c0aaf414610459578063ebb7119414610479578063f6506db414610499578063f7434ea9146104b457600080fd5b8063a60a4db514610311578063bcb1a16614610331578063c13517e114610346578063ce0aaf9514610359578063d3c617ff1461037757600080fd5b806336e41d3d116100fd57806336e41d3d1461024e57806345c9044114610264578063492d85d4146102915780634d53c2a5146102b157806367c51947146102d157806393626084146102f157600080fd5b80630c340a241461013a5780631c3db16d146101775780631debaba6146101b45780631fc6b556146101d65780632e1db89014610218575b600080fd5b34801561014657600080fd5b5060025461015a906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018357600080fd5b50610197610192366004610c01565b6104d4565b60408051938452911515602084015215159082015260600161016e565b3480156101c057600080fd5b506101d46101cf366004610c32565b6104fa565b005b3480156101e257600080fd5b5061020a7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161016e565b34801561022457600080fd5b5061020a610233366004610c01565b6000908152600760205260409020546001600160f81b031690565b34801561025a57600080fd5b5061020a60065481565b34801561027057600080fd5b5061020a61027f366004610c7a565b60016020526000908152604090205481565b34801561029d57600080fd5b506101d46102ac366004610c9c565b610562565b3480156102bd57600080fd5b5060045461015a906001600160a01b031681565b3480156102dd57600080fd5b506101d46102ec366004610cb9565b6105ae565b3480156102fd57600080fd5b5060055461015a906001600160a01b031681565b34801561031d57600080fd5b506101d461032c366004610cd5565b610631565b34801561033d57600080fd5b5061020a600381565b61020a610354366004610d68565b61084e565b34801561036557600080fd5b506004546001600160a01b031661015a565b34801561038357600080fd5b506103db610392366004610c01565b60076020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a00161016e565b34801561042557600080fd5b5061020a610434366004610db4565b6109ea565b34801561044557600080fd5b5060035461015a906001600160a01b031681565b34801561046557600080fd5b506101d4610474366004610c9c565b610a04565b34801561048557600080fd5b506101d4610494366004610c01565b610a50565b3480156104a557600080fd5b5061020a610434366004610e0b565b3480156104c057600080fd5b5061020a6104cf366004610e72565b610b22565b600080600060405162461bcd60e51b81526004016104f190610eb4565b60405180910390fd5b6002546001600160a01b031633146105245760405162461bcd60e51b81526004016104f190610edb565b61052e8142610f33565b6006555060038054600580546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b0316331461058c5760405162461bcd60e51b81526004016104f190610edb565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146105d85760405162461bcd60e51b81526004016104f190610edb565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c596906106259084815260200190565b60405180910390a25050565b60035484906001600160a01b031633148061066257506006544210801561066257506005546001600160a01b031633145b6106ba5760405162461bcd60e51b8152602060048201526024808201527f416363657373206e6f7420616c6c6f7765643a20566561204f7574626f78206f60448201526337363c9760e11b60648201526084016104f1565b6004546001600160a01b038281169116146107255760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a20486f6d65476174657761792060448201526437b7363c9760d91b60648201526084016104f1565b6000848152600760205260408120805490916001600160f81b0390911690036107605760405162461bcd60e51b81526004016104f190610f4c565b8054600160f81b900460ff16156107ad5760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b60448201526064016104f1565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038681166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018790521690819063311a6c5690604401600060405180830381600087803b15801561082d57600080fd5b505af1158015610841573d6000803e3d6000fd5b5050505050505050505050565b600061085a8383610b22565b3410156108a95760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e0060448201526064016104f1565b6000805490806108b883610f7c565b9091555090504660006108cc600143610f95565b408233858989896040516020016108e99796959493929190610fa8565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b0380881685526000858401818152338787018181523460608a0190815260808a01858152878652600790985297909320975191511515600160f81b029190931617865551600186810180546001600160a01b039384166001600160a01b031991821617909155955160028801559351600390960180549690911695909416949094179092559092508491907f03e54fa10baada663d819e5d7e4533535bfb6d4407abe51045be84e6c8de0203906109c59043610f95565b408989896040516109d99493929190611001565b60405180910390a350509392505050565b600060405162461bcd60e51b81526004016104f190610eb4565b6002546001600160a01b03163314610a2e5760405162461bcd60e51b81526004016104f190610edb565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600760205260408120805490916001600160f81b039091169003610a8b5760405162461bcd60e51b81526004016104f190610f4c565b8054600160f81b900460ff16610ad35760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b60448201526064016104f1565b600281018054600091829055600383015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015610b1c573d6000803e3d6000fd5b50505050565b6000806000610b6685858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b9892505050565b6001600160601b0382166000908152600160205260409020549193509150610b8f90829061103e565b95945050505050565b6000806040835110610bf557602083015191506040830151905060016000836001600160601b03166001600160601b0316815260200190815260200160002054600003610be457600091505b80600003610bf0575060035b915091565b50600090506003915091565b600060208284031215610c1357600080fd5b5035919050565b6001600160a01b0381168114610c2f57600080fd5b50565b60008060408385031215610c4557600080fd5b8235610c5081610c1a565b946020939093013593505050565b80356001600160601b0381168114610c7557600080fd5b919050565b600060208284031215610c8c57600080fd5b610c9582610c5e565b9392505050565b600060208284031215610cae57600080fd5b8135610c9581610c1a565b60008060408385031215610ccc57600080fd5b610c5083610c5e565b60008060008060808587031215610ceb57600080fd5b8435610cf681610c1a565b935060208501359250604085013591506060850135610d1481610c1a565b939692955090935050565b60008083601f840112610d3157600080fd5b50813567ffffffffffffffff811115610d4957600080fd5b602083019150836020828501011115610d6157600080fd5b9250929050565b600080600060408486031215610d7d57600080fd5b83359250602084013567ffffffffffffffff811115610d9b57600080fd5b610da786828701610d1f565b9497909650939450505050565b600080600060408486031215610dc957600080fd5b833567ffffffffffffffff811115610de057600080fd5b610dec86828701610d1f565b9094509250506020840135610e0081610c1a565b809150509250925092565b600080600080600060808688031215610e2357600080fd5b85359450602086013567ffffffffffffffff811115610e4157600080fd5b610e4d88828901610d1f565b9095509350506040860135610e6181610c1a565b949793965091946060013592915050565b60008060208385031215610e8557600080fd5b823567ffffffffffffffff811115610e9c57600080fd5b610ea885828601610d1f565b90969095509350505050565b6020808252600d908201526c139bdd081cdd5c1c1bdc9d1959609a1b604082015260600190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610f4657610f46610f1d565b92915050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b600060018201610f8e57610f8e610f1d565b5060010190565b81810381811115610f4657610f46610f1d565b6c6372656174654469737075746560981b815287600d82015286602d8201526001600160601b03198660601b16604d820152846061820152836081820152818360a18301376000910160a1019081529695505050505050565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b8082028115828204841417610f4657610f46610f1d56fea2646970667358221220931fd4fe4e99c0813be39446a3a954d163acc18576c61647f74ca12dc071ede964736f6c63430008120033", "devdoc": { "events": { + "AcceptedFeeToken(address,bool)": { + "details": "To be emitted when an ERC20 token is added or removed as a method to pay fees.", + "params": { + "_accepted": "Whether the token is accepted or not.", + "_token": "The ERC20 token." + } + }, + "CrossChainDisputeOutgoing(bytes32,address,uint256,uint256,bytes)": { + "details": "To be emitted when a dispute is sent to the IHomeGateway.", + "params": { + "_foreignArbitrable": "The address of the Arbitrable contract.", + "_foreignBlockHash": "foreignBlockHash", + "_foreignDisputeID": "The identifier of the dispute in the Arbitrable contract." + } + }, "DisputeCreation(uint256,address)": { "details": "To be emitted when a dispute is created.", "params": { "_arbitrable": "The contract which created the dispute.", - "_disputeID": "ID of the dispute." + "_disputeID": "The identifier of the dispute in the Arbitrator contract." } }, "Ruling(address,uint256,uint256)": { "details": "To be raised when a ruling is given.", "params": { "_arbitrable": "The arbitrable receiving the ruling.", - "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", "_ruling": "The ruling which was given." } } @@ -544,18 +624,28 @@ "kind": "dev", "methods": { "arbitrationCost(bytes)": { - "details": "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.", + "details": "Compute the cost of arbitration denominated in the native currency, typically ETH. 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.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes)." + }, + "returns": { + "cost": "The arbitration cost in ETH." + } + }, + "arbitrationCost(bytes,address)": { + "details": "Compute the cost of arbitration denominated in `_feeToken`. 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.", "params": { - "_extraData": "Can be used to give additional info on the dispute to be created." + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeToken": "The ERC20 token used to pay fees." }, "returns": { - "cost": "Required cost of arbitration." + "_0": "The arbitration cost in `_feeToken`." } }, "changeCourtJurorFee(uint96,uint256)": { "details": "Changes the `feeForJuror` property value of a specified court.", "params": { - "_courtID": "The ID of the court.", + "_courtID": "The ID of the court on the v2 arbitrator. Not to be confused with the courtID on KlerosLiquid.", "_feeForJuror": "The new value for the `feeForJuror` property value." } }, @@ -565,10 +655,10 @@ "_governor": "The address of the new governor." } }, - "changeReceiverGateway(address)": { - "details": "Changes the sender gateway.", + "changeHomeGateway(address)": { + "details": "Changes the home gateway.", "params": { - "_senderGateway": "The address of the new sender gateway." + "_homeGateway": "The address of the new home gateway." } }, "changeVea(address,uint256)": { @@ -577,6 +667,53 @@ "_gracePeriod": "The duration to accept messages from the deprecated bridge (if at all).", "_veaOutbox": "The address of the new outbox." } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "createDispute(uint256,bytes,address,uint256)": { + "details": "Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeAmount": "Amount of the ERC20 token used to pay fees.", + "_feeToken": "The ERC20 token used to pay fees.", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "_0": "The identifier of the dispute created." + } + }, + "disputeHashToForeignID(bytes32)": { + "details": "Looks up the local foreign disputeID for a disputeHash", + "params": { + "_disputeHash": "dispute hash" + } + }, + "withdrawFees(bytes32)": { + "params": { + "_disputeHash": "The dispute hash for which to withdraw the fees." + } + } + }, + "stateVariables": { + "homeChainID": { + "return": "The chain ID where the corresponding home gateway is deployed.", + "returns": { + "_0": "The chain ID where the corresponding home gateway is deployed." + } + }, + "homeGateway": { + "return": "The address of the corresponding home gateway.", + "returns": { + "_0": "The address of the corresponding home gateway." + } } }, "version": 1 @@ -586,6 +723,9 @@ "methods": { "relayRule(address,bytes32,uint256,address)": { "notice": "Relay the rule call from the home gateway to the arbitrable." + }, + "withdrawFees(bytes32)": { + "notice": "Reimburses the dispute fees to the relayer who paid for these fees on the home chain." } }, "notice": "Foreign Gateway Counterpart of `HomeGateway`", @@ -594,68 +734,68 @@ "storageLayout": { "storage": [ { - "astId": 10873, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15413, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "localDisputeID", "offset": 0, "slot": "0", "type": "t_uint256" }, { - "astId": 10877, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15417, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "feeForJuror", "offset": 0, "slot": "1", "type": "t_mapping(t_uint96,t_uint256)" }, { - "astId": 10879, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15419, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "governor", "offset": 0, "slot": "2", "type": "t_address" }, { - "astId": 10881, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15421, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "veaOutbox", "offset": 0, "slot": "3", "type": "t_address" }, { - "astId": 10886, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", - "label": "senderGateway", + "astId": 15427, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "homeGateway", "offset": 0, "slot": "4", "type": "t_address" }, { - "astId": 10888, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15429, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "deprecatedVeaOutbox", "offset": 0, "slot": "5", "type": "t_address" }, { - "astId": 10890, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15431, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "deprecatedVeaOutboxExpiration", "offset": 0, "slot": "6", "type": "t_uint256" }, { - "astId": 10895, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15436, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "disputeHashtoDisputeData", "offset": 0, "slot": "7", - "type": "t_mapping(t_bytes32,t_struct(DisputeData)10844_storage)" + "type": "t_mapping(t_bytes32,t_struct(DisputeData)15401_storage)" } ], "types": { @@ -674,12 +814,12 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_mapping(t_bytes32,t_struct(DisputeData)10844_storage)": { + "t_mapping(t_bytes32,t_struct(DisputeData)15401_storage)": { "encoding": "mapping", "key": "t_bytes32", - "label": "mapping(bytes32 => struct ForeignGatewayOnGnosis.DisputeData)", + "label": "mapping(bytes32 => struct ForeignGateway.DisputeData)", "numberOfBytes": "32", - "value": "t_struct(DisputeData)10844_storage" + "value": "t_struct(DisputeData)15401_storage" }, "t_mapping(t_uint96,t_uint256)": { "encoding": "mapping", @@ -688,45 +828,45 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(DisputeData)10844_storage": { + "t_struct(DisputeData)15401_storage": { "encoding": "inplace", - "label": "struct ForeignGatewayOnGnosis.DisputeData", + "label": "struct ForeignGateway.DisputeData", "members": [ { - "astId": 10835, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15392, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "id", "offset": 0, "slot": "0", "type": "t_uint248" }, { - "astId": 10837, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15394, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "ruled", "offset": 31, "slot": "0", "type": "t_bool" }, { - "astId": 10839, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15396, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "arbitrable", "offset": 0, "slot": "1", "type": "t_address" }, { - "astId": 10841, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15398, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "paid", "offset": 0, "slot": "2", "type": "t_uint256" }, { - "astId": 10843, - "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "astId": 15400, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "relayer", "offset": 0, "slot": "3", diff --git a/contracts/deployments/goerli/ArbitrableExample.json b/contracts/deployments/goerli/ArbitrableExample.json deleted file mode 100644 index 35f2071af..000000000 --- a/contracts/deployments/goerli/ArbitrableExample.json +++ /dev/null @@ -1,434 +0,0 @@ -{ - "address": "0xd78dcdde2c5a2bd4bb246bc7db6994b95f7c442c", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IArbitrator", - "name": "_arbitrator", - "type": "address" - }, - { - "internalType": "string", - "name": "_metaEvidence", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "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": "uint256", - "name": "_metaEvidenceID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "_evidence", - "type": "string" - } - ], - "name": "MetaEvidence", - "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" - }, - { - "inputs": [], - "name": "arbitrator", - "outputs": [ - { - "internalType": "contract IArbitrator", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_metaEvidence", - "type": "string" - } - ], - "name": "changedMetaEvidence", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_numberOfRulingOptions", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_arbitratorExtraData", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_evidenceGroupID", - "type": "uint256" - } - ], - "name": "createDispute", - "outputs": [ - { - "internalType": "uint256", - "name": "disputeID", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "disputes", - "outputs": [ - { - "internalType": "bool", - "name": "isRuled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "ruling", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "numberOfRulingOptions", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "externalIDtoLocalID", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "governor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_externalDisputeID", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_ruling", - "type": "uint256" - } - ], - "name": "rule", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x02f544b818f85a5e49415f54f72cbdcd348cb7d38a85a397c4002d04c2899001", - "receipt": { - "to": null, - "from": "0xf50e77f2a2b6138d16c6c7511562e5c33c4b15a3", - "contractAddress": "0xd78dcdde2c5a2bd4bb246bc7db6994b95f7c442c", - "transactionIndex": "0x86", - "gasUsed": "0x8fe6b", - "logsBloom": "0x00000000004000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000010000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000800000000000000000000000000000000000000000000000000000", - "blockHash": "0x7f79a91d98ee2d2de471aab05c9452a352fe25395d02660f82fdc717605258b9", - "transactionHash": "0x02f544b818f85a5e49415f54f72cbdcd348cb7d38a85a397c4002d04c2899001", - "logs": [ - { - "address": "0xd78dcdde2c5a2bd4bb246bc7db6994b95f7c442c", - "blockHash": "0x7f79a91d98ee2d2de471aab05c9452a352fe25395d02660f82fdc717605258b9", - "blockNumber": "0x7851ab", - "data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000007b68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f6b6c65726f732f6b6c65726f732d76322f6d61737465722f636f6e7472616374732f6465706c6f796d656e74732f72696e6b6562792f4d65746145766964656e63655f41726269747261626c654578616d706c652e6a736f6e0000000000", - "logIndex": "0x11c", - "removed": false, - "topics": [ - "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "transactionHash": "0x02f544b818f85a5e49415f54f72cbdcd348cb7d38a85a397c4002d04c2899001", - "transactionIndex": "0x86" - } - ], - "blockNumber": "0x7851ab", - "cumulativeGasUsed": "0x182bf1f", - "status": "0x1" - }, - "args": [ - "0x4401a368dea8d5761aeeffd3c4a674086dea0666", - "https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json" - ], - "numDeployments": 2, - "solcInputHash": "f57208d12ea18de1e79aa93372bf0e19", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"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\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"}],\"name\":\"changedMetaEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_metaEvidence\":\"The URI of the meta evidence object for evidence submissions requests.\"}},\"createDispute(uint256,bytes,uint256)\":{\"details\":\"TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group that is linked to this dispute.\",\"_numberOfRulingOptions\":\"Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\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, uint256 indexed _disputeID, uint256 _ruling);\\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 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(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). 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).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\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(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay 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(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\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 Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0xe63efdae904b4299c17efd4c6174869a49fbfe1b11ccfd05fcc22e735ced7b26\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"../IArbitrable.sol\\\";\\nimport \\\"../../evidence/IMetaEvidence.sol\\\";\\n\\n/**\\n * @title ArbitrableExample\\n * An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\n */\\ncontract ArbitrableExample is IArbitrable, IMetaEvidence {\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n uint256 META_EVIDENCE_ID = 0;\\n address public governor;\\n IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n /** @dev Constructor\\n * @param _arbitrator The arbitrator to rule on created disputes.\\n * @param _metaEvidence The URI of the meta evidence object for evidence submissions requests.\\n */\\n constructor(IArbitrator _arbitrator, string memory _metaEvidence) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n emit MetaEvidence(META_EVIDENCE_ID, _metaEvidence);\\n }\\n\\n /** @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute.\\n Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n * @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\\n * @param _arbitratorExtraData Extra data for the arbitrator.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n * @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n */\\n function createDispute(\\n uint256 _numberOfRulingOptions,\\n bytes calldata _arbitratorExtraData,\\n uint256 _evidenceGroupID\\n ) external payable returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Incorrect number of choices\\\");\\n\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: _numberOfRulingOptions}));\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n emit Dispute(arbitrator, disputeID, META_EVIDENCE_ID, _evidenceGroupID);\\n }\\n\\n /** @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n * @param _externalDisputeID ID of the dispute in arbitrator contract.\\n * @param _ruling The ruling choice of the arbitration.\\n */\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n function changedMetaEvidence(string memory _metaEvidence) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n emit MetaEvidence(++META_EVIDENCE_ID, _metaEvidence);\\n }\\n}\\n\",\"keccak256\":\"0x405ab14ff61d32194bc190d0cfb7d192badf836543e7041105a81f2cb3c4e158\",\"license\":\"MIT\"},\"src/evidence/IEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\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 IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n */\\n event Evidence(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _evidenceGroupID,\\n address indexed _party,\\n string _evidence\\n );\\n}\\n\",\"keccak256\":\"0x9656bf34a7ec73bb3b42b6a880047736f395074ac1841096fec7f65337c197d4\",\"license\":\"MIT\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\nimport \\\"./IEvidence.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IMetaEvidence is IEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\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(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0x0e11c56cda1de6f7976818cca8048b8d6d05090874667570cc9d9685e89d31eb\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a06040526000805534801561001457600080fd5b50604051610b12380380610b12833981016040819052610033916100da565b600180546001600160a01b031916331790556001600160a01b0382166080526000546040517f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906100859084906101a8565b60405180910390a250506101db565b634e487b7160e01b600052604160045260246000fd5b60005b838110156100c55781810151838201526020016100ad565b838111156100d4576000848401525b50505050565b600080604083850312156100ed57600080fd5b82516001600160a01b038116811461010457600080fd5b60208401519092506001600160401b038082111561012157600080fd5b818501915085601f83011261013557600080fd5b81518181111561014757610147610094565b604051601f8201601f19908116603f0116810190838211818310171561016f5761016f610094565b8160405282815288602084870101111561018857600080fd5b6101998360208301602088016100aa565b80955050505050509250929050565b60208152600082518060208401526101c78160408501602087016100aa565b601f01601f19169190910160400192915050565b60805161090761020b60003960008181610154015281816101db01528181610550015261060d01526109076000f3fe6080604052600436106100605760003560e01c80630c340a2414610065578063311a6c56146100a257806332705fa6146100c4578063564a565d146100e45780636137048c146101215780636cc6cde114610142578063c21ae06114610176575b600080fd5b34801561007157600080fd5b50600154610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100c26100bd36600461066a565b6101a3565b005b3480156100d057600080fd5b506100c26100df3660046106a2565b610360565b3480156100f057600080fd5b506101046100ff366004610753565b610408565b604080519315158452602084019290925290820152606001610099565b61013461012f36600461076c565b61043f565b604051908152602001610099565b34801561014e57600080fd5b506100857f000000000000000000000000000000000000000000000000000000000000000081565b34801561018257600080fd5b50610134610191366004610753565b60026020526000908152604090205481565b60008281526002602052604081205460038054919291839081106101c9576101c96107ee565b906000526020600020906003020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03161461026d5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156102b35760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610264565b805460ff16156103115760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610264565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6001546001600160a01b031633146103ba5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e00006044820152606401610264565b60008081546103c890610804565b9190508190557f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040516103fd919061082d565b60405180910390a250565b6003818154811061041857600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000600185116104915760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f6963657300000000006044820152606401610264565b60038054604080516060810182526000808252602082018181528284018b81526001860187559186905291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b958502958601805460ff191691151591909117905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d90930192909255905163c13517e160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c13517e1903490610593908a908a908a90600401610882565b6020604051808303818588803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105e591906108b8565b60008181526002602090815260408083208590559154825190815290810186905291935083917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350949350505050565b6000806040838503121561067d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156106b457600080fd5b813567ffffffffffffffff808211156106cc57600080fd5b818401915084601f8301126106e057600080fd5b8135818111156106f2576106f261068c565b604051601f8201601f19908116603f0116810190838211818310171561071a5761071a61068c565b8160405282815287602084870101111561073357600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561076557600080fd5b5035919050565b6000806000806060858703121561078257600080fd5b84359350602085013567ffffffffffffffff808211156107a157600080fd5b818701915087601f8301126107b557600080fd5b8135818111156107c457600080fd5b8860208285010111156107d657600080fd5b95986020929092019750949560400135945092505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561082657634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208083528351808285015260005b8181101561085a5785810183015185820160400152820161083e565b8181111561086c576000604083870101525b50601f01601f1916929092016040019392505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156108ca57600080fd5b505191905056fea264697066735822122048abe1dc65ec08c8802d6fcc7de66ea0cc6b6ac39e6963fcfeb5ed477eead42564736f6c63430008090033", - "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a2414610065578063311a6c56146100a257806332705fa6146100c4578063564a565d146100e45780636137048c146101215780636cc6cde114610142578063c21ae06114610176575b600080fd5b34801561007157600080fd5b50600154610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100c26100bd36600461066a565b6101a3565b005b3480156100d057600080fd5b506100c26100df3660046106a2565b610360565b3480156100f057600080fd5b506101046100ff366004610753565b610408565b604080519315158452602084019290925290820152606001610099565b61013461012f36600461076c565b61043f565b604051908152602001610099565b34801561014e57600080fd5b506100857f000000000000000000000000000000000000000000000000000000000000000081565b34801561018257600080fd5b50610134610191366004610753565b60026020526000908152604090205481565b60008281526002602052604081205460038054919291839081106101c9576101c96107ee565b906000526020600020906003020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03161461026d5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156102b35760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610264565b805460ff16156103115760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610264565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6001546001600160a01b031633146103ba5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e00006044820152606401610264565b60008081546103c890610804565b9190508190557f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040516103fd919061082d565b60405180910390a250565b6003818154811061041857600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000600185116104915760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f6963657300000000006044820152606401610264565b60038054604080516060810182526000808252602082018181528284018b81526001860187559186905291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b958502958601805460ff191691151591909117905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d90930192909255905163c13517e160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c13517e1903490610593908a908a908a90600401610882565b6020604051808303818588803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105e591906108b8565b60008181526002602090815260408083208590559154825190815290810186905291935083917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350949350505050565b6000806040838503121561067d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156106b457600080fd5b813567ffffffffffffffff808211156106cc57600080fd5b818401915084601f8301126106e057600080fd5b8135818111156106f2576106f261068c565b604051601f8201601f19908116603f0116810190838211818310171561071a5761071a61068c565b8160405282815287602084870101111561073357600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561076557600080fd5b5035919050565b6000806000806060858703121561078257600080fd5b84359350602085013567ffffffffffffffff808211156107a157600080fd5b818701915087601f8301126107b557600080fd5b8135818111156107c457600080fd5b8860208285010111156107d657600080fd5b95986020929092019750949560400135945092505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561082657634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208083528351808285015260005b8181101561085a5785810183015185820160400152820161083e565b8181111561086c576000604083870101525b50601f01601f1916929092016040019392505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156108ca57600080fd5b505191905056fea264697066735822122048abe1dc65ec08c8802d6fcc7de66ea0cc6b6ac39e6963fcfeb5ed477eead42564736f6c63430008090033", - "devdoc": { - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "_arbitrator": "The arbitrator to rule on created disputes.", - "_metaEvidence": "The URI of the meta evidence object for evidence submissions requests." - } - }, - "createDispute(uint256,bytes,uint256)": { - "details": "TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", - "params": { - "_arbitratorExtraData": "Extra data for the arbitrator.", - "_evidenceGroupID": "Unique identifier of the evidence group that is linked to this dispute.", - "_numberOfRulingOptions": "Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from." - }, - "returns": { - "disputeID": "Dispute id (on arbitrator side) of the dispute created." - } - }, - "rule(uint256,uint256)": { - "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", - "params": { - "_externalDisputeID": "ID of the dispute in arbitrator contract.", - "_ruling": "The ruling choice of the arbitration." - } - } - }, - "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 5936, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "META_EVIDENCE_ID", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 5938, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "governor", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 5945, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "externalIDtoLocalID", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 5949, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "disputes", - "offset": 0, - "slot": "3", - "type": "t_array(t_struct(DisputeStruct)5933_storage)dyn_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(DisputeStruct)5933_storage)dyn_storage": { - "base": "t_struct(DisputeStruct)5933_storage", - "encoding": "dynamic_array", - "label": "struct ArbitrableExample.DisputeStruct[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_struct(DisputeStruct)5933_storage": { - "encoding": "inplace", - "label": "struct ArbitrableExample.DisputeStruct", - "members": [ - { - "astId": 5928, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "isRuled", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5930, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "ruling", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 5932, - "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", - "label": "numberOfRulingOptions", - "offset": 0, - "slot": "2", - "type": "t_uint256" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -}