diff --git a/.vscode/settings.json b/.vscode/settings.json index ff6776010..e4d0c9291 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,7 @@ "mochaExplorer.files": "contracts/test/**/*.{j,t}s", "cSpell.words": [ "arbitrum", + "IERC", "kleros" ] } diff --git a/contracts/README.md b/contracts/README.md index 858098a34..f87af8a30 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -16,8 +16,8 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments - [ConstantNG](https://testnet.arbiscan.io/address/0x4401A368dea8D5761AEEFfd3c4a674086dea0666) - [DisputeKitClassic](https://testnet.arbiscan.io/address/0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C) - [FastBridgeSender](https://testnet.arbiscan.io/address/0x34E520dc1d2Db660113b64724e14CEdCD01Ee879) -- [HomeGateway](https://testnet.arbiscan.io/address/0x40a78989317B953e427B3BD87C59eA003fcC2296) -- [KlerosCore](https://testnet.arbiscan.io/address/0xf2a59723c5d625D646668E0B615B5764c3F81540) +- [HomeGateway](https://testnet.arbiscan.io/address/0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C) +- [KlerosCore](https://testnet.arbiscan.io/address/0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F) - [SafeBridgeArbitrum](https://testnet.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD) - [SortitionSumTreeFactory](https://testnet.arbiscan.io/address/0xf02733d9e5CbfE67B54F165b0277E1995106D526) @@ -80,11 +80,34 @@ The ones below are optional: If some of the constructor parameters (such as the Meta Evidence) needs to change, you need to update the files in the `deploy/` directory. +#### 2. Deploy to a Local Network + +The complete deployment is multi-chain, so a deployment to the local network can only simulate either the Home chain or the Foreign chain. +Currently the scripts support only deploying the HomeChain contracts to the local network. + +**Shell 1: the node** + +```bash +yarn hardhat node --tags nothing +``` + +**Shell 2: the deploy script** + +```bash +yarn hardhat deploy --network localhost --tags HomeChain +``` + #### 2. Deploy to Public Testnets ```bash -yarn deploy:staging # to deploy to L1/L2 testnet -# yarn deploy:production # to deploy to L1/L2 mainnet +# To deploy on L2 only +yarn hardhat deploy --network arbitrumRinkeby --tags HomeChain + +# To deploy on L1 only +yarn hardhat deploy --network rinkeby --tags ForeignChain + +# To deploy both L1 and L2 +yarn deploy:staging ``` The deployed addresses should be output to the screen after the deployment is complete. diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index 284ca1ccc..16c96d83f 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -1,16 +1,26 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -const HOME_CHAIN_IDS = [42161, 421611, 31337]; // ArbOne, ArbRinkeby, Hardhat +enum HomeChains { + ARBITRUM_ONE = 42161, + ARBITRUM_RINKEBY = 421611, + HARDHAT = 31337, +} + +const pnkByChain = new Map([ + [HomeChains.ARBITRUM_ONE, "0x330bD769382cFc6d50175903434CCC8D206DCAE5"], + [HomeChains.ARBITRUM_RINKEBY, "0x364530164a2338cdba211f72c1438eb811b5c639"], +]); const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - const { deployments, getNamedAccounts } = hre; + const { deployments, getNamedAccounts, getChainId } = hre; const { deploy, execute } = deployments; const { AddressZero } = hre.ethers.constants; // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; - console.log("deployer: %s", deployer); + const chainId = Number(await getChainId()); + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); const rng = await deploy("ConstantNG", { from: deployer, @@ -29,21 +39,39 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) log: true, }); - // TODO: deploy a PNK token if there isn't one already + if (chainId === HomeChains.HARDHAT) { + pnkByChain.set( + HomeChains.HARDHAT, + ( + await deploy("PNK", { + from: deployer, + log: true, + }) + ).address + ); + } + const pnk = pnkByChain.get(Number(await getChainId())) ?? AddressZero; const klerosCore = await deploy("KlerosCore", { from: deployer, libraries: { SortitionSumTreeFactory: sortitionSumTreeLibrary.address, }, - args: [deployer, AddressZero, AddressZero, disputeKit.address, false, 200, 10000, 100, 3, [0, 0, 0, 0], 3], + args: [deployer, pnk, AddressZero, disputeKit.address, false, 200, 10000, 100, 3, [0, 0, 0, 0], 3], log: true, }); - await execute("DisputeKitClassic", { from: deployer, log: true }, "changeCore", klerosCore.address); + // execute DisputeKitClassic.changeCore() only if necessary + const currentCore = await hre.ethers.getContractAt("DisputeKitClassic", disputeKit.address).then((dk) => dk.core()); + if (currentCore !== klerosCore.address) { + await execute("DisputeKitClassic", { from: deployer, log: true }, "changeCore", klerosCore.address); + } }; deployArbitration.tags = ["HomeChain", "Arbitration"]; -deployArbitration.skip = async ({ getChainId }) => !HOME_CHAIN_IDS.includes(Number(await getChainId())); +deployArbitration.skip = async ({ getChainId }) => { + const chainId = Number(await getChainId()); + return !HomeChains[chainId]; +}; export default deployArbitration; diff --git a/contracts/deploy/01-foreign-chain.ts b/contracts/deploy/01-foreign-chain.ts index e81c4b715..6b3824cf1 100644 --- a/contracts/deploy/01-foreign-chain.ts +++ b/contracts/deploy/01-foreign-chain.ts @@ -22,7 +22,7 @@ const paramsByChainId = { const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; const { deploy } = deployments; - const { providers, constants } = ethers; + const { providers } = ethers; const { hexZeroPad } = hre.ethers.utils; const { deployer } = await getNamedAccounts(); diff --git a/contracts/deployments/arbitrumRinkeby/HomeGateway.json b/contracts/deployments/arbitrumRinkeby/HomeGateway.json index 8b001a487..a710f9d3b 100644 --- a/contracts/deployments/arbitrumRinkeby/HomeGateway.json +++ b/contracts/deployments/arbitrumRinkeby/HomeGateway.json @@ -1,5 +1,5 @@ { - "address": "0x40a78989317B953e427B3BD87C59eA003fcC2296", + "address": "0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C", "abi": [ { "inputs": [ @@ -336,44 +336,44 @@ "type": "function" } ], - "transactionHash": "0xd6de68fd2bbcd4d81a2322e06e8ea09e84c28d8f44e8fbf64082b38235d21d7f", + "transactionHash": "0x32883b2e1d6077f6d73c336cf7c496baf83674ad2fc675d23b18fa8d1f6e6147", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x40a78989317B953e427B3BD87C59eA003fcC2296", + "contractAddress": "0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C", "transactionIndex": 0, - "gasUsed": "5322843", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000004000000000010000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000100008000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x73926b0cb76f488581a9a9fda166a0df19c1326906fd204def70b553713ebfcd", - "transactionHash": "0xd6de68fd2bbcd4d81a2322e06e8ea09e84c28d8f44e8fbf64082b38235d21d7f", + "gasUsed": "5321339", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000080000000000000000000008000000000000000000", + "blockHash": "0xd39dac52e9b26c2872c1f0f474be1e92d2e78d3047399521da7926494041045c", + "transactionHash": "0x32883b2e1d6077f6d73c336cf7c496baf83674ad2fc675d23b18fa8d1f6e6147", "logs": [ { "transactionIndex": 0, - "blockNumber": 9361454, - "transactionHash": "0xd6de68fd2bbcd4d81a2322e06e8ea09e84c28d8f44e8fbf64082b38235d21d7f", - "address": "0x40a78989317B953e427B3BD87C59eA003fcC2296", + "blockNumber": 9532053, + "transactionHash": "0x32883b2e1d6077f6d73c336cf7c496baf83674ad2fc675d23b18fa8d1f6e6147", + "address": "0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C", "topics": [ "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064252494447450000000000000000000000000000000000000000000000000000", "logIndex": 0, - "blockHash": "0x73926b0cb76f488581a9a9fda166a0df19c1326906fd204def70b553713ebfcd" + "blockHash": "0xd39dac52e9b26c2872c1f0f474be1e92d2e78d3047399521da7926494041045c" } ], - "blockNumber": 9361454, - "cumulativeGasUsed": "289063", + "blockNumber": 9532053, + "cumulativeGasUsed": "288939", "status": 1, "byzantium": true }, "args": [ - "0xf2a59723c5d625D646668E0B615B5764c3F81540", + "0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F", "0x34E520dc1d2Db660113b64724e14CEdCD01Ee879", "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", 4 ], - "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "numDeployments": 2, + "solcInputHash": "cb9cc63f5df7c380e26ec11990659306", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"_fastbridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_foreignGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_foreignChainID\",\"type\":\"uint256\"}],\"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\":[],\"name\":\"chainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToHomeID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoRelayedData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"arbitrationCost\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastbridge\",\"outputs\":[{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"foreignChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"foreignGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_originalChainID\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_originalBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_originalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"relayCreateDispute\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)\":{\"details\":\"Provide the same parameters as on the originalChain while creating a dispute. Providing incorrect parameters will create a different hash than on the originalChain and will not affect the actual dispute/arbitrable's ruling.\",\"params\":{\"_arbitrable\":\"arbitrable\",\"_choices\":\"number of ruling choices\",\"_extraData\":\"extraData\",\"_originalBlockHash\":\"originalBlockHash\",\"_originalChainID\":\"originalChainId\",\"_originalDisputeID\":\"originalDisputeID\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/HomeGateway.sol\":\"HomeGateway\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"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/bridge/interfaces/IFastBridgeSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeSender {\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the fast bridge mechanism\\n *\\n * TODO: probably needs some access control either on the sender side\\n * or the receiver side\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The receiving domain encoded message data.\\n */\\n function sendFast(address _receiver, bytes memory _calldata) external;\\n}\\n\",\"keccak256\":\"0xcbf3e9b5e153940b73ab5f09469eaf2fb24a1effac83c3786b27f785c325ff2e\",\"license\":\"MIT\"},\"src/evidence/IEvidence.sol\":{\"content\":\"pragma 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 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 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 /**\\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\":\"0xc5f2cf95c0148aa1bddead4de02ccd8b7eaf7d5982163e7c05747cf9b3463dba\"},\"src/gateway/HomeGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\nimport \\\"../bridge/interfaces/IFastBridgeSender.sol\\\";\\n\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\nimport \\\"./interfaces/IHomeGateway.sol\\\";\\n\\ncontract HomeGateway is IHomeGateway {\\n mapping(uint256 => bytes32) public disputeIDtoHash;\\n mapping(bytes32 => uint256) public disputeHashtoID;\\n\\n IArbitrator public arbitrator;\\n IFastBridgeSender public fastbridge;\\n address public foreignGateway;\\n uint256 public chainID;\\n uint256 public foreignChainID;\\n\\n struct RelayedData {\\n uint256 arbitrationCost;\\n address relayer;\\n }\\n mapping(bytes32 => RelayedData) public disputeHashtoRelayedData;\\n\\n constructor(\\n IArbitrator _arbitrator,\\n IFastBridgeSender _fastbridge,\\n address _foreignGateway,\\n uint256 _foreignChainID\\n ) {\\n arbitrator = _arbitrator;\\n fastbridge = _fastbridge;\\n foreignGateway = _foreignGateway;\\n foreignChainID = _foreignChainID;\\n\\n assembly {\\n sstore(chainID.slot, chainid())\\n }\\n\\n emit MetaEvidence(0, \\\"BRIDGE\\\");\\n }\\n\\n /**\\n * @dev Provide the same parameters as on the originalChain while creating a\\n * dispute. Providing incorrect parameters will create a different hash\\n * than on the originalChain and will not affect the actual dispute/arbitrable's\\n * ruling.\\n *\\n * @param _originalChainID originalChainId\\n * @param _originalBlockHash originalBlockHash\\n * @param _originalDisputeID originalDisputeID\\n * @param _choices number of ruling choices\\n * @param _extraData extraData\\n * @param _arbitrable arbitrable\\n */\\n function relayCreateDispute(\\n uint256 _originalChainID,\\n bytes32 _originalBlockHash,\\n uint256 _originalDisputeID,\\n uint256 _choices,\\n bytes calldata _extraData,\\n address _arbitrable\\n ) external payable {\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n _originalChainID,\\n _originalBlockHash,\\n \\\"createDispute\\\",\\n _originalDisputeID,\\n _choices,\\n _extraData,\\n _arbitrable\\n )\\n );\\n RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash];\\n require(relayedData.relayer == address(0), \\\"Dispute already relayed\\\");\\n\\n // TODO: will mostly be replaced by the actual arbitrationCost paid on the foreignChain.\\n relayedData.arbitrationCost = arbitrator.arbitrationCost(_extraData);\\n require(msg.value >= relayedData.arbitrationCost, \\\"Not enough arbitration cost paid\\\");\\n\\n uint256 disputeID = arbitrator.createDispute{value: msg.value}(_choices, _extraData);\\n disputeIDtoHash[disputeID] = disputeHash;\\n disputeHashtoID[disputeHash] = disputeID;\\n relayedData.relayer = msg.sender;\\n\\n emit Dispute(arbitrator, disputeID, 0, 0);\\n }\\n\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(msg.sender == address(arbitrator), \\\"Only Arbitrator\\\");\\n\\n bytes32 disputeHash = disputeIDtoHash[_disputeID];\\n RelayedData memory relayedData = disputeHashtoRelayedData[disputeHash];\\n\\n bytes4 methodSelector = IForeignGateway.relayRule.selector;\\n bytes memory data = abi.encodeWithSelector(methodSelector, disputeHash, _ruling, relayedData.relayer);\\n\\n fastbridge.sendFast(foreignGateway, data);\\n }\\n\\n function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256) {\\n return disputeHashtoID[_disputeHash];\\n }\\n}\\n\",\"keccak256\":\"0x838f448abaf4f9c8812ca0e4ffcd2acc1f475ef585b2287b61b0dec162dee775\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator {\\n function chainID() external view returns (uint256);\\n\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _forwarder\\n ) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function homeChainID() external view returns (uint256);\\n\\n function homeGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x9142bf9265b4399468f833c69e2f72896103e63f643ca186c9000424c2aa100a\",\"license\":\"MIT\"},\"src/gateway/interfaces/IHomeGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrable.sol\\\";\\nimport \\\"../../evidence/IEvidence.sol\\\";\\n\\ninterface IHomeGateway is IArbitrable, IEvidence {\\n function chainID() external view returns (uint256);\\n\\n function relayCreateDispute(\\n uint256 _originalChainID,\\n bytes32 _originalBlockHash,\\n uint256 _originalDisputeID,\\n uint256 _choices,\\n bytes calldata _extraData,\\n address _arbitrable\\n ) external payable;\\n\\n // For cross-chain Evidence standard\\n\\n function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function foreignChainID() external view returns (uint256);\\n\\n function foreignGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x38783b4e88382c2d87b0c5f5ac1b18450a5de41bf45b5299affaa9d6f952efb7\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516109df3803806109df83398101604081905261002f916100ea565b600280546001600160a01b038087166001600160a01b0319928316179092556003805486841690831617905560048054928516929091169190911790556006819055466005556040516000907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906100c19060208082526006908201526542524944474560d01b604082015260600190565b60405180910390a25050505061013d565b6001600160a01b03811681146100e757600080fd5b50565b6000806000806080858703121561010057600080fd5b845161010b816100d2565b602086015190945061011c816100d2565b604086015190935061012d816100d2565b6060959095015193969295505050565b6108938061014c6000396000f3fe60806040526004361061009c5760003560e01c8063adc879e911610064578063adc879e914610157578063ba4bc7631461016d578063c95c09511461019a578063cddbfa14146101c7578063d1d559c514610221578063fc4ba3a21461024157600080fd5b8063311a6c56146100a15780633b103f53146100c35780636cc6cde1146100d65780638d7c7daa146101135780639688240314610133575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610616565b61026e565b005b6100c16100d1366004610654565b6103ac565b3480156100e257600080fd5b506002546100f6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011f57600080fd5b506004546100f6906001600160a01b031681565b34801561013f57600080fd5b5061014960065481565b60405190815260200161010a565b34801561016357600080fd5b5061014960055481565b34801561017957600080fd5b506101496101883660046106fe565b60006020819052908152604090205481565b3480156101a657600080fd5b506101496101b53660046106fe565b60016020526000908152604090205481565b3480156101d357600080fd5b506102046101e23660046106fe565b600760205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b0390911660208301520161010a565b34801561022d57600080fd5b506003546100f6906001600160a01b031681565b34801561024d57600080fd5b5061014961025c3660046106fe565b60009081526001602052604090205490565b6002546001600160a01b031633146102bf5760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b60008281526020818152604080832054808452600783529281902081518083018352815481526001909101546001600160a01b039081168285018190528351602481018790526044810188905260648082019290925284518082039092018252608401845293840180516001600160e01b0316633496987960e01b90811790915260035460048054955163263b083b60e21b8152949692959294918416936398ec20ec9361037293911691869101610717565b600060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b50505050505050505050565b6000878787878787876040516020016103cb979695949392919061077c565b60408051601f1981840301815291815281516020928301206000818152600790935291206001810154919250906001600160a01b03161561044e5760405162461bcd60e51b815260206004820152601760248201527f4469737075746520616c72656164792072656c6179656400000000000000000060448201526064016102b6565b60025460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906104809088908890600401610805565b602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610821565b8082553410156105135760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f7374207061696460448201526064016102b6565b60025460405163c13517e160e01b81526000916001600160a01b03169063c13517e190349061054a908b908b908b9060040161083a565b60206040518083038185885af1158015610568573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061058d9190610821565b6000818152602081815260408083208790558683526001808352818420859055860180546001600160a01b0319163317905560025481518481529283019390935292935083926001600160a01b03909216917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000806040838503121561062957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461064f57600080fd5b919050565b600080600080600080600060c0888a03121561066f57600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff808211156106a357600080fd5b818a0191508a601f8301126106b757600080fd5b8135818111156106c657600080fd5b8b60208285010111156106d857600080fd5b6020830195508094505050506106f060a08901610638565b905092959891949750929550565b60006020828403121561071057600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561075357858101830151858201606001528201610737565b81811115610765576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006108196020830184866107dc565b949350505050565b60006020828403121561083357600080fd5b5051919050565b8381526040602082015260006108546040830184866107dc565b9594505050505056fea2646970667358221220c32c57bb20a4d603adf4127081cc69fac6ffa5e780152402c401ddb12d7596da64736f6c634300080a0033", "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063adc879e911610064578063adc879e914610157578063ba4bc7631461016d578063c95c09511461019a578063cddbfa14146101c7578063d1d559c514610221578063fc4ba3a21461024157600080fd5b8063311a6c56146100a15780633b103f53146100c35780636cc6cde1146100d65780638d7c7daa146101135780639688240314610133575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610616565b61026e565b005b6100c16100d1366004610654565b6103ac565b3480156100e257600080fd5b506002546100f6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011f57600080fd5b506004546100f6906001600160a01b031681565b34801561013f57600080fd5b5061014960065481565b60405190815260200161010a565b34801561016357600080fd5b5061014960055481565b34801561017957600080fd5b506101496101883660046106fe565b60006020819052908152604090205481565b3480156101a657600080fd5b506101496101b53660046106fe565b60016020526000908152604090205481565b3480156101d357600080fd5b506102046101e23660046106fe565b600760205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b0390911660208301520161010a565b34801561022d57600080fd5b506003546100f6906001600160a01b031681565b34801561024d57600080fd5b5061014961025c3660046106fe565b60009081526001602052604090205490565b6002546001600160a01b031633146102bf5760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b60008281526020818152604080832054808452600783529281902081518083018352815481526001909101546001600160a01b039081168285018190528351602481018790526044810188905260648082019290925284518082039092018252608401845293840180516001600160e01b0316633496987960e01b90811790915260035460048054955163263b083b60e21b8152949692959294918416936398ec20ec9361037293911691869101610717565b600060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b50505050505050505050565b6000878787878787876040516020016103cb979695949392919061077c565b60408051601f1981840301815291815281516020928301206000818152600790935291206001810154919250906001600160a01b03161561044e5760405162461bcd60e51b815260206004820152601760248201527f4469737075746520616c72656164792072656c6179656400000000000000000060448201526064016102b6565b60025460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906104809088908890600401610805565b602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610821565b8082553410156105135760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f7374207061696460448201526064016102b6565b60025460405163c13517e160e01b81526000916001600160a01b03169063c13517e190349061054a908b908b908b9060040161083a565b60206040518083038185885af1158015610568573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061058d9190610821565b6000818152602081815260408083208790558683526001808352818420859055860180546001600160a01b0319163317905560025481518481529283019390935292935083926001600160a01b03909216917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000806040838503121561062957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461064f57600080fd5b919050565b600080600080600080600060c0888a03121561066f57600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff808211156106a357600080fd5b818a0191508a601f8301126106b757600080fd5b8135818111156106c657600080fd5b8b60208285010111156106d857600080fd5b6020830195508094505050506106f060a08901610638565b905092959891949750929550565b60006020828403121561071057600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561075357858101830151858201606001528201610737565b81811115610765576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006108196020830184866107dc565b949350505050565b60006020828403121561083357600080fd5b5051919050565b8381526040602082015260006108546040830184866107dc565b9594505050505056fea2646970667358221220c32c57bb20a4d603adf4127081cc69fac6ffa5e780152402c401ddb12d7596da64736f6c634300080a0033", @@ -409,7 +409,7 @@ "storageLayout": { "storage": [ { - "astId": 10351, + "astId": 10958, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "disputeIDtoHash", "offset": 0, @@ -417,7 +417,7 @@ "type": "t_mapping(t_uint256,t_bytes32)" }, { - "astId": 10355, + "astId": 10962, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "disputeHashtoID", "offset": 0, @@ -425,23 +425,23 @@ "type": "t_mapping(t_bytes32,t_uint256)" }, { - "astId": 10358, + "astId": 10965, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "arbitrator", "offset": 0, "slot": "2", - "type": "t_contract(IArbitrator)1296" + "type": "t_contract(IArbitrator)1889" }, { - "astId": 10361, + "astId": 10968, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "fastbridge", "offset": 0, "slot": "3", - "type": "t_contract(IFastBridgeSender)7802" + "type": "t_contract(IFastBridgeSender)8409" }, { - "astId": 10363, + "astId": 10970, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "foreignGateway", "offset": 0, @@ -449,7 +449,7 @@ "type": "t_address" }, { - "astId": 10365, + "astId": 10972, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "chainID", "offset": 0, @@ -457,7 +457,7 @@ "type": "t_uint256" }, { - "astId": 10367, + "astId": 10974, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "foreignChainID", "offset": 0, @@ -465,12 +465,12 @@ "type": "t_uint256" }, { - "astId": 10377, + "astId": 10984, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "disputeHashtoRelayedData", "offset": 0, "slot": "7", - "type": "t_mapping(t_bytes32,t_struct(RelayedData)10372_storage)" + "type": "t_mapping(t_bytes32,t_struct(RelayedData)10979_storage)" } ], "types": { @@ -484,22 +484,22 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IArbitrator)1296": { + "t_contract(IArbitrator)1889": { "encoding": "inplace", "label": "contract IArbitrator", "numberOfBytes": "20" }, - "t_contract(IFastBridgeSender)7802": { + "t_contract(IFastBridgeSender)8409": { "encoding": "inplace", "label": "contract IFastBridgeSender", "numberOfBytes": "20" }, - "t_mapping(t_bytes32,t_struct(RelayedData)10372_storage)": { + "t_mapping(t_bytes32,t_struct(RelayedData)10979_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct HomeGateway.RelayedData)", "numberOfBytes": "32", - "value": "t_struct(RelayedData)10372_storage" + "value": "t_struct(RelayedData)10979_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -515,12 +515,12 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_struct(RelayedData)10372_storage": { + "t_struct(RelayedData)10979_storage": { "encoding": "inplace", "label": "struct HomeGateway.RelayedData", "members": [ { - "astId": 10369, + "astId": 10976, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "arbitrationCost", "offset": 0, @@ -528,7 +528,7 @@ "type": "t_uint256" }, { - "astId": 10371, + "astId": 10978, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "relayer", "offset": 0, diff --git a/contracts/deployments/arbitrumRinkeby/KlerosCore.json b/contracts/deployments/arbitrumRinkeby/KlerosCore.json index 75014abb2..b93c00974 100644 --- a/contracts/deployments/arbitrumRinkeby/KlerosCore.json +++ b/contracts/deployments/arbitrumRinkeby/KlerosCore.json @@ -1,5 +1,5 @@ { - "address": "0xf2a59723c5d625D646668E0B615B5764c3F81540", + "address": "0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F", "abi": [ { "inputs": [ @@ -1110,25 +1110,25 @@ "type": "function" } ], - "transactionHash": "0xb74ce3a64fc7a024cfe8759f0733b5884dec8917c49e65025974e2a09a0d7cbb", + "transactionHash": "0x410cdb405cd569666020b07d678fab6448bbf4016af3f4ab1b879f1452bda74a", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xf2a59723c5d625D646668E0B615B5764c3F81540", + "contractAddress": "0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F", "transactionIndex": 0, - "gasUsed": "65263500", + "gasUsed": "36471879", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x52bc720f24643d424bc466b9f3451124dfd73dce0b22ca0c2a13abc269da7426", - "transactionHash": "0xb74ce3a64fc7a024cfe8759f0733b5884dec8917c49e65025974e2a09a0d7cbb", + "blockHash": "0x0dedfba37de0fc9730e38f33a85640bcf38147060d36428c5bbdd2d5042c37da", + "transactionHash": "0x410cdb405cd569666020b07d678fab6448bbf4016af3f4ab1b879f1452bda74a", "logs": [], - "blockNumber": 9361444, - "cumulativeGasUsed": "29664559", + "blockNumber": 9532047, + "cumulativeGasUsed": "845338", "status": 1, "byzantium": true }, "args": [ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "0x0000000000000000000000000000000000000000", + "0x364530164a2338cdba211f72c1438eb811b5c639", "0x0000000000000000000000000000000000000000", "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", false, @@ -1144,8 +1144,8 @@ ], 3 ], - "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "numDeployments": 2, + "solcInputHash": "cb9cc63f5df7c380e26ec11990659306", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"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\",\"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\":\"uint256\",\"name\":\"_sortitionSumTreeK\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_appeal\",\"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\":false,\"internalType\":\"enum KlerosCore.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_subcourtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_newTotalStake\",\"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\":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\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"_disputeKitID\",\"type\":\"uint8\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"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\":\"uint256\",\"name\":\"_subcourtID\",\"type\":\"uint256\"}],\"name\":\"areVotesHidden\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"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\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtAlpha\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtJurorsForJump\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtMinStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeSubcourtTimesPerPeriod\",\"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\":\"uint256\",\"name\":\"supportedDisputeKits\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"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\":\"uint256\",\"name\":\"_sortitionSumTreeK\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256\"}],\"name\":\"createSubcourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKits\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrable\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"disputeKit\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCore.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVotes\",\"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\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_appeal\",\"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\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getCurrentPeriod\",\"outputs\":[{\"internalType\":\"enum KlerosCore.Period\",\"name\":\"period\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"staked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"locked\",\"type\":\"uint256\"}],\"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\"},{\"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[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"}],\"name\":\"getSortitionSumTree\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"K\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"stack\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"nodes\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_nodeIndex\",\"type\":\"uint256\"}],\"name\":\"getSortitionSumTreeID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"ID\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getSubcourtID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"subcourtID\",\"type\":\"uint256\"}],\"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\":\"isRuled\",\"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\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint8[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint8[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"setDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_stake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address,uint8)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\",\"_disputeKitID\":\"The ID assigned to the added dispute kit.\"}},\"appeal(uint256)\":{\"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.\"}},\"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 subcourt.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost.\"}},\"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.\"}},\"changeSubcourtAlpha(uint96,uint256)\":{\"details\":\"Changes the `alpha` property value of a specified subcourt.\",\"params\":{\"_alpha\":\"The new value for the `alpha` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified subcourt.\",\"params\":{\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtJurorsForJump(uint96,uint256)\":{\"details\":\"Changes the `jurorsForCourtJump` property value of a specified subcourt.\",\"params\":{\"_jurorsForCourtJump\":\"The new value for the `jurorsForCourtJump` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtMinStake(uint96,uint256)\":{\"details\":\"Changes the `minStake` property value of a specified subcourt. Don't set to a value lower than its parent's `minStake` property value.\",\"params\":{\"_minStake\":\"The new value for the `minStake` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtTimesPerPeriod(uint96,uint256[4])\":{\"details\":\"Changes the `timesPerPeriod` property value of a specified subcourt.\",\"params\":{\"_subcourtID\":\"The ID of the subcourt.\",\"_timesPerPeriod\":\"The new value for the `timesPerPeriod` property value.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_alpha\":\"The `alpha` property value of the forking court.\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_feeForJuror\":\"The `feeForJuror` property value of the forking court.\",\"_governor\":\"The governor's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the forking court.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the forking court.\",\"_minStake\":\"The `minStake` property value of the forking court.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionSumTreeK\":\"The number of children per node of the forking court's sortition sum tree.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the forking 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 subcourt (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.\"}},\"createSubcourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256,uint256)\":{\"details\":\"Creates a subcourt under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the subcourt.\",\"_feeForJuror\":\"The `feeForJuror` property value of the subcourt.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the subcourt.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the subcourt.\",\"_minStake\":\"The `minStake` property value of the subcourt.\",\"_parent\":\"The `parent` property value of the subcourt.\",\"_sortitionSumTreeK\":\"The number of children per node of the subcourt's sortition sum tree.\",\"_supportedDisputeKits\":\"Bitfield that contains the IDs of the dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the subcourt.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"ruling\":\"The current ruling.\"}},\"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.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute tokens and ETH for the specific round of the dispute. Can be called in parts.\",\"params\":{\"_appeal\":\"The appeal round.\",\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"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.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"setDisputeKits(uint96,uint8[],bool)\":{\"details\":\"Adds/removes particular dispute kits to a subcourt's bitfield of supported dispute kits.\",\"params\":{\"_disputeKitIDs\":\"IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the subcourt.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a subcourt.\",\"params\":{\"_stake\":\"The new stake.\",\"_subcourtID\":\"The ID of the subcourt.\"}}},\"title\":\"KlerosCore Core arbitrator contract for Kleros v2.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCore.sol\":\"KlerosCore\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` 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 sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x61437cb513a887a1bbad006e7b1c8b414478427d33de47c5600af3c748f108da\",\"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 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/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@unknownunknown1, @jaybuidl]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\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.\\n */\\ninterface IDisputeKit {\\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 _disputeID 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 */\\n function createDispute(\\n uint256 _disputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\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 _disputeID The ID of the dispute in Kleros Core.\\n * @return drawnAddress The drawn address.\\n */\\n function draw(uint256 _disputeID) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /** @dev Gets the current ruling of a specified dispute.\\n * @param _disputeID The ID of the dispute in Kleros Core.\\n * @return ruling The current ruling.\\n */\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling);\\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 _disputeID The ID of the dispute in Kleros Core.\\n * @param _round The ID of the round.\\n * @param _voteID The ID of the vote.\\n * @return The degree of coherence in basis points.\\n */\\n function getDegreeOfCoherence(\\n uint256 _disputeID,\\n uint256 _round,\\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 _disputeID The ID of the dispute in Kleros Core.\\n * @param _round The ID of the round.\\n * @return The number of coherent jurors.\\n */\\n function getCoherentCount(uint256 _disputeID, uint256 _round) external view returns (uint256);\\n\\n /** @dev Returns true if the specified voter was active in this round.\\n * @param _disputeID The ID of the dispute in Kleros Core.\\n * @param _round The ID of the round.\\n * @param _voteID The ID of the voter.\\n * @return Whether the voter was active or not.\\n */\\n function isVoteActive(\\n uint256 _disputeID,\\n uint256 _round,\\n uint256 _voteID\\n ) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round,\\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 _disputeID,\\n uint256 _round,\\n uint256 _voteID\\n )\\n external\\n view\\n returns (\\n address account,\\n bytes32 commit,\\n uint256 choice,\\n bool voted\\n );\\n}\\n\",\"keccak256\":\"0x7511e6a1b452100290a642f41916c67b3642b79f54899415ff09e8ead94ae53c\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@unknownunknown1]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrator.sol\\\";\\nimport \\\"./IDisputeKit.sol\\\";\\nimport {SortitionSumTreeFactory} from \\\"../data-structures/SortitionSumTreeFactory.sol\\\";\\n\\n/**\\n * @title KlerosCore\\n * Core arbitrator contract for Kleros v2.\\n */\\ncontract KlerosCore is IArbitrator {\\n using SortitionSumTreeFactory for SortitionSumTreeFactory.SortitionSumTrees; // Use library functions for sortition sum trees.\\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 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 uint256 supportedDisputeKits; // The bitfield of dispute kits that the court supports.\\n }\\n\\n struct Dispute {\\n uint96 subcourtID; // The ID of the subcourt the dispute is in.\\n IArbitrable arbitrated; // The arbitrable contract.\\n IDisputeKit disputeKit; // ID of the dispute kit that this dispute was assigned to.\\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 uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_appeal].length.\\n Round[] rounds;\\n }\\n\\n struct Round {\\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 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 }\\n\\n struct Juror {\\n uint96[] subcourtIDs; // The IDs of subcourts where the juror's stake path ends. A stake path is a path from the forking 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 subcourt in the form `stakedTokens[subcourtID]`.\\n mapping(uint96 => uint256) lockedTokens; // The number of tokens the juror has locked in the subcourt in the form `lockedTokens[subcourtID]`.\\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 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\\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\\n Court[] public courts; // The subcourts.\\n\\n //TODO: disputeKits forest.\\n mapping(uint256 => IDisputeKit) public disputeKits; // All supported dispute kits.\\n\\n Dispute[] public disputes; // The disputes.\\n mapping(address => Juror) internal jurors; // The jurors.\\n SortitionSumTreeFactory.SortitionSumTrees internal sortitionSumTrees; // The sortition sum trees.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _subcourtID, uint256 _amount, uint256 _newTotalStake);\\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 _appeal, uint256 _voteID);\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n int256 _tokenAmount,\\n int256 _ETHAmount\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: 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 forking court.\\n * @param _minStake The `minStake` property value of the forking court.\\n * @param _alpha The `alpha` property value of the forking court.\\n * @param _feeForJuror The `feeForJuror` property value of the forking court.\\n * @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the forking court.\\n * @param _timesPerPeriod The `timesPerPeriod` property value of the forking court.\\n * @param _sortitionSumTreeK The number of children per node of the forking court's sortition sum tree.\\n */\\n constructor(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n uint256 _sortitionSumTreeK\\n ) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n disputeKits[0] = _disputeKit;\\n\\n // Create the Forking court.\\n courts.push(\\n Court({\\n parent: 0,\\n children: new uint256[](0),\\n hiddenVotes: _hiddenVotes,\\n minStake: _minStake,\\n alpha: _alpha,\\n feeForJuror: _feeForJuror,\\n jurorsForCourtJump: _jurorsForCourtJump,\\n timesPerPeriod: _timesPerPeriod,\\n supportedDisputeKits: 1 // The first bit of the bit field is supported by default.\\n })\\n );\\n sortitionSumTrees.createTree(bytes32(0), _sortitionSumTreeK);\\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 */\\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 */\\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 */\\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 */\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\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 _disputeKitID The ID assigned to the added dispute kit.\\n */\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint8 _disputeKitID) external onlyByGovernor {\\n // TODO: the dispute kit data structure. For now keep it a simple mapping.\\n // Also note that in current state this function doesn't take into account that the added address is actually new.\\n disputeKits[_disputeKitID] = _disputeKitAddress;\\n }\\n\\n /** @dev Creates a subcourt under a specified parent court.\\n * @param _parent The `parent` property value of the subcourt.\\n * @param _hiddenVotes The `hiddenVotes` property value of the subcourt.\\n * @param _minStake The `minStake` property value of the subcourt.\\n * @param _alpha The `alpha` property value of the subcourt.\\n * @param _feeForJuror The `feeForJuror` property value of the subcourt.\\n * @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the subcourt.\\n * @param _timesPerPeriod The `timesPerPeriod` property value of the subcourt.\\n * @param _sortitionSumTreeK The number of children per node of the subcourt's sortition sum tree.\\n * @param _supportedDisputeKits Bitfield that contains the IDs of the dispute kits that this court will support.\\n */\\n function createSubcourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n uint256 _sortitionSumTreeK,\\n uint256 _supportedDisputeKits\\n ) external onlyByGovernor {\\n require(\\n courts[_parent].minStake <= _minStake,\\n \\\"A subcourt cannot be a child of a subcourt with a higher minimum stake.\\\"\\n );\\n\\n uint256 subcourtID = courts.length;\\n // Create the subcourt.\\n courts.push(\\n Court({\\n parent: _parent,\\n children: new uint256[](0),\\n hiddenVotes: _hiddenVotes,\\n minStake: _minStake,\\n alpha: _alpha,\\n feeForJuror: _feeForJuror,\\n jurorsForCourtJump: _jurorsForCourtJump,\\n timesPerPeriod: _timesPerPeriod,\\n supportedDisputeKits: _supportedDisputeKits\\n })\\n );\\n\\n sortitionSumTrees.createTree(bytes32(subcourtID), _sortitionSumTreeK);\\n // Update the parent.\\n courts[_parent].children.push(subcourtID);\\n }\\n\\n /** @dev Changes the `minStake` property value of a specified subcourt. Don't set to a value lower than its parent's `minStake` property value.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _minStake The new value for the `minStake` property value.\\n */\\n function changeSubcourtMinStake(uint96 _subcourtID, uint256 _minStake) external onlyByGovernor {\\n require(_subcourtID == 0 || courts[courts[_subcourtID].parent].minStake <= _minStake);\\n for (uint256 i = 0; i < courts[_subcourtID].children.length; i++) {\\n require(\\n courts[courts[_subcourtID].children[i]].minStake >= _minStake,\\n \\\"A subcourt cannot be the parent of a subcourt with a lower minimum stake.\\\"\\n );\\n }\\n\\n courts[_subcourtID].minStake = _minStake;\\n }\\n\\n /** @dev Changes the `alpha` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _alpha The new value for the `alpha` property value.\\n */\\n function changeSubcourtAlpha(uint96 _subcourtID, uint256 _alpha) external onlyByGovernor {\\n courts[_subcourtID].alpha = _alpha;\\n }\\n\\n /** @dev Changes the `feeForJuror` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _feeForJuror The new value for the `feeForJuror` property value.\\n */\\n function changeSubcourtJurorFee(uint96 _subcourtID, uint256 _feeForJuror) external onlyByGovernor {\\n courts[_subcourtID].feeForJuror = _feeForJuror;\\n }\\n\\n /** @dev Changes the `jurorsForCourtJump` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _jurorsForCourtJump The new value for the `jurorsForCourtJump` property value.\\n */\\n function changeSubcourtJurorsForJump(uint96 _subcourtID, uint256 _jurorsForCourtJump) external onlyByGovernor {\\n courts[_subcourtID].jurorsForCourtJump = _jurorsForCourtJump;\\n }\\n\\n /** @dev Changes the `timesPerPeriod` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _timesPerPeriod The new value for the `timesPerPeriod` property value.\\n */\\n function changeSubcourtTimesPerPeriod(uint96 _subcourtID, uint256[4] memory _timesPerPeriod)\\n external\\n onlyByGovernor\\n {\\n courts[_subcourtID].timesPerPeriod = _timesPerPeriod;\\n }\\n\\n /** @dev Adds/removes particular dispute kits to a subcourt's bitfield of supported dispute kits.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _disputeKitIDs IDs of dispute kits which support should be added/removed.\\n * @param _enable Whether add or remove the dispute kits from the subcourt.\\n */\\n function setDisputeKits(\\n uint96 _subcourtID,\\n uint8[] memory _disputeKitIDs,\\n bool _enable\\n ) external onlyByGovernor {\\n Court storage subcourt = courts[_subcourtID];\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n uint256 bitToChange = 1 << _disputeKitIDs[i]; // Get the bit that corresponds with dispute kit's ID.\\n if (_enable)\\n require((bitToChange & ~subcourt.supportedDisputeKits) == bitToChange, \\\"Dispute kit already supported\\\");\\n else require((bitToChange & subcourt.supportedDisputeKits) == bitToChange, \\\"Dispute kit is not supported\\\");\\n\\n // Change the bit corresponding with the dispute kit's ID to an opposite value.\\n subcourt.supportedDisputeKits ^= bitToChange;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /** @dev Sets the caller's stake in a subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _stake The new stake.\\n */\\n function setStake(uint96 _subcourtID, uint256 _stake) external {\\n require(setStakeForAccount(msg.sender, _subcourtID, _stake, 0), \\\"Staking failed\\\");\\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 subcourt (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 */\\n function createDispute(uint256 _numberOfChoices, bytes memory _extraData)\\n external\\n payable\\n override\\n returns (uint256 disputeID)\\n {\\n require(msg.value >= arbitrationCost(_extraData), \\\"Not enough ETH to cover arbitration cost.\\\");\\n (uint96 subcourtID, , uint8 disputeKitID) = extraDataToSubcourtIDMinJurorsDisputeKit(_extraData);\\n\\n uint256 bitToCheck = 1 << disputeKitID; // Get the bit that corresponds with dispute kit's ID.\\n require(\\n (bitToCheck & courts[subcourtID].supportedDisputeKits) == bitToCheck,\\n \\\"The dispute kit is not supported by this subcourt\\\"\\n );\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.subcourtID = subcourtID;\\n dispute.arbitrated = IArbitrable(msg.sender);\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n dispute.disputeKit = disputeKit;\\n\\n dispute.lastPeriodChange = block.timestamp;\\n dispute.nbVotes = msg.value / courts[dispute.subcourtID].feeForJuror;\\n\\n Round storage round = dispute.rounds.push();\\n round.tokensAtStakePerJuror =\\n (courts[dispute.subcourtID].minStake * courts[dispute.subcourtID].alpha) /\\n ALPHA_DIVISOR;\\n round.totalFeesForJurors = msg.value;\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData);\\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 */\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\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 >=\\n courts[dispute.subcourtID].timesPerPeriod[uint256(dispute.period)],\\n \\\"The evidence period time has not passed yet and it is not an appeal.\\\"\\n );\\n require(round.drawnJurors.length == dispute.nbVotes, \\\"The dispute has not finished drawing yet.\\\");\\n dispute.period = courts[dispute.subcourtID].hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n // In case the jurors finished casting commits beforehand the dispute kit should call passPeriod() by itself.\\n require(\\n block.timestamp - dispute.lastPeriodChange >=\\n courts[dispute.subcourtID].timesPerPeriod[uint256(dispute.period)] ||\\n msg.sender == address(dispute.disputeKit),\\n \\\"The commit period time has not passed yet.\\\"\\n );\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n // In case the jurors finished casting votes beforehand the dispute kit should call passPeriod() by itself.\\n require(\\n block.timestamp - dispute.lastPeriodChange >=\\n courts[dispute.subcourtID].timesPerPeriod[uint256(dispute.period)] ||\\n msg.sender == address(dispute.disputeKit),\\n \\\"The vote period time has not passed yet\\\"\\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 >=\\n courts[dispute.subcourtID].timesPerPeriod[uint256(dispute.period)],\\n \\\"The appeal period time has not passed yet.\\\"\\n );\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert(\\\"The dispute is already in the last period.\\\");\\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 */\\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, \\\"Should be evidence period.\\\");\\n\\n IDisputeKit disputeKit = dispute.disputeKit;\\n uint256 startIndex = round.drawnJurors.length;\\n uint256 endIndex = startIndex + _iterations <= dispute.nbVotes ? startIndex + _iterations : dispute.nbVotes;\\n\\n for (uint256 i = startIndex; i < endIndex; i++) {\\n address drawnAddress = disputeKit.draw(_disputeID);\\n if (drawnAddress != address(0)) {\\n // In case no one has staked at the court yet.\\n jurors[drawnAddress].lockedTokens[dispute.subcourtID] += round.tokensAtStakePerJuror;\\n require(\\n jurors[drawnAddress].stakedTokens[dispute.subcourtID] >=\\n jurors[drawnAddress].lockedTokens[dispute.subcourtID],\\n \\\"Locked amount shouldn't exceed staked amount.\\\"\\n );\\n round.drawnJurors.push(drawnAddress);\\n emit Draw(drawnAddress, _disputeID, currentRound, i);\\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 */\\n function appeal(uint256 _disputeID) external payable {\\n require(msg.value >= appealCost(_disputeID), \\\"Not enough ETH to cover appeal cost.\\\");\\n\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.appeal, \\\"Dispute is not appealable.\\\");\\n require(msg.sender == address(dispute.disputeKit), \\\"Access not allowed: Dispute Kit only.\\\");\\n\\n if (dispute.nbVotes >= courts[dispute.subcourtID].jurorsForCourtJump)\\n // Jump to parent subcourt.\\n // TODO: Handle court jump in the Forking court. Also make sure the new subcourt is compatible with the dispute kit.\\n dispute.subcourtID = courts[dispute.subcourtID].parent;\\n\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n // As many votes that can be afforded by the provided funds.\\n dispute.nbVotes = msg.value / courts[dispute.subcourtID].feeForJuror;\\n\\n Round storage extraRound = dispute.rounds.push();\\n extraRound.tokensAtStakePerJuror =\\n (courts[dispute.subcourtID].minStake * courts[dispute.subcourtID].alpha) /\\n ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\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 _appeal The appeal round.\\n * @param _iterations The number of iterations to run.\\n */\\n function execute(\\n uint256 _disputeID,\\n uint256 _appeal,\\n uint256 _iterations\\n ) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"Should be execution period.\\\");\\n\\n uint256 end = dispute.rounds[_appeal].repartitions + _iterations;\\n uint256 penaltiesInRoundCache = dispute.rounds[_appeal].penalties; // For saving gas.\\n\\n uint256 numberOfVotesInRound = dispute.rounds[_appeal].drawnJurors.length;\\n uint256 coherentCount = dispute.disputeKit.getCoherentCount(_disputeID, _appeal); // Total number of jurors that are eligible to a reward in this round.\\n\\n address account; // Address of the juror.\\n uint256 degreeOfCoherence; // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\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\\n for (uint256 i = dispute.rounds[_appeal].repartitions; i < end; i++) {\\n // Penalty.\\n if (i < numberOfVotesInRound) {\\n degreeOfCoherence = dispute.disputeKit.getDegreeOfCoherence(_disputeID, _appeal, i);\\n if (degreeOfCoherence > ALPHA_DIVISOR) degreeOfCoherence = ALPHA_DIVISOR; // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n\\n uint256 penalty = (dispute.rounds[_appeal].tokensAtStakePerJuror *\\n (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR; // Fully coherent jurors won't be penalized.\\n penaltiesInRoundCache += penalty;\\n\\n account = dispute.rounds[_appeal].drawnJurors[i];\\n jurors[account].lockedTokens[dispute.subcourtID] -= penalty; // Release this part of locked tokens.\\n\\n // Can only update the stake if it is able to cover the minStake and penalty, otherwise unstake from the court.\\n if (jurors[account].stakedTokens[dispute.subcourtID] >= courts[dispute.subcourtID].minStake + penalty) {\\n setStakeForAccount(\\n account,\\n dispute.subcourtID,\\n jurors[account].stakedTokens[dispute.subcourtID] - penalty,\\n penalty\\n );\\n } else if (jurors[account].stakedTokens[dispute.subcourtID] != 0) {\\n setStakeForAccount(account, dispute.subcourtID, 0, penalty);\\n }\\n\\n // Unstake the juror if he lost due to inactivity.\\n if (!dispute.disputeKit.isVoteActive(_disputeID, _appeal, i)) {\\n for (uint256 j = 0; j < jurors[account].subcourtIDs.length; j++)\\n setStakeForAccount(account, jurors[account].subcourtIDs[j], 0, 0);\\n }\\n emit TokenAndETHShift(account, _disputeID, -int256(penalty), 0);\\n\\n if (i == numberOfVotesInRound - 1) {\\n if (coherentCount == 0) {\\n // No one was coherent. Send the rewards to governor.\\n payable(governor).send(dispute.rounds[_appeal].totalFeesForJurors);\\n pinakion.transfer(governor, penaltiesInRoundCache);\\n }\\n }\\n // Reward.\\n } else {\\n degreeOfCoherence = dispute.disputeKit.getDegreeOfCoherence(\\n _disputeID,\\n _appeal,\\n i % numberOfVotesInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) degreeOfCoherence = ALPHA_DIVISOR;\\n account = dispute.rounds[_appeal].drawnJurors[i % numberOfVotesInRound];\\n // Release the rest of the tokens of the juror for this round.\\n jurors[account].lockedTokens[dispute.subcourtID] -=\\n (dispute.rounds[_appeal].tokensAtStakePerJuror * degreeOfCoherence) /\\n ALPHA_DIVISOR;\\n\\n if (jurors[account].stakedTokens[dispute.subcourtID] == 0) {\\n // Give back the locked tokens in case the juror fully unstaked earlier.\\n pinakion.transfer(\\n account,\\n (dispute.rounds[_appeal].tokensAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR\\n );\\n }\\n\\n uint256 tokenReward = ((penaltiesInRoundCache / coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n uint256 ETHReward = ((dispute.rounds[_appeal].totalFeesForJurors / coherentCount) * degreeOfCoherence) /\\n ALPHA_DIVISOR;\\n\\n pinakion.transfer(account, tokenReward);\\n payable(account).send(ETHReward);\\n emit TokenAndETHShift(account, _disputeID, int256(tokenReward), int256(ETHReward));\\n }\\n }\\n\\n if (dispute.rounds[_appeal].penalties != penaltiesInRoundCache)\\n dispute.rounds[_appeal].penalties = penaltiesInRoundCache;\\n dispute.rounds[_appeal].repartitions = end;\\n }\\n\\n /** @dev Executes a specified dispute's ruling. UNTRUSTED.\\n * @param _disputeID The ID of the dispute.\\n */\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n require(dispute.period == Period.execution, \\\"Should be execution period.\\\");\\n require(!dispute.ruled, \\\"Ruling already executed.\\\");\\n\\n uint256 winningChoice = currentRuling(_disputeID);\\n dispute.ruled = true;\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /** @dev Gets the cost of arbitration in a specified subcourt.\\n * @param _extraData Additional info about the dispute. We use it to pass the ID of the subcourt 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 */\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 subcourtID, uint256 minJurors, ) = extraDataToSubcourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[subcourtID].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 */\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.nbVotes >= courts[dispute.subcourtID].jurorsForCourtJump) {\\n // Jump to parent subcourt.\\n if (dispute.subcourtID == 0)\\n // Already in the forking court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent subcourt.\\n else cost = courts[courts[dispute.subcourtID].parent].feeForJuror * ((dispute.nbVotes * 2) + 1);\\n }\\n // Stay in current subcourt.\\n else cost = courts[dispute.subcourtID].feeForJuror * ((dispute.nbVotes * 2) + 1);\\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 */\\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.subcourtID].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 */\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling) {\\n IDisputeKit disputeKit = disputes[_disputeID].disputeKit;\\n return disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round)\\n external\\n view\\n returns (\\n uint256 tokensAtStakePerJuror,\\n uint256 totalFeesForJurors,\\n uint256 repartitions,\\n uint256 penalties,\\n address[] memory drawnJurors\\n )\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[_round];\\n return (\\n round.tokensAtStakePerJuror,\\n round.totalFeesForJurors,\\n round.repartitions,\\n round.penalties,\\n round.drawnJurors\\n );\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds.length;\\n }\\n\\n function getJurorBalance(address _juror, uint96 _subcourtID)\\n external\\n view\\n returns (uint256 staked, uint256 locked)\\n {\\n Juror storage juror = jurors[_juror];\\n staked = juror.stakedTokens[_subcourtID];\\n locked = juror.lockedTokens[_subcourtID];\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n function getSortitionSumTree(bytes32 _key)\\n public\\n view\\n returns (\\n uint256 K,\\n uint256[] memory stack,\\n uint256[] memory nodes\\n )\\n {\\n SortitionSumTreeFactory.SortitionSumTree storage tree = sortitionSumTrees.sortitionSumTrees[_key];\\n K = tree.K;\\n stack = tree.stack;\\n nodes = tree.nodes;\\n }\\n\\n function getSortitionSumTreeID(bytes32 _key, uint256 _nodeIndex) external view returns (bytes32 ID) {\\n ID = sortitionSumTrees.sortitionSumTrees[_key].nodeIndexesToIDs[_nodeIndex];\\n }\\n\\n function getSubcourtID(uint256 _disputeID) external view returns (uint256 subcourtID) {\\n return disputes[_disputeID].subcourtID;\\n }\\n\\n function getCurrentPeriod(uint256 _disputeID) external view returns (Period period) {\\n return disputes[_disputeID].period;\\n }\\n\\n function areVotesHidden(uint256 _subcourtID) external view returns (bool hiddenVotes) {\\n return courts[_subcourtID].hiddenVotes;\\n }\\n\\n function isRuled(uint256 _disputeID) external view returns (bool) {\\n return disputes[_disputeID].ruled;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /** @dev Sets the specified juror's stake in a subcourt.\\n * `O(n + p * log_k(j))` where\\n * `n` is the number of subcourts the juror has staked in,\\n * `p` is the depth of the subcourt tree,\\n * `k` is the minimum number of children per node of one of these subcourts' sortition sum tree,\\n * and `j` is the maximum number of jurors that ever staked in one of these subcourts simultaneously.\\n * @param _account The address of the juror.\\n * @param _subcourtID The ID of the subcourt.\\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 */\\n function setStakeForAccount(\\n address _account,\\n uint96 _subcourtID,\\n uint256 _stake,\\n uint256 _penalty\\n ) internal returns (bool succeeded) {\\n Juror storage juror = jurors[_account];\\n bytes32 stakePathID = accountAndSubcourtIDToStakePathID(_account, _subcourtID);\\n uint256 currentStake = sortitionSumTrees.stakeOf(bytes32(uint256(_subcourtID)), stakePathID);\\n\\n if (_stake != 0) {\\n // Check against locked tokens in case the min stake was lowered.\\n if (_stake < courts[_subcourtID].minStake || _stake < juror.lockedTokens[_subcourtID]) return false;\\n if (currentStake == 0) {\\n if (juror.subcourtIDs.length >= MAX_STAKE_PATHS) return false;\\n juror.subcourtIDs.push(_subcourtID);\\n }\\n } else {\\n for (uint256 i = 0; i < juror.subcourtIDs.length; i++) {\\n if (juror.subcourtIDs[i] == _subcourtID) {\\n juror.subcourtIDs[i] = juror.subcourtIDs[juror.subcourtIDs.length - 1];\\n juror.subcourtIDs.pop();\\n break;\\n }\\n }\\n }\\n\\n // Update juror's records.\\n uint256 newTotalStake = juror.stakedTokens[_subcourtID] - currentStake + _stake;\\n juror.stakedTokens[_subcourtID] = newTotalStake;\\n\\n // Update subcourt parents.\\n bool finished = false;\\n uint256 currentSubcourtID = _subcourtID;\\n while (!finished) {\\n sortitionSumTrees.set(bytes32(currentSubcourtID), _stake, stakePathID);\\n if (currentSubcourtID == 0) finished = true;\\n else currentSubcourtID = courts[currentSubcourtID].parent;\\n }\\n\\n emit StakeSet(_account, _subcourtID, _stake, newTotalStake);\\n\\n uint256 transferredAmount;\\n if (_stake >= currentStake) {\\n transferredAmount = _stake - currentStake;\\n if (transferredAmount > 0) {\\n if (!pinakion.transferFrom(_account, address(this), transferredAmount)) return false;\\n }\\n } else if (_stake == 0) {\\n // Keep locked tokens in the contract and release them after dispute is executed.\\n transferredAmount = currentStake - juror.lockedTokens[_subcourtID] - _penalty;\\n if (transferredAmount > 0) {\\n if (!pinakion.transfer(_account, transferredAmount)) return false;\\n }\\n } else {\\n transferredAmount = currentStake - _stake - _penalty;\\n if (transferredAmount > 0) {\\n if (!pinakion.transfer(_account, transferredAmount)) return false;\\n }\\n }\\n\\n return true;\\n }\\n\\n /** @dev Gets a subcourt 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 subcourt ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n * @return subcourtID The subcourt ID.\\n * @return minJurors The minimum number of jurors required.\\n * @return disputeKitID The ID of the dispute kit.\\n */\\n function extraDataToSubcourtIDMinJurorsDisputeKit(bytes memory _extraData)\\n internal\\n view\\n returns (\\n uint96 subcourtID,\\n uint256 minJurors,\\n uint8 disputeKitID\\n )\\n {\\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 subcourtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (subcourtID >= courts.length) subcourtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n if (disputeKits[disputeKitID] == IDisputeKit(address(0))) disputeKitID = 0;\\n } else {\\n subcourtID = 0;\\n minJurors = MIN_JURORS;\\n disputeKitID = 0;\\n }\\n }\\n\\n /** @dev Packs an account and a subcourt ID into a stake path ID.\\n * @param _account The address of the juror to pack.\\n * @param _subcourtID The subcourt ID to pack.\\n * @return stakePathID The stake path ID.\\n */\\n function accountAndSubcourtIDToStakePathID(address _account, uint96 _subcourtID)\\n internal\\n pure\\n returns (bytes32 stakePathID)\\n {\\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, _subcourtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4f156370910dd96e11867e8334e533cc8700ebb1a9bc07c63184eeace94887d9\",\"license\":\"MIT\"},\"src/data-structures/SortitionSumTreeFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@epiqueras, @unknownunknown1]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @title SortitionSumTreeFactory\\n * @dev A factory of trees that keeps track of staked values for sortition. This is the updated version for 0.8 compiler.\\n */\\nlibrary SortitionSumTreeFactory {\\n /* Structs */\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of childs 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 /* Storage */\\n\\n struct SortitionSumTrees {\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees;\\n }\\n\\n /* Public */\\n\\n /**\\n * @dev Create a sortition sum tree at the specified key.\\n * @param _key The key of the new tree.\\n * @param _K The number of children each node in the tree should have.\\n */\\n function createTree(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint256 _K\\n ) external {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\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 /**\\n * @dev Set a value of 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 childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function set(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint256 _value,\\n bytes32 _ID\\n ) external {\\n SortitionSumTree storage tree = self.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(self, _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(self, _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(self, _key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /* Public Views */\\n\\n /**\\n * @dev Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned.\\n * @param _key The key of the tree to get the leaves from.\\n * @param _cursor The pagination cursor.\\n * @param _count The number of items to return.\\n * @return startIndex The index at which leaves start.\\n * @return values The values of the returned leaves.\\n * @return hasMore Whether there are more for pagination.\\n * `O(n)` where\\n * `n` is the maximum number of nodes ever appended.\\n */\\n function queryLeafs(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint256 _cursor,\\n uint256 _count\\n )\\n external\\n view\\n returns (\\n uint256 startIndex,\\n uint256[] memory values,\\n bool hasMore\\n )\\n {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n // Find the start index.\\n for (uint256 i = 0; i < tree.nodes.length; i++) {\\n if ((tree.K * i) + 1 >= tree.nodes.length) {\\n startIndex = i;\\n break;\\n }\\n }\\n\\n // Get the values.\\n uint256 loopStartIndex = startIndex + _cursor;\\n values = new uint256[](\\n loopStartIndex + _count > tree.nodes.length ? tree.nodes.length - loopStartIndex : _count\\n );\\n uint256 valuesIndex = 0;\\n for (uint256 j = loopStartIndex; j < tree.nodes.length; j++) {\\n if (valuesIndex < _count) {\\n values[valuesIndex] = tree.nodes[j];\\n valuesIndex++;\\n } else {\\n hasMore = true;\\n break;\\n }\\n }\\n }\\n\\n /** @dev Gets a specified ID's associated value.\\n * @param _key The key of the tree.\\n * @param _ID The ID of the value.\\n * @return value The associated value.\\n */\\n function stakeOf(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n bytes32 _ID\\n ) external view returns (uint256 value) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) value = 0;\\n else value = tree.nodes[treeIndex];\\n }\\n\\n /* Private */\\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 childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function updateParents(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint256 _treeIndex,\\n bool _plusOrMinus,\\n uint256 _value\\n ) private {\\n SortitionSumTree storage tree = self.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\",\"keccak256\":\"0x158abfe345fecd93d3d6de008c01f4f72ffb03af5c6fbdf0208c7228fc978114\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b5060405162004bf638038062004bf68339810160408190526200003491620003a2565b600080546001600160a01b03199081166001600160a01b038e81169190911783556001805483168e83161781556002805484168e8416179055600460209081527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec8054909416928d169290921790925560408051610120810182528481528b151581840190815282518681528085018452928201928352606082018c9052608082018b905260a082018a905260c0820189905260e08201889052610100820185905260038054958601815590955280517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600b9095029485018054965115156c01000000000000000000000000026001600160681b03199097166001600160601b0390921691909117959095178555905180519194936200019d937fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c9091019291019062000272565b50606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e082015181600601906004620001df929190620002c2565b506101009190910151600a9091015560405163483abc4f60e11b815260076004820152600060248201526044810182905273f02733d9e5CbfE67B54F165b0277E1995106D52690639075789e9060640160006040518083038186803b1580156200024857600080fd5b505af41580156200025d573d6000803e3d6000fd5b5050505050505050505050505050506200046d565b828054828255906000526020600020908101928215620002b0579160200282015b82811115620002b057825182559160200191906001019062000293565b50620002be929150620002f2565b5090565b8260048101928215620002b05791602002820182811115620002b057825182559160200191906001019062000293565b5b80821115620002be5760008155600101620002f3565b6001600160a01b03811681146200031f57600080fd5b50565b600082601f8301126200033457600080fd5b604051608081016001600160401b03811182821017156200036557634e487b7160e01b600052604160045260246000fd5b6040528060808401858111156200037b57600080fd5b845b81811015620003975780518352602092830192016200037d565b509195945050505050565b60008060008060008060008060008060006101c08c8e031215620003c557600080fd5b8b51620003d28162000309565b60208d0151909b50620003e58162000309565b60408d0151909a50620003f88162000309565b60608d01519099506200040b8162000309565b60808d015190985080151581146200042257600080fd5b8097505060a08c0151955060c08c0151945060e08c015193506101008c01519250620004538d6101208e0162000322565b91506101a08c015190509295989b509295989b9093969950565b614779806200047d6000396000f3fe6080604052600436106102505760003560e01c80638a9bb02a11610139578063d2b8035a116100b6578063eaff425a1161007a578063eaff425a146107e1578063f441d9b3146107f6578063f6a6ef7a14610816578063f7434ea914610836578063fbf405b014610856578063fc6f8f161461087657600080fd5b8063d2b8035a14610716578063d2d514e014610736578063d578cbac14610765578063de1a1e5914610785578063e4c0aaf4146107c157600080fd5b8063b4a61608116100fd578063b4a6160814610651578063c13517e114610666578063c258bb1914610679578063cf0c38f814610699578063d1c1df48146106b957600080fd5b80638a9bb02a146105755780638bb04875146105a6578063a57366e7146105c6578063acdbf51d146105e6578063afe15cfb1461061c57600080fd5b80635468f919116101d257806359ec827e1161019657806359ec827e146104c75780635bc24dd3146104e7578063751accd0146105075780637717a6e8146105275780637e69b7b014610547578063840bc19c1461055a57600080fd5b80635468f91914610414578063564a565d1461043457806357260364146104675780635788795d1461048757806359354c77146104a757600080fd5b806322684db01161021957806322684db0146103615780632d29a47b1461038e5780632ea7b4d0146103ae5780633e1d09be146103c45780634b7fcda2146103e457600080fd5b8062f5822c146102555780630c340a2414610277578063115d5376146102b45780631c3db16d146102d45780631f5a0dd214610302575b600080fd5b34801561026157600080fd5b50610275610270366004613ed9565b610896565b005b34801561028357600080fd5b50600054610297906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102c057600080fd5b506102756102cf366004613ef6565b6108eb565b3480156102e057600080fd5b506102f46102ef366004613ef6565b610fe4565b6040519081526020016102ab565b34801561030e57600080fd5b5061032261031d366004613ef6565b611082565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a083015260c082015260e0016102ab565b34801561036d57600080fd5b5061038161037c366004613ef6565b6110df565b6040516102ab9190613f47565b34801561039a57600080fd5b506102756103a9366004613f5b565b611118565b3480156103ba57600080fd5b506102f461271081565b3480156103d057600080fd5b506102756103df366004613fa3565b611c9c565b3480156103f057600080fd5b506104046103ff366004613ef6565b611eb7565b60405190151581526020016102ab565b34801561042057600080fd5b5061027561042f36600461403e565b611ef0565b34801561044057600080fd5b5061045461044f366004613ef6565b612053565b6040516102ab979695949392919061410e565b34801561047357600080fd5b506102756104823660046141ce565b6120c0565b34801561049357600080fd5b506102756104a2366004614202565b61212b565b3480156104b357600080fd5b506102756104c2366004613fa3565b6123ff565b3480156104d357600080fd5b506102f46104e2366004613ef6565b61245f565b3480156104f357600080fd5b50610275610502366004613fa3565b6125cf565b34801561051357600080fd5b506102756105223660046142f4565b61262f565b34801561053357600080fd5b50610275610542366004613fa3565b612701565b610275610555366004613ef6565b61274f565b34801561056657600080fd5b506102f46001600160ff1b0381565b34801561058157600080fd5b5061059561059036600461434d565b612abd565b6040516102ab95949392919061436f565b3480156105b257600080fd5b506102756105c1366004613ef6565b612b9b565b3480156105d257600080fd5b506102756105e1366004613fa3565b612d1f565b3480156105f257600080fd5b50610297610601366004613ef6565b6004602052600090815260409020546001600160a01b031681565b34801561062857600080fd5b5061063c610637366004613ef6565b612d7f565b604080519283526020830191909152016102ab565b34801561065d57600080fd5b506102f4600481565b6102f46106743660046143db565b612e33565b34801561068557600080fd5b50610275610694366004613ed9565b61319c565b3480156106a557600080fd5b50600254610297906001600160a01b031681565b3480156106c557600080fd5b5061063c6106d4366004614422565b6001600160a01b0390911660009081526006602090815260408083206001600160601b0390941683526001840182528083205460029094019091529020549091565b34801561072257600080fd5b5061027561073136600461434d565b6131e8565b34801561074257600080fd5b50610756610751366004613ef6565b6134fd565b6040516102ab93929190614489565b34801561077157600080fd5b50610404610780366004613ef6565b6135c5565b34801561079157600080fd5b506102f46107a036600461434d565b60009182526007602090815260408084209284526004909201905290205490565b3480156107cd57600080fd5b506102756107dc366004613ed9565b6135fb565b3480156107ed57600080fd5b506102f4600381565b34801561080257600080fd5b506102756108113660046144be565b613647565b34801561082257600080fd5b506102f4610831366004613ef6565b6136a2565b34801561084257600080fd5b506102f46108513660046144ea565b6136d7565b34801561086257600080fd5b50600154610297906001600160a01b031681565b34801561088257600080fd5b506102f4610891366004613ef6565b61372b565b6000546001600160a01b031633146108c95760405162461bcd60e51b81526004016108c09061451f565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006005828154811061090057610900614561565b90600052602060002090600502019050600060018260040180549050610926919061458d565b9050600082600401828154811061093f5761093f614561565b60009182526020822060059091020191506001840154600160a01b900460ff16600481111561097057610970613f0f565b1415610b585760008211806109f8575082546003805490916001600160601b03169081106109a0576109a0614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff1660048111156109d4576109d4613f0f565b600481106109e4576109e4614561565b015460028401546109f5904261458d565b10155b610a785760405162461bcd60e51b8152602060048201526044602482018190527f5468652065766964656e636520706572696f642074696d6520686173206e6f74908201527f207061737365642079657420616e64206974206973206e6f7420616e2061707060648201526332b0b61760e11b608482015260a4016108c0565b6003830154600482015414610ae15760405162461bcd60e51b815260206004820152602960248201527f546865206469737075746520686173206e6f742066696e6973686564206472616044820152683bb4b733903cb2ba1760b91b60648201526084016108c0565b82546003805490916001600160601b0316908110610b0157610b01614561565b60009182526020909120600b9091020154600160601b900460ff16610b27576002610b2a565b60015b60018401805460ff60a01b1916600160a01b836004811115610b4e57610b4e613f0f565b0217905550610f90565b600180840154600160a01b900460ff166004811115610b7957610b79613f0f565b1415610c885782546003805490916001600160601b0316908110610b9f57610b9f614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610bd357610bd3613f0f565b60048110610be357610be3614561565b01546002840154610bf4904261458d565b101580610c0d575060018301546001600160a01b031633145b610c6c5760405162461bcd60e51b815260206004820152602a60248201527f54686520636f6d6d697420706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108c0565b6001830180546002919060ff60a01b1916600160a01b83610b4e565b60026001840154600160a01b900460ff166004811115610caa57610caa613f0f565b1415610df35782546003805490916001600160601b0316908110610cd057610cd0614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610d0457610d04613f0f565b60048110610d1457610d14614561565b01546002840154610d25904261458d565b101580610d3e575060018301546001600160a01b031633145b610d9a5760405162461bcd60e51b815260206004820152602760248201527f54686520766f746520706572696f642074696d6520686173206e6f74207061736044820152661cd959081e595d60ca1b60648201526084016108c0565b60018301805460ff60a01b1916600360a01b1790558254604051600160601b9091046001600160a01b03169085907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610f90565b60036001840154600160a01b900460ff166004811115610e1557610e15613f0f565b1415610f0d5782546003805490916001600160601b0316908110610e3b57610e3b614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610e6f57610e6f613f0f565b60048110610e7f57610e7f614561565b01546002840154610e90904261458d565b1015610ef15760405162461bcd60e51b815260206004820152602a60248201527f5468652061707065616c20706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108c0565b6001830180546004919060ff60a01b1916600160a01b83610b4e565b60046001840154600160a01b900460ff166004811115610f2f57610f2f613f0f565b1415610f905760405162461bcd60e51b815260206004820152602a60248201527f546865206469737075746520697320616c726561647920696e20746865206c6160448201526939ba103832b934b7b21760b11b60648201526084016108c0565b426002840155600183015460405185917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b9191610fd691600160a01b900460ff1690613f47565b60405180910390a250505050565b60008060058381548110610ffa57610ffa614561565b6000918252602090912060059091020160010154604051631c3db16d60e01b8152600481018590526001600160a01b0390911691508190631c3db16d90602401602060405180830381865afa158015611057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107b91906145a4565b9392505050565b6003818154811061109257600080fd5b60009182526020909120600b9091020180546002820154600383015460048401546005850154600a909501546001600160601b0385169650600160601b90940460ff169492939192909187565b6000600582815481106110f4576110f4614561565b6000918252602090912060059091020160010154600160a01b900460ff1692915050565b60006005848154811061112d5761112d614561565b60009182526020909120600590910201905060046001820154600160a01b900460ff16600481111561116157611161613f0f565b146111ae5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108c0565b6000828260040185815481106111c6576111c6614561565b9060005260206000209060050201600201546111e291906145bd565b905060008260040185815481106111fb576111fb614561565b9060005260206000209060050201600301549050600083600401868154811061122657611226614561565b6000918252602082206004600590920201810154600187015460405163368efae360e21b81529194506001600160a01b03169163da3beb8c91611276918c918c9101918252602082015260400190565b602060405180830381865afa158015611293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b791906145a4565b9050600080826112d257838611156112cd578395505b6112f2565b6112dd8460026145d5565b8611156112f2576112ef8460026145d5565b95505b6000876004018a8154811061130957611309614561565b90600052602060002090600502016002015490505b86811015611c0b5784811015611809576001880154604051634fe264fb60e01b8152600481018d9052602481018c9052604481018390526001600160a01b0390911690634fe264fb90606401602060405180830381865afa158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab91906145a4565b91506127108211156113bd5761271091505b60006127106113cc848261458d565b8a6004018d815481106113e1576113e1614561565b9060005260206000209060050201600001546113fd91906145d5565b611407919061460a565b905061141381886145bd565b9650886004018b8154811061142a5761142a614561565b9060005260206000209060050201600401828154811061144c5761144c614561565b60009182526020808320909101546001600160a01b03168083526006825260408084208d546001600160601b0316855260020190925290822080549196508392909161149990849061458d565b909155505088546003805483926001600160601b03169081106114be576114be614561565b90600052602060002090600b0201600201546114da91906145bd565b6001600160a01b03851660009081526006602090815260408083208d546001600160601b03168452600101909152902054106115635788546001600160a01b03851660009081526006602090815260408083206001600160601b03909416808452600190940190915290205461155d91869161155790859061458d565b8461375c565b506115b4565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b03168452600101909152902054156115b45788546115b29085906001600160601b031660008461375c565b505b600189015460405163ba66fde760e01b8152600481018e9052602481018d9052604481018490526001600160a01b039091169063ba66fde790606401602060405180830381865afa15801561160d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611631919061461e565b6116ce5760005b6001600160a01b0385166000908152600660205260409020548110156116cc576001600160a01b038516600090815260066020526040902080546116b99187918490811061168857611688614561565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b031660008061375c565b50806116c48161463b565b915050611638565b505b8b6001600160a01b0385167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e1961170384614656565b60408051918252600060208301520160405180910390a361172560018761458d565b82141561180357846118035760005460048a0180546001600160a01b03909216916108fc91908e90811061175b5761175b614561565b9060005260206000209060050201600101549081150290604051600060405180830381858888f1505060015460005460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018d90529116935063a9059cbb925060440190506020604051808303816000875af11580156117dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611801919061461e565b505b50611bf9565b60018801546001600160a01b0316634fe264fb8c8c6118288986614673565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015611871573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189591906145a4565b91506127108211156118a75761271091505b876004018a815481106118bc576118bc614561565b906000526020600020906005020160040185826118d99190614673565b815481106118e9576118e9614561565b9060005260206000200160009054906101000a90046001600160a01b0316925061271082896004018c8154811061192257611922614561565b90600052602060002090600502016000015461193e91906145d5565b611948919061460a565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b031684526002019091528120805490919061198890849061458d565b90915550506001600160a01b03831660009081526006602090815260408083208b546001600160601b03168452600101909152902054611a9757600160009054906101000a90046001600160a01b03166001600160a01b031663a9059cbb84612710858c6004018f81548110611a0057611a00614561565b906000526020600020906005020160000154611a1c91906145d5565b611a26919061460a565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a95919061461e565b505b600061271083611aa7878a61460a565b611ab191906145d5565b611abb919061460a565b9050600061271084878c6004018f81548110611ad957611ad9614561565b906000526020600020906005020160010154611af5919061460a565b611aff91906145d5565b611b09919061460a565b60015460405163a9059cbb60e01b81526001600160a01b0388811660048301526024820186905292935091169063a9059cbb906044016020604051808303816000875af1158015611b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b82919061461e565b506040516001600160a01b0386169082156108fc029083906000818181858888f19350505050508c856001600160a01b03167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e198484604051611bee929190918252602082015260400190565b60405180910390a350505b80611c038161463b565b91505061131e565b5084876004018a81548110611c2257611c22614561565b90600052602060002090600502016003015414611c655784876004018a81548110611c4f57611c4f614561565b9060005260206000209060050201600301819055505b85876004018a81548110611c7b57611c7b614561565b90600052602060002090600502016002018190555050505050505050505050565b6000546001600160a01b03163314611cc65760405162461bcd60e51b81526004016108c09061451f565b6001600160601b0382161580611d37575080600380846001600160601b031681548110611cf557611cf5614561565b60009182526020909120600b909102015481546001600160601b03909116908110611d2257611d22614561565b90600052602060002090600b02016002015411155b611d4057600080fd5b60005b6003836001600160601b031681548110611d5f57611d5f614561565b90600052602060002090600b020160010180549050811015611e805781600380856001600160601b031681548110611d9957611d99614561565b90600052602060002090600b02016001018381548110611dbb57611dbb614561565b906000526020600020015481548110611dd657611dd6614561565b90600052602060002090600b0201600201541015611e6e5760405162461bcd60e51b815260206004820152604960248201527f4120737562636f7572742063616e6e6f742062652074686520706172656e742060448201527f6f66206120737562636f75727420776974682061206c6f776572206d696e696d6064820152683ab69039ba30b5b29760b91b608482015260a4016108c0565b80611e788161463b565b915050611d43565b50806003836001600160601b031681548110611e9e57611e9e614561565b90600052602060002090600b0201600201819055505050565b600060058281548110611ecc57611ecc614561565b6000918252602090912060059091020160010154600160a81b900460ff1692915050565b6000546001600160a01b03163314611f1a5760405162461bcd60e51b81526004016108c09061451f565b60006003846001600160601b031681548110611f3857611f38614561565b90600052602060002090600b0201905060005b835181101561204c576000848281518110611f6857611f68614561565b602002602001015160ff166001901b90508315611fda578083600a015419821614611fd55760405162461bcd60e51b815260206004820152601d60248201527f44697370757465206b697420616c726561647920737570706f7274656400000060448201526064016108c0565b61202f565b8083600a015482161461202f5760405162461bcd60e51b815260206004820152601c60248201527f44697370757465206b6974206973206e6f7420737570706f727465640000000060448201526064016108c0565b600a830180549091189055806120448161463b565b915050611f4b565b5050505050565b6005818154811061206357600080fd5b600091825260209091206005909102018054600182015460028301546003909301546001600160601b03831694506001600160a01b03600160601b9093048316939282169260ff600160a01b8404811693600160a81b9004169187565b6000546001600160a01b031633146120ea5760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b03168154811061210757612107614561565b90600052602060002090600b0201600601906004612126929190613e34565b505050565b6000546001600160a01b031633146121555760405162461bcd60e51b81526004016108c09061451f565b8660038a6001600160601b03168154811061217257612172614561565b90600052602060002090600b02016002015411156122085760405162461bcd60e51b815260206004820152604760248201527f4120737562636f7572742063616e6e6f742062652061206368696c64206f662060448201527f6120737562636f7572742077697468206120686967686572206d696e696d756d6064820152661039ba30b5b29760c91b608482015260a4016108c0565b6003805460408051610120810182526001600160601b038d1681528b15156020820152919291908101600060405190808252806020026020018201604052801561225c578160200160208202803683370190505b50815260208082018c905260408083018c9052606083018b9052608083018a905260a0830189905260c09092018690528354600181810186556000958652948290208451600b909202018054858401511515600160601b026cffffffffffffffffffffffffff199091166001600160601b0390931692909217919091178155918301518051939492936122f6938501929190910190613e72565b50606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e082015181600601906004612336929190613e34565b506101009190910151600a9091015560405163483abc4f60e11b815260076004820152602481018290526044810184905273f02733d9e5CbfE67B54F165b0277E1995106D52690639075789e9060640160006040518083038186803b15801561239e57600080fd5b505af41580156123b2573d6000803e3d6000fd5b5050505060038a6001600160601b0316815481106123d2576123d2614561565b600091825260208083206001600b9093020182018054928301815583529091200155505050505050505050565b6000546001600160a01b031633146124295760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b03168154811061244657612446614561565b90600052602060002090600b0201600401819055505050565b6000806005838154811061247557612475614561565b60009182526020909120600590910201805460038054929350916001600160601b039091169081106124a9576124a9614561565b90600052602060002090600b0201600501548160030154106125725780546001600160601b03166124e3576001600160ff1b0391506125c9565b60038101546124f39060026145d5565b6124fe9060016145bd565b815460038054909182916001600160601b0390911690811061252257612522614561565b60009182526020909120600b909102015481546001600160601b0390911690811061254f5761254f614561565b90600052602060002090600b02016004015461256b91906145d5565b91506125c9565b60038101546125829060026145d5565b61258d9060016145bd565b81546003805490916001600160601b03169081106125ad576125ad614561565b90600052602060002090600b02016004015461107b91906145d5565b50919050565b6000546001600160a01b031633146125f95760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b03168154811061261657612616614561565b90600052602060002090600b0201600301819055505050565b6000546001600160a01b031633146126595760405162461bcd60e51b81526004016108c09061451f565b6000836001600160a01b0316838360405161267491906146b3565b60006040518083038185875af1925050503d80600081146126b1576040519150601f19603f3d011682016040523d82523d6000602084013e6126b6565b606091505b50509050806126fb5760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b60448201526064016108c0565b50505050565b61270e338383600061375c565b61274b5760405162461bcd60e51b815260206004820152600e60248201526d14dd185ada5b99c819985a5b195960921b60448201526064016108c0565b5050565b6127588161245f565b3410156127b35760405162461bcd60e51b8152602060048201526024808201527f4e6f7420656e6f7567682045544820746f20636f7665722061707065616c206360448201526337b9ba1760e11b60648201526084016108c0565b6000600582815481106127c8576127c8614561565b60009182526020909120600590910201905060036001820154600160a01b900460ff1660048111156127fc576127fc613f0f565b146128495760405162461bcd60e51b815260206004820152601a60248201527f44697370757465206973206e6f742061707065616c61626c652e00000000000060448201526064016108c0565b60018101546001600160a01b031633146128b35760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2044697370757465204b69742060448201526437b7363c9760d91b60648201526084016108c0565b80546003805490916001600160601b03169081106128d3576128d3614561565b90600052602060002090600b0201600501548160030154106129405780546003805490916001600160601b031690811061290f5761290f614561565b60009182526020909120600b909102015481546bffffffffffffffffffffffff19166001600160601b039091161781555b60018101805460ff60a01b1916905542600282015580546003805490916001600160601b031690811061297557612975614561565b90600052602060002090600b02016004015434612992919061460a565b60038083019190915560048201805460018101825560009182526020909120835483546005909302909101926127109290916001600160601b03169081106129dc576129dc614561565b600091825260209091206003600b90920201810154845482549192916001600160601b03909116908110612a1257612a12614561565b90600052602060002090600b020160020154612a2e91906145d5565b612a38919061460a565b81553460018201558154604051600160601b9091046001600160a01b03169084907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3827f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612ab09190613f47565b60405180910390a2505050565b6000806000806060600060058881548110612ada57612ada614561565b906000526020600020906005020190506000816004018881548110612b0157612b01614561565b9060005260206000209060050201905080600001548160010154826002015483600301548460040180805480602002602001604051908101604052809291908181526020018280548015612b7e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612b60575b505050505090509650965096509650965050509295509295909350565b600060058281548110612bb057612bb0614561565b60009182526020909120600590910201905060046001820154600160a01b900460ff166004811115612be457612be4613f0f565b14612c315760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108c0565b6001810154600160a81b900460ff1615612c8d5760405162461bcd60e51b815260206004820152601860248201527f52756c696e6720616c72656164792065786563757465642e000000000000000060448201526064016108c0565b6000612c9883610fe4565b60018301805460ff60a81b1916600160a81b179055825460405163188d362b60e11b815260048101869052602481018390529192506001600160a01b03600160601b909104169063311a6c5690604401600060405180830381600087803b158015612d0257600080fd5b505af1158015612d16573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314612d495760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b031681548110612d6657612d66614561565b90600052602060002090600b0201600501819055505050565b600080600060058481548110612d9757612d97614561565b60009182526020909120600590910201905060036001820154600160a01b900460ff166004811115612dcb57612dcb613f0f565b1415612e24576002810154815460038054929550916001600160601b03909116908110612dfa57612dfa614561565b600091825260209091206009600b9092020101546002820154612e1d91906145bd565b9150612e2d565b60009250600091505b50915091565b6000612e3e826136d7565b341015612e9f5760405162461bcd60e51b815260206004820152602960248201527f4e6f7420656e6f7567682045544820746f20636f76657220617262697472617460448201526834b7b71031b7b9ba1760b91b60648201526084016108c0565b600080612eab84613d70565b925050915060008160ff166001901b9050806003846001600160601b031681548110612ed957612ed9614561565b90600052602060002090600b0201600a0154821614612f545760405162461bcd60e51b815260206004820152603160248201527f5468652064697370757465206b6974206973206e6f7420737570706f7274656460448201527008189e481d1a1a5cc81cdd5898dbdd5c9d607a1b60648201526084016108c0565b60058054600181018255600160601b33026001600160601b038087168281179484027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810195865560ff88166000908152600460205260409020547f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1820180546001600160a01b0319166001600160a01b03929092169182179055427f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29092019190915560038054959a50909490939092161790811061303657613036614561565b90600052602060002090600b02016004015434613053919061460a565b60038084019190915560048301805460018101825560009182526020909120845483546005909302909101926127109290916001600160601b031690811061309d5761309d614561565b600091825260209091206003600b90920201810154855482549192916001600160601b039091169081106130d3576130d3614561565b90600052602060002090600b0201600201546130ef91906145d5565b6130f9919061460a565b8155346001820155604051638d31de6d60e01b81526001600160a01b03831690638d31de6d90613131908a908d908d906004016146cf565b600060405180830381600087803b15801561314b57600080fd5b505af115801561315f573d6000803e3d6000fd5b50506040513392508991507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505092915050565b6000546001600160a01b031633146131c65760405162461bcd60e51b81526004016108c09061451f565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000600583815481106131fd576131fd614561565b90600052602060002090600502019050600060018260040180549050613223919061458d565b9050600082600401828154811061323c5761323c614561565b60009182526020822060059091020191506001840154600160a01b900460ff16600481111561326d5761326d613f0f565b146132ba5760405162461bcd60e51b815260206004820152601a60248201527f53686f756c642062652065766964656e636520706572696f642e00000000000060448201526064016108c0565b6001830154600482015460038501546001600160a01b03909216916000906132e288846145bd565b11156132f25785600301546132fc565b6132fc87836145bd565b9050815b818110156134f257604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af1158015613352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133769190614710565b90506001600160a01b038116156134df5785546001600160a01b03821660009081526006602090815260408083208c546001600160601b03168452600201909152812080549091906133c99084906145bd565b90915550506001600160a01b03811660009081526006602090815260408083208b546001600160601b031684526002810183528184205460019091019092529091205410156134705760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b656420616d6f756e742073686f756c646e277420657863656564207360448201526c3a30b5b2b21030b6b7bab73a1760991b60648201526084016108c0565b60048601805460018101825560009182526020918290200180546001600160a01b0319166001600160a01b038416908117909155604080518a81529283018590528c927f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a35b50806134ea8161463b565b915050613300565b505050505050505050565b600081815260076020908152604091829020805460018201805485518186028101860190965280865291946060948594939192919083018282801561356157602002820191906000526020600020905b81548152602001906001019080831161354d575b50505050509250806002018054806020026020016040519081016040528092919081815260200182805480156135b657602002820191906000526020600020905b8154815260200190600101908083116135a2575b50505050509150509193909250565b6000600382815481106135da576135da614561565b60009182526020909120600b9091020154600160601b900460ff1692915050565b6000546001600160a01b031633146136255760405162461bcd60e51b81526004016108c09061451f565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146136715760405162461bcd60e51b81526004016108c09061451f565b60ff16600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6000600582815481106136b7576136b7614561565b60009182526020909120600590910201546001600160601b031692915050565b60008060006136e584613d70565b5091509150806003836001600160601b03168154811061370757613707614561565b90600052602060002090600b02016004015461372391906145d5565b949350505050565b6000806005838154811061374157613741614561565b60009182526020909120600460059092020101549392505050565b6001600160a01b03841660009081526006602052604081208161377f8787613dec565b604051637521ccb160e01b8152600760048201526001600160601b03881660248201526044810182905290915060009073f02733d9e5CbfE67B54F165b0277E1995106D52690637521ccb190606401602060405180830381865af41580156137eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061380f91906145a4565b905085156138d6576003876001600160601b03168154811061383357613833614561565b90600052602060002090600b02016002015486108061386b57506001600160601b038716600090815260028401602052604090205486105b1561387c5760009350505050613723565b806138d15782546004116138965760009350505050613723565b8254600180820185556000858152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918a16021790555b613a22565b60005b8354811015613a2057876001600160601b031684600001828154811061390157613901614561565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03161415613a0e578354849061393e9060019061458d565b8154811061394e5761394e614561565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b031684600001828154811061398c5761398c614561565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550836000018054806139d8576139d861472d565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055613a20565b80613a188161463b565b9150506138d9565b505b6001600160601b03871660009081526001840160205260408120548790613a4a90849061458d565b613a5491906145bd565b6001600160601b038916600081815260018701602052604081208390559192505b81613b3857604051631712e1c560e11b81526007600482015260248101829052604481018a90526064810186905273f02733d9e5CbfE67B54F165b0277E1995106D52690632e25c38a9060840160006040518083038186803b158015613ada57600080fd5b505af4158015613aee573d6000803e3d6000fd5b505050508060001415613b045760019150613a75565b60038181548110613b1757613b17614561565b60009182526020909120600b90910201546001600160601b03169050613a75565b604080516001600160601b038c168152602081018b90529081018490526001600160a01b038c16907f70ca4ec64687bf265f39041896f3dbf10b9f650503cb38f2b3569fdce7489c369060600160405180910390a26000848a10613c3f57613ba0858b61458d565b90508015613c3a576001546040516323b872dd60e01b81526001600160a01b038e8116600483015230602483015260448201849052909116906323b872dd906064015b6020604051808303816000875af1158015613c02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c26919061461e565b613c3a576000975050505050505050613723565b613d5e565b89613cb6576001600160601b038b1660009081526002880160205260409020548990613c6b908761458d565b613c75919061458d565b90508015613c3a5760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb90604401613be3565b88613cc18b8761458d565b613ccb919061458d565b90508015613d5e5760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb906044016020604051808303816000875af1158015613d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d4a919061461e565b613d5e576000975050505050505050613723565b5060019b9a5050505050505050505050565b60008060006040845110613dda575050506020810151604082015160608301516003546001600160601b03841610613da757600092505b81613db157600391505b60ff81166000908152600460205260409020546001600160a01b0316613dd5575060005b613de5565b506000915060039050815b9193909250565b600060405160005b6014811015613e0f578481600c011a81830153600101613df4565b5060145b6020811015613e2b5783811a81830153600101613e13565b50519392505050565b8260048101928215613e62579160200282015b82811115613e62578251825591602001919060010190613e47565b50613e6e929150613eac565b5090565b828054828255906000526020600020908101928215613e625791602002820182811115613e62578251825591602001919060010190613e47565b5b80821115613e6e5760008155600101613ead565b6001600160a01b0381168114613ed657600080fd5b50565b600060208284031215613eeb57600080fd5b813561107b81613ec1565b600060208284031215613f0857600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60058110613f4357634e487b7160e01b600052602160045260246000fd5b9052565b60208101613f558284613f25565b92915050565b600080600060608486031215613f7057600080fd5b505081359360208301359350604090920135919050565b80356001600160601b0381168114613f9e57600080fd5b919050565b60008060408385031215613fb657600080fd5b613fbf83613f87565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561400c5761400c613fcd565b604052919050565b803560ff81168114613f9e57600080fd5b8015158114613ed657600080fd5b8035613f9e81614025565b60008060006060848603121561405357600080fd5b61405c84613f87565b925060208085013567ffffffffffffffff8082111561407a57600080fd5b818701915087601f83011261408e57600080fd5b8135818111156140a0576140a0613fcd565b8060051b91506140b1848301613fe3565b818152918301840191848101908a8411156140cb57600080fd5b938501935b838510156140f0576140e185614014565b825293850193908501906140d0565b80975050505050505061410560408501614033565b90509250925092565b6001600160601b03881681526001600160a01b0387811660208301528616604082015260e081016141426060830187613f25565b931515608082015260a081019290925260c090910152949350505050565b600082601f83011261417157600080fd5b6040516080810181811067ffffffffffffffff8211171561419457614194613fcd565b6040528060808401858111156141a957600080fd5b845b818110156141c35780358352602092830192016141ab565b509195945050505050565b60008060a083850312156141e157600080fd5b6141ea83613f87565b91506141f98460208501614160565b90509250929050565b60008060008060008060008060006101808a8c03121561422157600080fd5b61422a8a613f87565b985060208a013561423a81614025565b975060408a0135965060608a0135955060808a0135945060a08a013593506142658b60c08c01614160565b92506101408a013591506101608a013590509295985092959850929598565b600082601f83011261429557600080fd5b813567ffffffffffffffff8111156142af576142af613fcd565b6142c2601f8201601f1916602001613fe3565b8181528460208386010111156142d757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561430957600080fd5b833561431481613ec1565b925060208401359150604084013567ffffffffffffffff81111561433757600080fd5b61434386828701614284565b9150509250925092565b6000806040838503121561436057600080fd5b50508035926020909101359150565b600060a082018783526020878185015286604085015285606085015260a0608085015281855180845260c086019150828701935060005b818110156143cb5784516001600160a01b0316835293830193918301916001016143a6565b50909a9950505050505050505050565b600080604083850312156143ee57600080fd5b82359150602083013567ffffffffffffffff81111561440c57600080fd5b61441885828601614284565b9150509250929050565b6000806040838503121561443557600080fd5b823561444081613ec1565b91506141f960208401613f87565b600081518084526020808501945080840160005b8381101561447e57815187529582019590820190600101614462565b509495945050505050565b8381526060602082015260006144a2606083018561444e565b82810360408401526144b4818561444e565b9695505050505050565b600080604083850312156144d157600080fd5b82356144dc81613ec1565b91506141f960208401614014565b6000602082840312156144fc57600080fd5b813567ffffffffffffffff81111561451357600080fd5b61372384828501614284565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561459f5761459f614577565b500390565b6000602082840312156145b657600080fd5b5051919050565b600082198211156145d0576145d0614577565b500190565b60008160001904831182151516156145ef576145ef614577565b500290565b634e487b7160e01b600052601260045260246000fd5b600082614619576146196145f4565b500490565b60006020828403121561463057600080fd5b815161107b81614025565b600060001982141561464f5761464f614577565b5060010190565b6000600160ff1b82141561466c5761466c614577565b5060000390565b600082614682576146826145f4565b500690565b60005b838110156146a257818101518382015260200161468a565b838111156126fb5750506000910152565b600082516146c5818460208701614687565b9190910192915050565b83815282602082015260606040820152600082518060608401526146fa816080850160208701614687565b601f01601f191691909101608001949350505050565b60006020828403121561472257600080fd5b815161107b81613ec1565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220bd91fce7201899d75d819f63f7e467358cfc4d44030583d012667271506fcec564736f6c634300080a0033", "deployedBytecode": "0x6080604052600436106102505760003560e01c80638a9bb02a11610139578063d2b8035a116100b6578063eaff425a1161007a578063eaff425a146107e1578063f441d9b3146107f6578063f6a6ef7a14610816578063f7434ea914610836578063fbf405b014610856578063fc6f8f161461087657600080fd5b8063d2b8035a14610716578063d2d514e014610736578063d578cbac14610765578063de1a1e5914610785578063e4c0aaf4146107c157600080fd5b8063b4a61608116100fd578063b4a6160814610651578063c13517e114610666578063c258bb1914610679578063cf0c38f814610699578063d1c1df48146106b957600080fd5b80638a9bb02a146105755780638bb04875146105a6578063a57366e7146105c6578063acdbf51d146105e6578063afe15cfb1461061c57600080fd5b80635468f919116101d257806359ec827e1161019657806359ec827e146104c75780635bc24dd3146104e7578063751accd0146105075780637717a6e8146105275780637e69b7b014610547578063840bc19c1461055a57600080fd5b80635468f91914610414578063564a565d1461043457806357260364146104675780635788795d1461048757806359354c77146104a757600080fd5b806322684db01161021957806322684db0146103615780632d29a47b1461038e5780632ea7b4d0146103ae5780633e1d09be146103c45780634b7fcda2146103e457600080fd5b8062f5822c146102555780630c340a2414610277578063115d5376146102b45780631c3db16d146102d45780631f5a0dd214610302575b600080fd5b34801561026157600080fd5b50610275610270366004613ed9565b610896565b005b34801561028357600080fd5b50600054610297906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102c057600080fd5b506102756102cf366004613ef6565b6108eb565b3480156102e057600080fd5b506102f46102ef366004613ef6565b610fe4565b6040519081526020016102ab565b34801561030e57600080fd5b5061032261031d366004613ef6565b611082565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a083015260c082015260e0016102ab565b34801561036d57600080fd5b5061038161037c366004613ef6565b6110df565b6040516102ab9190613f47565b34801561039a57600080fd5b506102756103a9366004613f5b565b611118565b3480156103ba57600080fd5b506102f461271081565b3480156103d057600080fd5b506102756103df366004613fa3565b611c9c565b3480156103f057600080fd5b506104046103ff366004613ef6565b611eb7565b60405190151581526020016102ab565b34801561042057600080fd5b5061027561042f36600461403e565b611ef0565b34801561044057600080fd5b5061045461044f366004613ef6565b612053565b6040516102ab979695949392919061410e565b34801561047357600080fd5b506102756104823660046141ce565b6120c0565b34801561049357600080fd5b506102756104a2366004614202565b61212b565b3480156104b357600080fd5b506102756104c2366004613fa3565b6123ff565b3480156104d357600080fd5b506102f46104e2366004613ef6565b61245f565b3480156104f357600080fd5b50610275610502366004613fa3565b6125cf565b34801561051357600080fd5b506102756105223660046142f4565b61262f565b34801561053357600080fd5b50610275610542366004613fa3565b612701565b610275610555366004613ef6565b61274f565b34801561056657600080fd5b506102f46001600160ff1b0381565b34801561058157600080fd5b5061059561059036600461434d565b612abd565b6040516102ab95949392919061436f565b3480156105b257600080fd5b506102756105c1366004613ef6565b612b9b565b3480156105d257600080fd5b506102756105e1366004613fa3565b612d1f565b3480156105f257600080fd5b50610297610601366004613ef6565b6004602052600090815260409020546001600160a01b031681565b34801561062857600080fd5b5061063c610637366004613ef6565b612d7f565b604080519283526020830191909152016102ab565b34801561065d57600080fd5b506102f4600481565b6102f46106743660046143db565b612e33565b34801561068557600080fd5b50610275610694366004613ed9565b61319c565b3480156106a557600080fd5b50600254610297906001600160a01b031681565b3480156106c557600080fd5b5061063c6106d4366004614422565b6001600160a01b0390911660009081526006602090815260408083206001600160601b0390941683526001840182528083205460029094019091529020549091565b34801561072257600080fd5b5061027561073136600461434d565b6131e8565b34801561074257600080fd5b50610756610751366004613ef6565b6134fd565b6040516102ab93929190614489565b34801561077157600080fd5b50610404610780366004613ef6565b6135c5565b34801561079157600080fd5b506102f46107a036600461434d565b60009182526007602090815260408084209284526004909201905290205490565b3480156107cd57600080fd5b506102756107dc366004613ed9565b6135fb565b3480156107ed57600080fd5b506102f4600381565b34801561080257600080fd5b506102756108113660046144be565b613647565b34801561082257600080fd5b506102f4610831366004613ef6565b6136a2565b34801561084257600080fd5b506102f46108513660046144ea565b6136d7565b34801561086257600080fd5b50600154610297906001600160a01b031681565b34801561088257600080fd5b506102f4610891366004613ef6565b61372b565b6000546001600160a01b031633146108c95760405162461bcd60e51b81526004016108c09061451f565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006005828154811061090057610900614561565b90600052602060002090600502019050600060018260040180549050610926919061458d565b9050600082600401828154811061093f5761093f614561565b60009182526020822060059091020191506001840154600160a01b900460ff16600481111561097057610970613f0f565b1415610b585760008211806109f8575082546003805490916001600160601b03169081106109a0576109a0614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff1660048111156109d4576109d4613f0f565b600481106109e4576109e4614561565b015460028401546109f5904261458d565b10155b610a785760405162461bcd60e51b8152602060048201526044602482018190527f5468652065766964656e636520706572696f642074696d6520686173206e6f74908201527f207061737365642079657420616e64206974206973206e6f7420616e2061707060648201526332b0b61760e11b608482015260a4016108c0565b6003830154600482015414610ae15760405162461bcd60e51b815260206004820152602960248201527f546865206469737075746520686173206e6f742066696e6973686564206472616044820152683bb4b733903cb2ba1760b91b60648201526084016108c0565b82546003805490916001600160601b0316908110610b0157610b01614561565b60009182526020909120600b9091020154600160601b900460ff16610b27576002610b2a565b60015b60018401805460ff60a01b1916600160a01b836004811115610b4e57610b4e613f0f565b0217905550610f90565b600180840154600160a01b900460ff166004811115610b7957610b79613f0f565b1415610c885782546003805490916001600160601b0316908110610b9f57610b9f614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610bd357610bd3613f0f565b60048110610be357610be3614561565b01546002840154610bf4904261458d565b101580610c0d575060018301546001600160a01b031633145b610c6c5760405162461bcd60e51b815260206004820152602a60248201527f54686520636f6d6d697420706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108c0565b6001830180546002919060ff60a01b1916600160a01b83610b4e565b60026001840154600160a01b900460ff166004811115610caa57610caa613f0f565b1415610df35782546003805490916001600160601b0316908110610cd057610cd0614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610d0457610d04613f0f565b60048110610d1457610d14614561565b01546002840154610d25904261458d565b101580610d3e575060018301546001600160a01b031633145b610d9a5760405162461bcd60e51b815260206004820152602760248201527f54686520766f746520706572696f642074696d6520686173206e6f74207061736044820152661cd959081e595d60ca1b60648201526084016108c0565b60018301805460ff60a01b1916600360a01b1790558254604051600160601b9091046001600160a01b03169085907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610f90565b60036001840154600160a01b900460ff166004811115610e1557610e15613f0f565b1415610f0d5782546003805490916001600160601b0316908110610e3b57610e3b614561565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610e6f57610e6f613f0f565b60048110610e7f57610e7f614561565b01546002840154610e90904261458d565b1015610ef15760405162461bcd60e51b815260206004820152602a60248201527f5468652061707065616c20706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108c0565b6001830180546004919060ff60a01b1916600160a01b83610b4e565b60046001840154600160a01b900460ff166004811115610f2f57610f2f613f0f565b1415610f905760405162461bcd60e51b815260206004820152602a60248201527f546865206469737075746520697320616c726561647920696e20746865206c6160448201526939ba103832b934b7b21760b11b60648201526084016108c0565b426002840155600183015460405185917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b9191610fd691600160a01b900460ff1690613f47565b60405180910390a250505050565b60008060058381548110610ffa57610ffa614561565b6000918252602090912060059091020160010154604051631c3db16d60e01b8152600481018590526001600160a01b0390911691508190631c3db16d90602401602060405180830381865afa158015611057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107b91906145a4565b9392505050565b6003818154811061109257600080fd5b60009182526020909120600b9091020180546002820154600383015460048401546005850154600a909501546001600160601b0385169650600160601b90940460ff169492939192909187565b6000600582815481106110f4576110f4614561565b6000918252602090912060059091020160010154600160a01b900460ff1692915050565b60006005848154811061112d5761112d614561565b60009182526020909120600590910201905060046001820154600160a01b900460ff16600481111561116157611161613f0f565b146111ae5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108c0565b6000828260040185815481106111c6576111c6614561565b9060005260206000209060050201600201546111e291906145bd565b905060008260040185815481106111fb576111fb614561565b9060005260206000209060050201600301549050600083600401868154811061122657611226614561565b6000918252602082206004600590920201810154600187015460405163368efae360e21b81529194506001600160a01b03169163da3beb8c91611276918c918c9101918252602082015260400190565b602060405180830381865afa158015611293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b791906145a4565b9050600080826112d257838611156112cd578395505b6112f2565b6112dd8460026145d5565b8611156112f2576112ef8460026145d5565b95505b6000876004018a8154811061130957611309614561565b90600052602060002090600502016002015490505b86811015611c0b5784811015611809576001880154604051634fe264fb60e01b8152600481018d9052602481018c9052604481018390526001600160a01b0390911690634fe264fb90606401602060405180830381865afa158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab91906145a4565b91506127108211156113bd5761271091505b60006127106113cc848261458d565b8a6004018d815481106113e1576113e1614561565b9060005260206000209060050201600001546113fd91906145d5565b611407919061460a565b905061141381886145bd565b9650886004018b8154811061142a5761142a614561565b9060005260206000209060050201600401828154811061144c5761144c614561565b60009182526020808320909101546001600160a01b03168083526006825260408084208d546001600160601b0316855260020190925290822080549196508392909161149990849061458d565b909155505088546003805483926001600160601b03169081106114be576114be614561565b90600052602060002090600b0201600201546114da91906145bd565b6001600160a01b03851660009081526006602090815260408083208d546001600160601b03168452600101909152902054106115635788546001600160a01b03851660009081526006602090815260408083206001600160601b03909416808452600190940190915290205461155d91869161155790859061458d565b8461375c565b506115b4565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b03168452600101909152902054156115b45788546115b29085906001600160601b031660008461375c565b505b600189015460405163ba66fde760e01b8152600481018e9052602481018d9052604481018490526001600160a01b039091169063ba66fde790606401602060405180830381865afa15801561160d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611631919061461e565b6116ce5760005b6001600160a01b0385166000908152600660205260409020548110156116cc576001600160a01b038516600090815260066020526040902080546116b99187918490811061168857611688614561565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b031660008061375c565b50806116c48161463b565b915050611638565b505b8b6001600160a01b0385167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e1961170384614656565b60408051918252600060208301520160405180910390a361172560018761458d565b82141561180357846118035760005460048a0180546001600160a01b03909216916108fc91908e90811061175b5761175b614561565b9060005260206000209060050201600101549081150290604051600060405180830381858888f1505060015460005460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018d90529116935063a9059cbb925060440190506020604051808303816000875af11580156117dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611801919061461e565b505b50611bf9565b60018801546001600160a01b0316634fe264fb8c8c6118288986614673565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015611871573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189591906145a4565b91506127108211156118a75761271091505b876004018a815481106118bc576118bc614561565b906000526020600020906005020160040185826118d99190614673565b815481106118e9576118e9614561565b9060005260206000200160009054906101000a90046001600160a01b0316925061271082896004018c8154811061192257611922614561565b90600052602060002090600502016000015461193e91906145d5565b611948919061460a565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b031684526002019091528120805490919061198890849061458d565b90915550506001600160a01b03831660009081526006602090815260408083208b546001600160601b03168452600101909152902054611a9757600160009054906101000a90046001600160a01b03166001600160a01b031663a9059cbb84612710858c6004018f81548110611a0057611a00614561565b906000526020600020906005020160000154611a1c91906145d5565b611a26919061460a565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a95919061461e565b505b600061271083611aa7878a61460a565b611ab191906145d5565b611abb919061460a565b9050600061271084878c6004018f81548110611ad957611ad9614561565b906000526020600020906005020160010154611af5919061460a565b611aff91906145d5565b611b09919061460a565b60015460405163a9059cbb60e01b81526001600160a01b0388811660048301526024820186905292935091169063a9059cbb906044016020604051808303816000875af1158015611b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b82919061461e565b506040516001600160a01b0386169082156108fc029083906000818181858888f19350505050508c856001600160a01b03167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e198484604051611bee929190918252602082015260400190565b60405180910390a350505b80611c038161463b565b91505061131e565b5084876004018a81548110611c2257611c22614561565b90600052602060002090600502016003015414611c655784876004018a81548110611c4f57611c4f614561565b9060005260206000209060050201600301819055505b85876004018a81548110611c7b57611c7b614561565b90600052602060002090600502016002018190555050505050505050505050565b6000546001600160a01b03163314611cc65760405162461bcd60e51b81526004016108c09061451f565b6001600160601b0382161580611d37575080600380846001600160601b031681548110611cf557611cf5614561565b60009182526020909120600b909102015481546001600160601b03909116908110611d2257611d22614561565b90600052602060002090600b02016002015411155b611d4057600080fd5b60005b6003836001600160601b031681548110611d5f57611d5f614561565b90600052602060002090600b020160010180549050811015611e805781600380856001600160601b031681548110611d9957611d99614561565b90600052602060002090600b02016001018381548110611dbb57611dbb614561565b906000526020600020015481548110611dd657611dd6614561565b90600052602060002090600b0201600201541015611e6e5760405162461bcd60e51b815260206004820152604960248201527f4120737562636f7572742063616e6e6f742062652074686520706172656e742060448201527f6f66206120737562636f75727420776974682061206c6f776572206d696e696d6064820152683ab69039ba30b5b29760b91b608482015260a4016108c0565b80611e788161463b565b915050611d43565b50806003836001600160601b031681548110611e9e57611e9e614561565b90600052602060002090600b0201600201819055505050565b600060058281548110611ecc57611ecc614561565b6000918252602090912060059091020160010154600160a81b900460ff1692915050565b6000546001600160a01b03163314611f1a5760405162461bcd60e51b81526004016108c09061451f565b60006003846001600160601b031681548110611f3857611f38614561565b90600052602060002090600b0201905060005b835181101561204c576000848281518110611f6857611f68614561565b602002602001015160ff166001901b90508315611fda578083600a015419821614611fd55760405162461bcd60e51b815260206004820152601d60248201527f44697370757465206b697420616c726561647920737570706f7274656400000060448201526064016108c0565b61202f565b8083600a015482161461202f5760405162461bcd60e51b815260206004820152601c60248201527f44697370757465206b6974206973206e6f7420737570706f727465640000000060448201526064016108c0565b600a830180549091189055806120448161463b565b915050611f4b565b5050505050565b6005818154811061206357600080fd5b600091825260209091206005909102018054600182015460028301546003909301546001600160601b03831694506001600160a01b03600160601b9093048316939282169260ff600160a01b8404811693600160a81b9004169187565b6000546001600160a01b031633146120ea5760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b03168154811061210757612107614561565b90600052602060002090600b0201600601906004612126929190613e34565b505050565b6000546001600160a01b031633146121555760405162461bcd60e51b81526004016108c09061451f565b8660038a6001600160601b03168154811061217257612172614561565b90600052602060002090600b02016002015411156122085760405162461bcd60e51b815260206004820152604760248201527f4120737562636f7572742063616e6e6f742062652061206368696c64206f662060448201527f6120737562636f7572742077697468206120686967686572206d696e696d756d6064820152661039ba30b5b29760c91b608482015260a4016108c0565b6003805460408051610120810182526001600160601b038d1681528b15156020820152919291908101600060405190808252806020026020018201604052801561225c578160200160208202803683370190505b50815260208082018c905260408083018c9052606083018b9052608083018a905260a0830189905260c09092018690528354600181810186556000958652948290208451600b909202018054858401511515600160601b026cffffffffffffffffffffffffff199091166001600160601b0390931692909217919091178155918301518051939492936122f6938501929190910190613e72565b50606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e082015181600601906004612336929190613e34565b506101009190910151600a9091015560405163483abc4f60e11b815260076004820152602481018290526044810184905273__$52cf47af9c3c0d67e54ac2a3225447effa$__90639075789e9060640160006040518083038186803b15801561239e57600080fd5b505af41580156123b2573d6000803e3d6000fd5b5050505060038a6001600160601b0316815481106123d2576123d2614561565b600091825260208083206001600b9093020182018054928301815583529091200155505050505050505050565b6000546001600160a01b031633146124295760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b03168154811061244657612446614561565b90600052602060002090600b0201600401819055505050565b6000806005838154811061247557612475614561565b60009182526020909120600590910201805460038054929350916001600160601b039091169081106124a9576124a9614561565b90600052602060002090600b0201600501548160030154106125725780546001600160601b03166124e3576001600160ff1b0391506125c9565b60038101546124f39060026145d5565b6124fe9060016145bd565b815460038054909182916001600160601b0390911690811061252257612522614561565b60009182526020909120600b909102015481546001600160601b0390911690811061254f5761254f614561565b90600052602060002090600b02016004015461256b91906145d5565b91506125c9565b60038101546125829060026145d5565b61258d9060016145bd565b81546003805490916001600160601b03169081106125ad576125ad614561565b90600052602060002090600b02016004015461107b91906145d5565b50919050565b6000546001600160a01b031633146125f95760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b03168154811061261657612616614561565b90600052602060002090600b0201600301819055505050565b6000546001600160a01b031633146126595760405162461bcd60e51b81526004016108c09061451f565b6000836001600160a01b0316838360405161267491906146b3565b60006040518083038185875af1925050503d80600081146126b1576040519150601f19603f3d011682016040523d82523d6000602084013e6126b6565b606091505b50509050806126fb5760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b60448201526064016108c0565b50505050565b61270e338383600061375c565b61274b5760405162461bcd60e51b815260206004820152600e60248201526d14dd185ada5b99c819985a5b195960921b60448201526064016108c0565b5050565b6127588161245f565b3410156127b35760405162461bcd60e51b8152602060048201526024808201527f4e6f7420656e6f7567682045544820746f20636f7665722061707065616c206360448201526337b9ba1760e11b60648201526084016108c0565b6000600582815481106127c8576127c8614561565b60009182526020909120600590910201905060036001820154600160a01b900460ff1660048111156127fc576127fc613f0f565b146128495760405162461bcd60e51b815260206004820152601a60248201527f44697370757465206973206e6f742061707065616c61626c652e00000000000060448201526064016108c0565b60018101546001600160a01b031633146128b35760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2044697370757465204b69742060448201526437b7363c9760d91b60648201526084016108c0565b80546003805490916001600160601b03169081106128d3576128d3614561565b90600052602060002090600b0201600501548160030154106129405780546003805490916001600160601b031690811061290f5761290f614561565b60009182526020909120600b909102015481546bffffffffffffffffffffffff19166001600160601b039091161781555b60018101805460ff60a01b1916905542600282015580546003805490916001600160601b031690811061297557612975614561565b90600052602060002090600b02016004015434612992919061460a565b60038083019190915560048201805460018101825560009182526020909120835483546005909302909101926127109290916001600160601b03169081106129dc576129dc614561565b600091825260209091206003600b90920201810154845482549192916001600160601b03909116908110612a1257612a12614561565b90600052602060002090600b020160020154612a2e91906145d5565b612a38919061460a565b81553460018201558154604051600160601b9091046001600160a01b03169084907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3827f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612ab09190613f47565b60405180910390a2505050565b6000806000806060600060058881548110612ada57612ada614561565b906000526020600020906005020190506000816004018881548110612b0157612b01614561565b9060005260206000209060050201905080600001548160010154826002015483600301548460040180805480602002602001604051908101604052809291908181526020018280548015612b7e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612b60575b505050505090509650965096509650965050509295509295909350565b600060058281548110612bb057612bb0614561565b60009182526020909120600590910201905060046001820154600160a01b900460ff166004811115612be457612be4613f0f565b14612c315760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108c0565b6001810154600160a81b900460ff1615612c8d5760405162461bcd60e51b815260206004820152601860248201527f52756c696e6720616c72656164792065786563757465642e000000000000000060448201526064016108c0565b6000612c9883610fe4565b60018301805460ff60a81b1916600160a81b179055825460405163188d362b60e11b815260048101869052602481018390529192506001600160a01b03600160601b909104169063311a6c5690604401600060405180830381600087803b158015612d0257600080fd5b505af1158015612d16573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314612d495760405162461bcd60e51b81526004016108c09061451f565b806003836001600160601b031681548110612d6657612d66614561565b90600052602060002090600b0201600501819055505050565b600080600060058481548110612d9757612d97614561565b60009182526020909120600590910201905060036001820154600160a01b900460ff166004811115612dcb57612dcb613f0f565b1415612e24576002810154815460038054929550916001600160601b03909116908110612dfa57612dfa614561565b600091825260209091206009600b9092020101546002820154612e1d91906145bd565b9150612e2d565b60009250600091505b50915091565b6000612e3e826136d7565b341015612e9f5760405162461bcd60e51b815260206004820152602960248201527f4e6f7420656e6f7567682045544820746f20636f76657220617262697472617460448201526834b7b71031b7b9ba1760b91b60648201526084016108c0565b600080612eab84613d70565b925050915060008160ff166001901b9050806003846001600160601b031681548110612ed957612ed9614561565b90600052602060002090600b0201600a0154821614612f545760405162461bcd60e51b815260206004820152603160248201527f5468652064697370757465206b6974206973206e6f7420737570706f7274656460448201527008189e481d1a1a5cc81cdd5898dbdd5c9d607a1b60648201526084016108c0565b60058054600181018255600160601b33026001600160601b038087168281179484027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810195865560ff88166000908152600460205260409020547f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1820180546001600160a01b0319166001600160a01b03929092169182179055427f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29092019190915560038054959a50909490939092161790811061303657613036614561565b90600052602060002090600b02016004015434613053919061460a565b60038084019190915560048301805460018101825560009182526020909120845483546005909302909101926127109290916001600160601b031690811061309d5761309d614561565b600091825260209091206003600b90920201810154855482549192916001600160601b039091169081106130d3576130d3614561565b90600052602060002090600b0201600201546130ef91906145d5565b6130f9919061460a565b8155346001820155604051638d31de6d60e01b81526001600160a01b03831690638d31de6d90613131908a908d908d906004016146cf565b600060405180830381600087803b15801561314b57600080fd5b505af115801561315f573d6000803e3d6000fd5b50506040513392508991507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505092915050565b6000546001600160a01b031633146131c65760405162461bcd60e51b81526004016108c09061451f565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000600583815481106131fd576131fd614561565b90600052602060002090600502019050600060018260040180549050613223919061458d565b9050600082600401828154811061323c5761323c614561565b60009182526020822060059091020191506001840154600160a01b900460ff16600481111561326d5761326d613f0f565b146132ba5760405162461bcd60e51b815260206004820152601a60248201527f53686f756c642062652065766964656e636520706572696f642e00000000000060448201526064016108c0565b6001830154600482015460038501546001600160a01b03909216916000906132e288846145bd565b11156132f25785600301546132fc565b6132fc87836145bd565b9050815b818110156134f257604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af1158015613352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133769190614710565b90506001600160a01b038116156134df5785546001600160a01b03821660009081526006602090815260408083208c546001600160601b03168452600201909152812080549091906133c99084906145bd565b90915550506001600160a01b03811660009081526006602090815260408083208b546001600160601b031684526002810183528184205460019091019092529091205410156134705760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b656420616d6f756e742073686f756c646e277420657863656564207360448201526c3a30b5b2b21030b6b7bab73a1760991b60648201526084016108c0565b60048601805460018101825560009182526020918290200180546001600160a01b0319166001600160a01b038416908117909155604080518a81529283018590528c927f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a35b50806134ea8161463b565b915050613300565b505050505050505050565b600081815260076020908152604091829020805460018201805485518186028101860190965280865291946060948594939192919083018282801561356157602002820191906000526020600020905b81548152602001906001019080831161354d575b50505050509250806002018054806020026020016040519081016040528092919081815260200182805480156135b657602002820191906000526020600020905b8154815260200190600101908083116135a2575b50505050509150509193909250565b6000600382815481106135da576135da614561565b60009182526020909120600b9091020154600160601b900460ff1692915050565b6000546001600160a01b031633146136255760405162461bcd60e51b81526004016108c09061451f565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146136715760405162461bcd60e51b81526004016108c09061451f565b60ff16600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6000600582815481106136b7576136b7614561565b60009182526020909120600590910201546001600160601b031692915050565b60008060006136e584613d70565b5091509150806003836001600160601b03168154811061370757613707614561565b90600052602060002090600b02016004015461372391906145d5565b949350505050565b6000806005838154811061374157613741614561565b60009182526020909120600460059092020101549392505050565b6001600160a01b03841660009081526006602052604081208161377f8787613dec565b604051637521ccb160e01b8152600760048201526001600160601b03881660248201526044810182905290915060009073__$52cf47af9c3c0d67e54ac2a3225447effa$__90637521ccb190606401602060405180830381865af41580156137eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061380f91906145a4565b905085156138d6576003876001600160601b03168154811061383357613833614561565b90600052602060002090600b02016002015486108061386b57506001600160601b038716600090815260028401602052604090205486105b1561387c5760009350505050613723565b806138d15782546004116138965760009350505050613723565b8254600180820185556000858152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918a16021790555b613a22565b60005b8354811015613a2057876001600160601b031684600001828154811061390157613901614561565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03161415613a0e578354849061393e9060019061458d565b8154811061394e5761394e614561565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b031684600001828154811061398c5761398c614561565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550836000018054806139d8576139d861472d565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055613a20565b80613a188161463b565b9150506138d9565b505b6001600160601b03871660009081526001840160205260408120548790613a4a90849061458d565b613a5491906145bd565b6001600160601b038916600081815260018701602052604081208390559192505b81613b3857604051631712e1c560e11b81526007600482015260248101829052604481018a90526064810186905273__$52cf47af9c3c0d67e54ac2a3225447effa$__90632e25c38a9060840160006040518083038186803b158015613ada57600080fd5b505af4158015613aee573d6000803e3d6000fd5b505050508060001415613b045760019150613a75565b60038181548110613b1757613b17614561565b60009182526020909120600b90910201546001600160601b03169050613a75565b604080516001600160601b038c168152602081018b90529081018490526001600160a01b038c16907f70ca4ec64687bf265f39041896f3dbf10b9f650503cb38f2b3569fdce7489c369060600160405180910390a26000848a10613c3f57613ba0858b61458d565b90508015613c3a576001546040516323b872dd60e01b81526001600160a01b038e8116600483015230602483015260448201849052909116906323b872dd906064015b6020604051808303816000875af1158015613c02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c26919061461e565b613c3a576000975050505050505050613723565b613d5e565b89613cb6576001600160601b038b1660009081526002880160205260409020548990613c6b908761458d565b613c75919061458d565b90508015613c3a5760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb90604401613be3565b88613cc18b8761458d565b613ccb919061458d565b90508015613d5e5760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb906044016020604051808303816000875af1158015613d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d4a919061461e565b613d5e576000975050505050505050613723565b5060019b9a5050505050505050505050565b60008060006040845110613dda575050506020810151604082015160608301516003546001600160601b03841610613da757600092505b81613db157600391505b60ff81166000908152600460205260409020546001600160a01b0316613dd5575060005b613de5565b506000915060039050815b9193909250565b600060405160005b6014811015613e0f578481600c011a81830153600101613df4565b5060145b6020811015613e2b5783811a81830153600101613e13565b50519392505050565b8260048101928215613e62579160200282015b82811115613e62578251825591602001919060010190613e47565b50613e6e929150613eac565b5090565b828054828255906000526020600020908101928215613e625791602002820182811115613e62578251825591602001919060010190613e47565b5b80821115613e6e5760008155600101613ead565b6001600160a01b0381168114613ed657600080fd5b50565b600060208284031215613eeb57600080fd5b813561107b81613ec1565b600060208284031215613f0857600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60058110613f4357634e487b7160e01b600052602160045260246000fd5b9052565b60208101613f558284613f25565b92915050565b600080600060608486031215613f7057600080fd5b505081359360208301359350604090920135919050565b80356001600160601b0381168114613f9e57600080fd5b919050565b60008060408385031215613fb657600080fd5b613fbf83613f87565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561400c5761400c613fcd565b604052919050565b803560ff81168114613f9e57600080fd5b8015158114613ed657600080fd5b8035613f9e81614025565b60008060006060848603121561405357600080fd5b61405c84613f87565b925060208085013567ffffffffffffffff8082111561407a57600080fd5b818701915087601f83011261408e57600080fd5b8135818111156140a0576140a0613fcd565b8060051b91506140b1848301613fe3565b818152918301840191848101908a8411156140cb57600080fd5b938501935b838510156140f0576140e185614014565b825293850193908501906140d0565b80975050505050505061410560408501614033565b90509250925092565b6001600160601b03881681526001600160a01b0387811660208301528616604082015260e081016141426060830187613f25565b931515608082015260a081019290925260c090910152949350505050565b600082601f83011261417157600080fd5b6040516080810181811067ffffffffffffffff8211171561419457614194613fcd565b6040528060808401858111156141a957600080fd5b845b818110156141c35780358352602092830192016141ab565b509195945050505050565b60008060a083850312156141e157600080fd5b6141ea83613f87565b91506141f98460208501614160565b90509250929050565b60008060008060008060008060006101808a8c03121561422157600080fd5b61422a8a613f87565b985060208a013561423a81614025565b975060408a0135965060608a0135955060808a0135945060a08a013593506142658b60c08c01614160565b92506101408a013591506101608a013590509295985092959850929598565b600082601f83011261429557600080fd5b813567ffffffffffffffff8111156142af576142af613fcd565b6142c2601f8201601f1916602001613fe3565b8181528460208386010111156142d757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561430957600080fd5b833561431481613ec1565b925060208401359150604084013567ffffffffffffffff81111561433757600080fd5b61434386828701614284565b9150509250925092565b6000806040838503121561436057600080fd5b50508035926020909101359150565b600060a082018783526020878185015286604085015285606085015260a0608085015281855180845260c086019150828701935060005b818110156143cb5784516001600160a01b0316835293830193918301916001016143a6565b50909a9950505050505050505050565b600080604083850312156143ee57600080fd5b82359150602083013567ffffffffffffffff81111561440c57600080fd5b61441885828601614284565b9150509250929050565b6000806040838503121561443557600080fd5b823561444081613ec1565b91506141f960208401613f87565b600081518084526020808501945080840160005b8381101561447e57815187529582019590820190600101614462565b509495945050505050565b8381526060602082015260006144a2606083018561444e565b82810360408401526144b4818561444e565b9695505050505050565b600080604083850312156144d157600080fd5b82356144dc81613ec1565b91506141f960208401614014565b6000602082840312156144fc57600080fd5b813567ffffffffffffffff81111561451357600080fd5b61372384828501614284565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561459f5761459f614577565b500390565b6000602082840312156145b657600080fd5b5051919050565b600082198211156145d0576145d0614577565b500190565b60008160001904831182151516156145ef576145ef614577565b500290565b634e487b7160e01b600052601260045260246000fd5b600082614619576146196145f4565b500490565b60006020828403121561463057600080fd5b815161107b81614025565b600060001982141561464f5761464f614577565b5060010190565b6000600160ff1b82141561466c5761466c614577565b5060000390565b600082614682576146826145f4565b500690565b60005b838110156146a257818101518382015260200161468a565b838111156126fb5750506000910152565b600082516146c5818460208701614687565b9190910192915050565b83815282602082015260606040820152600082518060608401526146fa816080850160208701614687565b601f01601f191691909101608001949350505050565b60006020828403121561472257600080fd5b815161107b81613ec1565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220bd91fce7201899d75d819f63f7e467358cfc4d44030583d012667271506fcec564736f6c634300080a0033", @@ -1360,7 +1360,7 @@ "storageLayout": { "storage": [ { - "astId": 1508, + "astId": 2101, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "governor", "offset": 0, @@ -1368,15 +1368,15 @@ "type": "t_address" }, { - "astId": 1511, + "astId": 2104, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "pinakion", "offset": 0, "slot": "1", - "type": "t_contract(IERC20)77" + "type": "t_contract(IERC20)623" }, { - "astId": 1513, + "astId": 2106, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurorProsecutionModule", "offset": 0, @@ -1384,44 +1384,44 @@ "type": "t_address" }, { - "astId": 1517, + "astId": 2110, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "courts", "offset": 0, "slot": "3", - "type": "t_array(t_struct(Court)1441_storage)dyn_storage" + "type": "t_array(t_struct(Court)2034_storage)dyn_storage" }, { - "astId": 1522, + "astId": 2115, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKits", "offset": 0, "slot": "4", - "type": "t_mapping(t_uint256,t_contract(IDisputeKit)1399)" + "type": "t_mapping(t_uint256,t_contract(IDisputeKit)1992)" }, { - "astId": 1526, + "astId": 2119, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputes", "offset": 0, "slot": "5", - "type": "t_array(t_struct(Dispute)1463_storage)dyn_storage" + "type": "t_array(t_struct(Dispute)2056_storage)dyn_storage" }, { - "astId": 1531, + "astId": 2124, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurors", "offset": 0, "slot": "6", - "type": "t_mapping(t_address,t_struct(Juror)1487_storage)" + "type": "t_mapping(t_address,t_struct(Juror)2080_storage)" }, { - "astId": 1534, + "astId": 2127, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "sortitionSumTrees", "offset": 0, "slot": "7", - "type": "t_struct(SortitionSumTrees)8012_storage" + "type": "t_struct(SortitionSumTrees)8619_storage" } ], "types": { @@ -1436,20 +1436,20 @@ "label": "address[]", "numberOfBytes": "32" }, - "t_array(t_struct(Court)1441_storage)dyn_storage": { - "base": "t_struct(Court)1441_storage", + "t_array(t_struct(Court)2034_storage)dyn_storage": { + "base": "t_struct(Court)2034_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Court[]", "numberOfBytes": "32" }, - "t_array(t_struct(Dispute)1463_storage)dyn_storage": { - "base": "t_struct(Dispute)1463_storage", + "t_array(t_struct(Dispute)2056_storage)dyn_storage": { + "base": "t_struct(Dispute)2056_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Dispute[]", "numberOfBytes": "32" }, - "t_array(t_struct(Round)1475_storage)dyn_storage": { - "base": "t_struct(Round)1475_storage", + "t_array(t_struct(Round)2068_storage)dyn_storage": { + "base": "t_struct(Round)2068_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Round[]", "numberOfBytes": "32" @@ -1482,39 +1482,39 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IArbitrable)1265": { + "t_contract(IArbitrable)1858": { "encoding": "inplace", "label": "contract IArbitrable", "numberOfBytes": "20" }, - "t_contract(IDisputeKit)1399": { + "t_contract(IDisputeKit)1992": { "encoding": "inplace", "label": "contract IDisputeKit", "numberOfBytes": "20" }, - "t_contract(IERC20)77": { + "t_contract(IERC20)623": { "encoding": "inplace", "label": "contract IERC20", "numberOfBytes": "20" }, - "t_enum(Period)1419": { + "t_enum(Period)2012": { "encoding": "inplace", "label": "enum KlerosCore.Period", "numberOfBytes": "1" }, - "t_mapping(t_address,t_struct(Juror)1487_storage)": { + "t_mapping(t_address,t_struct(Juror)2080_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct KlerosCore.Juror)", "numberOfBytes": "32", - "value": "t_struct(Juror)1487_storage" + "value": "t_struct(Juror)2080_storage" }, - "t_mapping(t_bytes32,t_struct(SortitionSumTree)8006_storage)": { + "t_mapping(t_bytes32,t_struct(SortitionSumTree)8613_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct SortitionSumTreeFactory.SortitionSumTree)", "numberOfBytes": "32", - "value": "t_struct(SortitionSumTree)8006_storage" + "value": "t_struct(SortitionSumTree)8613_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -1530,12 +1530,12 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_uint256,t_contract(IDisputeKit)1399)": { + "t_mapping(t_uint256,t_contract(IDisputeKit)1992)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => contract IDisputeKit)", "numberOfBytes": "32", - "value": "t_contract(IDisputeKit)1399" + "value": "t_contract(IDisputeKit)1992" }, "t_mapping(t_uint96,t_uint256)": { "encoding": "mapping", @@ -1544,12 +1544,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(Court)1441_storage": { + "t_struct(Court)2034_storage": { "encoding": "inplace", "label": "struct KlerosCore.Court", "members": [ { - "astId": 1421, + "astId": 2014, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "parent", "offset": 0, @@ -1557,7 +1557,7 @@ "type": "t_uint96" }, { - "astId": 1423, + "astId": 2016, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "hiddenVotes", "offset": 12, @@ -1565,7 +1565,7 @@ "type": "t_bool" }, { - "astId": 1426, + "astId": 2019, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "children", "offset": 0, @@ -1573,7 +1573,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 1428, + "astId": 2021, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "minStake", "offset": 0, @@ -1581,7 +1581,7 @@ "type": "t_uint256" }, { - "astId": 1430, + "astId": 2023, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "alpha", "offset": 0, @@ -1589,7 +1589,7 @@ "type": "t_uint256" }, { - "astId": 1432, + "astId": 2025, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "feeForJuror", "offset": 0, @@ -1597,7 +1597,7 @@ "type": "t_uint256" }, { - "astId": 1434, + "astId": 2027, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurorsForCourtJump", "offset": 0, @@ -1605,7 +1605,7 @@ "type": "t_uint256" }, { - "astId": 1438, + "astId": 2031, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "timesPerPeriod", "offset": 0, @@ -1613,7 +1613,7 @@ "type": "t_array(t_uint256)4_storage" }, { - "astId": 1440, + "astId": 2033, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "supportedDisputeKits", "offset": 0, @@ -1623,12 +1623,12 @@ ], "numberOfBytes": "352" }, - "t_struct(Dispute)1463_storage": { + "t_struct(Dispute)2056_storage": { "encoding": "inplace", "label": "struct KlerosCore.Dispute", "members": [ { - "astId": 1443, + "astId": 2036, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "subcourtID", "offset": 0, @@ -1636,31 +1636,31 @@ "type": "t_uint96" }, { - "astId": 1446, + "astId": 2039, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "arbitrated", "offset": 12, "slot": "0", - "type": "t_contract(IArbitrable)1265" + "type": "t_contract(IArbitrable)1858" }, { - "astId": 1449, + "astId": 2042, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKit", "offset": 0, "slot": "1", - "type": "t_contract(IDisputeKit)1399" + "type": "t_contract(IDisputeKit)1992" }, { - "astId": 1452, + "astId": 2045, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "period", "offset": 20, "slot": "1", - "type": "t_enum(Period)1419" + "type": "t_enum(Period)2012" }, { - "astId": 1454, + "astId": 2047, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "ruled", "offset": 21, @@ -1668,7 +1668,7 @@ "type": "t_bool" }, { - "astId": 1456, + "astId": 2049, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "lastPeriodChange", "offset": 0, @@ -1676,7 +1676,7 @@ "type": "t_uint256" }, { - "astId": 1458, + "astId": 2051, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nbVotes", "offset": 0, @@ -1684,22 +1684,22 @@ "type": "t_uint256" }, { - "astId": 1462, + "astId": 2055, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "rounds", "offset": 0, "slot": "4", - "type": "t_array(t_struct(Round)1475_storage)dyn_storage" + "type": "t_array(t_struct(Round)2068_storage)dyn_storage" } ], "numberOfBytes": "160" }, - "t_struct(Juror)1487_storage": { + "t_struct(Juror)2080_storage": { "encoding": "inplace", "label": "struct KlerosCore.Juror", "members": [ { - "astId": 1478, + "astId": 2071, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "subcourtIDs", "offset": 0, @@ -1707,7 +1707,7 @@ "type": "t_array(t_uint96)dyn_storage" }, { - "astId": 1482, + "astId": 2075, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "stakedTokens", "offset": 0, @@ -1715,7 +1715,7 @@ "type": "t_mapping(t_uint96,t_uint256)" }, { - "astId": 1486, + "astId": 2079, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "lockedTokens", "offset": 0, @@ -1725,12 +1725,12 @@ ], "numberOfBytes": "96" }, - "t_struct(Round)1475_storage": { + "t_struct(Round)2068_storage": { "encoding": "inplace", "label": "struct KlerosCore.Round", "members": [ { - "astId": 1465, + "astId": 2058, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "tokensAtStakePerJuror", "offset": 0, @@ -1738,7 +1738,7 @@ "type": "t_uint256" }, { - "astId": 1467, + "astId": 2060, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "totalFeesForJurors", "offset": 0, @@ -1746,7 +1746,7 @@ "type": "t_uint256" }, { - "astId": 1469, + "astId": 2062, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "repartitions", "offset": 0, @@ -1754,7 +1754,7 @@ "type": "t_uint256" }, { - "astId": 1471, + "astId": 2064, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "penalties", "offset": 0, @@ -1762,7 +1762,7 @@ "type": "t_uint256" }, { - "astId": 1474, + "astId": 2067, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "drawnJurors", "offset": 0, @@ -1772,12 +1772,12 @@ ], "numberOfBytes": "160" }, - "t_struct(SortitionSumTree)8006_storage": { + "t_struct(SortitionSumTree)8613_storage": { "encoding": "inplace", "label": "struct SortitionSumTreeFactory.SortitionSumTree", "members": [ { - "astId": 7991, + "astId": 8598, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "K", "offset": 0, @@ -1785,7 +1785,7 @@ "type": "t_uint256" }, { - "astId": 7994, + "astId": 8601, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "stack", "offset": 0, @@ -1793,7 +1793,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 7997, + "astId": 8604, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nodes", "offset": 0, @@ -1801,7 +1801,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 8001, + "astId": 8608, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "IDsToNodeIndexes", "offset": 0, @@ -1809,7 +1809,7 @@ "type": "t_mapping(t_bytes32,t_uint256)" }, { - "astId": 8005, + "astId": 8612, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nodeIndexesToIDs", "offset": 0, @@ -1819,17 +1819,17 @@ ], "numberOfBytes": "160" }, - "t_struct(SortitionSumTrees)8012_storage": { + "t_struct(SortitionSumTrees)8619_storage": { "encoding": "inplace", "label": "struct SortitionSumTreeFactory.SortitionSumTrees", "members": [ { - "astId": 8011, + "astId": 8618, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "sortitionSumTrees", "offset": 0, "slot": "0", - "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)8006_storage)" + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)8613_storage)" } ], "numberOfBytes": "32" diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 583262833..5db4de6f0 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -9,6 +9,7 @@ import "hardhat-deploy"; import "hardhat-deploy-ethers"; import "hardhat-watcher"; import "hardhat-docgen"; +import "hardhat-contract-sizer"; dotenv.config(); diff --git a/contracts/package.json b/contracts/package.json index 680629a70..1920e60b1 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -37,6 +37,7 @@ "ethers": "^5.5.1", "follow-redirects": "^1.14.7", "hardhat": "^2.6.8", + "hardhat-contract-sizer": "^2.4.0", "hardhat-deploy": "^0.10.5", "hardhat-deploy-ethers": "^0.3.0-beta.11", "hardhat-docgen": "^1.2.1", diff --git a/contracts/src/arbitration/PNK.sol b/contracts/src/arbitration/PNK.sol new file mode 100644 index 000000000..e9e81fe33 --- /dev/null +++ b/contracts/src/arbitration/PNK.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract PNK is ERC20 { + constructor() ERC20("Pinakion", "PNK") {} +} diff --git a/contracts/test/arbitration/index.ts b/contracts/test/arbitration/index.ts index 723180737..8050e1f3f 100644 --- a/contracts/test/arbitration/index.ts +++ b/contracts/test/arbitration/index.ts @@ -41,7 +41,7 @@ async function deployContracts(deployer) { const disputeKitFactory = await ethers.getContractFactory("DisputeKitClassic", deployer); const disputeKit = await disputeKitFactory.deploy( - deployer.address, + deployer.address, ethers.constants.AddressZero, // KlerosCore is set later once it is deployed rng.address ); @@ -57,7 +57,7 @@ async function deployContracts(deployer) { }, }); const core = await klerosCoreFactory.deploy( - deployer.address, + deployer.address, ethers.constants.AddressZero, // should be an ERC20 ethers.constants.AddressZero, // should be a Juror Prosecution module disputeKit.address, diff --git a/yarn.lock b/yarn.lock index 2f06e8d0e..4faf8bb21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1028,6 +1028,7 @@ __metadata: ethers: ^5.5.1 follow-redirects: ^1.14.7 hardhat: ^2.6.8 + hardhat-contract-sizer: ^2.4.0 hardhat-deploy: ^0.10.5 hardhat-deploy-ethers: ^0.3.0-beta.11 hardhat-docgen: ^1.2.1 @@ -4233,6 +4234,19 @@ __metadata: languageName: node linkType: hard +"cli-table3@npm:^0.6.0": + version: 0.6.1 + resolution: "cli-table3@npm:0.6.1" + dependencies: + colors: 1.4.0 + string-width: ^4.2.0 + dependenciesMeta: + colors: + optional: true + checksum: 956e175f8eb019c26465b9f1e51121c08d8978e2aab04be7f8520ea8a4e67906fcbd8516dfb77e386ae3730ef0281aa21a65613dffbfa3d62969263252bd25a9 + languageName: node + linkType: hard + "cli-truncate@npm:2.1.0, cli-truncate@npm:^2.1.0": version: 2.1.0 resolution: "cli-truncate@npm:2.1.0" @@ -8023,6 +8037,18 @@ __metadata: languageName: node linkType: hard +"hardhat-contract-sizer@npm:^2.4.0": + version: 2.4.0 + resolution: "hardhat-contract-sizer@npm:2.4.0" + dependencies: + chalk: ^4.0.0 + cli-table3: ^0.6.0 + peerDependencies: + hardhat: ^2.0.0 + checksum: 813111c3ae27264a1e50feecd0c2670421e9c77eb08ac474ab9b88b1c5cc7578cf3a7f0778f583d684e127084de9ca81be9412eeb02c593aa8acc7e6a42bde89 + languageName: node + linkType: hard + "hardhat-deploy-ethers@npm:^0.3.0-beta.11": version: 0.3.0-beta.13 resolution: "hardhat-deploy-ethers@npm:0.3.0-beta.13"