diff --git a/contracts/README.md b/contracts/README.md index b96277a83..950050022 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -9,18 +9,19 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments ### Rinkeby - [PNK](https://rinkeby.etherscan.io/token/0x14aba1fa8a31a8649e8098ad067b739cc5708f30) -- [FastBridgeReceiver](https://rinkeby.etherscan.io/address/0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB) -- [ForeignGateway](https://rinkeby.etherscan.io/address/0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE) +- [ArbitrableExample](https://rinkeby.etherscan.io/address/0xf2a59723c5d625D646668E0B615B5764c3F81540) +- [FastBridgeReceiver](https://rinkeby.etherscan.io/address/0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C) +- [ForeignGateway](https://rinkeby.etherscan.io/address/0xf02733d9e5CbfE67B54F165b0277E1995106D526) ### Arbitrum Rinkeby - [PNK](https://testnet.arbiscan.io/token/0x364530164a2338cdba211f72c1438eb811b5c639) - [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/0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C) -- [KlerosCore](https://testnet.arbiscan.io/address/0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F) -- [SafeBridgeArbitrum](https://testnet.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD) +- [DisputeKitClassic](https://testnet.arbiscan.io/address/0xed12799915180a257985631fbD2ead261eD838cf) +- [FastBridgeSender](https://testnet.arbiscan.io/address/0x0b9e03455Fed83f209Fa7ce596c93ba6aBAd1f46) +- [HomeGateway](https://testnet.arbiscan.io/address/0x2Aa1f82d363f79c1E7a4CcF955Fb7E4306b9B260) +- [KlerosCore](https://testnet.arbiscan.io/address/0xd08452AEE7ab5bE3BF6733BA0d3F0CFdaf060Aa2) +- [SafeBridgeArbitrum](https://testnet.arbiscan.io/address/0x1406bC99873d16Cde3491F809f1Af9442cb5A338) - [SortitionSumTreeFactory](https://testnet.arbiscan.io/address/0xf02733d9e5CbfE67B54F165b0277E1995106D526) ## Contributing diff --git a/contracts/deploy/01-foreign-chain.ts b/contracts/deploy/01-foreign-chain.ts index 6b3824cf1..8ac809c51 100644 --- a/contracts/deploy/01-foreign-chain.ts +++ b/contracts/deploy/01-foreign-chain.ts @@ -5,7 +5,11 @@ import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; -const FOREIGN_CHAIN_IDS = [1, 4, 31337]; // Mainnet, Rinkeby, Hardhat +enum ForeignChains { + ETHEREUM_MAINNET = 1, + ETHEREUM_RINKEBY = 4, + HARDHAT = 31337, +} const paramsByChainId = { 1: { claimDeposit: parseEther("0.1"), @@ -17,6 +21,11 @@ const paramsByChainId = { challengeDuration: 3600, // 1 hour homeChainId: 421611, }, + 31337: { + claimDeposit: parseEther("0.1"), + challengeDuration: 3600, // 1 hour + homeChainId: 421611, + }, }; const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { @@ -25,26 +34,24 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme const { providers } = ethers; const { hexZeroPad } = hre.ethers.utils; - const { deployer } = await getNamedAccounts(); - const chainId = await getChainId(); + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; + const chainId = Number(await getChainId()); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); const homeNetworks = { 1: config.networks.arbitrum, 4: config.networks.arbitrumRinkeby, + 31337: config.networks.localhost, }; - const { url } = homeNetworks[chainId]; - const homeChainProvider = new providers.JsonRpcProvider(url); + const homeChainProvider = new providers.JsonRpcProvider(homeNetworks[chainId].url); const nonce = await homeChainProvider.getTransactionCount(deployer); - const { claimDeposit, challengeDuration, homeChainId } = paramsByChainId[chainId]; + const homeChainIdAsBytes32 = hexZeroPad(homeChainId, 32); - // home Gateway deploy tx will the third tx after this on it's network, - // so we add two to the current nonce. + // HomeGateway deploy tx will the third tx after this on it's network, so we add two to the current nonce. const homeGatewayAddress = getContractAddress(deployer, nonce + 2); - - const homeChainIdAsBytes32 = hexZeroPad(homeChainId, 32); - console.log(nonce + 2); - console.log(homeGatewayAddress); + console.log("calculated future HomeGateway address for nonce %d: %s", nonce + 2, homeGatewayAddress); const fastBridgeReceiver = await deploy("FastBridgeReceiver", { from: deployer, @@ -57,9 +64,20 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme args: [deployer, fastBridgeReceiver.address, ["1000", "10000"], homeGatewayAddress, homeChainIdAsBytes32], log: true, }); + + const metaEvidenceUri = + "https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json"; + const arbitrable = await deploy("ArbitrableExample", { + from: deployer, + args: [foreignGateway.address, metaEvidenceUri], + log: true, + }); }; -deployForeignGateway.tags = ["ForeignChain"]; -deployForeignGateway.skip = async ({ getChainId }) => !FOREIGN_CHAIN_IDS.includes(Number(await getChainId())); +deployForeignGateway.tags = ["ForeignChain", "ForeignGateway"]; +deployForeignGateway.skip = async ({ getChainId }) => { + const chainId = Number(await getChainId()); + return !ForeignChains[chainId]; +}; export default deployForeignGateway; diff --git a/contracts/deploy/02-home-chain.ts b/contracts/deploy/02-home-chain.ts index 4dae17d18..88b9e7a24 100644 --- a/contracts/deploy/02-home-chain.ts +++ b/contracts/deploy/02-home-chain.ts @@ -14,14 +14,14 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) const safeBridge = await deploy("SafeBridgeArbitrum", { from: deployer, log: true, - }); + }); // nonce const fastBridgeReceiver = await hre.companionNetworks.foreign.deployments.get("FastBridgeReceiver"); const fastBridgeSender = await deploy("FastBridgeSender", { from: deployer, args: [safeBridge.address, fastBridgeReceiver.address], log: true, - }); + }); // nonce+1 const klerosCore = await deployments.get("KlerosCore"); const foreignGateway = await hre.companionNetworks.foreign.deployments.get("ForeignGateway"); @@ -30,7 +30,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) from: deployer, args: [klerosCore.address, fastBridgeSender.address, foreignGateway.address, foreignChainId], log: true, - }); + }); // nonce+2 await execute("FastBridgeSender", { from: deployer, log: true }, "setFastSender", homeGateway.address); }; diff --git a/contracts/deployments/arbitrumRinkeby/DisputeKitClassic.json b/contracts/deployments/arbitrumRinkeby/DisputeKitClassic.json index da706af08..44c622470 100644 --- a/contracts/deployments/arbitrumRinkeby/DisputeKitClassic.json +++ b/contracts/deployments/arbitrumRinkeby/DisputeKitClassic.json @@ -1,5 +1,5 @@ { - "address": "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", + "address": "0xed12799915180a257985631fbD2ead261eD838cf", "abi": [ { "inputs": [ @@ -84,6 +84,37 @@ "name": "Contribution", "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": [ @@ -622,6 +653,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -657,19 +706,19 @@ "type": "function" } ], - "transactionHash": "0x6b1d3c4d8dbdbc42ddeacf2cc46d7bb6bede43ae07b83767313bddc5e1f1de4c", + "transactionHash": "0x443a399fe9afd0e02929611b8eb447e8f8a03ac6758cfb2b69adf6a619035340", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", + "contractAddress": "0xed12799915180a257985631fbD2ead261eD838cf", "transactionIndex": 0, - "gasUsed": "20682356", + "gasUsed": "38879448", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x88b502695f11ecc1a9f415f5fdbd8be173b3d9a4dfe074f971f4fa0493805488", - "transactionHash": "0x6b1d3c4d8dbdbc42ddeacf2cc46d7bb6bede43ae07b83767313bddc5e1f1de4c", + "blockHash": "0x4c817460b1a428665a6015f3348d3a2aa697f6a8c683c6e3267324c4c773b0dd", + "transactionHash": "0x443a399fe9afd0e02929611b8eb447e8f8a03ac6758cfb2b69adf6a619035340", "logs": [], - "blockNumber": 9361440, - "cumulativeGasUsed": "269396", + "blockNumber": 9609828, + "cumulativeGasUsed": "17940708", "status": 1, "byzantium": true }, @@ -679,10 +728,10 @@ "0x4401A368dea8D5761AEEFfd3c4a674086dea0666" ], "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", - "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"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\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit.\",\"_disputeID\":\"The ID of the dispute.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_disputeID\":\"The ID of the dispute.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeRandomNumberGenerator(address)\":{\"details\":\"Changes the `_rng` storage variable.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\",\"_rng\":\"The random number generator.\"}},\"createDispute(uint256,uint256,bytes)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"ruling\":\"The current ruling.\"}},\"draw(uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_disputeID\":\"Index of the dispute in Kleros Core contract.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_round\":\"The ID of the round.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_round\":\"The ID of the round.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_round\":\"The ID of the round.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"withdrawFeesAndRewards(uint256,address,uint256,uint256)\":{\"details\":\"Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_disputeID\":\"Index of the dispute in Kleros Core contract.\",\"_round\":\"The round the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggreation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice. TODO: - phase management: Generating->Drawing->Resolving->Generating in coordination with KlerosCore to freeze staking.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"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/arbitration/dispute-kits/BaseDisputeKit.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 \\\"../IDisputeKit.sol\\\";\\nimport \\\"../KlerosCore.sol\\\";\\n\\n/**\\n * @title BaseDisputeKit\\n * Provides common basic behaviours to the Dispute Kit implementations.\\n */\\nabstract contract BaseDisputeKit is IDisputeKit {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n /** @dev Constructor.\\n * @param _governor The governor's address.\\n * @param _core The KlerosCore arbitrator.\\n */\\n constructor(address _governor, KlerosCore _core) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Allows the governor to call anything on behalf of the contract.\\n * @param _destination The destination of the call.\\n * @param _amount The value sent with the call.\\n * @param _data The data sent with the call.\\n */\\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\",\"keccak256\":\"0x8c07add2ea39e9598bfe64afcdd8c5d13cf65c139656e7b8f6142adb8a829d49\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.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 \\\"./BaseDisputeKit.sol\\\";\\nimport \\\"../../rng/RNG.sol\\\";\\n\\n/**\\n * @title DisputeKitClassic\\n * Dispute kit implementation of the Kleros v1 features including:\\n * - a drawing system: proportional to staked PNK,\\n * - a vote aggreation system: plurality,\\n * - an incentive system: equal split between coherent votes,\\n * - an appeal system: fund 2 choices only, vote on any choice.\\n * TODO:\\n * - phase management: Generating->Drawing->Resolving->Generating in coordination with KlerosCore to freeze staking.\\n */\\ncontract DisputeKitClassic is BaseDisputeKit {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n RNG public rng; // The random number generator\\n Dispute[] public disputes; // Array of the locally created disputes.\\n mapping(uint256 => uint256) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event Contribution(\\n uint256 indexed _disputeID,\\n uint256 indexed _round,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event Withdrawal(\\n uint256 indexed _disputeID,\\n uint256 indexed _round,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event ChoiceFunded(uint256 indexed _disputeID, uint256 indexed _round, uint256 indexed _choice);\\n\\n /** @dev Constructor.\\n * @param _governor The governor's address.\\n * @param _core The KlerosCore arbitrator.\\n * @param _rng The random number generator.\\n */\\n constructor(\\n address _governor,\\n KlerosCore _core,\\n RNG _rng\\n ) BaseDisputeKit(_governor, _core) {\\n rng = _rng;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Changes the `governor` storage variable.\\n * @param _governor The new value for the `governor` storage variable.\\n */\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /** @dev Changes the `core` storage variable.\\n * @param _core The new value for the `core` storage variable.\\n */\\n function changeCore(address payable _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n /** @dev Changes the `_rng` storage variable.\\n * @param _rng The new value for the `RNGenerator` storage variable.\\n */\\n function changeRandomNumberGenerator(RNG _rng) external onlyByGovernor {\\n rng = _rng;\\n // TODO: if current phase is generating, call rng.requestRN() for the next block\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /** @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n * Note: Access restricted to Kleros Core only.\\n * @param _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 override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n\\n Round storage round = dispute.rounds.push();\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_disputeID] = localDisputeID;\\n }\\n\\n /** @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n * Note: Access restricted to Kleros Core only.\\n * @param _disputeID The ID of the dispute in Kleros Core.\\n * @return drawnAddress The drawn address.\\n */\\n function draw(uint256 _disputeID) external override onlyByCore returns (address drawnAddress) {\\n bytes32 key = bytes32(core.getSubcourtID(_disputeID)); // Get the ID of the tree.\\n uint256 drawnNumber = getRandomNumber();\\n\\n (uint256 K, , uint256[] memory nodes) = core.getSortitionSumTree(key);\\n uint256 treeIndex = 0;\\n uint256 currentDrawnNumber = drawnNumber % nodes[0];\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n // TODO: Handle the situation when no one has staked yet.\\n\\n // While it still has children\\n while ((K * treeIndex) + 1 < nodes.length) {\\n for (uint256 i = 1; i <= K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (K * treeIndex) + i;\\n uint256 nodeValue = nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n\\n bytes32 ID = core.getSortitionSumTreeID(key, treeIndex);\\n drawnAddress = stakePathIDToAccount(ID);\\n\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n }\\n\\n /** @dev Sets the caller's commit for the specified votes.\\n * `O(n)` where\\n * `n` is the number of votes.\\n * @param _disputeID The ID of the dispute.\\n * @param _voteIDs The IDs of the votes.\\n * @param _commit The commit.\\n */\\n function castCommit(\\n uint256 _disputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external {\\n require(\\n core.getCurrentPeriod(_disputeID) == KlerosCore.Period.commit,\\n \\\"The dispute should be in Commit period.\\\"\\n );\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(round.votes[_voteIDs[i]].commit == bytes32(0), \\\"Already committed this vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n\\n if (round.totalCommitted == round.votes.length) core.passPeriod(_disputeID);\\n }\\n\\n /** @dev Sets the caller's choices for the specified votes.\\n * `O(n)` where\\n * `n` is the number of votes.\\n * @param _disputeID The ID of the dispute.\\n * @param _voteIDs The IDs of the votes.\\n * @param _choice The choice.\\n * @param _salt The salt for the commit if the votes were hidden.\\n */\\n function castVote(\\n uint256 _disputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt\\n ) external {\\n require(core.getCurrentPeriod(_disputeID) == KlerosCore.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n bool hiddenVotes = core.areVotesHidden(core.getSubcourtID(_disputeID));\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _salt)),\\n \\\"The commit must match the choice in subcourts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n\\n // Automatically switch period when voting is finished.\\n if (round.totalVoted == round.votes.length) core.passPeriod(_disputeID);\\n }\\n\\n /** @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n * Note that the surplus deposit will be reimbursed.\\n * @param _disputeID Index of the dispute in Kleros Core contract.\\n * @param _choice A choice that receives funding.\\n */\\n function fundAppeal(uint256 _disputeID, uint256 _choice) external payable {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_disputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n if (this.currentRuling(_disputeID) == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_disputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_disputeID, dispute.rounds.length - 1, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_disputeID, dispute.rounds.length - 1, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.tied = true;\\n core.appeal{value: appealCost}(_disputeID);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /** @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n * @param _disputeID Index of the dispute in Kleros Core contract.\\n * @param _beneficiary The address whose rewards to withdraw.\\n * @param _round The round the caller wants to withdraw from.\\n * @param _choice The ruling option that the caller wants to withdraw from.\\n * @return amount The withdrawn amount.\\n */\\n function withdrawFeesAndRewards(\\n uint256 _disputeID,\\n address payable _beneficiary,\\n uint256 _round,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n require(core.isRuled(_disputeID), \\\"Dispute should be resolved.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[_round];\\n uint256 finalRuling = this.currentRuling(_disputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_disputeID, _round, _choice, _beneficiary, amount);\\n }\\n }\\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 override returns (uint256 ruling) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n ruling = round.tied ? 0 : round.winningChoice;\\n }\\n\\n /** @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n * @param _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 override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n Vote storage vote = dispute.rounds[_round].votes[_voteID];\\n\\n if (vote.voted && (vote.choice == lastRound.winningChoice || lastRound.tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /** @dev Gets the number of jurors who are eligible to a reward in this round.\\n * @param _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 override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n Round storage currentRound = dispute.rounds[_round];\\n uint256 winningChoice = lastRound.winningChoice;\\n\\n if (currentRound.totalVoted == 0 || (!lastRound.tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (lastRound.tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\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 override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Vote storage vote = dispute.rounds[_round].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[_round];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _disputeID,\\n uint256 _round,\\n uint256 _voteID\\n )\\n external\\n view\\n override\\n returns (\\n address account,\\n bytes32 commit,\\n uint256 choice,\\n bool voted\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Vote storage vote = dispute.rounds[_round].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /** @dev RNG function\\n * @return rn A random number.\\n */\\n function getRandomNumber() internal returns (uint256) {\\n return rng.getUncorrelatedRN(block.number);\\n }\\n\\n /** @dev Retrieves a juror's address from the stake path ID.\\n * @param _stakePathID The stake path ID to unpack.\\n * @return account The account.\\n */\\n function stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe5edb2b8162fad81d12eb72790a19333925f6f4d57a6ee3a8f1653ea483b898b\",\"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\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@clesaege]\\n * @reviewers: [@remedcu]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @title Random Number Generator Standard\\n * @author Cl\\u00e9ment Lesaege - \\n * @dev This is an abstract contract\\n */\\nabstract contract RNG {\\n /**\\n * @dev Contribute to the reward of a random number.\\n * @param _block Block the random number is linked to.\\n */\\n function contribute(uint256 _block) public payable virtual;\\n\\n /**\\n * @dev Request a random number.\\n * @param _block Block linked to the request.\\n */\\n function requestRN(uint256 _block) public payable {\\n contribute(_block);\\n }\\n\\n /**\\n * @dev Get the random number.\\n * @param _block Block the random number is linked to.\\n * @return RN Random Number. If the number is not ready or has not been required 0 instead.\\n */\\n function getRN(uint256 _block) public virtual returns (uint256 RN);\\n\\n /**\\n * @dev Get a uncorrelated random number. Act like getRN but give a different number for each sender.\\n * This is to prevent users from getting correlated numbers.\\n * @param _block Block the random number is linked to.\\n * @return RN Random Number. If the number is not ready or has not been required 0 instead.\\n */\\n function getUncorrelatedRN(uint256 _block) public returns (uint256 RN) {\\n uint256 baseRN = getRN(_block);\\n if (baseRN == 0) return 0;\\n else return uint256(keccak256(abi.encode(msg.sender, baseRN)));\\n }\\n}\\n\",\"keccak256\":\"0x854bcb147fe44383cba7a5fdbcb69b3c0a9a71435c80eb73c172222da472a855\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162002b7a38038062002b7a833981016040819052620000349162000090565b600080546001600160a01b039485166001600160a01b031991821617909155600180549385169382169390931790925560028054919093169116179055620000e4565b6001600160a01b03811681146200008d57600080fd5b50565b600080600060608486031215620000a657600080fd5b8351620000b38162000077565b6020850151909350620000c68162000077565b6040850151909250620000d98162000077565b809150509250925092565b612a8680620000f46000396000f3fe6080604052600436106101665760003560e01c8063796490f9116100d1578063be4676041161008a578063da3beb8c11610064578063da3beb8c14610483578063e349ad3014610345578063e4c0aaf4146104a3578063f2f4eb26146104c357600080fd5b8063be4676041461042d578063c41bda6114610443578063d605787b1461046357600080fd5b8063796490f9146103455780638d31de6d1461035b5780638e4264601461037b578063a7cc08fe1461039b578063b34bfaa8146103e7578063ba66fde7146103fd57600080fd5b80634b2f0ea0116101235780634b2f0ea0146102655780634fe264fb14610278578063564a565d146102985780635c92e2f6146102b857806369f3f041146102d8578063751accd01461032557600080fd5b80630c340a241461016b5780631200aabc146101a85780631c3db16d146101e3578063362c3479146102035780633850f804146102235780633b30414714610245575b600080fd5b34801561017757600080fd5b5060005461018b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101b457600080fd5b506101d56101c33660046123eb565b60046020526000908152604090205481565b60405190815260200161019f565b3480156101ef57600080fd5b506101d56101fe3660046123eb565b6104e3565b34801561020f57600080fd5b506101d561021e36600461241c565b61056d565b34801561022f57600080fd5b5061024361023e3660046124a5565b61091c565b005b34801561025157600080fd5b5061018b6102603660046123eb565b610fc5565b610243610273366004612503565b611321565b34801561028457600080fd5b506101d5610293366004612525565b611928565b3480156102a457600080fd5b506101d56102b33660046123eb565b611a24565b3480156102c457600080fd5b506102436102d3366004612551565b611a4d565b3480156102e457600080fd5b506102f86102f3366004612525565b611dd1565b604080519687529415156020870152938501929092526060840152608083015260a082015260c00161019f565b34801561033157600080fd5b506102436103403660046125eb565b611e7c565b34801561035157600080fd5b506101d561271081565b34801561036757600080fd5b5061024361037636600461269c565b611f4e565b34801561038757600080fd5b5061024361039636600461271c565b61200a565b3480156103a757600080fd5b506103bb6103b6366004612525565b612056565b604080516001600160a01b0390951685526020850193909352918301521515606082015260800161019f565b3480156103f357600080fd5b506101d5614e2081565b34801561040957600080fd5b5061041d610418366004612525565b61210f565b604051901515815260200161019f565b34801561043957600080fd5b506101d561138881565b34801561044f57600080fd5b5061024361045e36600461271c565b61219d565b34801561046f57600080fd5b5060025461018b906001600160a01b031681565b34801561048f57600080fd5b506101d561049e366004612503565b6121e9565b3480156104af57600080fd5b506102436104be36600461271c565b612300565b3480156104cf57600080fd5b5060015461018b906001600160a01b031681565b60008181526004602052604081205460038054839290811061050757610507612739565b6000918252602082206002909102018054909250829061052990600190612765565b8154811061053957610539612739565b60009182526020909120600b90910201600381015490915060ff16610562578060010154610565565b60005b949350505050565b6001546040516325bfe6d160e11b8152600481018690526000916001600160a01b031690634b7fcda290602401602060405180830381865afa1580156105b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105db919061277c565b61062c5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b60008581526004602052604081205460038054909190811061065057610650612739565b90600052602060002090600202019050600081600001858154811061067757610677612739565b600091825260208220604051631c3db16d60e01b8152600481018b9052600b929092020192503090631c3db16d90602401602060405180830381865afa1580156106c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e9919061279e565b600086815260078401602052604090205490915060ff16610731576001600160a01b038716600090815260088301602090815260408083208884529091529020549350610877565b808514156107a75760008581526006830160205260409020546107555760006107a0565b600085815260068301602090815260408083205460098601546001600160a01b038c1685526008870184528285208a865290935292205461079691906127b7565b6107a091906127ec565b9350610877565b600081815260078301602052604090205460ff166108775781600601600083600a016001815481106107db576107db612739565b906000526020600020015481526020019081526020016000205482600601600084600a0160008154811061081157610811612739565b90600052602060002001548152602001908152602001600020546108359190612800565b60098301546001600160a01b038916600090815260088501602090815260408083208a845290915290205461086a91906127b7565b61087491906127ec565b93505b6001600160a01b038716600090815260088301602090815260408083208884529091528120558315610911576040516001600160a01b0388169085156108fc029086906000818181858888f1505060408051898152602081018990526001600160a01b038c1694508a93508c92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b505050949350505050565b60015460405163022684db60e41b8152600481018790526002916001600160a01b0316906322684db090602401602060405180830381865afa158015610966573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098a919061282e565b600481111561099b5761099b612818565b146109f65760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610623565b82610a385760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610623565b600085815260046020526040812054600380549091908110610a5c57610a5c612739565b906000526020600020906002020190508060010154831115610ab75760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610623565b80546000908290610aca90600190612765565b81548110610ada57610ada612739565b600091825260208220600154604051637b5377bd60e11b8152600481018c9052600b9390930290910193506001600160a01b03169063d578cbac90829063f6a6ef7a90602401602060405180830381865afa158015610b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b61919061279e565b6040518263ffffffff1660e01b8152600401610b7f91815260200190565b602060405180830381865afa158015610b9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc0919061277c565b905060005b86811015610e68573383898984818110610be157610be1612739565b9050602002013581548110610bf857610bf8612739565b60009182526020909120600490910201546001600160a01b031614610c5f5760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e006044820152606401610623565b811580610cd2575060408051602081018890529081018690526060016040516020818303038152906040528051906020012083600001898984818110610ca757610ca7612739565b9050602002013581548110610cbe57610cbe612739565b906000526020600020906004020160010154145b610d46576040805162461bcd60e51b81526020600482015260248101919091527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20737562636f7572747320776974682068696464656e20766f7465732e6064820152608401610623565b82888883818110610d5957610d59612739565b9050602002013581548110610d7057610d70612739565b600091825260209091206003600490920201015460ff1615610dc95760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610623565b8583898984818110610ddd57610ddd612739565b9050602002013581548110610df457610df4612739565b6000918252602090912060026004909202010155600183898984818110610e1d57610e1d612739565b9050602002013581548110610e3457610e34612739565b60009182526020909120600490910201600301805460ff191691151591909117905580610e608161284f565b915050610bc5565b5086869050826004016000828254610e809190612800565b9091555050600085815260028301602052604081208054889290610ea5908490612800565b90915550506001820154851415610ed557600382015460ff1615610ed05760038201805460ff191690555b610f4f565b60018201546000908152600283016020526040808220548783529120541415610f1857600382015460ff16610ed05760038201805460ff19166001179055610f4f565b60018201546000908152600283016020526040808220548783529120541115610f4f576001820185905560038201805460ff191690555b815460048301541415610fbb576001546040516308aea9bb60e11b8152600481018a90526001600160a01b039091169063115d537690602401600060405180830381600087803b158015610fa257600080fd5b505af1158015610fb6573d6000803e3d6000fd5b505050505b5050505050505050565b6001546000906001600160a01b03163314610ff25760405162461bcd60e51b81526004016106239061286a565b600154604051637b5377bd60e11b8152600481018490526000916001600160a01b03169063f6a6ef7a90602401602060405180830381865afa15801561103c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611060919061279e565b9050600061106c61234c565b600154604051630696a8a760e51b81526004810185905291925060009182916001600160a01b03169063d2d514e090602401600060405180830381865afa1580156110bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110e3919081019061292e565b9250509150600080826000815181106110fe576110fe612739565b602002602001015185611111919061299b565b600089815260046020526040812054600380549394509192811061113757611137612739565b6000918252602082206002909102018054909250829061115990600190612765565b8154811061116957611169612739565b90600052602060002090600b020190505b845161118685886127b7565b611191906001612800565b10156112135760015b86811161120d576000816111ae878a6127b7565b6111b89190612800565b905060008782815181106111ce576111ce612739565b602002602001015190508086106111f0576111e98187612765565b95506111f8565b50945061120d565b505080806112059061284f565b91505061119a565b5061117a565b60015460405163de1a1e5960e01b8152600481018a9052602481018690526000916001600160a01b03169063de1a1e5990604401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611288919061279e565b9050611293816123c0565b604080516080810182526001600160a01b0383811682526000602080840182815294840182815260608501838152895460018082018c559a8552929093209451600490920290940180546001600160a01b03191691909316178255925195810195909555516002850155516003909301805460ff191693151593909317909255509998505050505050505050565b60008281526004602052604081205460038054909190811061134557611345612739565b9060005260206000209060020201905080600101548211156113a95760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610623565b60015460405163afe15cfb60e01b81526004810185905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa1580156113f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141a91906129af565b9150915081421015801561142d57508042105b6114725760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610623565b604051631c3db16d60e01b81526004810186905260009085903090631c3db16d90602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d7919061279e565b14156114e65750612710611566565b6127106113886114f68585612765565b61150091906127b7565b61150a91906127ec565b6115148442612765565b106115615760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610623565b50614e205b8354600090859061157990600190612765565b8154811061158957611589612739565b600091825260208083208984526007600b90930201918201905260409091205490915060ff16156115fc5760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610623565b600154604051632cf6413f60e11b8152600481018990526000916001600160a01b0316906359ec827e90602401602060405180830381865afa158015611646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166a919061279e565b9050600061271061167b85846127b7565b61168591906127ec565b61168f9083612800565b60008981526006850160205260408120549192509082111561173e57600089815260068501602052604090205434906116c89084612765565b116116ed5760008981526006850160205260409020546116e89083612765565b6116ef565b345b8854909150339061170290600190612765565b604080518c8152602081018590528d917fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c0910160405180910390a45b33600090815260088501602090815260408083208c84529091528120805483929061176a908490612800565b909155505060008981526006850160205260408120805483929061178f908490612800565b909155505060008981526006850160205260409020548211611845576000898152600685016020526040812054600986018054919290916117d1908490612800565b9091555050600a8401805460018181018355600092835260208084209092018c90558b8352600787019091526040909120805460ff19168217905588548a9161181991612765565b6040518c907fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00990600090a45b600a840154600110156118ee578284600901546118629190612765565b6009850155875460018082018a5560008a8152602090206003600b90930201918201805460ff191682179055546040516307e69b7b60e41b8152600481018d90526001600160a01b0390911690637e69b7b09086906024016000604051808303818588803b1580156118d357600080fd5b505af11580156118e7573d6000803e3d6000fd5b5050505050505b8034111561191c57336108fc6119048334612765565b6040518115909202916000818181858888f150505050505b50505050505050505050565b60008381526004602052604081205460038054839290811061194c5761194c612739565b6000918252602082206002909102018054909250829061196e90600190612765565b8154811061197e5761197e612739565b90600052602060002090600b0201905060008260000186815481106119a5576119a5612739565b90600052602060002090600b020160000185815481106119c7576119c7612739565b60009182526020909120600490910201600381015490915060ff168015611a035750816001015481600201541480611a035750600382015460ff165b15611a15576127109350505050611a1d565b600093505050505b9392505050565b60038181548110611a3457600080fd5b6000918252602090912060016002909202010154905081565b6001805460405163022684db60e41b8152600481018790526001600160a01b03909116906322684db090602401602060405180830381865afa158015611a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abb919061282e565b6004811115611acc57611acc612818565b14611b295760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610623565b80611b665760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610623565b600084815260046020526040812054600380549091908110611b8a57611b8a612739565b60009182526020822060029091020180549092508290611bac90600190612765565b81548110611bbc57611bbc612739565b90600052602060002090600b0201905060005b84811015611d45573382878784818110611beb57611beb612739565b9050602002013581548110611c0257611c02612739565b60009182526020909120600490910201546001600160a01b031614611c695760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e006044820152606401610623565b600082878784818110611c7e57611c7e612739565b9050602002013581548110611c9557611c95612739565b90600052602060002090600402016001015414611cf45760405162461bcd60e51b815260206004820152601c60248201527f416c726561647920636f6d6d6974746564207468697320766f74652e000000006044820152606401610623565b8382878784818110611d0857611d08612739565b9050602002013581548110611d1f57611d1f612739565b600091825260209091206001600490920201015580611d3d8161284f565b915050611bcf565b5084849050816005016000828254611d5d9190612800565b9091555050805460058201541415611dc9576001546040516308aea9bb60e11b8152600481018890526001600160a01b039091169063115d537690602401600060405180830381600087803b158015611db557600080fd5b505af115801561191c573d6000803e3d6000fd5b505050505050565b60008060008060008060006003600460008c81526020019081526020016000205481548110611e0257611e02612739565b906000526020600020906002020190506000816000018a81548110611e2957611e29612739565b600091825260208083206001600b909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b6000546001600160a01b03163314611ea65760405162461bcd60e51b8152600401610623906129d3565b6000836001600160a01b03168383604051611ec19190612a15565b60006040518083038185875af1925050503d8060008114611efe576040519150601f19603f3d011682016040523d82523d6000602084013e611f03565b606091505b5050905080611f485760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610623565b50505050565b6001546001600160a01b03163314611f785760405162461bcd60e51b81526004016106239061286a565b50506003805460018082018355600282027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8101949094557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9093018054808501825560009182526020808320600b909202909101909301805460ff1916909417909355928252600490526040902055565b6000546001600160a01b031633146120345760405162461bcd60e51b8152600401610623906129d3565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006003600460008a8152602001908152602001600020548154811061208457612084612739565b9060005260206000209060020201905060008160000188815481106120ab576120ab612739565b90600052602060002090600b020160000187815481106120cd576120cd612739565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b60008381526004602052604081205460038054839290811061213357612133612739565b90600052602060002090600202019050600081600001858154811061215a5761215a612739565b90600052602060002090600b0201600001848154811061217c5761217c612739565b600091825260209091206004909102016003015460ff169695505050505050565b6000546001600160a01b031633146121c75760405162461bcd60e51b8152600401610623906129d3565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526004602052604081205460038054839290811061220d5761220d612739565b6000918252602082206002909102018054909250829061222f90600190612765565b8154811061223f5761223f612739565b90600052602060002090600b02019050600082600001858154811061226657612266612739565b90600052602060002090600b020190506000826001015490508160040154600014806122b05750600383015460ff161580156122b057506000818152600283016020526040902054155b156122c25760009450505050506122fa565b600383015460ff16156122de57506004015492506122fa915050565b60009081526002909101602052604090205492506122fa915050565b92915050565b6000546001600160a01b0316331461232a5760405162461bcd60e51b8152600401610623906129d3565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600254604051630e39b00f60e11b81524360048201526000916001600160a01b031690631c73601e906024016020604051808303816000875af1158015612397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123bb919061279e565b905090565b600060405160005b60148110156123e35783811a81600c840101536001016123c8565b505192915050565b6000602082840312156123fd57600080fd5b5035919050565b6001600160a01b038116811461241957600080fd5b50565b6000806000806080858703121561243257600080fd5b84359350602085013561244481612404565b93969395505050506040820135916060013590565b60008083601f84011261246b57600080fd5b50813567ffffffffffffffff81111561248357600080fd5b6020830191508360208260051b850101111561249e57600080fd5b9250929050565b6000806000806000608086880312156124bd57600080fd5b85359450602086013567ffffffffffffffff8111156124db57600080fd5b6124e788828901612459565b9699909850959660408101359660609091013595509350505050565b6000806040838503121561251657600080fd5b50508035926020909101359150565b60008060006060848603121561253a57600080fd5b505081359360208301359350604090920135919050565b6000806000806060858703121561256757600080fd5b84359350602085013567ffffffffffffffff81111561258557600080fd5b61259187828801612459565b9598909750949560400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125e3576125e36125a4565b604052919050565b60008060006060848603121561260057600080fd5b833561260b81612404565b92506020848101359250604085013567ffffffffffffffff8082111561263057600080fd5b818701915087601f83011261264457600080fd5b813581811115612656576126566125a4565b612668601f8201601f191685016125ba565b9150808252888482850101111561267e57600080fd5b80848401858401376000848284010152508093505050509250925092565b600080600080606085870312156126b257600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156126d857600080fd5b818701915087601f8301126126ec57600080fd5b8135818111156126fb57600080fd5b88602082850101111561270d57600080fd5b95989497505060200194505050565b60006020828403121561272e57600080fd5b8135611a1d81612404565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156127775761277761274f565b500390565b60006020828403121561278e57600080fd5b81518015158114611a1d57600080fd5b6000602082840312156127b057600080fd5b5051919050565b60008160001904831182151516156127d1576127d161274f565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826127fb576127fb6127d6565b500490565b600082198211156128135761281361274f565b500190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561284057600080fd5b815160058110611a1d57600080fd5b60006000198214156128635761286361274f565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600082601f8301126128bf57600080fd5b8151602067ffffffffffffffff8211156128db576128db6125a4565b8160051b6128ea8282016125ba565b928352848101820192828101908785111561290457600080fd5b83870192505b848310156129235782518252918301919083019061290a565b979650505050505050565b60008060006060848603121561294357600080fd5b83519250602084015167ffffffffffffffff8082111561296257600080fd5b61296e878388016128ae565b9350604086015191508082111561298457600080fd5b50612991868287016128ae565b9150509250925092565b6000826129aa576129aa6127d6565b500690565b600080604083850312156129c257600080fd5b505080516020909101519092909150565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612a365760208186018101518583015201612a1c565b81811115612a45576000828501525b50919091019291505056fea2646970667358221220cadd48586bf74e6d7354c701bac3b4beacf7fea9e66e7923bd24cee0b55af07c64736f6c634300080a0033", - "deployedBytecode": "0x6080604052600436106101665760003560e01c8063796490f9116100d1578063be4676041161008a578063da3beb8c11610064578063da3beb8c14610483578063e349ad3014610345578063e4c0aaf4146104a3578063f2f4eb26146104c357600080fd5b8063be4676041461042d578063c41bda6114610443578063d605787b1461046357600080fd5b8063796490f9146103455780638d31de6d1461035b5780638e4264601461037b578063a7cc08fe1461039b578063b34bfaa8146103e7578063ba66fde7146103fd57600080fd5b80634b2f0ea0116101235780634b2f0ea0146102655780634fe264fb14610278578063564a565d146102985780635c92e2f6146102b857806369f3f041146102d8578063751accd01461032557600080fd5b80630c340a241461016b5780631200aabc146101a85780631c3db16d146101e3578063362c3479146102035780633850f804146102235780633b30414714610245575b600080fd5b34801561017757600080fd5b5060005461018b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101b457600080fd5b506101d56101c33660046123eb565b60046020526000908152604090205481565b60405190815260200161019f565b3480156101ef57600080fd5b506101d56101fe3660046123eb565b6104e3565b34801561020f57600080fd5b506101d561021e36600461241c565b61056d565b34801561022f57600080fd5b5061024361023e3660046124a5565b61091c565b005b34801561025157600080fd5b5061018b6102603660046123eb565b610fc5565b610243610273366004612503565b611321565b34801561028457600080fd5b506101d5610293366004612525565b611928565b3480156102a457600080fd5b506101d56102b33660046123eb565b611a24565b3480156102c457600080fd5b506102436102d3366004612551565b611a4d565b3480156102e457600080fd5b506102f86102f3366004612525565b611dd1565b604080519687529415156020870152938501929092526060840152608083015260a082015260c00161019f565b34801561033157600080fd5b506102436103403660046125eb565b611e7c565b34801561035157600080fd5b506101d561271081565b34801561036757600080fd5b5061024361037636600461269c565b611f4e565b34801561038757600080fd5b5061024361039636600461271c565b61200a565b3480156103a757600080fd5b506103bb6103b6366004612525565b612056565b604080516001600160a01b0390951685526020850193909352918301521515606082015260800161019f565b3480156103f357600080fd5b506101d5614e2081565b34801561040957600080fd5b5061041d610418366004612525565b61210f565b604051901515815260200161019f565b34801561043957600080fd5b506101d561138881565b34801561044f57600080fd5b5061024361045e36600461271c565b61219d565b34801561046f57600080fd5b5060025461018b906001600160a01b031681565b34801561048f57600080fd5b506101d561049e366004612503565b6121e9565b3480156104af57600080fd5b506102436104be36600461271c565b612300565b3480156104cf57600080fd5b5060015461018b906001600160a01b031681565b60008181526004602052604081205460038054839290811061050757610507612739565b6000918252602082206002909102018054909250829061052990600190612765565b8154811061053957610539612739565b60009182526020909120600b90910201600381015490915060ff16610562578060010154610565565b60005b949350505050565b6001546040516325bfe6d160e11b8152600481018690526000916001600160a01b031690634b7fcda290602401602060405180830381865afa1580156105b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105db919061277c565b61062c5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b60008581526004602052604081205460038054909190811061065057610650612739565b90600052602060002090600202019050600081600001858154811061067757610677612739565b600091825260208220604051631c3db16d60e01b8152600481018b9052600b929092020192503090631c3db16d90602401602060405180830381865afa1580156106c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e9919061279e565b600086815260078401602052604090205490915060ff16610731576001600160a01b038716600090815260088301602090815260408083208884529091529020549350610877565b808514156107a75760008581526006830160205260409020546107555760006107a0565b600085815260068301602090815260408083205460098601546001600160a01b038c1685526008870184528285208a865290935292205461079691906127b7565b6107a091906127ec565b9350610877565b600081815260078301602052604090205460ff166108775781600601600083600a016001815481106107db576107db612739565b906000526020600020015481526020019081526020016000205482600601600084600a0160008154811061081157610811612739565b90600052602060002001548152602001908152602001600020546108359190612800565b60098301546001600160a01b038916600090815260088501602090815260408083208a845290915290205461086a91906127b7565b61087491906127ec565b93505b6001600160a01b038716600090815260088301602090815260408083208884529091528120558315610911576040516001600160a01b0388169085156108fc029086906000818181858888f1505060408051898152602081018990526001600160a01b038c1694508a93508c92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b505050949350505050565b60015460405163022684db60e41b8152600481018790526002916001600160a01b0316906322684db090602401602060405180830381865afa158015610966573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098a919061282e565b600481111561099b5761099b612818565b146109f65760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610623565b82610a385760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610623565b600085815260046020526040812054600380549091908110610a5c57610a5c612739565b906000526020600020906002020190508060010154831115610ab75760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610623565b80546000908290610aca90600190612765565b81548110610ada57610ada612739565b600091825260208220600154604051637b5377bd60e11b8152600481018c9052600b9390930290910193506001600160a01b03169063d578cbac90829063f6a6ef7a90602401602060405180830381865afa158015610b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b61919061279e565b6040518263ffffffff1660e01b8152600401610b7f91815260200190565b602060405180830381865afa158015610b9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc0919061277c565b905060005b86811015610e68573383898984818110610be157610be1612739565b9050602002013581548110610bf857610bf8612739565b60009182526020909120600490910201546001600160a01b031614610c5f5760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e006044820152606401610623565b811580610cd2575060408051602081018890529081018690526060016040516020818303038152906040528051906020012083600001898984818110610ca757610ca7612739565b9050602002013581548110610cbe57610cbe612739565b906000526020600020906004020160010154145b610d46576040805162461bcd60e51b81526020600482015260248101919091527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20737562636f7572747320776974682068696464656e20766f7465732e6064820152608401610623565b82888883818110610d5957610d59612739565b9050602002013581548110610d7057610d70612739565b600091825260209091206003600490920201015460ff1615610dc95760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610623565b8583898984818110610ddd57610ddd612739565b9050602002013581548110610df457610df4612739565b6000918252602090912060026004909202010155600183898984818110610e1d57610e1d612739565b9050602002013581548110610e3457610e34612739565b60009182526020909120600490910201600301805460ff191691151591909117905580610e608161284f565b915050610bc5565b5086869050826004016000828254610e809190612800565b9091555050600085815260028301602052604081208054889290610ea5908490612800565b90915550506001820154851415610ed557600382015460ff1615610ed05760038201805460ff191690555b610f4f565b60018201546000908152600283016020526040808220548783529120541415610f1857600382015460ff16610ed05760038201805460ff19166001179055610f4f565b60018201546000908152600283016020526040808220548783529120541115610f4f576001820185905560038201805460ff191690555b815460048301541415610fbb576001546040516308aea9bb60e11b8152600481018a90526001600160a01b039091169063115d537690602401600060405180830381600087803b158015610fa257600080fd5b505af1158015610fb6573d6000803e3d6000fd5b505050505b5050505050505050565b6001546000906001600160a01b03163314610ff25760405162461bcd60e51b81526004016106239061286a565b600154604051637b5377bd60e11b8152600481018490526000916001600160a01b03169063f6a6ef7a90602401602060405180830381865afa15801561103c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611060919061279e565b9050600061106c61234c565b600154604051630696a8a760e51b81526004810185905291925060009182916001600160a01b03169063d2d514e090602401600060405180830381865afa1580156110bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110e3919081019061292e565b9250509150600080826000815181106110fe576110fe612739565b602002602001015185611111919061299b565b600089815260046020526040812054600380549394509192811061113757611137612739565b6000918252602082206002909102018054909250829061115990600190612765565b8154811061116957611169612739565b90600052602060002090600b020190505b845161118685886127b7565b611191906001612800565b10156112135760015b86811161120d576000816111ae878a6127b7565b6111b89190612800565b905060008782815181106111ce576111ce612739565b602002602001015190508086106111f0576111e98187612765565b95506111f8565b50945061120d565b505080806112059061284f565b91505061119a565b5061117a565b60015460405163de1a1e5960e01b8152600481018a9052602481018690526000916001600160a01b03169063de1a1e5990604401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611288919061279e565b9050611293816123c0565b604080516080810182526001600160a01b0383811682526000602080840182815294840182815260608501838152895460018082018c559a8552929093209451600490920290940180546001600160a01b03191691909316178255925195810195909555516002850155516003909301805460ff191693151593909317909255509998505050505050505050565b60008281526004602052604081205460038054909190811061134557611345612739565b9060005260206000209060020201905080600101548211156113a95760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610623565b60015460405163afe15cfb60e01b81526004810185905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa1580156113f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141a91906129af565b9150915081421015801561142d57508042105b6114725760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610623565b604051631c3db16d60e01b81526004810186905260009085903090631c3db16d90602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d7919061279e565b14156114e65750612710611566565b6127106113886114f68585612765565b61150091906127b7565b61150a91906127ec565b6115148442612765565b106115615760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610623565b50614e205b8354600090859061157990600190612765565b8154811061158957611589612739565b600091825260208083208984526007600b90930201918201905260409091205490915060ff16156115fc5760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610623565b600154604051632cf6413f60e11b8152600481018990526000916001600160a01b0316906359ec827e90602401602060405180830381865afa158015611646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166a919061279e565b9050600061271061167b85846127b7565b61168591906127ec565b61168f9083612800565b60008981526006850160205260408120549192509082111561173e57600089815260068501602052604090205434906116c89084612765565b116116ed5760008981526006850160205260409020546116e89083612765565b6116ef565b345b8854909150339061170290600190612765565b604080518c8152602081018590528d917fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c0910160405180910390a45b33600090815260088501602090815260408083208c84529091528120805483929061176a908490612800565b909155505060008981526006850160205260408120805483929061178f908490612800565b909155505060008981526006850160205260409020548211611845576000898152600685016020526040812054600986018054919290916117d1908490612800565b9091555050600a8401805460018181018355600092835260208084209092018c90558b8352600787019091526040909120805460ff19168217905588548a9161181991612765565b6040518c907fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00990600090a45b600a840154600110156118ee578284600901546118629190612765565b6009850155875460018082018a5560008a8152602090206003600b90930201918201805460ff191682179055546040516307e69b7b60e41b8152600481018d90526001600160a01b0390911690637e69b7b09086906024016000604051808303818588803b1580156118d357600080fd5b505af11580156118e7573d6000803e3d6000fd5b5050505050505b8034111561191c57336108fc6119048334612765565b6040518115909202916000818181858888f150505050505b50505050505050505050565b60008381526004602052604081205460038054839290811061194c5761194c612739565b6000918252602082206002909102018054909250829061196e90600190612765565b8154811061197e5761197e612739565b90600052602060002090600b0201905060008260000186815481106119a5576119a5612739565b90600052602060002090600b020160000185815481106119c7576119c7612739565b60009182526020909120600490910201600381015490915060ff168015611a035750816001015481600201541480611a035750600382015460ff165b15611a15576127109350505050611a1d565b600093505050505b9392505050565b60038181548110611a3457600080fd5b6000918252602090912060016002909202010154905081565b6001805460405163022684db60e41b8152600481018790526001600160a01b03909116906322684db090602401602060405180830381865afa158015611a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abb919061282e565b6004811115611acc57611acc612818565b14611b295760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610623565b80611b665760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610623565b600084815260046020526040812054600380549091908110611b8a57611b8a612739565b60009182526020822060029091020180549092508290611bac90600190612765565b81548110611bbc57611bbc612739565b90600052602060002090600b0201905060005b84811015611d45573382878784818110611beb57611beb612739565b9050602002013581548110611c0257611c02612739565b60009182526020909120600490910201546001600160a01b031614611c695760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e006044820152606401610623565b600082878784818110611c7e57611c7e612739565b9050602002013581548110611c9557611c95612739565b90600052602060002090600402016001015414611cf45760405162461bcd60e51b815260206004820152601c60248201527f416c726561647920636f6d6d6974746564207468697320766f74652e000000006044820152606401610623565b8382878784818110611d0857611d08612739565b9050602002013581548110611d1f57611d1f612739565b600091825260209091206001600490920201015580611d3d8161284f565b915050611bcf565b5084849050816005016000828254611d5d9190612800565b9091555050805460058201541415611dc9576001546040516308aea9bb60e11b8152600481018890526001600160a01b039091169063115d537690602401600060405180830381600087803b158015611db557600080fd5b505af115801561191c573d6000803e3d6000fd5b505050505050565b60008060008060008060006003600460008c81526020019081526020016000205481548110611e0257611e02612739565b906000526020600020906002020190506000816000018a81548110611e2957611e29612739565b600091825260208083206001600b909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b6000546001600160a01b03163314611ea65760405162461bcd60e51b8152600401610623906129d3565b6000836001600160a01b03168383604051611ec19190612a15565b60006040518083038185875af1925050503d8060008114611efe576040519150601f19603f3d011682016040523d82523d6000602084013e611f03565b606091505b5050905080611f485760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610623565b50505050565b6001546001600160a01b03163314611f785760405162461bcd60e51b81526004016106239061286a565b50506003805460018082018355600282027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8101949094557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9093018054808501825560009182526020808320600b909202909101909301805460ff1916909417909355928252600490526040902055565b6000546001600160a01b031633146120345760405162461bcd60e51b8152600401610623906129d3565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006003600460008a8152602001908152602001600020548154811061208457612084612739565b9060005260206000209060020201905060008160000188815481106120ab576120ab612739565b90600052602060002090600b020160000187815481106120cd576120cd612739565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b60008381526004602052604081205460038054839290811061213357612133612739565b90600052602060002090600202019050600081600001858154811061215a5761215a612739565b90600052602060002090600b0201600001848154811061217c5761217c612739565b600091825260209091206004909102016003015460ff169695505050505050565b6000546001600160a01b031633146121c75760405162461bcd60e51b8152600401610623906129d3565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526004602052604081205460038054839290811061220d5761220d612739565b6000918252602082206002909102018054909250829061222f90600190612765565b8154811061223f5761223f612739565b90600052602060002090600b02019050600082600001858154811061226657612266612739565b90600052602060002090600b020190506000826001015490508160040154600014806122b05750600383015460ff161580156122b057506000818152600283016020526040902054155b156122c25760009450505050506122fa565b600383015460ff16156122de57506004015492506122fa915050565b60009081526002909101602052604090205492506122fa915050565b92915050565b6000546001600160a01b0316331461232a5760405162461bcd60e51b8152600401610623906129d3565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600254604051630e39b00f60e11b81524360048201526000916001600160a01b031690631c73601e906024016020604051808303816000875af1158015612397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123bb919061279e565b905090565b600060405160005b60148110156123e35783811a81600c840101536001016123c8565b505192915050565b6000602082840312156123fd57600080fd5b5035919050565b6001600160a01b038116811461241957600080fd5b50565b6000806000806080858703121561243257600080fd5b84359350602085013561244481612404565b93969395505050506040820135916060013590565b60008083601f84011261246b57600080fd5b50813567ffffffffffffffff81111561248357600080fd5b6020830191508360208260051b850101111561249e57600080fd5b9250929050565b6000806000806000608086880312156124bd57600080fd5b85359450602086013567ffffffffffffffff8111156124db57600080fd5b6124e788828901612459565b9699909850959660408101359660609091013595509350505050565b6000806040838503121561251657600080fd5b50508035926020909101359150565b60008060006060848603121561253a57600080fd5b505081359360208301359350604090920135919050565b6000806000806060858703121561256757600080fd5b84359350602085013567ffffffffffffffff81111561258557600080fd5b61259187828801612459565b9598909750949560400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125e3576125e36125a4565b604052919050565b60008060006060848603121561260057600080fd5b833561260b81612404565b92506020848101359250604085013567ffffffffffffffff8082111561263057600080fd5b818701915087601f83011261264457600080fd5b813581811115612656576126566125a4565b612668601f8201601f191685016125ba565b9150808252888482850101111561267e57600080fd5b80848401858401376000848284010152508093505050509250925092565b600080600080606085870312156126b257600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156126d857600080fd5b818701915087601f8301126126ec57600080fd5b8135818111156126fb57600080fd5b88602082850101111561270d57600080fd5b95989497505060200194505050565b60006020828403121561272e57600080fd5b8135611a1d81612404565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156127775761277761274f565b500390565b60006020828403121561278e57600080fd5b81518015158114611a1d57600080fd5b6000602082840312156127b057600080fd5b5051919050565b60008160001904831182151516156127d1576127d161274f565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826127fb576127fb6127d6565b500490565b600082198211156128135761281361274f565b500190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561284057600080fd5b815160058110611a1d57600080fd5b60006000198214156128635761286361274f565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600082601f8301126128bf57600080fd5b8151602067ffffffffffffffff8211156128db576128db6125a4565b8160051b6128ea8282016125ba565b928352848101820192828101908785111561290457600080fd5b83870192505b848310156129235782518252918301919083019061290a565b979650505050505050565b60008060006060848603121561294357600080fd5b83519250602084015167ffffffffffffffff8082111561296257600080fd5b61296e878388016128ae565b9350604086015191508082111561298457600080fd5b50612991868287016128ae565b9150509250925092565b6000826129aa576129aa6127d6565b500690565b600080604083850312156129c257600080fd5b505080516020909101519092909150565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612a365760208186018101518583015201612a1c565b81811115612a45576000828501525b50919091019291505056fea2646970667358221220cadd48586bf74e6d7354c701bac3b4beacf7fea9e66e7923bd24cee0b55af07c64736f6c634300080a0033", + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"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\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"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\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit.\",\"_disputeID\":\"The ID of the dispute.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_disputeID\":\"The ID of the dispute.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeRandomNumberGenerator(address)\":{\"details\":\"Changes the `_rng` storage variable.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\",\"_rng\":\"The random number generator.\"}},\"createDispute(uint256,uint256,bytes)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"ruling\":\"The current ruling.\"}},\"draw(uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_disputeID\":\"Index of the dispute in Kleros Core contract.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_round\":\"The ID of the round.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_round\":\"The ID of the round.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_disputeID\":\"The ID of the dispute in Kleros Core.\",\"_round\":\"The ID of the round.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"submitEvidence(uint256,string)\":{\"details\":\"Submits evidence.\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.\"}},\"withdrawFeesAndRewards(uint256,address,uint256,uint256)\":{\"details\":\"Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_disputeID\":\"Index of the dispute in Kleros Core contract.\",\"_round\":\"The round the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggreation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice. TODO: - phase management: Generating->Drawing->Resolving->Generating in coordination with KlerosCore to freeze staking.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"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 /** @dev Gets the timesPerPeriod array for a given court.\\n * @param _subcourtID The ID of the court to get the times from.\\n * @return timesPerPeriod The timesPerPeriod array for the given court.\\n */\\n function getTimesPerPeriod(uint96 _subcourtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_subcourtID];\\n timesPerPeriod = court.timesPerPeriod;\\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\":\"0x2212bb97e222dcf1ee614a84a6858e9f01d6cc5e69b58c9c88b252dfb00a4bf6\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/BaseDisputeKit.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 \\\"../IDisputeKit.sol\\\";\\nimport \\\"../KlerosCore.sol\\\";\\n\\n/**\\n * @title BaseDisputeKit\\n * Provides common basic behaviours to the Dispute Kit implementations.\\n */\\nabstract contract BaseDisputeKit is IDisputeKit {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n /** @dev Constructor.\\n * @param _governor The governor's address.\\n * @param _core The KlerosCore arbitrator.\\n */\\n constructor(address _governor, KlerosCore _core) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Allows the governor to call anything on behalf of the contract.\\n * @param _destination The destination of the call.\\n * @param _amount The value sent with the call.\\n * @param _data The data sent with the call.\\n */\\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\",\"keccak256\":\"0x8c07add2ea39e9598bfe64afcdd8c5d13cf65c139656e7b8f6142adb8a829d49\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.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 \\\"./BaseDisputeKit.sol\\\";\\nimport \\\"../../rng/RNG.sol\\\";\\nimport \\\"../../evidence/IEvidence.sol\\\";\\n\\n/**\\n * @title DisputeKitClassic\\n * Dispute kit implementation of the Kleros v1 features including:\\n * - a drawing system: proportional to staked PNK,\\n * - a vote aggreation system: plurality,\\n * - an incentive system: equal split between coherent votes,\\n * - an appeal system: fund 2 choices only, vote on any choice.\\n * TODO:\\n * - phase management: Generating->Drawing->Resolving->Generating in coordination with KlerosCore to freeze staking.\\n */\\ncontract DisputeKitClassic is BaseDisputeKit, IEvidence {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n RNG public rng; // The random number generator\\n Dispute[] public disputes; // Array of the locally created disputes.\\n mapping(uint256 => uint256) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event Contribution(\\n uint256 indexed _disputeID,\\n uint256 indexed _round,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event Withdrawal(\\n uint256 indexed _disputeID,\\n uint256 indexed _round,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n event ChoiceFunded(uint256 indexed _disputeID, uint256 indexed _round, uint256 indexed _choice);\\n\\n /** @dev Constructor.\\n * @param _governor The governor's address.\\n * @param _core The KlerosCore arbitrator.\\n * @param _rng The random number generator.\\n */\\n constructor(\\n address _governor,\\n KlerosCore _core,\\n RNG _rng\\n ) BaseDisputeKit(_governor, _core) {\\n rng = _rng;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /** @dev Changes the `governor` storage variable.\\n * @param _governor The new value for the `governor` storage variable.\\n */\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /** @dev Changes the `core` storage variable.\\n * @param _core The new value for the `core` storage variable.\\n */\\n function changeCore(address payable _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n /** @dev Changes the `_rng` storage variable.\\n * @param _rng The new value for the `RNGenerator` storage variable.\\n */\\n function changeRandomNumberGenerator(RNG _rng) external onlyByGovernor {\\n rng = _rng;\\n // TODO: if current phase is generating, call rng.requestRN() for the next block\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /** @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n * Note: Access restricted to Kleros Core only.\\n * @param _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 override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n\\n Round storage round = dispute.rounds.push();\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_disputeID] = localDisputeID;\\n }\\n\\n /** @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n * Note: Access restricted to Kleros Core only.\\n * @param _disputeID The ID of the dispute in Kleros Core.\\n * @return drawnAddress The drawn address.\\n */\\n function draw(uint256 _disputeID) external override onlyByCore returns (address drawnAddress) {\\n bytes32 key = bytes32(core.getSubcourtID(_disputeID)); // Get the ID of the tree.\\n uint256 drawnNumber = getRandomNumber();\\n\\n (uint256 K, , uint256[] memory nodes) = core.getSortitionSumTree(key);\\n uint256 treeIndex = 0;\\n uint256 currentDrawnNumber = drawnNumber % nodes[0];\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n // TODO: Handle the situation when no one has staked yet.\\n\\n // While it still has children\\n while ((K * treeIndex) + 1 < nodes.length) {\\n for (uint256 i = 1; i <= K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (K * treeIndex) + i;\\n uint256 nodeValue = nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n\\n bytes32 ID = core.getSortitionSumTreeID(key, treeIndex);\\n drawnAddress = stakePathIDToAccount(ID);\\n\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n }\\n\\n /** @dev Sets the caller's commit for the specified votes.\\n * `O(n)` where\\n * `n` is the number of votes.\\n * @param _disputeID The ID of the dispute.\\n * @param _voteIDs The IDs of the votes.\\n * @param _commit The commit.\\n */\\n function castCommit(\\n uint256 _disputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external {\\n require(\\n core.getCurrentPeriod(_disputeID) == KlerosCore.Period.commit,\\n \\\"The dispute should be in Commit period.\\\"\\n );\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(round.votes[_voteIDs[i]].commit == bytes32(0), \\\"Already committed this vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n\\n if (round.totalCommitted == round.votes.length) core.passPeriod(_disputeID);\\n }\\n\\n /** @dev Sets the caller's choices for the specified votes.\\n * `O(n)` where\\n * `n` is the number of votes.\\n * @param _disputeID The ID of the dispute.\\n * @param _voteIDs The IDs of the votes.\\n * @param _choice The choice.\\n * @param _salt The salt for the commit if the votes were hidden.\\n */\\n function castVote(\\n uint256 _disputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt\\n ) external {\\n require(core.getCurrentPeriod(_disputeID) == KlerosCore.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n bool hiddenVotes = core.areVotesHidden(core.getSubcourtID(_disputeID));\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _salt)),\\n \\\"The commit must match the choice in subcourts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n\\n // Automatically switch period when voting is finished.\\n if (round.totalVoted == round.votes.length) core.passPeriod(_disputeID);\\n }\\n\\n /** @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n * Note that the surplus deposit will be reimbursed.\\n * @param _disputeID Index of the dispute in Kleros Core contract.\\n * @param _choice A choice that receives funding.\\n */\\n function fundAppeal(uint256 _disputeID, uint256 _choice) external payable {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_disputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n if (this.currentRuling(_disputeID) == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_disputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_disputeID, dispute.rounds.length - 1, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_disputeID, dispute.rounds.length - 1, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.tied = true;\\n core.appeal{value: appealCost}(_disputeID);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /** @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n * @param _disputeID Index of the dispute in Kleros Core contract.\\n * @param _beneficiary The address whose rewards to withdraw.\\n * @param _round The round the caller wants to withdraw from.\\n * @param _choice The ruling option that the caller wants to withdraw from.\\n * @return amount The withdrawn amount.\\n */\\n function withdrawFeesAndRewards(\\n uint256 _disputeID,\\n address payable _beneficiary,\\n uint256 _round,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n require(core.isRuled(_disputeID), \\\"Dispute should be resolved.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[_round];\\n uint256 finalRuling = this.currentRuling(_disputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_disputeID, _round, _choice, _beneficiary, amount);\\n }\\n }\\n\\n /** @dev Submits evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.\\n * @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\\n */\\n function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {\\n emit Evidence(core, _evidenceGroupID, msg.sender, _evidence);\\n }\\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 override returns (uint256 ruling) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n ruling = round.tied ? 0 : round.winningChoice;\\n }\\n\\n /** @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n * @param _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 override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n Vote storage vote = dispute.rounds[_round].votes[_voteID];\\n\\n if (vote.voted && (vote.choice == lastRound.winningChoice || lastRound.tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /** @dev Gets the number of jurors who are eligible to a reward in this round.\\n * @param _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 override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n Round storage currentRound = dispute.rounds[_round];\\n uint256 winningChoice = lastRound.winningChoice;\\n\\n if (currentRound.totalVoted == 0 || (!lastRound.tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (lastRound.tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\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 override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Vote storage vote = dispute.rounds[_round].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _disputeID,\\n uint256 _round,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Round storage round = dispute.rounds[_round];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _disputeID,\\n uint256 _round,\\n uint256 _voteID\\n )\\n external\\n view\\n override\\n returns (\\n address account,\\n bytes32 commit,\\n uint256 choice,\\n bool voted\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_disputeID]];\\n Vote storage vote = dispute.rounds[_round].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /** @dev RNG function\\n * @return rn A random number.\\n */\\n function getRandomNumber() internal returns (uint256) {\\n return rng.getUncorrelatedRN(block.number);\\n }\\n\\n /** @dev Retrieves a juror's address from the stake path ID.\\n * @param _stakePathID The stake path ID to unpack.\\n * @return account The account.\\n */\\n function stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2187fd39877efa27c653c4ff7729d80f62310e4aa8e9e61c9c3b3b86c3e3aa63\",\"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\"},\"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 raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n */\\n event Evidence(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _evidenceGroupID,\\n address indexed _party,\\n string _evidence\\n );\\n}\\n\",\"keccak256\":\"0xbd6a3d07e2e192f521340f62965aae59e0ece36cf4ae6918d461725e6a51b70c\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@clesaege]\\n * @reviewers: [@remedcu]\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @title Random Number Generator Standard\\n * @author Cl\\u00e9ment Lesaege - \\n * @dev This is an abstract contract\\n */\\nabstract contract RNG {\\n /**\\n * @dev Contribute to the reward of a random number.\\n * @param _block Block the random number is linked to.\\n */\\n function contribute(uint256 _block) public payable virtual;\\n\\n /**\\n * @dev Request a random number.\\n * @param _block Block linked to the request.\\n */\\n function requestRN(uint256 _block) public payable {\\n contribute(_block);\\n }\\n\\n /**\\n * @dev Get the random number.\\n * @param _block Block the random number is linked to.\\n * @return RN Random Number. If the number is not ready or has not been required 0 instead.\\n */\\n function getRN(uint256 _block) public virtual returns (uint256 RN);\\n\\n /**\\n * @dev Get a uncorrelated random number. Act like getRN but give a different number for each sender.\\n * This is to prevent users from getting correlated numbers.\\n * @param _block Block the random number is linked to.\\n * @return RN Random Number. If the number is not ready or has not been required 0 instead.\\n */\\n function getUncorrelatedRN(uint256 _block) public returns (uint256 RN) {\\n uint256 baseRN = getRN(_block);\\n if (baseRN == 0) return 0;\\n else return uint256(keccak256(abi.encode(msg.sender, baseRN)));\\n }\\n}\\n\",\"keccak256\":\"0x854bcb147fe44383cba7a5fdbcb69b3c0a9a71435c80eb73c172222da472a855\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162002c9738038062002c97833981016040819052620000349162000090565b600080546001600160a01b039485166001600160a01b031991821617909155600180549385169382169390931790925560028054919093169116179055620000e4565b6001600160a01b03811681146200008d57600080fd5b50565b600080600060608486031215620000a657600080fd5b8351620000b38162000077565b6020850151909350620000c68162000077565b6040850151909250620000d98162000077565b809150509250925092565b612ba380620000f46000396000f3fe6080604052600436106101815760003560e01c80638d31de6d116100d1578063be4676041161008a578063da3beb8c11610064578063da3beb8c146104be578063e349ad3014610360578063e4c0aaf4146104de578063f2f4eb26146104fe57600080fd5b8063be46760414610468578063c41bda611461047e578063d605787b1461049e57600080fd5b80638d31de6d146103765780638e42646014610396578063a6a7f0eb146103b6578063a7cc08fe146103d6578063b34bfaa814610422578063ba66fde71461043857600080fd5b80634b2f0ea01161013e5780635c92e2f6116101185780635c92e2f6146102d357806369f3f041146102f3578063751accd014610340578063796490f91461036057600080fd5b80634b2f0ea0146102805780634fe264fb14610293578063564a565d146102b357600080fd5b80630c340a24146101865780631200aabc146101c35780631c3db16d146101fe578063362c34791461021e5780633850f8041461023e5780633b30414714610260575b600080fd5b34801561019257600080fd5b506000546101a6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101cf57600080fd5b506101f06101de366004612478565b60046020526000908152604090205481565b6040519081526020016101ba565b34801561020a57600080fd5b506101f0610219366004612478565b61051e565b34801561022a57600080fd5b506101f06102393660046124a9565b6105a8565b34801561024a57600080fd5b5061025e610259366004612532565b610957565b005b34801561026c57600080fd5b506101a661027b366004612478565b611000565b61025e61028e366004612590565b61135c565b34801561029f57600080fd5b506101f06102ae3660046125b2565b611963565b3480156102bf57600080fd5b506101f06102ce366004612478565b611a5f565b3480156102df57600080fd5b5061025e6102ee3660046125de565b611a88565b3480156102ff57600080fd5b5061031361030e3660046125b2565b611e0c565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101ba565b34801561034c57600080fd5b5061025e61035b366004612678565b611eb7565b34801561036c57600080fd5b506101f061271081565b34801561038257600080fd5b5061025e61039136600461276b565b611f89565b3480156103a257600080fd5b5061025e6103b13660046127be565b612045565b3480156103c257600080fd5b5061025e6103d13660046127db565b612091565b3480156103e257600080fd5b506103f66103f13660046125b2565b6120e3565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101ba565b34801561042e57600080fd5b506101f0614e2081565b34801561044457600080fd5b506104586104533660046125b2565b61219c565b60405190151581526020016101ba565b34801561047457600080fd5b506101f061138881565b34801561048a57600080fd5b5061025e6104993660046127be565b61222a565b3480156104aa57600080fd5b506002546101a6906001600160a01b031681565b3480156104ca57600080fd5b506101f06104d9366004612590565b612276565b3480156104ea57600080fd5b5061025e6104f93660046127be565b61238d565b34801561050a57600080fd5b506001546101a6906001600160a01b031681565b60008181526004602052604081205460038054839290811061054257610542612827565b6000918252602082206002909102018054909250829061056490600190612853565b8154811061057457610574612827565b60009182526020909120600b90910201600381015490915060ff1661059d5780600101546105a0565b60005b949350505050565b6001546040516325bfe6d160e11b8152600481018690526000916001600160a01b031690634b7fcda290602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610616919061286a565b6106675760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b60008581526004602052604081205460038054909190811061068b5761068b612827565b9060005260206000209060020201905060008160000185815481106106b2576106b2612827565b600091825260208220604051631c3db16d60e01b8152600481018b9052600b929092020192503090631c3db16d90602401602060405180830381865afa158015610700573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610724919061288c565b600086815260078401602052604090205490915060ff1661076c576001600160a01b0387166000908152600883016020908152604080832088845290915290205493506108b2565b808514156107e25760008581526006830160205260409020546107905760006107db565b600085815260068301602090815260408083205460098601546001600160a01b038c1685526008870184528285208a86529093529220546107d191906128a5565b6107db91906128da565b93506108b2565b600081815260078301602052604090205460ff166108b25781600601600083600a0160018154811061081657610816612827565b906000526020600020015481526020019081526020016000205482600601600084600a0160008154811061084c5761084c612827565b906000526020600020015481526020019081526020016000205461087091906128ee565b60098301546001600160a01b038916600090815260088501602090815260408083208a84529091529020546108a591906128a5565b6108af91906128da565b93505b6001600160a01b03871660009081526008830160209081526040808320888452909152812055831561094c576040516001600160a01b0388169085156108fc029086906000818181858888f1505060408051898152602081018990526001600160a01b038c1694508a93508c92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b505050949350505050565b60015460405163022684db60e41b8152600481018790526002916001600160a01b0316906322684db090602401602060405180830381865afa1580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c5919061291c565b60048111156109d6576109d6612906565b14610a315760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b606482015260840161065e565b82610a735760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b604482015260640161065e565b600085815260046020526040812054600380549091908110610a9757610a97612827565b906000526020600020906002020190508060010154831115610af25760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b604482015260640161065e565b80546000908290610b0590600190612853565b81548110610b1557610b15612827565b600091825260208220600154604051637b5377bd60e11b8152600481018c9052600b9390930290910193506001600160a01b03169063d578cbac90829063f6a6ef7a90602401602060405180830381865afa158015610b78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9c919061288c565b6040518263ffffffff1660e01b8152600401610bba91815260200190565b602060405180830381865afa158015610bd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfb919061286a565b905060005b86811015610ea3573383898984818110610c1c57610c1c612827565b9050602002013581548110610c3357610c33612827565b60009182526020909120600490910201546001600160a01b031614610c9a5760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604482015260640161065e565b811580610d0d575060408051602081018890529081018690526060016040516020818303038152906040528051906020012083600001898984818110610ce257610ce2612827565b9050602002013581548110610cf957610cf9612827565b906000526020600020906004020160010154145b610d81576040805162461bcd60e51b81526020600482015260248101919091527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20737562636f7572747320776974682068696464656e20766f7465732e606482015260840161065e565b82888883818110610d9457610d94612827565b9050602002013581548110610dab57610dab612827565b600091825260209091206003600490920201015460ff1615610e045760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b604482015260640161065e565b8583898984818110610e1857610e18612827565b9050602002013581548110610e2f57610e2f612827565b6000918252602090912060026004909202010155600183898984818110610e5857610e58612827565b9050602002013581548110610e6f57610e6f612827565b60009182526020909120600490910201600301805460ff191691151591909117905580610e9b8161293d565b915050610c00565b5086869050826004016000828254610ebb91906128ee565b9091555050600085815260028301602052604081208054889290610ee09084906128ee565b90915550506001820154851415610f1057600382015460ff1615610f0b5760038201805460ff191690555b610f8a565b60018201546000908152600283016020526040808220548783529120541415610f5357600382015460ff16610f0b5760038201805460ff19166001179055610f8a565b60018201546000908152600283016020526040808220548783529120541115610f8a576001820185905560038201805460ff191690555b815460048301541415610ff6576001546040516308aea9bb60e11b8152600481018a90526001600160a01b039091169063115d537690602401600060405180830381600087803b158015610fdd57600080fd5b505af1158015610ff1573d6000803e3d6000fd5b505050505b5050505050505050565b6001546000906001600160a01b0316331461102d5760405162461bcd60e51b815260040161065e90612958565b600154604051637b5377bd60e11b8152600481018490526000916001600160a01b03169063f6a6ef7a90602401602060405180830381865afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109b919061288c565b905060006110a76123d9565b600154604051630696a8a760e51b81526004810185905291925060009182916001600160a01b03169063d2d514e090602401600060405180830381865afa1580156110f6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261111e9190810190612a1c565b92505091506000808260008151811061113957611139612827565b60200260200101518561114c9190612a89565b600089815260046020526040812054600380549394509192811061117257611172612827565b6000918252602082206002909102018054909250829061119490600190612853565b815481106111a4576111a4612827565b90600052602060002090600b020190505b84516111c185886128a5565b6111cc9060016128ee565b101561124e5760015b868111611248576000816111e9878a6128a5565b6111f391906128ee565b9050600087828151811061120957611209612827565b6020026020010151905080861061122b576112248187612853565b9550611233565b509450611248565b505080806112409061293d565b9150506111d5565b506111b5565b60015460405163de1a1e5960e01b8152600481018a9052602481018690526000916001600160a01b03169063de1a1e5990604401602060405180830381865afa15801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c3919061288c565b90506112ce8161244d565b604080516080810182526001600160a01b0383811682526000602080840182815294840182815260608501838152895460018082018c559a8552929093209451600490920290940180546001600160a01b03191691909316178255925195810195909555516002850155516003909301805460ff191693151593909317909255509998505050505050505050565b60008281526004602052604081205460038054909190811061138057611380612827565b9060005260206000209060020201905080600101548211156113e45760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e604482015260640161065e565b60015460405163afe15cfb60e01b81526004810185905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015611431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114559190612a9d565b9150915081421015801561146857508042105b6114ad5760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b604482015260640161065e565b604051631c3db16d60e01b81526004810186905260009085903090631c3db16d90602401602060405180830381865afa1580156114ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611512919061288c565b141561152157506127106115a1565b6127106113886115318585612853565b61153b91906128a5565b61154591906128da565b61154f8442612853565b1061159c5760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f73657200604482015260640161065e565b50614e205b835460009085906115b490600190612853565b815481106115c4576115c4612827565b600091825260208083208984526007600b90930201918201905260409091205490915060ff16156116375760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e0000000000604482015260640161065e565b600154604051632cf6413f60e11b8152600481018990526000916001600160a01b0316906359ec827e90602401602060405180830381865afa158015611681573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a5919061288c565b905060006127106116b685846128a5565b6116c091906128da565b6116ca90836128ee565b60008981526006850160205260408120549192509082111561177957600089815260068501602052604090205434906117039084612853565b116117285760008981526006850160205260409020546117239083612853565b61172a565b345b8854909150339061173d90600190612853565b604080518c8152602081018590528d917fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c0910160405180910390a45b33600090815260088501602090815260408083208c8452909152812080548392906117a59084906128ee565b90915550506000898152600685016020526040812080548392906117ca9084906128ee565b9091555050600089815260068501602052604090205482116118805760008981526006850160205260408120546009860180549192909161180c9084906128ee565b9091555050600a8401805460018181018355600092835260208084209092018c90558b8352600787019091526040909120805460ff19168217905588548a9161185491612853565b6040518c907fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00990600090a45b600a840154600110156119295782846009015461189d9190612853565b6009850155875460018082018a5560008a8152602090206003600b90930201918201805460ff191682179055546040516307e69b7b60e41b8152600481018d90526001600160a01b0390911690637e69b7b09086906024016000604051808303818588803b15801561190e57600080fd5b505af1158015611922573d6000803e3d6000fd5b5050505050505b8034111561195757336108fc61193f8334612853565b6040518115909202916000818181858888f150505050505b50505050505050505050565b60008381526004602052604081205460038054839290811061198757611987612827565b600091825260208220600290910201805490925082906119a990600190612853565b815481106119b9576119b9612827565b90600052602060002090600b0201905060008260000186815481106119e0576119e0612827565b90600052602060002090600b02016000018581548110611a0257611a02612827565b60009182526020909120600490910201600381015490915060ff168015611a3e5750816001015481600201541480611a3e5750600382015460ff165b15611a50576127109350505050611a58565b600093505050505b9392505050565b60038181548110611a6f57600080fd5b6000918252602090912060016002909202010154905081565b6001805460405163022684db60e41b8152600481018790526001600160a01b03909116906322684db090602401602060405180830381865afa158015611ad2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af6919061291c565b6004811115611b0757611b07612906565b14611b645760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b606482015260840161065e565b80611ba15760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b604482015260640161065e565b600084815260046020526040812054600380549091908110611bc557611bc5612827565b60009182526020822060029091020180549092508290611be790600190612853565b81548110611bf757611bf7612827565b90600052602060002090600b0201905060005b84811015611d80573382878784818110611c2657611c26612827565b9050602002013581548110611c3d57611c3d612827565b60009182526020909120600490910201546001600160a01b031614611ca45760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604482015260640161065e565b600082878784818110611cb957611cb9612827565b9050602002013581548110611cd057611cd0612827565b90600052602060002090600402016001015414611d2f5760405162461bcd60e51b815260206004820152601c60248201527f416c726561647920636f6d6d6974746564207468697320766f74652e00000000604482015260640161065e565b8382878784818110611d4357611d43612827565b9050602002013581548110611d5a57611d5a612827565b600091825260209091206001600490920201015580611d788161293d565b915050611c0a565b5084849050816005016000828254611d9891906128ee565b9091555050805460058201541415611e04576001546040516308aea9bb60e11b8152600481018890526001600160a01b039091169063115d537690602401600060405180830381600087803b158015611df057600080fd5b505af1158015611957573d6000803e3d6000fd5b505050505050565b60008060008060008060006003600460008c81526020019081526020016000205481548110611e3d57611e3d612827565b906000526020600020906002020190506000816000018a81548110611e6457611e64612827565b600091825260208083206001600b909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b6000546001600160a01b03163314611ee15760405162461bcd60e51b815260040161065e90612ac1565b6000836001600160a01b03168383604051611efc9190612b03565b60006040518083038185875af1925050503d8060008114611f39576040519150601f19603f3d011682016040523d82523d6000602084013e611f3e565b606091505b5050905080611f835760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b604482015260640161065e565b50505050565b6001546001600160a01b03163314611fb35760405162461bcd60e51b815260040161065e90612958565b50506003805460018082018355600282027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8101949094557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9093018054808501825560009182526020808320600b909202909101909301805460ff1916909417909355928252600490526040902055565b6000546001600160a01b0316331461206f5760405162461bcd60e51b815260040161065e90612ac1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600154604051339185916001600160a01b03909116907fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c906120d69087908790612b3e565b60405180910390a4505050565b60008060008060006003600460008a8152602001908152602001600020548154811061211157612111612827565b90600052602060002090600202019050600081600001888154811061213857612138612827565b90600052602060002090600b0201600001878154811061215a5761215a612827565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6000838152600460205260408120546003805483929081106121c0576121c0612827565b9060005260206000209060020201905060008160000185815481106121e7576121e7612827565b90600052602060002090600b0201600001848154811061220957612209612827565b600091825260209091206004909102016003015460ff169695505050505050565b6000546001600160a01b031633146122545760405162461bcd60e51b815260040161065e90612ac1565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526004602052604081205460038054839290811061229a5761229a612827565b600091825260208220600290910201805490925082906122bc90600190612853565b815481106122cc576122cc612827565b90600052602060002090600b0201905060008260000185815481106122f3576122f3612827565b90600052602060002090600b0201905060008260010154905081600401546000148061233d5750600383015460ff1615801561233d57506000818152600283016020526040902054155b1561234f576000945050505050612387565b600383015460ff161561236b5750600401549250612387915050565b6000908152600290910160205260409020549250612387915050565b92915050565b6000546001600160a01b031633146123b75760405162461bcd60e51b815260040161065e90612ac1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600254604051630e39b00f60e11b81524360048201526000916001600160a01b031690631c73601e906024016020604051808303816000875af1158015612424573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612448919061288c565b905090565b600060405160005b60148110156124705783811a81600c84010153600101612455565b505192915050565b60006020828403121561248a57600080fd5b5035919050565b6001600160a01b03811681146124a657600080fd5b50565b600080600080608085870312156124bf57600080fd5b8435935060208501356124d181612491565b93969395505050506040820135916060013590565b60008083601f8401126124f857600080fd5b50813567ffffffffffffffff81111561251057600080fd5b6020830191508360208260051b850101111561252b57600080fd5b9250929050565b60008060008060006080868803121561254a57600080fd5b85359450602086013567ffffffffffffffff81111561256857600080fd5b612574888289016124e6565b9699909850959660408101359660609091013595509350505050565b600080604083850312156125a357600080fd5b50508035926020909101359150565b6000806000606084860312156125c757600080fd5b505081359360208301359350604090920135919050565b600080600080606085870312156125f457600080fd5b84359350602085013567ffffffffffffffff81111561261257600080fd5b61261e878288016124e6565b9598909750949560400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561267057612670612631565b604052919050565b60008060006060848603121561268d57600080fd5b833561269881612491565b92506020848101359250604085013567ffffffffffffffff808211156126bd57600080fd5b818701915087601f8301126126d157600080fd5b8135818111156126e3576126e3612631565b6126f5601f8201601f19168501612647565b9150808252888482850101111561270b57600080fd5b80848401858401376000848284010152508093505050509250925092565b60008083601f84011261273b57600080fd5b50813567ffffffffffffffff81111561275357600080fd5b60208301915083602082850101111561252b57600080fd5b6000806000806060858703121561278157600080fd5b8435935060208501359250604085013567ffffffffffffffff8111156127a657600080fd5b6127b287828801612729565b95989497509550505050565b6000602082840312156127d057600080fd5b8135611a5881612491565b6000806000604084860312156127f057600080fd5b83359250602084013567ffffffffffffffff81111561280e57600080fd5b61281a86828701612729565b9497909650939450505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156128655761286561283d565b500390565b60006020828403121561287c57600080fd5b81518015158114611a5857600080fd5b60006020828403121561289e57600080fd5b5051919050565b60008160001904831182151516156128bf576128bf61283d565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826128e9576128e96128c4565b500490565b600082198211156129015761290161283d565b500190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561292e57600080fd5b815160058110611a5857600080fd5b60006000198214156129515761295161283d565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600082601f8301126129ad57600080fd5b8151602067ffffffffffffffff8211156129c9576129c9612631565b8160051b6129d8828201612647565b92835284810182019282810190878511156129f257600080fd5b83870192505b84831015612a11578251825291830191908301906129f8565b979650505050505050565b600080600060608486031215612a3157600080fd5b83519250602084015167ffffffffffffffff80821115612a5057600080fd5b612a5c8783880161299c565b93506040860151915080821115612a7257600080fd5b50612a7f8682870161299c565b9150509250925092565b600082612a9857612a986128c4565b500690565b60008060408385031215612ab057600080fd5b505080516020909101519092909150565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612b245760208186018101518583015201612b0a565b81811115612b33576000828501525b509190910192915050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fea26469706673582212207551bf29f13c51981e72c747ae1295cb56e3b16976c137c5d15a933b3f5913c764736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106101815760003560e01c80638d31de6d116100d1578063be4676041161008a578063da3beb8c11610064578063da3beb8c146104be578063e349ad3014610360578063e4c0aaf4146104de578063f2f4eb26146104fe57600080fd5b8063be46760414610468578063c41bda611461047e578063d605787b1461049e57600080fd5b80638d31de6d146103765780638e42646014610396578063a6a7f0eb146103b6578063a7cc08fe146103d6578063b34bfaa814610422578063ba66fde71461043857600080fd5b80634b2f0ea01161013e5780635c92e2f6116101185780635c92e2f6146102d357806369f3f041146102f3578063751accd014610340578063796490f91461036057600080fd5b80634b2f0ea0146102805780634fe264fb14610293578063564a565d146102b357600080fd5b80630c340a24146101865780631200aabc146101c35780631c3db16d146101fe578063362c34791461021e5780633850f8041461023e5780633b30414714610260575b600080fd5b34801561019257600080fd5b506000546101a6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101cf57600080fd5b506101f06101de366004612478565b60046020526000908152604090205481565b6040519081526020016101ba565b34801561020a57600080fd5b506101f0610219366004612478565b61051e565b34801561022a57600080fd5b506101f06102393660046124a9565b6105a8565b34801561024a57600080fd5b5061025e610259366004612532565b610957565b005b34801561026c57600080fd5b506101a661027b366004612478565b611000565b61025e61028e366004612590565b61135c565b34801561029f57600080fd5b506101f06102ae3660046125b2565b611963565b3480156102bf57600080fd5b506101f06102ce366004612478565b611a5f565b3480156102df57600080fd5b5061025e6102ee3660046125de565b611a88565b3480156102ff57600080fd5b5061031361030e3660046125b2565b611e0c565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101ba565b34801561034c57600080fd5b5061025e61035b366004612678565b611eb7565b34801561036c57600080fd5b506101f061271081565b34801561038257600080fd5b5061025e61039136600461276b565b611f89565b3480156103a257600080fd5b5061025e6103b13660046127be565b612045565b3480156103c257600080fd5b5061025e6103d13660046127db565b612091565b3480156103e257600080fd5b506103f66103f13660046125b2565b6120e3565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101ba565b34801561042e57600080fd5b506101f0614e2081565b34801561044457600080fd5b506104586104533660046125b2565b61219c565b60405190151581526020016101ba565b34801561047457600080fd5b506101f061138881565b34801561048a57600080fd5b5061025e6104993660046127be565b61222a565b3480156104aa57600080fd5b506002546101a6906001600160a01b031681565b3480156104ca57600080fd5b506101f06104d9366004612590565b612276565b3480156104ea57600080fd5b5061025e6104f93660046127be565b61238d565b34801561050a57600080fd5b506001546101a6906001600160a01b031681565b60008181526004602052604081205460038054839290811061054257610542612827565b6000918252602082206002909102018054909250829061056490600190612853565b8154811061057457610574612827565b60009182526020909120600b90910201600381015490915060ff1661059d5780600101546105a0565b60005b949350505050565b6001546040516325bfe6d160e11b8152600481018690526000916001600160a01b031690634b7fcda290602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610616919061286a565b6106675760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b60008581526004602052604081205460038054909190811061068b5761068b612827565b9060005260206000209060020201905060008160000185815481106106b2576106b2612827565b600091825260208220604051631c3db16d60e01b8152600481018b9052600b929092020192503090631c3db16d90602401602060405180830381865afa158015610700573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610724919061288c565b600086815260078401602052604090205490915060ff1661076c576001600160a01b0387166000908152600883016020908152604080832088845290915290205493506108b2565b808514156107e25760008581526006830160205260409020546107905760006107db565b600085815260068301602090815260408083205460098601546001600160a01b038c1685526008870184528285208a86529093529220546107d191906128a5565b6107db91906128da565b93506108b2565b600081815260078301602052604090205460ff166108b25781600601600083600a0160018154811061081657610816612827565b906000526020600020015481526020019081526020016000205482600601600084600a0160008154811061084c5761084c612827565b906000526020600020015481526020019081526020016000205461087091906128ee565b60098301546001600160a01b038916600090815260088501602090815260408083208a84529091529020546108a591906128a5565b6108af91906128da565b93505b6001600160a01b03871660009081526008830160209081526040808320888452909152812055831561094c576040516001600160a01b0388169085156108fc029086906000818181858888f1505060408051898152602081018990526001600160a01b038c1694508a93508c92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b505050949350505050565b60015460405163022684db60e41b8152600481018790526002916001600160a01b0316906322684db090602401602060405180830381865afa1580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c5919061291c565b60048111156109d6576109d6612906565b14610a315760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b606482015260840161065e565b82610a735760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b604482015260640161065e565b600085815260046020526040812054600380549091908110610a9757610a97612827565b906000526020600020906002020190508060010154831115610af25760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b604482015260640161065e565b80546000908290610b0590600190612853565b81548110610b1557610b15612827565b600091825260208220600154604051637b5377bd60e11b8152600481018c9052600b9390930290910193506001600160a01b03169063d578cbac90829063f6a6ef7a90602401602060405180830381865afa158015610b78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9c919061288c565b6040518263ffffffff1660e01b8152600401610bba91815260200190565b602060405180830381865afa158015610bd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfb919061286a565b905060005b86811015610ea3573383898984818110610c1c57610c1c612827565b9050602002013581548110610c3357610c33612827565b60009182526020909120600490910201546001600160a01b031614610c9a5760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604482015260640161065e565b811580610d0d575060408051602081018890529081018690526060016040516020818303038152906040528051906020012083600001898984818110610ce257610ce2612827565b9050602002013581548110610cf957610cf9612827565b906000526020600020906004020160010154145b610d81576040805162461bcd60e51b81526020600482015260248101919091527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20737562636f7572747320776974682068696464656e20766f7465732e606482015260840161065e565b82888883818110610d9457610d94612827565b9050602002013581548110610dab57610dab612827565b600091825260209091206003600490920201015460ff1615610e045760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b604482015260640161065e565b8583898984818110610e1857610e18612827565b9050602002013581548110610e2f57610e2f612827565b6000918252602090912060026004909202010155600183898984818110610e5857610e58612827565b9050602002013581548110610e6f57610e6f612827565b60009182526020909120600490910201600301805460ff191691151591909117905580610e9b8161293d565b915050610c00565b5086869050826004016000828254610ebb91906128ee565b9091555050600085815260028301602052604081208054889290610ee09084906128ee565b90915550506001820154851415610f1057600382015460ff1615610f0b5760038201805460ff191690555b610f8a565b60018201546000908152600283016020526040808220548783529120541415610f5357600382015460ff16610f0b5760038201805460ff19166001179055610f8a565b60018201546000908152600283016020526040808220548783529120541115610f8a576001820185905560038201805460ff191690555b815460048301541415610ff6576001546040516308aea9bb60e11b8152600481018a90526001600160a01b039091169063115d537690602401600060405180830381600087803b158015610fdd57600080fd5b505af1158015610ff1573d6000803e3d6000fd5b505050505b5050505050505050565b6001546000906001600160a01b0316331461102d5760405162461bcd60e51b815260040161065e90612958565b600154604051637b5377bd60e11b8152600481018490526000916001600160a01b03169063f6a6ef7a90602401602060405180830381865afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109b919061288c565b905060006110a76123d9565b600154604051630696a8a760e51b81526004810185905291925060009182916001600160a01b03169063d2d514e090602401600060405180830381865afa1580156110f6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261111e9190810190612a1c565b92505091506000808260008151811061113957611139612827565b60200260200101518561114c9190612a89565b600089815260046020526040812054600380549394509192811061117257611172612827565b6000918252602082206002909102018054909250829061119490600190612853565b815481106111a4576111a4612827565b90600052602060002090600b020190505b84516111c185886128a5565b6111cc9060016128ee565b101561124e5760015b868111611248576000816111e9878a6128a5565b6111f391906128ee565b9050600087828151811061120957611209612827565b6020026020010151905080861061122b576112248187612853565b9550611233565b509450611248565b505080806112409061293d565b9150506111d5565b506111b5565b60015460405163de1a1e5960e01b8152600481018a9052602481018690526000916001600160a01b03169063de1a1e5990604401602060405180830381865afa15801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c3919061288c565b90506112ce8161244d565b604080516080810182526001600160a01b0383811682526000602080840182815294840182815260608501838152895460018082018c559a8552929093209451600490920290940180546001600160a01b03191691909316178255925195810195909555516002850155516003909301805460ff191693151593909317909255509998505050505050505050565b60008281526004602052604081205460038054909190811061138057611380612827565b9060005260206000209060020201905080600101548211156113e45760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e604482015260640161065e565b60015460405163afe15cfb60e01b81526004810185905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015611431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114559190612a9d565b9150915081421015801561146857508042105b6114ad5760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b604482015260640161065e565b604051631c3db16d60e01b81526004810186905260009085903090631c3db16d90602401602060405180830381865afa1580156114ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611512919061288c565b141561152157506127106115a1565b6127106113886115318585612853565b61153b91906128a5565b61154591906128da565b61154f8442612853565b1061159c5760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f73657200604482015260640161065e565b50614e205b835460009085906115b490600190612853565b815481106115c4576115c4612827565b600091825260208083208984526007600b90930201918201905260409091205490915060ff16156116375760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e0000000000604482015260640161065e565b600154604051632cf6413f60e11b8152600481018990526000916001600160a01b0316906359ec827e90602401602060405180830381865afa158015611681573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a5919061288c565b905060006127106116b685846128a5565b6116c091906128da565b6116ca90836128ee565b60008981526006850160205260408120549192509082111561177957600089815260068501602052604090205434906117039084612853565b116117285760008981526006850160205260409020546117239083612853565b61172a565b345b8854909150339061173d90600190612853565b604080518c8152602081018590528d917fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c0910160405180910390a45b33600090815260088501602090815260408083208c8452909152812080548392906117a59084906128ee565b90915550506000898152600685016020526040812080548392906117ca9084906128ee565b9091555050600089815260068501602052604090205482116118805760008981526006850160205260408120546009860180549192909161180c9084906128ee565b9091555050600a8401805460018181018355600092835260208084209092018c90558b8352600787019091526040909120805460ff19168217905588548a9161185491612853565b6040518c907fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00990600090a45b600a840154600110156119295782846009015461189d9190612853565b6009850155875460018082018a5560008a8152602090206003600b90930201918201805460ff191682179055546040516307e69b7b60e41b8152600481018d90526001600160a01b0390911690637e69b7b09086906024016000604051808303818588803b15801561190e57600080fd5b505af1158015611922573d6000803e3d6000fd5b5050505050505b8034111561195757336108fc61193f8334612853565b6040518115909202916000818181858888f150505050505b50505050505050505050565b60008381526004602052604081205460038054839290811061198757611987612827565b600091825260208220600290910201805490925082906119a990600190612853565b815481106119b9576119b9612827565b90600052602060002090600b0201905060008260000186815481106119e0576119e0612827565b90600052602060002090600b02016000018581548110611a0257611a02612827565b60009182526020909120600490910201600381015490915060ff168015611a3e5750816001015481600201541480611a3e5750600382015460ff165b15611a50576127109350505050611a58565b600093505050505b9392505050565b60038181548110611a6f57600080fd5b6000918252602090912060016002909202010154905081565b6001805460405163022684db60e41b8152600481018790526001600160a01b03909116906322684db090602401602060405180830381865afa158015611ad2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af6919061291c565b6004811115611b0757611b07612906565b14611b645760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b606482015260840161065e565b80611ba15760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b604482015260640161065e565b600084815260046020526040812054600380549091908110611bc557611bc5612827565b60009182526020822060029091020180549092508290611be790600190612853565b81548110611bf757611bf7612827565b90600052602060002090600b0201905060005b84811015611d80573382878784818110611c2657611c26612827565b9050602002013581548110611c3d57611c3d612827565b60009182526020909120600490910201546001600160a01b031614611ca45760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604482015260640161065e565b600082878784818110611cb957611cb9612827565b9050602002013581548110611cd057611cd0612827565b90600052602060002090600402016001015414611d2f5760405162461bcd60e51b815260206004820152601c60248201527f416c726561647920636f6d6d6974746564207468697320766f74652e00000000604482015260640161065e565b8382878784818110611d4357611d43612827565b9050602002013581548110611d5a57611d5a612827565b600091825260209091206001600490920201015580611d788161293d565b915050611c0a565b5084849050816005016000828254611d9891906128ee565b9091555050805460058201541415611e04576001546040516308aea9bb60e11b8152600481018890526001600160a01b039091169063115d537690602401600060405180830381600087803b158015611df057600080fd5b505af1158015611957573d6000803e3d6000fd5b505050505050565b60008060008060008060006003600460008c81526020019081526020016000205481548110611e3d57611e3d612827565b906000526020600020906002020190506000816000018a81548110611e6457611e64612827565b600091825260208083206001600b909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b6000546001600160a01b03163314611ee15760405162461bcd60e51b815260040161065e90612ac1565b6000836001600160a01b03168383604051611efc9190612b03565b60006040518083038185875af1925050503d8060008114611f39576040519150601f19603f3d011682016040523d82523d6000602084013e611f3e565b606091505b5050905080611f835760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b604482015260640161065e565b50505050565b6001546001600160a01b03163314611fb35760405162461bcd60e51b815260040161065e90612958565b50506003805460018082018355600282027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8101949094557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9093018054808501825560009182526020808320600b909202909101909301805460ff1916909417909355928252600490526040902055565b6000546001600160a01b0316331461206f5760405162461bcd60e51b815260040161065e90612ac1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600154604051339185916001600160a01b03909116907fdccf2f8b2cc26eafcd61905cba744cff4b81d14740725f6376390dc6298a6a3c906120d69087908790612b3e565b60405180910390a4505050565b60008060008060006003600460008a8152602001908152602001600020548154811061211157612111612827565b90600052602060002090600202019050600081600001888154811061213857612138612827565b90600052602060002090600b0201600001878154811061215a5761215a612827565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6000838152600460205260408120546003805483929081106121c0576121c0612827565b9060005260206000209060020201905060008160000185815481106121e7576121e7612827565b90600052602060002090600b0201600001848154811061220957612209612827565b600091825260209091206004909102016003015460ff169695505050505050565b6000546001600160a01b031633146122545760405162461bcd60e51b815260040161065e90612ac1565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526004602052604081205460038054839290811061229a5761229a612827565b600091825260208220600290910201805490925082906122bc90600190612853565b815481106122cc576122cc612827565b90600052602060002090600b0201905060008260000185815481106122f3576122f3612827565b90600052602060002090600b0201905060008260010154905081600401546000148061233d5750600383015460ff1615801561233d57506000818152600283016020526040902054155b1561234f576000945050505050612387565b600383015460ff161561236b5750600401549250612387915050565b6000908152600290910160205260409020549250612387915050565b92915050565b6000546001600160a01b031633146123b75760405162461bcd60e51b815260040161065e90612ac1565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600254604051630e39b00f60e11b81524360048201526000916001600160a01b031690631c73601e906024016020604051808303816000875af1158015612424573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612448919061288c565b905090565b600060405160005b60148110156124705783811a81600c84010153600101612455565b505192915050565b60006020828403121561248a57600080fd5b5035919050565b6001600160a01b03811681146124a657600080fd5b50565b600080600080608085870312156124bf57600080fd5b8435935060208501356124d181612491565b93969395505050506040820135916060013590565b60008083601f8401126124f857600080fd5b50813567ffffffffffffffff81111561251057600080fd5b6020830191508360208260051b850101111561252b57600080fd5b9250929050565b60008060008060006080868803121561254a57600080fd5b85359450602086013567ffffffffffffffff81111561256857600080fd5b612574888289016124e6565b9699909850959660408101359660609091013595509350505050565b600080604083850312156125a357600080fd5b50508035926020909101359150565b6000806000606084860312156125c757600080fd5b505081359360208301359350604090920135919050565b600080600080606085870312156125f457600080fd5b84359350602085013567ffffffffffffffff81111561261257600080fd5b61261e878288016124e6565b9598909750949560400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561267057612670612631565b604052919050565b60008060006060848603121561268d57600080fd5b833561269881612491565b92506020848101359250604085013567ffffffffffffffff808211156126bd57600080fd5b818701915087601f8301126126d157600080fd5b8135818111156126e3576126e3612631565b6126f5601f8201601f19168501612647565b9150808252888482850101111561270b57600080fd5b80848401858401376000848284010152508093505050509250925092565b60008083601f84011261273b57600080fd5b50813567ffffffffffffffff81111561275357600080fd5b60208301915083602082850101111561252b57600080fd5b6000806000806060858703121561278157600080fd5b8435935060208501359250604085013567ffffffffffffffff8111156127a657600080fd5b6127b287828801612729565b95989497509550505050565b6000602082840312156127d057600080fd5b8135611a5881612491565b6000806000604084860312156127f057600080fd5b83359250602084013567ffffffffffffffff81111561280e57600080fd5b61281a86828701612729565b9497909650939450505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156128655761286561283d565b500390565b60006020828403121561287c57600080fd5b81518015158114611a5857600080fd5b60006020828403121561289e57600080fd5b5051919050565b60008160001904831182151516156128bf576128bf61283d565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826128e9576128e96128c4565b500490565b600082198211156129015761290161283d565b500190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561292e57600080fd5b815160058110611a5857600080fd5b60006000198214156129515761295161283d565b5060010190565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600082601f8301126129ad57600080fd5b8151602067ffffffffffffffff8211156129c9576129c9612631565b8160051b6129d8828201612647565b92835284810182019282810190878511156129f257600080fd5b83870192505b84831015612a11578251825291830191908301906129f8565b979650505050505050565b600080600060608486031215612a3157600080fd5b83519250602084015167ffffffffffffffff80821115612a5057600080fd5b612a5c8783880161299c565b93506040860151915080821115612a7257600080fd5b50612a7f8682870161299c565b9150509250925092565b600082612a9857612a986128c4565b500690565b60008060408385031215612ab057600080fd5b505080516020909101519092909150565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612b245760208186018101518583015201612b0a565b81811115612b33576000828501525b509190910192915050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fea26469706673582212207551bf29f13c51981e72c747ae1295cb56e3b16976c137c5d15a933b3f5913c764736f6c634300080a0033", "devdoc": { "kind": "dev", "methods": { @@ -802,6 +851,13 @@ "_0": "Whether the voter was active or not." } }, + "submitEvidence(uint256,string)": { + "details": "Submits evidence.", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.", + "_evidenceGroupID": "Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID." + } + }, "withdrawFeesAndRewards(uint256,address,uint256,uint256)": { "details": "Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.", "params": { @@ -826,7 +882,7 @@ "storageLayout": { "storage": [ { - "astId": 4022, + "astId": 4674, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "governor", "offset": 0, @@ -834,31 +890,31 @@ "type": "t_address" }, { - "astId": 4025, + "astId": 4677, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "core", "offset": 0, "slot": "1", - "type": "t_contract(KlerosCore)4013" + "type": "t_contract(KlerosCore)4651" }, { - "astId": 4172, + "astId": 4827, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "rng", "offset": 0, "slot": "2", - "type": "t_contract(RNG)11674" + "type": "t_contract(RNG)12375" }, { - "astId": 4176, + "astId": 4831, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "disputes", "offset": 0, "slot": "3", - "type": "t_array(t_struct(Dispute)4112_storage)dyn_storage" + "type": "t_array(t_struct(Dispute)4767_storage)dyn_storage" }, { - "astId": 4180, + "astId": 4835, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "coreDisputeIDToLocal", "offset": 0, @@ -872,20 +928,20 @@ "label": "address", "numberOfBytes": "20" }, - "t_array(t_struct(Dispute)4112_storage)dyn_storage": { - "base": "t_struct(Dispute)4112_storage", + "t_array(t_struct(Dispute)4767_storage)dyn_storage": { + "base": "t_struct(Dispute)4767_storage", "encoding": "dynamic_array", "label": "struct DisputeKitClassic.Dispute[]", "numberOfBytes": "32" }, - "t_array(t_struct(Round)4148_storage)dyn_storage": { - "base": "t_struct(Round)4148_storage", + "t_array(t_struct(Round)4803_storage)dyn_storage": { + "base": "t_struct(Round)4803_storage", "encoding": "dynamic_array", "label": "struct DisputeKitClassic.Round[]", "numberOfBytes": "32" }, - "t_array(t_struct(Vote)4157_storage)dyn_storage": { - "base": "t_struct(Vote)4157_storage", + "t_array(t_struct(Vote)4812_storage)dyn_storage": { + "base": "t_struct(Vote)4812_storage", "encoding": "dynamic_array", "label": "struct DisputeKitClassic.Vote[]", "numberOfBytes": "32" @@ -906,12 +962,12 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(KlerosCore)4013": { + "t_contract(KlerosCore)4651": { "encoding": "inplace", "label": "contract KlerosCore", "numberOfBytes": "20" }, - "t_contract(RNG)11674": { + "t_contract(RNG)12375": { "encoding": "inplace", "label": "contract RNG", "numberOfBytes": "20" @@ -937,20 +993,20 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(Dispute)4112_storage": { + "t_struct(Dispute)4767_storage": { "encoding": "inplace", "label": "struct DisputeKitClassic.Dispute", "members": [ { - "astId": 4109, + "astId": 4764, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "rounds", "offset": 0, "slot": "0", - "type": "t_array(t_struct(Round)4148_storage)dyn_storage" + "type": "t_array(t_struct(Round)4803_storage)dyn_storage" }, { - "astId": 4111, + "astId": 4766, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "numberOfChoices", "offset": 0, @@ -960,20 +1016,20 @@ ], "numberOfBytes": "64" }, - "t_struct(Round)4148_storage": { + "t_struct(Round)4803_storage": { "encoding": "inplace", "label": "struct DisputeKitClassic.Round", "members": [ { - "astId": 4116, + "astId": 4771, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "votes", "offset": 0, "slot": "0", - "type": "t_array(t_struct(Vote)4157_storage)dyn_storage" + "type": "t_array(t_struct(Vote)4812_storage)dyn_storage" }, { - "astId": 4118, + "astId": 4773, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "winningChoice", "offset": 0, @@ -981,7 +1037,7 @@ "type": "t_uint256" }, { - "astId": 4122, + "astId": 4777, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "counts", "offset": 0, @@ -989,7 +1045,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 4124, + "astId": 4779, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "tied", "offset": 0, @@ -997,7 +1053,7 @@ "type": "t_bool" }, { - "astId": 4126, + "astId": 4781, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "totalVoted", "offset": 0, @@ -1005,7 +1061,7 @@ "type": "t_uint256" }, { - "astId": 4128, + "astId": 4783, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "totalCommitted", "offset": 0, @@ -1013,7 +1069,7 @@ "type": "t_uint256" }, { - "astId": 4132, + "astId": 4787, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "paidFees", "offset": 0, @@ -1021,7 +1077,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 4136, + "astId": 4791, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "hasPaid", "offset": 0, @@ -1029,7 +1085,7 @@ "type": "t_mapping(t_uint256,t_bool)" }, { - "astId": 4142, + "astId": 4797, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "contributions", "offset": 0, @@ -1037,7 +1093,7 @@ "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" }, { - "astId": 4144, + "astId": 4799, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "feeRewards", "offset": 0, @@ -1045,7 +1101,7 @@ "type": "t_uint256" }, { - "astId": 4147, + "astId": 4802, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "fundedChoices", "offset": 0, @@ -1055,12 +1111,12 @@ ], "numberOfBytes": "352" }, - "t_struct(Vote)4157_storage": { + "t_struct(Vote)4812_storage": { "encoding": "inplace", "label": "struct DisputeKitClassic.Vote", "members": [ { - "astId": 4150, + "astId": 4805, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "account", "offset": 0, @@ -1068,7 +1124,7 @@ "type": "t_address" }, { - "astId": 4152, + "astId": 4807, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "commit", "offset": 0, @@ -1076,7 +1132,7 @@ "type": "t_bytes32" }, { - "astId": 4154, + "astId": 4809, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "choice", "offset": 0, @@ -1084,7 +1140,7 @@ "type": "t_uint256" }, { - "astId": 4156, + "astId": 4811, "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", "label": "voted", "offset": 0, diff --git a/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json b/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json index 2b35f8ad8..ac27b4dc6 100644 --- a/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json +++ b/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json @@ -1,5 +1,5 @@ { - "address": "0x34E520dc1d2Db660113b64724e14CEdCD01Ee879", + "address": "0x0b9e03455Fed83f209Fa7ce596c93ba6aBAd1f46", "abi": [ { "inputs": [ @@ -131,28 +131,28 @@ "type": "function" } ], - "transactionHash": "0x0af34fa80e0381978f1f1fb7ba3a7586b6b36b38f0feb8a03d4f252a2d0e8178", + "transactionHash": "0x8be78ae0b525d0fa74956c8fa9dfd82e73b37e0c742ebee0a8452cfa2e4d0bc8", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x34E520dc1d2Db660113b64724e14CEdCD01Ee879", + "contractAddress": "0x0b9e03455Fed83f209Fa7ce596c93ba6aBAd1f46", "transactionIndex": 0, - "gasUsed": "3164989", + "gasUsed": "3163802", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf161773cb59c122354aef8cf81465f3ff20d04bd8985b7df19fecc6442ce02cf", - "transactionHash": "0x0af34fa80e0381978f1f1fb7ba3a7586b6b36b38f0feb8a03d4f252a2d0e8178", + "blockHash": "0x1429a648bb019eca3b938c71d358c90d9eec53ce40e277623848fbcbd69fcad7", + "transactionHash": "0x8be78ae0b525d0fa74956c8fa9dfd82e73b37e0c742ebee0a8452cfa2e4d0bc8", "logs": [], - "blockNumber": 9361451, - "cumulativeGasUsed": "122089", + "blockNumber": 9610369, + "cumulativeGasUsed": "122282", "status": 1, "byzantium": true }, "args": [ - "0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD", - "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB" + "0x1406bC99873d16Cde3491F809f1Af9442cb5A338", + "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C" ], "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISafeBridge\",\"name\":\"_safebridge\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastBridgeReceiver\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"OutgoingMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"fastBridgeReceiver\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastSender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safebridge\",\"outputs\":[{\"internalType\":\"contract ISafeBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"sendFast\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"sendSafe\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_fastSender\",\"type\":\"address\"}],\"name\":\"setFastSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"sendFast(address,bytes)\":{\"params\":{\"_calldata\":\"The receiving domain encoded message data.\",\"_receiver\":\"The L1 contract address who will receive the calldata\"}},\"sendSafe(address,bytes)\":{\"params\":{\"_calldata\":\"The receiving domain encoded message data.\",\"_receiver\":\"The L1 contract address who will receive the calldata\"}}},\"version\":1},\"userdoc\":{\"events\":{\"OutgoingMessage(address,bytes32,bytes)\":{\"notice\":\"The bridgers need to watch for these events and relay the messageHash on the FastBridgeReceiver.\"}},\"kind\":\"user\",\"methods\":{\"sendFast(address,bytes)\":{\"notice\":\"Sends an arbitrary message from one domain to another via the fast bridge mechanism\"},\"sendSafe(address,bytes)\":{\"notice\":\"Sends an arbitrary message from one domain to another via the safe bridge mechanism, which relies on the chain's native bridge. It is unnecessary during normal operations but essential only in case of challenge. It may require some ETH (or whichever native token) to pay for the bridging cost, depending on the underlying safe bridge.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridge/FastBridgeSender.sol\":\"FastBridgeSender\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/bridge/FastBridgeSender.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 \\\"./interfaces/ISafeBridge.sol\\\";\\nimport \\\"./interfaces/IFastBridgeSender.sol\\\";\\nimport \\\"./interfaces/IFastBridgeReceiver.sol\\\";\\n\\ncontract FastBridgeSender is IFastBridgeSender {\\n ISafeBridge public safebridge;\\n IFastBridgeReceiver public fastBridgeReceiver;\\n address public fastSender;\\n\\n /**\\n * The bridgers need to watch for these events and\\n * relay the messageHash on the FastBridgeReceiver.\\n */\\n event OutgoingMessage(address target, bytes32 messageHash, bytes message);\\n\\n constructor(ISafeBridge _safebridge, IFastBridgeReceiver _fastBridgeReceiver) {\\n safebridge = _safebridge;\\n fastBridgeReceiver = _fastBridgeReceiver;\\n }\\n\\n function setFastSender(address _fastSender) external {\\n require(fastSender == address(0));\\n fastSender = _fastSender;\\n }\\n\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the fast bridge mechanism\\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 require(msg.sender == fastSender, \\\"Access not allowed: Fast Sender only.\\\");\\n\\n // Encode the receiver address with the function signature + arguments i.e calldata\\n bytes memory encodedData = abi.encode(_receiver, _calldata);\\n\\n emit OutgoingMessage(_receiver, keccak256(encodedData), encodedData);\\n }\\n\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the safe bridge mechanism, which relies on the chain's native bridge.\\n *\\n * It is unnecessary during normal operations but essential only in case of challenge.\\n *\\n * It may require some ETH (or whichever native token) to pay for the bridging cost,\\n * depending on the underlying safe bridge.\\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 sendSafe(address _receiver, bytes memory _calldata) external payable {\\n // The safe bridge sends the encoded data to the FastBridgeReceiver\\n // in order for the FastBridgeReceiver to resolve any potential\\n // challenges and then forwards the message to the actual\\n // intended recipient encoded in `data`\\n // TODO: For this encodedData needs to be wrapped into an\\n // IFastBridgeReceiver function.\\n // TODO: add access checks for this on the FastBridgeReceiver.\\n // TODO: how much ETH should be provided for bridging? add an ISafeBridge.bridgingCost()\\n bytes memory encodedData = abi.encode(_receiver, _calldata);\\n safebridge.sendSafe{value: msg.value}(address(fastBridgeReceiver), encodedData);\\n }\\n}\\n\",\"keccak256\":\"0x38b58a84e65e83b015c2ff77333129656a759b803118870db9e2bc0a0453c3eb\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n function claim(bytes32 _messageHash) external payable;\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _calldata) external;\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external;\\n\\n function claimDeposit() external view returns (uint256 amount);\\n}\\n\",\"keccak256\":\"0x1d7f6a6ed2c2b88f51833cba6091c57a43af2915a265395ad11aad08b1f7285d\",\"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/bridge/interfaces/ISafeBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface ISafeBridge {\\n /**\\n * Sends an arbitrary message from one domain to another.\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The L2 encoded message data.\\n * @return Unique id to track the message request/transaction.\\n */\\n function sendSafe(address _receiver, bytes memory _calldata) external payable returns (uint256);\\n}\\n\",\"keccak256\":\"0x2e7ab23dc7721f51f3d115ea3a06c590869e8671ed824987756ab4bb224845d1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516105b23803806105b283398101604081905261002f91610078565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100b2565b6001600160a01b038116811461007557600080fd5b50565b6000806040838503121561008b57600080fd5b825161009681610060565b60208401519092506100a781610060565b809150509250929050565b6104f1806100c16000396000f3fe6080604052600436106100555760003560e01c80630d85ec7e1461005a57806346c2cfee146100965780638f516b0d146100b857806398ec20ec146100d8578063be44ae1c146100f8578063d96a36ca1461010b575b600080fd5b34801561006657600080fd5b5060005461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b3480156100a257600080fd5b506100b66100b13660046102ff565b61012b565b005b3480156100c457600080fd5b5060025461007a906001600160a01b031681565b3480156100e457600080fd5b506100b66100f3366004610337565b610163565b6100b6610106366004610337565b61023c565b34801561011757600080fd5b5060015461007a906001600160a01b031681565b6002546001600160a01b03161561014157600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146101cf5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a20466173742053656e6465722060448201526437b7363c9760d91b606482015260840160405180910390fd5b600082826040516020016101e4929190610446565b60405160208183030381529060405290507f885ffc934437efa035b94d89742209ddef30dac81f0aadbb92d520cd54dc2d398382805190602001208360405161022f93929190610472565b60405180910390a1505050565b60008282604051602001610251929190610446565b60408051601f1981840301815290829052600054600154632f912b8760e21b84529193506001600160a01b039081169263be44ae1c92349261029a929116908690600401610446565b60206040518083038185885af11580156102b8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906102dd91906104a2565b50505050565b80356001600160a01b03811681146102fa57600080fd5b919050565b60006020828403121561031157600080fd5b61031a826102e3565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561034a57600080fd5b610353836102e3565b9150602083013567ffffffffffffffff8082111561037057600080fd5b818501915085601f83011261038457600080fd5b81358181111561039657610396610321565b604051601f8201601f19908116603f011681019083821181831017156103be576103be610321565b816040528281528860208487010111156103d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000815180845260005b8181101561041f57602081850181015186830182015201610403565b81811115610431576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061046a908301846103f9565b949350505050565b60018060a01b038416815282602082015260606040820152600061049960608301846103f9565b95945050505050565b6000602082840312156104b457600080fd5b505191905056fea264697066735822122027798849f47017ea415e2d49b22f4ac53ed207353ed98ef0272d1f23362730d864736f6c634300080a0033", "deployedBytecode": "0x6080604052600436106100555760003560e01c80630d85ec7e1461005a57806346c2cfee146100965780638f516b0d146100b857806398ec20ec146100d8578063be44ae1c146100f8578063d96a36ca1461010b575b600080fd5b34801561006657600080fd5b5060005461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b3480156100a257600080fd5b506100b66100b13660046102ff565b61012b565b005b3480156100c457600080fd5b5060025461007a906001600160a01b031681565b3480156100e457600080fd5b506100b66100f3366004610337565b610163565b6100b6610106366004610337565b61023c565b34801561011757600080fd5b5060015461007a906001600160a01b031681565b6002546001600160a01b03161561014157600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146101cf5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a20466173742053656e6465722060448201526437b7363c9760d91b606482015260840160405180910390fd5b600082826040516020016101e4929190610446565b60405160208183030381529060405290507f885ffc934437efa035b94d89742209ddef30dac81f0aadbb92d520cd54dc2d398382805190602001208360405161022f93929190610472565b60405180910390a1505050565b60008282604051602001610251929190610446565b60408051601f1981840301815290829052600054600154632f912b8760e21b84529193506001600160a01b039081169263be44ae1c92349261029a929116908690600401610446565b60206040518083038185885af11580156102b8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906102dd91906104a2565b50505050565b80356001600160a01b03811681146102fa57600080fd5b919050565b60006020828403121561031157600080fd5b61031a826102e3565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561034a57600080fd5b610353836102e3565b9150602083013567ffffffffffffffff8082111561037057600080fd5b818501915085601f83011261038457600080fd5b81358181111561039657610396610321565b604051601f8201601f19908116603f011681019083821181831017156103be576103be610321565b816040528281528860208487010111156103d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000815180845260005b8181101561041f57602081850181015186830182015201610403565b81811115610431576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061046a908301846103f9565b949350505050565b60018060a01b038416815282602082015260606040820152600061049960608301846103f9565b95945050505050565b6000602082840312156104b457600080fd5b505191905056fea264697066735822122027798849f47017ea415e2d49b22f4ac53ed207353ed98ef0272d1f23362730d864736f6c634300080a0033", @@ -194,23 +194,23 @@ "storageLayout": { "storage": [ { - "astId": 7557, + "astId": 8249, "contract": "src/bridge/FastBridgeSender.sol:FastBridgeSender", "label": "safebridge", "offset": 0, "slot": "0", - "type": "t_contract(ISafeBridge)7815" + "type": "t_contract(ISafeBridge)8507" }, { - "astId": 7560, + "astId": 8252, "contract": "src/bridge/FastBridgeSender.sol:FastBridgeSender", "label": "fastBridgeReceiver", "offset": 0, "slot": "1", - "type": "t_contract(IFastBridgeReceiver)7791" + "type": "t_contract(IFastBridgeReceiver)8483" }, { - "astId": 7562, + "astId": 8254, "contract": "src/bridge/FastBridgeSender.sol:FastBridgeSender", "label": "fastSender", "offset": 0, @@ -224,12 +224,12 @@ "label": "address", "numberOfBytes": "20" }, - "t_contract(IFastBridgeReceiver)7791": { + "t_contract(IFastBridgeReceiver)8483": { "encoding": "inplace", "label": "contract IFastBridgeReceiver", "numberOfBytes": "20" }, - "t_contract(ISafeBridge)7815": { + "t_contract(ISafeBridge)8507": { "encoding": "inplace", "label": "contract ISafeBridge", "numberOfBytes": "20" diff --git a/contracts/deployments/arbitrumRinkeby/HomeGateway.json b/contracts/deployments/arbitrumRinkeby/HomeGateway.json index a710f9d3b..242d1299e 100644 --- a/contracts/deployments/arbitrumRinkeby/HomeGateway.json +++ b/contracts/deployments/arbitrumRinkeby/HomeGateway.json @@ -1,5 +1,5 @@ { - "address": "0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C", + "address": "0x2Aa1f82d363f79c1E7a4CcF955Fb7E4306b9B260", "abi": [ { "inputs": [ @@ -336,47 +336,47 @@ "type": "function" } ], - "transactionHash": "0x32883b2e1d6077f6d73c336cf7c496baf83674ad2fc675d23b18fa8d1f6e6147", + "transactionHash": "0x232a8e30be09383002c2ff5e333dd848156b2ab9aa32769e8a1954ab9dbe060d", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C", + "contractAddress": "0x2Aa1f82d363f79c1E7a4CcF955Fb7E4306b9B260", "transactionIndex": 0, - "gasUsed": "5321339", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000080000000000000000000008000000000000000000", - "blockHash": "0xd39dac52e9b26c2872c1f0f474be1e92d2e78d3047399521da7926494041045c", - "transactionHash": "0x32883b2e1d6077f6d73c336cf7c496baf83674ad2fc675d23b18fa8d1f6e6147", + "gasUsed": "5322942", + "logsBloom": "0x00000000000000000000000000000000000000000000000002000004000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000020008000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9b028bb1ddc37bf4d0ce1d531d614eeeaae56664bb37aeafa83d0e8eb771c3c1", + "transactionHash": "0x232a8e30be09383002c2ff5e333dd848156b2ab9aa32769e8a1954ab9dbe060d", "logs": [ { "transactionIndex": 0, - "blockNumber": 9532053, - "transactionHash": "0x32883b2e1d6077f6d73c336cf7c496baf83674ad2fc675d23b18fa8d1f6e6147", - "address": "0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C", + "blockNumber": 9610376, + "transactionHash": "0x232a8e30be09383002c2ff5e333dd848156b2ab9aa32769e8a1954ab9dbe060d", + "address": "0x2Aa1f82d363f79c1E7a4CcF955Fb7E4306b9B260", "topics": [ "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064252494447450000000000000000000000000000000000000000000000000000", "logIndex": 0, - "blockHash": "0xd39dac52e9b26c2872c1f0f474be1e92d2e78d3047399521da7926494041045c" + "blockHash": "0x9b028bb1ddc37bf4d0ce1d531d614eeeaae56664bb37aeafa83d0e8eb771c3c1" } ], - "blockNumber": 9532053, - "cumulativeGasUsed": "288939", + "blockNumber": 9610376, + "cumulativeGasUsed": "289162", "status": 1, "byzantium": true }, "args": [ - "0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F", - "0x34E520dc1d2Db660113b64724e14CEdCD01Ee879", - "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "0xd08452AEE7ab5bE3BF6733BA0d3F0CFdaf060Aa2", + "0x0b9e03455Fed83f209Fa7ce596c93ba6aBAd1f46", + "0xf02733d9e5CbfE67B54F165b0277E1995106D526", 4 ], - "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", + "numDeployments": 1, + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", + "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 raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n */\\n event Evidence(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _evidenceGroupID,\\n address indexed _party,\\n string _evidence\\n );\\n}\\n\",\"keccak256\":\"0xbd6a3d07e2e192f521340f62965aae59e0ece36cf4ae6918d461725e6a51b70c\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"pragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\nimport \\\"./IEvidence.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IMetaEvidence is IEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\n /**\\n * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0x18ad77e96ca1592f7833c4d3a93a8a7de55bff137d357d66040f99ac13bf1f88\"},\"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/IMetaEvidence.sol\\\";\\n\\ninterface IHomeGateway is IArbitrable, IMetaEvidence {\\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\":\"0xd962398e6e91839bfc95c9bbe9d17c1e7b8c057e6e8cb3acd8fb836feb01614c\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516109df3803806109df83398101604081905261002f916100ea565b600280546001600160a01b038087166001600160a01b0319928316179092556003805486841690831617905560048054928516929091169190911790556006819055466005556040516000907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906100c19060208082526006908201526542524944474560d01b604082015260600190565b60405180910390a25050505061013d565b6001600160a01b03811681146100e757600080fd5b50565b6000806000806080858703121561010057600080fd5b845161010b816100d2565b602086015190945061011c816100d2565b604086015190935061012d816100d2565b6060959095015193969295505050565b6108938061014c6000396000f3fe60806040526004361061009c5760003560e01c8063adc879e911610064578063adc879e914610157578063ba4bc7631461016d578063c95c09511461019a578063cddbfa14146101c7578063d1d559c514610221578063fc4ba3a21461024157600080fd5b8063311a6c56146100a15780633b103f53146100c35780636cc6cde1146100d65780638d7c7daa146101135780639688240314610133575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610616565b61026e565b005b6100c16100d1366004610654565b6103ac565b3480156100e257600080fd5b506002546100f6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011f57600080fd5b506004546100f6906001600160a01b031681565b34801561013f57600080fd5b5061014960065481565b60405190815260200161010a565b34801561016357600080fd5b5061014960055481565b34801561017957600080fd5b506101496101883660046106fe565b60006020819052908152604090205481565b3480156101a657600080fd5b506101496101b53660046106fe565b60016020526000908152604090205481565b3480156101d357600080fd5b506102046101e23660046106fe565b600760205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b0390911660208301520161010a565b34801561022d57600080fd5b506003546100f6906001600160a01b031681565b34801561024d57600080fd5b5061014961025c3660046106fe565b60009081526001602052604090205490565b6002546001600160a01b031633146102bf5760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b60008281526020818152604080832054808452600783529281902081518083018352815481526001909101546001600160a01b039081168285018190528351602481018790526044810188905260648082019290925284518082039092018252608401845293840180516001600160e01b0316633496987960e01b90811790915260035460048054955163263b083b60e21b8152949692959294918416936398ec20ec9361037293911691869101610717565b600060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b50505050505050505050565b6000878787878787876040516020016103cb979695949392919061077c565b60408051601f1981840301815291815281516020928301206000818152600790935291206001810154919250906001600160a01b03161561044e5760405162461bcd60e51b815260206004820152601760248201527f4469737075746520616c72656164792072656c6179656400000000000000000060448201526064016102b6565b60025460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906104809088908890600401610805565b602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610821565b8082553410156105135760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f7374207061696460448201526064016102b6565b60025460405163c13517e160e01b81526000916001600160a01b03169063c13517e190349061054a908b908b908b9060040161083a565b60206040518083038185885af1158015610568573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061058d9190610821565b6000818152602081815260408083208790558683526001808352818420859055860180546001600160a01b0319163317905560025481518481529283019390935292935083926001600160a01b03909216917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000806040838503121561062957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461064f57600080fd5b919050565b600080600080600080600060c0888a03121561066f57600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff808211156106a357600080fd5b818a0191508a601f8301126106b757600080fd5b8135818111156106c657600080fd5b8b60208285010111156106d857600080fd5b6020830195508094505050506106f060a08901610638565b905092959891949750929550565b60006020828403121561071057600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561075357858101830151858201606001528201610737565b81811115610765576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006108196020830184866107dc565b949350505050565b60006020828403121561083357600080fd5b5051919050565b8381526040602082015260006108546040830184866107dc565b9594505050505056fea26469706673582212209b353cefef6d96cad6be13b5e743211703f8a1ea1168c9a258240cf76493f69964736f6c634300080a0033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063adc879e911610064578063adc879e914610157578063ba4bc7631461016d578063c95c09511461019a578063cddbfa14146101c7578063d1d559c514610221578063fc4ba3a21461024157600080fd5b8063311a6c56146100a15780633b103f53146100c35780636cc6cde1146100d65780638d7c7daa146101135780639688240314610133575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610616565b61026e565b005b6100c16100d1366004610654565b6103ac565b3480156100e257600080fd5b506002546100f6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011f57600080fd5b506004546100f6906001600160a01b031681565b34801561013f57600080fd5b5061014960065481565b60405190815260200161010a565b34801561016357600080fd5b5061014960055481565b34801561017957600080fd5b506101496101883660046106fe565b60006020819052908152604090205481565b3480156101a657600080fd5b506101496101b53660046106fe565b60016020526000908152604090205481565b3480156101d357600080fd5b506102046101e23660046106fe565b600760205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b0390911660208301520161010a565b34801561022d57600080fd5b506003546100f6906001600160a01b031681565b34801561024d57600080fd5b5061014961025c3660046106fe565b60009081526001602052604090205490565b6002546001600160a01b031633146102bf5760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b60008281526020818152604080832054808452600783529281902081518083018352815481526001909101546001600160a01b039081168285018190528351602481018790526044810188905260648082019290925284518082039092018252608401845293840180516001600160e01b0316633496987960e01b90811790915260035460048054955163263b083b60e21b8152949692959294918416936398ec20ec9361037293911691869101610717565b600060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b50505050505050505050565b6000878787878787876040516020016103cb979695949392919061077c565b60408051601f1981840301815291815281516020928301206000818152600790935291206001810154919250906001600160a01b03161561044e5760405162461bcd60e51b815260206004820152601760248201527f4469737075746520616c72656164792072656c6179656400000000000000000060448201526064016102b6565b60025460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906104809088908890600401610805565b602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610821565b8082553410156105135760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f7374207061696460448201526064016102b6565b60025460405163c13517e160e01b81526000916001600160a01b03169063c13517e190349061054a908b908b908b9060040161083a565b60206040518083038185885af1158015610568573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061058d9190610821565b6000818152602081815260408083208790558683526001808352818420859055860180546001600160a01b0319163317905560025481518481529283019390935292935083926001600160a01b03909216917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000806040838503121561062957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461064f57600080fd5b919050565b600080600080600080600060c0888a03121561066f57600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff808211156106a357600080fd5b818a0191508a601f8301126106b757600080fd5b8135818111156106c657600080fd5b8b60208285010111156106d857600080fd5b6020830195508094505050506106f060a08901610638565b905092959891949750929550565b60006020828403121561071057600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561075357858101830151858201606001528201610737565b81811115610765576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006108196020830184866107dc565b949350505050565b60006020828403121561083357600080fd5b5051919050565b8381526040602082015260006108546040830184866107dc565b9594505050505056fea26469706673582212209b353cefef6d96cad6be13b5e743211703f8a1ea1168c9a258240cf76493f69964736f6c634300080a0033", "devdoc": { "kind": "dev", "methods": { @@ -409,7 +409,7 @@ "storageLayout": { "storage": [ { - "astId": 10958, + "astId": 11052, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "disputeIDtoHash", "offset": 0, @@ -417,7 +417,7 @@ "type": "t_mapping(t_uint256,t_bytes32)" }, { - "astId": 10962, + "astId": 11056, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "disputeHashtoID", "offset": 0, @@ -425,23 +425,23 @@ "type": "t_mapping(t_bytes32,t_uint256)" }, { - "astId": 10965, + "astId": 11059, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "arbitrator", "offset": 0, "slot": "2", - "type": "t_contract(IArbitrator)1889" + "type": "t_contract(IArbitrator)1911" }, { - "astId": 10968, + "astId": 11062, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "fastbridge", "offset": 0, "slot": "3", - "type": "t_contract(IFastBridgeSender)8409" + "type": "t_contract(IFastBridgeSender)8494" }, { - "astId": 10970, + "astId": 11064, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "foreignGateway", "offset": 0, @@ -449,7 +449,7 @@ "type": "t_address" }, { - "astId": 10972, + "astId": 11066, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "chainID", "offset": 0, @@ -457,7 +457,7 @@ "type": "t_uint256" }, { - "astId": 10974, + "astId": 11068, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "foreignChainID", "offset": 0, @@ -465,12 +465,12 @@ "type": "t_uint256" }, { - "astId": 10984, + "astId": 11078, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "disputeHashtoRelayedData", "offset": 0, "slot": "7", - "type": "t_mapping(t_bytes32,t_struct(RelayedData)10979_storage)" + "type": "t_mapping(t_bytes32,t_struct(RelayedData)11073_storage)" } ], "types": { @@ -484,22 +484,22 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IArbitrator)1889": { + "t_contract(IArbitrator)1911": { "encoding": "inplace", "label": "contract IArbitrator", "numberOfBytes": "20" }, - "t_contract(IFastBridgeSender)8409": { + "t_contract(IFastBridgeSender)8494": { "encoding": "inplace", "label": "contract IFastBridgeSender", "numberOfBytes": "20" }, - "t_mapping(t_bytes32,t_struct(RelayedData)10979_storage)": { + "t_mapping(t_bytes32,t_struct(RelayedData)11073_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct HomeGateway.RelayedData)", "numberOfBytes": "32", - "value": "t_struct(RelayedData)10979_storage" + "value": "t_struct(RelayedData)11073_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -515,12 +515,12 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_struct(RelayedData)10979_storage": { + "t_struct(RelayedData)11073_storage": { "encoding": "inplace", "label": "struct HomeGateway.RelayedData", "members": [ { - "astId": 10976, + "astId": 11070, "contract": "src/gateway/HomeGateway.sol:HomeGateway", "label": "arbitrationCost", "offset": 0, @@ -528,7 +528,7 @@ "type": "t_uint256" }, { - "astId": 10978, + "astId": 11072, "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 b93c00974..1578bd526 100644 --- a/contracts/deployments/arbitrumRinkeby/KlerosCore.json +++ b/contracts/deployments/arbitrumRinkeby/KlerosCore.json @@ -1,5 +1,5 @@ { - "address": "0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F", + "address": "0xd08452AEE7ab5bE3BF6733BA0d3F0CFdaf060Aa2", "abi": [ { "inputs": [ @@ -997,6 +997,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "governor", @@ -1110,19 +1129,19 @@ "type": "function" } ], - "transactionHash": "0x410cdb405cd569666020b07d678fab6448bbf4016af3f4ab1b879f1452bda74a", + "transactionHash": "0x9344ab0fa25824656e9c466da7dca1d7d0d20e9f1d8f59693faeeb28dadb1ccd", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x5A407DcbD0F83ECbc1894C4B4f8Fc5b699D4822F", + "contractAddress": "0xd08452AEE7ab5bE3BF6733BA0d3F0CFdaf060Aa2", "transactionIndex": 0, - "gasUsed": "36471879", + "gasUsed": "66305095", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0dedfba37de0fc9730e38f33a85640bcf38147060d36428c5bbdd2d5042c37da", - "transactionHash": "0x410cdb405cd569666020b07d678fab6448bbf4016af3f4ab1b879f1452bda74a", + "blockHash": "0x61bf315df6704b3ae5d1b6275d8ff1c66da916b99585f1a63586aeea00d29025", + "transactionHash": "0x9344ab0fa25824656e9c466da7dca1d7d0d20e9f1d8f59693faeeb28dadb1ccd", "logs": [], - "blockNumber": 9532047, - "cumulativeGasUsed": "845338", + "blockNumber": 9609834, + "cumulativeGasUsed": "30173935", "status": 1, "byzantium": true }, @@ -1130,7 +1149,7 @@ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", "0x364530164a2338cdba211f72c1438eb811b5c639", "0x0000000000000000000000000000000000000000", - "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", + "0xed12799915180a257985631fbD2ead261eD838cf", false, 200, 10000, @@ -1144,11 +1163,11 @@ ], 3 ], - "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", + "numDeployments": 1, + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", + "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\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"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.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_subcourtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"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 /** @dev Gets the timesPerPeriod array for a given court.\\n * @param _subcourtID The ID of the court to get the times from.\\n * @return timesPerPeriod The timesPerPeriod array for the given court.\\n */\\n function getTimesPerPeriod(uint96 _subcourtID) external view returns (uint256[4] memory timesPerPeriod) {\\n Court storage court = courts[_subcourtID];\\n timesPerPeriod = court.timesPerPeriod;\\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\":\"0x2212bb97e222dcf1ee614a84a6858e9f01d6cc5e69b58c9c88b252dfb00a4bf6\",\"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": "0x60806040523480156200001157600080fd5b5060405162004d0938038062004d098339810160408190526200003491620003a2565b600080546001600160a01b03199081166001600160a01b038e81169190911783556001805483168e83161781556002805484168e8416179055600460209081527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec8054909416928d169290921790925560408051610120810182528481528b151581840190815282518681528085018452928201928352606082018c9052608082018b905260a082018a905260c0820189905260e08201889052610100820185905260038054958601815590955280517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600b9095029485018054965115156c01000000000000000000000000026001600160681b03199097166001600160601b0390921691909117959095178555905180519194936200019d937fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c9091019291019062000272565b50606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e082015181600601906004620001df929190620002c2565b506101009190910151600a9091015560405163483abc4f60e11b815260076004820152600060248201526044810182905273f02733d9e5CbfE67B54F165b0277E1995106D52690639075789e9060640160006040518083038186803b1580156200024857600080fd5b505af41580156200025d573d6000803e3d6000fd5b5050505050505050505050505050506200046d565b828054828255906000526020600020908101928215620002b0579160200282015b82811115620002b057825182559160200191906001019062000293565b50620002be929150620002f2565b5090565b8260048101928215620002b05791602002820182811115620002b057825182559160200191906001019062000293565b5b80821115620002be5760008155600101620002f3565b6001600160a01b03811681146200031f57600080fd5b50565b600082601f8301126200033457600080fd5b604051608081016001600160401b03811182821017156200036557634e487b7160e01b600052604160045260246000fd5b6040528060808401858111156200037b57600080fd5b845b81811015620003975780518352602092830192016200037d565b509195945050505050565b60008060008060008060008060008060006101c08c8e031215620003c557600080fd5b8b51620003d28162000309565b60208d0151909b50620003e58162000309565b60408d0151909a50620003f88162000309565b60608d01519099506200040b8162000309565b60808d015190985080151581146200042257600080fd5b8097505060a08c0151955060c08c0151945060e08c015193506101008c01519250620004538d6101208e0162000322565b91506101a08c015190509295989b509295989b9093969950565b61488c806200047d6000396000f3fe60806040526004361061025b5760003560e01c8063840bc19c11610144578063d2b8035a116100b6578063eaff425a1161007a578063eaff425a14610819578063f441d9b31461082e578063f6a6ef7a1461084e578063f7434ea91461086e578063fbf405b01461088e578063fc6f8f16146108ae57600080fd5b8063d2b8035a1461074e578063d2d514e01461076e578063d578cbac1461079d578063de1a1e59146107bd578063e4c0aaf4146107f957600080fd5b8063afe15cfb11610108578063afe15cfb14610654578063b4a6160814610689578063c13517e11461069e578063c258bb19146106b1578063cf0c38f8146106d1578063d1c1df48146106f157600080fd5b8063840bc19c146105925780638a9bb02a146105ad5780638bb04875146105de578063a57366e7146105fe578063acdbf51d1461061e57600080fd5b80634b7fcda2116101dd57806359354c77116101a157806359354c77146104df57806359ec827e146104ff5780635bc24dd31461051f578063751accd01461053f5780637717a6e81461055f5780637e69b7b01461057f57600080fd5b80634b7fcda21461041c5780635468f9191461044c578063564a565d1461046c578063572603641461049f5780635788795d146104bf57600080fd5b806322684db01161022457806322684db01461036c5780632d29a47b146103995780632ea7b4d0146103b95780633cfd1184146103cf5780633e1d09be146103fc57600080fd5b8062f5822c146102605780630c340a2414610282578063115d5376146102bf5780631c3db16d146102df5780631f5a0dd21461030d575b600080fd5b34801561026c57600080fd5b5061028061027b366004613fa0565b6108ce565b005b34801561028e57600080fd5b506000546102a2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102cb57600080fd5b506102806102da366004613fbd565b610923565b3480156102eb57600080fd5b506102ff6102fa366004613fbd565b61101c565b6040519081526020016102b6565b34801561031957600080fd5b5061032d610328366004613fbd565b6110ba565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a083015260c082015260e0016102b6565b34801561037857600080fd5b5061038c610387366004613fbd565b611117565b6040516102b6919061400e565b3480156103a557600080fd5b506102806103b4366004614022565b611150565b3480156103c557600080fd5b506102ff61271081565b3480156103db57600080fd5b506103ef6103ea36600461406a565b611cd4565b6040516102b69190614085565b34801561040857600080fd5b506102806104173660046140b6565b611d45565b34801561042857600080fd5b5061043c610437366004613fbd565b611f60565b60405190151581526020016102b6565b34801561045857600080fd5b50610280610467366004614151565b611f99565b34801561047857600080fd5b5061048c610487366004613fbd565b6120fc565b6040516102b69796959493929190614221565b3480156104ab57600080fd5b506102806104ba3660046142e1565b612169565b3480156104cb57600080fd5b506102806104da366004614315565b6121d4565b3480156104eb57600080fd5b506102806104fa3660046140b6565b6124a8565b34801561050b57600080fd5b506102ff61051a366004613fbd565b612508565b34801561052b57600080fd5b5061028061053a3660046140b6565b612678565b34801561054b57600080fd5b5061028061055a366004614407565b6126d8565b34801561056b57600080fd5b5061028061057a3660046140b6565b6127aa565b61028061058d366004613fbd565b6127f8565b34801561059e57600080fd5b506102ff6001600160ff1b0381565b3480156105b957600080fd5b506105cd6105c8366004614460565b612b66565b6040516102b6959493929190614482565b3480156105ea57600080fd5b506102806105f9366004613fbd565b612c44565b34801561060a57600080fd5b506102806106193660046140b6565b612dc8565b34801561062a57600080fd5b506102a2610639366004613fbd565b6004602052600090815260409020546001600160a01b031681565b34801561066057600080fd5b5061067461066f366004613fbd565b612e28565b604080519283526020830191909152016102b6565b34801561069557600080fd5b506102ff600481565b6102ff6106ac3660046144ee565b612edc565b3480156106bd57600080fd5b506102806106cc366004613fa0565b613245565b3480156106dd57600080fd5b506002546102a2906001600160a01b031681565b3480156106fd57600080fd5b5061067461070c366004614535565b6001600160a01b0390911660009081526006602090815260408083206001600160601b0390941683526001840182528083205460029094019091529020549091565b34801561075a57600080fd5b50610280610769366004614460565b613291565b34801561077a57600080fd5b5061078e610789366004613fbd565b6135a6565b6040516102b69392919061459c565b3480156107a957600080fd5b5061043c6107b8366004613fbd565b61366e565b3480156107c957600080fd5b506102ff6107d8366004614460565b60009182526007602090815260408084209284526004909201905290205490565b34801561080557600080fd5b50610280610814366004613fa0565b6136a4565b34801561082557600080fd5b506102ff600381565b34801561083a57600080fd5b506102806108493660046145d1565b6136f0565b34801561085a57600080fd5b506102ff610869366004613fbd565b61374b565b34801561087a57600080fd5b506102ff6108893660046145fd565b613780565b34801561089a57600080fd5b506001546102a2906001600160a01b031681565b3480156108ba57600080fd5b506102ff6108c9366004613fbd565b6137d4565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016108f890614632565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006005828154811061093857610938614674565b9060005260206000209060050201905060006001826004018054905061095e91906146a0565b9050600082600401828154811061097757610977614674565b60009182526020822060059091020191506001840154600160a01b900460ff1660048111156109a8576109a8613fd6565b1415610b90576000821180610a30575082546003805490916001600160601b03169081106109d8576109d8614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610a0c57610a0c613fd6565b60048110610a1c57610a1c614674565b01546002840154610a2d90426146a0565b10155b610ab05760405162461bcd60e51b8152602060048201526044602482018190527f5468652065766964656e636520706572696f642074696d6520686173206e6f74908201527f207061737365642079657420616e64206974206973206e6f7420616e2061707060648201526332b0b61760e11b608482015260a4016108f8565b6003830154600482015414610b195760405162461bcd60e51b815260206004820152602960248201527f546865206469737075746520686173206e6f742066696e6973686564206472616044820152683bb4b733903cb2ba1760b91b60648201526084016108f8565b82546003805490916001600160601b0316908110610b3957610b39614674565b60009182526020909120600b9091020154600160601b900460ff16610b5f576002610b62565b60015b60018401805460ff60a01b1916600160a01b836004811115610b8657610b86613fd6565b0217905550610fc8565b600180840154600160a01b900460ff166004811115610bb157610bb1613fd6565b1415610cc05782546003805490916001600160601b0316908110610bd757610bd7614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610c0b57610c0b613fd6565b60048110610c1b57610c1b614674565b01546002840154610c2c90426146a0565b101580610c45575060018301546001600160a01b031633145b610ca45760405162461bcd60e51b815260206004820152602a60248201527f54686520636f6d6d697420706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108f8565b6001830180546002919060ff60a01b1916600160a01b83610b86565b60026001840154600160a01b900460ff166004811115610ce257610ce2613fd6565b1415610e2b5782546003805490916001600160601b0316908110610d0857610d08614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610d3c57610d3c613fd6565b60048110610d4c57610d4c614674565b01546002840154610d5d90426146a0565b101580610d76575060018301546001600160a01b031633145b610dd25760405162461bcd60e51b815260206004820152602760248201527f54686520766f746520706572696f642074696d6520686173206e6f74207061736044820152661cd959081e595d60ca1b60648201526084016108f8565b60018301805460ff60a01b1916600360a01b1790558254604051600160601b9091046001600160a01b03169085907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610fc8565b60036001840154600160a01b900460ff166004811115610e4d57610e4d613fd6565b1415610f455782546003805490916001600160601b0316908110610e7357610e73614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610ea757610ea7613fd6565b60048110610eb757610eb7614674565b01546002840154610ec890426146a0565b1015610f295760405162461bcd60e51b815260206004820152602a60248201527f5468652061707065616c20706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108f8565b6001830180546004919060ff60a01b1916600160a01b83610b86565b60046001840154600160a01b900460ff166004811115610f6757610f67613fd6565b1415610fc85760405162461bcd60e51b815260206004820152602a60248201527f546865206469737075746520697320616c726561647920696e20746865206c6160448201526939ba103832b934b7b21760b11b60648201526084016108f8565b426002840155600183015460405185917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b919161100e91600160a01b900460ff169061400e565b60405180910390a250505050565b6000806005838154811061103257611032614674565b6000918252602090912060059091020160010154604051631c3db16d60e01b8152600481018590526001600160a01b0390911691508190631c3db16d90602401602060405180830381865afa15801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b391906146b7565b9392505050565b600381815481106110ca57600080fd5b60009182526020909120600b9091020180546002820154600383015460048401546005850154600a909501546001600160601b0385169650600160601b90940460ff169492939192909187565b60006005828154811061112c5761112c614674565b6000918252602090912060059091020160010154600160a01b900460ff1692915050565b60006005848154811061116557611165614674565b60009182526020909120600590910201905060046001820154600160a01b900460ff16600481111561119957611199613fd6565b146111e65760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108f8565b6000828260040185815481106111fe576111fe614674565b90600052602060002090600502016002015461121a91906146d0565b9050600082600401858154811061123357611233614674565b9060005260206000209060050201600301549050600083600401868154811061125e5761125e614674565b6000918252602082206004600590920201810154600187015460405163368efae360e21b81529194506001600160a01b03169163da3beb8c916112ae918c918c9101918252602082015260400190565b602060405180830381865afa1580156112cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ef91906146b7565b90506000808261130a5783861115611305578395505b61132a565b6113158460026146e8565b86111561132a576113278460026146e8565b95505b6000876004018a8154811061134157611341614674565b90600052602060002090600502016002015490505b86811015611c435784811015611841576001880154604051634fe264fb60e01b8152600481018d9052602481018c9052604481018390526001600160a01b0390911690634fe264fb90606401602060405180830381865afa1580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e391906146b7565b91506127108211156113f55761271091505b600061271061140484826146a0565b8a6004018d8154811061141957611419614674565b90600052602060002090600502016000015461143591906146e8565b61143f919061471d565b905061144b81886146d0565b9650886004018b8154811061146257611462614674565b9060005260206000209060050201600401828154811061148457611484614674565b60009182526020808320909101546001600160a01b03168083526006825260408084208d546001600160601b031685526002019092529082208054919650839290916114d19084906146a0565b909155505088546003805483926001600160601b03169081106114f6576114f6614674565b90600052602060002090600b02016002015461151291906146d0565b6001600160a01b03851660009081526006602090815260408083208d546001600160601b031684526001019091529020541061159b5788546001600160a01b03851660009081526006602090815260408083206001600160601b03909416808452600190940190915290205461159591869161158f9085906146a0565b84613805565b506115ec565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b03168452600101909152902054156115ec5788546115ea9085906001600160601b0316600084613805565b505b600189015460405163ba66fde760e01b8152600481018e9052602481018d9052604481018490526001600160a01b039091169063ba66fde790606401602060405180830381865afa158015611645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116699190614731565b6117065760005b6001600160a01b038516600090815260066020526040902054811015611704576001600160a01b038516600090815260066020526040902080546116f1918791849081106116c0576116c0614674565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316600080613805565b50806116fc8161474e565b915050611670565b505b8b6001600160a01b0385167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e1961173b84614769565b60408051918252600060208301520160405180910390a361175d6001876146a0565b82141561183b578461183b5760005460048a0180546001600160a01b03909216916108fc91908e90811061179357611793614674565b9060005260206000209060050201600101549081150290604051600060405180830381858888f1505060015460005460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018d90529116935063a9059cbb925060440190506020604051808303816000875af1158015611815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118399190614731565b505b50611c31565b60018801546001600160a01b0316634fe264fb8c8c6118608986614786565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa1580156118a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cd91906146b7565b91506127108211156118df5761271091505b876004018a815481106118f4576118f4614674565b906000526020600020906005020160040185826119119190614786565b8154811061192157611921614674565b9060005260206000200160009054906101000a90046001600160a01b0316925061271082896004018c8154811061195a5761195a614674565b90600052602060002090600502016000015461197691906146e8565b611980919061471d565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b03168452600201909152812080549091906119c09084906146a0565b90915550506001600160a01b03831660009081526006602090815260408083208b546001600160601b03168452600101909152902054611acf57600160009054906101000a90046001600160a01b03166001600160a01b031663a9059cbb84612710858c6004018f81548110611a3857611a38614674565b906000526020600020906005020160000154611a5491906146e8565b611a5e919061471d565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acd9190614731565b505b600061271083611adf878a61471d565b611ae991906146e8565b611af3919061471d565b9050600061271084878c6004018f81548110611b1157611b11614674565b906000526020600020906005020160010154611b2d919061471d565b611b3791906146e8565b611b41919061471d565b60015460405163a9059cbb60e01b81526001600160a01b0388811660048301526024820186905292935091169063a9059cbb906044016020604051808303816000875af1158015611b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bba9190614731565b506040516001600160a01b0386169082156108fc029083906000818181858888f19350505050508c856001600160a01b03167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e198484604051611c26929190918252602082015260400190565b60405180910390a350505b80611c3b8161474e565b915050611356565b5084876004018a81548110611c5a57611c5a614674565b90600052602060002090600502016003015414611c9d5784876004018a81548110611c8757611c87614674565b9060005260206000209060050201600301819055505b85876004018a81548110611cb357611cb3614674565b90600052602060002090600502016002018190555050505050505050505050565b611cdc613edd565b60006003836001600160601b031681548110611cfa57611cfa614674565b60009182526020909120604080516080810191829052600b9093029091019250600683019060049082845b815481526020019060010190808311611d25575050505050915050919050565b6000546001600160a01b03163314611d6f5760405162461bcd60e51b81526004016108f890614632565b6001600160601b0382161580611de0575080600380846001600160601b031681548110611d9e57611d9e614674565b60009182526020909120600b909102015481546001600160601b03909116908110611dcb57611dcb614674565b90600052602060002090600b02016002015411155b611de957600080fd5b60005b6003836001600160601b031681548110611e0857611e08614674565b90600052602060002090600b020160010180549050811015611f295781600380856001600160601b031681548110611e4257611e42614674565b90600052602060002090600b02016001018381548110611e6457611e64614674565b906000526020600020015481548110611e7f57611e7f614674565b90600052602060002090600b0201600201541015611f175760405162461bcd60e51b815260206004820152604960248201527f4120737562636f7572742063616e6e6f742062652074686520706172656e742060448201527f6f66206120737562636f75727420776974682061206c6f776572206d696e696d6064820152683ab69039ba30b5b29760b91b608482015260a4016108f8565b80611f218161474e565b915050611dec565b50806003836001600160601b031681548110611f4757611f47614674565b90600052602060002090600b0201600201819055505050565b600060058281548110611f7557611f75614674565b6000918252602090912060059091020160010154600160a81b900460ff1692915050565b6000546001600160a01b03163314611fc35760405162461bcd60e51b81526004016108f890614632565b60006003846001600160601b031681548110611fe157611fe1614674565b90600052602060002090600b0201905060005b83518110156120f557600084828151811061201157612011614674565b602002602001015160ff166001901b90508315612083578083600a01541982161461207e5760405162461bcd60e51b815260206004820152601d60248201527f44697370757465206b697420616c726561647920737570706f7274656400000060448201526064016108f8565b6120d8565b8083600a01548216146120d85760405162461bcd60e51b815260206004820152601c60248201527f44697370757465206b6974206973206e6f7420737570706f727465640000000060448201526064016108f8565b600a830180549091189055806120ed8161474e565b915050611ff4565b5050505050565b6005818154811061210c57600080fd5b600091825260209091206005909102018054600182015460028301546003909301546001600160601b03831694506001600160a01b03600160601b9093048316939282169260ff600160a01b8404811693600160a81b9004169187565b6000546001600160a01b031633146121935760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b0316815481106121b0576121b0614674565b90600052602060002090600b02016006019060046121cf929190613efb565b505050565b6000546001600160a01b031633146121fe5760405162461bcd60e51b81526004016108f890614632565b8660038a6001600160601b03168154811061221b5761221b614674565b90600052602060002090600b02016002015411156122b15760405162461bcd60e51b815260206004820152604760248201527f4120737562636f7572742063616e6e6f742062652061206368696c64206f662060448201527f6120737562636f7572742077697468206120686967686572206d696e696d756d6064820152661039ba30b5b29760c91b608482015260a4016108f8565b6003805460408051610120810182526001600160601b038d1681528b151560208201529192919081016000604051908082528060200260200182016040528015612305578160200160208202803683370190505b50815260208082018c905260408083018c9052606083018b9052608083018a905260a0830189905260c09092018690528354600181810186556000958652948290208451600b909202018054858401511515600160601b026cffffffffffffffffffffffffff199091166001600160601b03909316929092179190911781559183015180519394929361239f938501929190910190613f39565b50606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e0820151816006019060046123df929190613efb565b506101009190910151600a9091015560405163483abc4f60e11b815260076004820152602481018290526044810184905273f02733d9e5CbfE67B54F165b0277E1995106D52690639075789e9060640160006040518083038186803b15801561244757600080fd5b505af415801561245b573d6000803e3d6000fd5b5050505060038a6001600160601b03168154811061247b5761247b614674565b600091825260208083206001600b9093020182018054928301815583529091200155505050505050505050565b6000546001600160a01b031633146124d25760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b0316815481106124ef576124ef614674565b90600052602060002090600b0201600401819055505050565b6000806005838154811061251e5761251e614674565b60009182526020909120600590910201805460038054929350916001600160601b0390911690811061255257612552614674565b90600052602060002090600b02016005015481600301541061261b5780546001600160601b031661258c576001600160ff1b039150612672565b600381015461259c9060026146e8565b6125a79060016146d0565b815460038054909182916001600160601b039091169081106125cb576125cb614674565b60009182526020909120600b909102015481546001600160601b039091169081106125f8576125f8614674565b90600052602060002090600b02016004015461261491906146e8565b9150612672565b600381015461262b9060026146e8565b6126369060016146d0565b81546003805490916001600160601b031690811061265657612656614674565b90600052602060002090600b0201600401546110b391906146e8565b50919050565b6000546001600160a01b031633146126a25760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b0316815481106126bf576126bf614674565b90600052602060002090600b0201600301819055505050565b6000546001600160a01b031633146127025760405162461bcd60e51b81526004016108f890614632565b6000836001600160a01b0316838360405161271d91906147c6565b60006040518083038185875af1925050503d806000811461275a576040519150601f19603f3d011682016040523d82523d6000602084013e61275f565b606091505b50509050806127a45760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b60448201526064016108f8565b50505050565b6127b73383836000613805565b6127f45760405162461bcd60e51b815260206004820152600e60248201526d14dd185ada5b99c819985a5b195960921b60448201526064016108f8565b5050565b61280181612508565b34101561285c5760405162461bcd60e51b8152602060048201526024808201527f4e6f7420656e6f7567682045544820746f20636f7665722061707065616c206360448201526337b9ba1760e11b60648201526084016108f8565b60006005828154811061287157612871614674565b60009182526020909120600590910201905060036001820154600160a01b900460ff1660048111156128a5576128a5613fd6565b146128f25760405162461bcd60e51b815260206004820152601a60248201527f44697370757465206973206e6f742061707065616c61626c652e00000000000060448201526064016108f8565b60018101546001600160a01b0316331461295c5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2044697370757465204b69742060448201526437b7363c9760d91b60648201526084016108f8565b80546003805490916001600160601b031690811061297c5761297c614674565b90600052602060002090600b0201600501548160030154106129e95780546003805490916001600160601b03169081106129b8576129b8614674565b60009182526020909120600b909102015481546bffffffffffffffffffffffff19166001600160601b039091161781555b60018101805460ff60a01b1916905542600282015580546003805490916001600160601b0316908110612a1e57612a1e614674565b90600052602060002090600b02016004015434612a3b919061471d565b60038083019190915560048201805460018101825560009182526020909120835483546005909302909101926127109290916001600160601b0316908110612a8557612a85614674565b600091825260209091206003600b90920201810154845482549192916001600160601b03909116908110612abb57612abb614674565b90600052602060002090600b020160020154612ad791906146e8565b612ae1919061471d565b81553460018201558154604051600160601b9091046001600160a01b03169084907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3827f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612b59919061400e565b60405180910390a2505050565b6000806000806060600060058881548110612b8357612b83614674565b906000526020600020906005020190506000816004018881548110612baa57612baa614674565b9060005260206000209060050201905080600001548160010154826002015483600301548460040180805480602002602001604051908101604052809291908181526020018280548015612c2757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c09575b505050505090509650965096509650965050509295509295909350565b600060058281548110612c5957612c59614674565b60009182526020909120600590910201905060046001820154600160a01b900460ff166004811115612c8d57612c8d613fd6565b14612cda5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108f8565b6001810154600160a81b900460ff1615612d365760405162461bcd60e51b815260206004820152601860248201527f52756c696e6720616c72656164792065786563757465642e000000000000000060448201526064016108f8565b6000612d418361101c565b60018301805460ff60a81b1916600160a81b179055825460405163188d362b60e11b815260048101869052602481018390529192506001600160a01b03600160601b909104169063311a6c5690604401600060405180830381600087803b158015612dab57600080fd5b505af1158015612dbf573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314612df25760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b031681548110612e0f57612e0f614674565b90600052602060002090600b0201600501819055505050565b600080600060058481548110612e4057612e40614674565b60009182526020909120600590910201905060036001820154600160a01b900460ff166004811115612e7457612e74613fd6565b1415612ecd576002810154815460038054929550916001600160601b03909116908110612ea357612ea3614674565b600091825260209091206009600b9092020101546002820154612ec691906146d0565b9150612ed6565b60009250600091505b50915091565b6000612ee782613780565b341015612f485760405162461bcd60e51b815260206004820152602960248201527f4e6f7420656e6f7567682045544820746f20636f76657220617262697472617460448201526834b7b71031b7b9ba1760b91b60648201526084016108f8565b600080612f5484613e19565b925050915060008160ff166001901b9050806003846001600160601b031681548110612f8257612f82614674565b90600052602060002090600b0201600a0154821614612ffd5760405162461bcd60e51b815260206004820152603160248201527f5468652064697370757465206b6974206973206e6f7420737570706f7274656460448201527008189e481d1a1a5cc81cdd5898dbdd5c9d607a1b60648201526084016108f8565b60058054600181018255600160601b33026001600160601b038087168281179484027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810195865560ff88166000908152600460205260409020547f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1820180546001600160a01b0319166001600160a01b03929092169182179055427f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29092019190915560038054959a5090949093909216179081106130df576130df614674565b90600052602060002090600b020160040154346130fc919061471d565b60038084019190915560048301805460018101825560009182526020909120845483546005909302909101926127109290916001600160601b031690811061314657613146614674565b600091825260209091206003600b90920201810154855482549192916001600160601b0390911690811061317c5761317c614674565b90600052602060002090600b02016002015461319891906146e8565b6131a2919061471d565b8155346001820155604051638d31de6d60e01b81526001600160a01b03831690638d31de6d906131da908a908d908d906004016147e2565b600060405180830381600087803b1580156131f457600080fd5b505af1158015613208573d6000803e3d6000fd5b50506040513392508991507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505092915050565b6000546001600160a01b0316331461326f5760405162461bcd60e51b81526004016108f890614632565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000600583815481106132a6576132a6614674565b906000526020600020906005020190506000600182600401805490506132cc91906146a0565b905060008260040182815481106132e5576132e5614674565b60009182526020822060059091020191506001840154600160a01b900460ff16600481111561331657613316613fd6565b146133635760405162461bcd60e51b815260206004820152601a60248201527f53686f756c642062652065766964656e636520706572696f642e00000000000060448201526064016108f8565b6001830154600482015460038501546001600160a01b039092169160009061338b88846146d0565b111561339b5785600301546133a5565b6133a587836146d0565b9050815b8181101561359b57604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af11580156133fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061341f9190614823565b90506001600160a01b038116156135885785546001600160a01b03821660009081526006602090815260408083208c546001600160601b03168452600201909152812080549091906134729084906146d0565b90915550506001600160a01b03811660009081526006602090815260408083208b546001600160601b031684526002810183528184205460019091019092529091205410156135195760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b656420616d6f756e742073686f756c646e277420657863656564207360448201526c3a30b5b2b21030b6b7bab73a1760991b60648201526084016108f8565b60048601805460018101825560009182526020918290200180546001600160a01b0319166001600160a01b038416908117909155604080518a81529283018590528c927f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a35b50806135938161474e565b9150506133a9565b505050505050505050565b600081815260076020908152604091829020805460018201805485518186028101860190965280865291946060948594939192919083018282801561360a57602002820191906000526020600020905b8154815260200190600101908083116135f6575b505050505092508060020180548060200260200160405190810160405280929190818152602001828054801561365f57602002820191906000526020600020905b81548152602001906001019080831161364b575b50505050509150509193909250565b60006003828154811061368357613683614674565b60009182526020909120600b9091020154600160601b900460ff1692915050565b6000546001600160a01b031633146136ce5760405162461bcd60e51b81526004016108f890614632565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461371a5760405162461bcd60e51b81526004016108f890614632565b60ff16600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006005828154811061376057613760614674565b60009182526020909120600590910201546001600160601b031692915050565b600080600061378e84613e19565b5091509150806003836001600160601b0316815481106137b0576137b0614674565b90600052602060002090600b0201600401546137cc91906146e8565b949350505050565b600080600583815481106137ea576137ea614674565b60009182526020909120600460059092020101549392505050565b6001600160a01b0384166000908152600660205260408120816138288787613e95565b604051637521ccb160e01b8152600760048201526001600160601b03881660248201526044810182905290915060009073f02733d9e5CbfE67B54F165b0277E1995106D52690637521ccb190606401602060405180830381865af4158015613894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b891906146b7565b9050851561397f576003876001600160601b0316815481106138dc576138dc614674565b90600052602060002090600b02016002015486108061391457506001600160601b038716600090815260028401602052604090205486105b1561392557600093505050506137cc565b8061397a57825460041161393f57600093505050506137cc565b8254600180820185556000858152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918a16021790555b613acb565b60005b8354811015613ac957876001600160601b03168460000182815481106139aa576139aa614674565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03161415613ab757835484906139e7906001906146a0565b815481106139f7576139f7614674565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316846000018281548110613a3557613a35614674565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b0316021790555083600001805480613a8157613a81614840565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055613ac9565b80613ac18161474e565b915050613982565b505b6001600160601b03871660009081526001840160205260408120548790613af39084906146a0565b613afd91906146d0565b6001600160601b038916600081815260018701602052604081208390559192505b81613be157604051631712e1c560e11b81526007600482015260248101829052604481018a90526064810186905273f02733d9e5CbfE67B54F165b0277E1995106D52690632e25c38a9060840160006040518083038186803b158015613b8357600080fd5b505af4158015613b97573d6000803e3d6000fd5b505050508060001415613bad5760019150613b1e565b60038181548110613bc057613bc0614674565b60009182526020909120600b90910201546001600160601b03169050613b1e565b604080516001600160601b038c168152602081018b90529081018490526001600160a01b038c16907f70ca4ec64687bf265f39041896f3dbf10b9f650503cb38f2b3569fdce7489c369060600160405180910390a26000848a10613ce857613c49858b6146a0565b90508015613ce3576001546040516323b872dd60e01b81526001600160a01b038e8116600483015230602483015260448201849052909116906323b872dd906064015b6020604051808303816000875af1158015613cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ccf9190614731565b613ce35760009750505050505050506137cc565b613e07565b89613d5f576001600160601b038b1660009081526002880160205260409020548990613d1490876146a0565b613d1e91906146a0565b90508015613ce35760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb90604401613c8c565b88613d6a8b876146a0565b613d7491906146a0565b90508015613e075760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb906044016020604051808303816000875af1158015613dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613df39190614731565b613e075760009750505050505050506137cc565b5060019b9a5050505050505050505050565b60008060006040845110613e83575050506020810151604082015160608301516003546001600160601b03841610613e5057600092505b81613e5a57600391505b60ff81166000908152600460205260409020546001600160a01b0316613e7e575060005b613e8e565b506000915060039050815b9193909250565b600060405160005b6014811015613eb8578481600c011a81830153600101613e9d565b5060145b6020811015613ed45783811a81830153600101613ebc565b50519392505050565b60405180608001604052806004906020820280368337509192915050565b8260048101928215613f29579160200282015b82811115613f29578251825591602001919060010190613f0e565b50613f35929150613f73565b5090565b828054828255906000526020600020908101928215613f295791602002820182811115613f29578251825591602001919060010190613f0e565b5b80821115613f355760008155600101613f74565b6001600160a01b0381168114613f9d57600080fd5b50565b600060208284031215613fb257600080fd5b81356110b381613f88565b600060208284031215613fcf57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6005811061400a57634e487b7160e01b600052602160045260246000fd5b9052565b6020810161401c8284613fec565b92915050565b60008060006060848603121561403757600080fd5b505081359360208301359350604090920135919050565b80356001600160601b038116811461406557600080fd5b919050565b60006020828403121561407c57600080fd5b6110b38261404e565b60808101818360005b60048110156140ad57815183526020928301929091019060010161408e565b50505092915050565b600080604083850312156140c957600080fd5b6140d28361404e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561411f5761411f6140e0565b604052919050565b803560ff8116811461406557600080fd5b8015158114613f9d57600080fd5b803561406581614138565b60008060006060848603121561416657600080fd5b61416f8461404e565b925060208085013567ffffffffffffffff8082111561418d57600080fd5b818701915087601f8301126141a157600080fd5b8135818111156141b3576141b36140e0565b8060051b91506141c48483016140f6565b818152918301840191848101908a8411156141de57600080fd5b938501935b83851015614203576141f485614127565b825293850193908501906141e3565b80975050505050505061421860408501614146565b90509250925092565b6001600160601b03881681526001600160a01b0387811660208301528616604082015260e081016142556060830187613fec565b931515608082015260a081019290925260c090910152949350505050565b600082601f83011261428457600080fd5b6040516080810181811067ffffffffffffffff821117156142a7576142a76140e0565b6040528060808401858111156142bc57600080fd5b845b818110156142d65780358352602092830192016142be565b509195945050505050565b60008060a083850312156142f457600080fd5b6142fd8361404e565b915061430c8460208501614273565b90509250929050565b60008060008060008060008060006101808a8c03121561433457600080fd5b61433d8a61404e565b985060208a013561434d81614138565b975060408a0135965060608a0135955060808a0135945060a08a013593506143788b60c08c01614273565b92506101408a013591506101608a013590509295985092959850929598565b600082601f8301126143a857600080fd5b813567ffffffffffffffff8111156143c2576143c26140e0565b6143d5601f8201601f19166020016140f6565b8181528460208386010111156143ea57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561441c57600080fd5b833561442781613f88565b925060208401359150604084013567ffffffffffffffff81111561444a57600080fd5b61445686828701614397565b9150509250925092565b6000806040838503121561447357600080fd5b50508035926020909101359150565b600060a082018783526020878185015286604085015285606085015260a0608085015281855180845260c086019150828701935060005b818110156144de5784516001600160a01b0316835293830193918301916001016144b9565b50909a9950505050505050505050565b6000806040838503121561450157600080fd5b82359150602083013567ffffffffffffffff81111561451f57600080fd5b61452b85828601614397565b9150509250929050565b6000806040838503121561454857600080fd5b823561455381613f88565b915061430c6020840161404e565b600081518084526020808501945080840160005b8381101561459157815187529582019590820190600101614575565b509495945050505050565b8381526060602082015260006145b56060830185614561565b82810360408401526145c78185614561565b9695505050505050565b600080604083850312156145e457600080fd5b82356145ef81613f88565b915061430c60208401614127565b60006020828403121561460f57600080fd5b813567ffffffffffffffff81111561462657600080fd5b6137cc84828501614397565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156146b2576146b261468a565b500390565b6000602082840312156146c957600080fd5b5051919050565b600082198211156146e3576146e361468a565b500190565b60008160001904831182151516156147025761470261468a565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261472c5761472c614707565b500490565b60006020828403121561474357600080fd5b81516110b381614138565b60006000198214156147625761476261468a565b5060010190565b6000600160ff1b82141561477f5761477f61468a565b5060000390565b60008261479557614795614707565b500690565b60005b838110156147b557818101518382015260200161479d565b838111156127a45750506000910152565b600082516147d881846020870161479a565b9190910192915050565b838152826020820152606060408201526000825180606084015261480d81608085016020870161479a565b601f01601f191691909101608001949350505050565b60006020828403121561483557600080fd5b81516110b381613f88565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ad09d81c74b0f536e4ee725a8c32bb4644f5f4ea81e800bd6c61b79e0918d69a64736f6c634300080a0033", + "deployedBytecode": "0x60806040526004361061025b5760003560e01c8063840bc19c11610144578063d2b8035a116100b6578063eaff425a1161007a578063eaff425a14610819578063f441d9b31461082e578063f6a6ef7a1461084e578063f7434ea91461086e578063fbf405b01461088e578063fc6f8f16146108ae57600080fd5b8063d2b8035a1461074e578063d2d514e01461076e578063d578cbac1461079d578063de1a1e59146107bd578063e4c0aaf4146107f957600080fd5b8063afe15cfb11610108578063afe15cfb14610654578063b4a6160814610689578063c13517e11461069e578063c258bb19146106b1578063cf0c38f8146106d1578063d1c1df48146106f157600080fd5b8063840bc19c146105925780638a9bb02a146105ad5780638bb04875146105de578063a57366e7146105fe578063acdbf51d1461061e57600080fd5b80634b7fcda2116101dd57806359354c77116101a157806359354c77146104df57806359ec827e146104ff5780635bc24dd31461051f578063751accd01461053f5780637717a6e81461055f5780637e69b7b01461057f57600080fd5b80634b7fcda21461041c5780635468f9191461044c578063564a565d1461046c578063572603641461049f5780635788795d146104bf57600080fd5b806322684db01161022457806322684db01461036c5780632d29a47b146103995780632ea7b4d0146103b95780633cfd1184146103cf5780633e1d09be146103fc57600080fd5b8062f5822c146102605780630c340a2414610282578063115d5376146102bf5780631c3db16d146102df5780631f5a0dd21461030d575b600080fd5b34801561026c57600080fd5b5061028061027b366004613fa0565b6108ce565b005b34801561028e57600080fd5b506000546102a2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102cb57600080fd5b506102806102da366004613fbd565b610923565b3480156102eb57600080fd5b506102ff6102fa366004613fbd565b61101c565b6040519081526020016102b6565b34801561031957600080fd5b5061032d610328366004613fbd565b6110ba565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a083015260c082015260e0016102b6565b34801561037857600080fd5b5061038c610387366004613fbd565b611117565b6040516102b6919061400e565b3480156103a557600080fd5b506102806103b4366004614022565b611150565b3480156103c557600080fd5b506102ff61271081565b3480156103db57600080fd5b506103ef6103ea36600461406a565b611cd4565b6040516102b69190614085565b34801561040857600080fd5b506102806104173660046140b6565b611d45565b34801561042857600080fd5b5061043c610437366004613fbd565b611f60565b60405190151581526020016102b6565b34801561045857600080fd5b50610280610467366004614151565b611f99565b34801561047857600080fd5b5061048c610487366004613fbd565b6120fc565b6040516102b69796959493929190614221565b3480156104ab57600080fd5b506102806104ba3660046142e1565b612169565b3480156104cb57600080fd5b506102806104da366004614315565b6121d4565b3480156104eb57600080fd5b506102806104fa3660046140b6565b6124a8565b34801561050b57600080fd5b506102ff61051a366004613fbd565b612508565b34801561052b57600080fd5b5061028061053a3660046140b6565b612678565b34801561054b57600080fd5b5061028061055a366004614407565b6126d8565b34801561056b57600080fd5b5061028061057a3660046140b6565b6127aa565b61028061058d366004613fbd565b6127f8565b34801561059e57600080fd5b506102ff6001600160ff1b0381565b3480156105b957600080fd5b506105cd6105c8366004614460565b612b66565b6040516102b6959493929190614482565b3480156105ea57600080fd5b506102806105f9366004613fbd565b612c44565b34801561060a57600080fd5b506102806106193660046140b6565b612dc8565b34801561062a57600080fd5b506102a2610639366004613fbd565b6004602052600090815260409020546001600160a01b031681565b34801561066057600080fd5b5061067461066f366004613fbd565b612e28565b604080519283526020830191909152016102b6565b34801561069557600080fd5b506102ff600481565b6102ff6106ac3660046144ee565b612edc565b3480156106bd57600080fd5b506102806106cc366004613fa0565b613245565b3480156106dd57600080fd5b506002546102a2906001600160a01b031681565b3480156106fd57600080fd5b5061067461070c366004614535565b6001600160a01b0390911660009081526006602090815260408083206001600160601b0390941683526001840182528083205460029094019091529020549091565b34801561075a57600080fd5b50610280610769366004614460565b613291565b34801561077a57600080fd5b5061078e610789366004613fbd565b6135a6565b6040516102b69392919061459c565b3480156107a957600080fd5b5061043c6107b8366004613fbd565b61366e565b3480156107c957600080fd5b506102ff6107d8366004614460565b60009182526007602090815260408084209284526004909201905290205490565b34801561080557600080fd5b50610280610814366004613fa0565b6136a4565b34801561082557600080fd5b506102ff600381565b34801561083a57600080fd5b506102806108493660046145d1565b6136f0565b34801561085a57600080fd5b506102ff610869366004613fbd565b61374b565b34801561087a57600080fd5b506102ff6108893660046145fd565b613780565b34801561089a57600080fd5b506001546102a2906001600160a01b031681565b3480156108ba57600080fd5b506102ff6108c9366004613fbd565b6137d4565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016108f890614632565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006005828154811061093857610938614674565b9060005260206000209060050201905060006001826004018054905061095e91906146a0565b9050600082600401828154811061097757610977614674565b60009182526020822060059091020191506001840154600160a01b900460ff1660048111156109a8576109a8613fd6565b1415610b90576000821180610a30575082546003805490916001600160601b03169081106109d8576109d8614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610a0c57610a0c613fd6565b60048110610a1c57610a1c614674565b01546002840154610a2d90426146a0565b10155b610ab05760405162461bcd60e51b8152602060048201526044602482018190527f5468652065766964656e636520706572696f642074696d6520686173206e6f74908201527f207061737365642079657420616e64206974206973206e6f7420616e2061707060648201526332b0b61760e11b608482015260a4016108f8565b6003830154600482015414610b195760405162461bcd60e51b815260206004820152602960248201527f546865206469737075746520686173206e6f742066696e6973686564206472616044820152683bb4b733903cb2ba1760b91b60648201526084016108f8565b82546003805490916001600160601b0316908110610b3957610b39614674565b60009182526020909120600b9091020154600160601b900460ff16610b5f576002610b62565b60015b60018401805460ff60a01b1916600160a01b836004811115610b8657610b86613fd6565b0217905550610fc8565b600180840154600160a01b900460ff166004811115610bb157610bb1613fd6565b1415610cc05782546003805490916001600160601b0316908110610bd757610bd7614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610c0b57610c0b613fd6565b60048110610c1b57610c1b614674565b01546002840154610c2c90426146a0565b101580610c45575060018301546001600160a01b031633145b610ca45760405162461bcd60e51b815260206004820152602a60248201527f54686520636f6d6d697420706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108f8565b6001830180546002919060ff60a01b1916600160a01b83610b86565b60026001840154600160a01b900460ff166004811115610ce257610ce2613fd6565b1415610e2b5782546003805490916001600160601b0316908110610d0857610d08614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610d3c57610d3c613fd6565b60048110610d4c57610d4c614674565b01546002840154610d5d90426146a0565b101580610d76575060018301546001600160a01b031633145b610dd25760405162461bcd60e51b815260206004820152602760248201527f54686520766f746520706572696f642074696d6520686173206e6f74207061736044820152661cd959081e595d60ca1b60648201526084016108f8565b60018301805460ff60a01b1916600360a01b1790558254604051600160601b9091046001600160a01b03169085907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610fc8565b60036001840154600160a01b900460ff166004811115610e4d57610e4d613fd6565b1415610f455782546003805490916001600160601b0316908110610e7357610e73614674565b90600052602060002090600b02016006018360010160149054906101000a900460ff166004811115610ea757610ea7613fd6565b60048110610eb757610eb7614674565b01546002840154610ec890426146a0565b1015610f295760405162461bcd60e51b815260206004820152602a60248201527f5468652061707065616c20706572696f642074696d6520686173206e6f74207060448201526930b9b9b2b2103cb2ba1760b11b60648201526084016108f8565b6001830180546004919060ff60a01b1916600160a01b83610b86565b60046001840154600160a01b900460ff166004811115610f6757610f67613fd6565b1415610fc85760405162461bcd60e51b815260206004820152602a60248201527f546865206469737075746520697320616c726561647920696e20746865206c6160448201526939ba103832b934b7b21760b11b60648201526084016108f8565b426002840155600183015460405185917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b919161100e91600160a01b900460ff169061400e565b60405180910390a250505050565b6000806005838154811061103257611032614674565b6000918252602090912060059091020160010154604051631c3db16d60e01b8152600481018590526001600160a01b0390911691508190631c3db16d90602401602060405180830381865afa15801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b391906146b7565b9392505050565b600381815481106110ca57600080fd5b60009182526020909120600b9091020180546002820154600383015460048401546005850154600a909501546001600160601b0385169650600160601b90940460ff169492939192909187565b60006005828154811061112c5761112c614674565b6000918252602090912060059091020160010154600160a01b900460ff1692915050565b60006005848154811061116557611165614674565b60009182526020909120600590910201905060046001820154600160a01b900460ff16600481111561119957611199613fd6565b146111e65760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108f8565b6000828260040185815481106111fe576111fe614674565b90600052602060002090600502016002015461121a91906146d0565b9050600082600401858154811061123357611233614674565b9060005260206000209060050201600301549050600083600401868154811061125e5761125e614674565b6000918252602082206004600590920201810154600187015460405163368efae360e21b81529194506001600160a01b03169163da3beb8c916112ae918c918c9101918252602082015260400190565b602060405180830381865afa1580156112cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ef91906146b7565b90506000808261130a5783861115611305578395505b61132a565b6113158460026146e8565b86111561132a576113278460026146e8565b95505b6000876004018a8154811061134157611341614674565b90600052602060002090600502016002015490505b86811015611c435784811015611841576001880154604051634fe264fb60e01b8152600481018d9052602481018c9052604481018390526001600160a01b0390911690634fe264fb90606401602060405180830381865afa1580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e391906146b7565b91506127108211156113f55761271091505b600061271061140484826146a0565b8a6004018d8154811061141957611419614674565b90600052602060002090600502016000015461143591906146e8565b61143f919061471d565b905061144b81886146d0565b9650886004018b8154811061146257611462614674565b9060005260206000209060050201600401828154811061148457611484614674565b60009182526020808320909101546001600160a01b03168083526006825260408084208d546001600160601b031685526002019092529082208054919650839290916114d19084906146a0565b909155505088546003805483926001600160601b03169081106114f6576114f6614674565b90600052602060002090600b02016002015461151291906146d0565b6001600160a01b03851660009081526006602090815260408083208d546001600160601b031684526001019091529020541061159b5788546001600160a01b03851660009081526006602090815260408083206001600160601b03909416808452600190940190915290205461159591869161158f9085906146a0565b84613805565b506115ec565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b03168452600101909152902054156115ec5788546115ea9085906001600160601b0316600084613805565b505b600189015460405163ba66fde760e01b8152600481018e9052602481018d9052604481018490526001600160a01b039091169063ba66fde790606401602060405180830381865afa158015611645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116699190614731565b6117065760005b6001600160a01b038516600090815260066020526040902054811015611704576001600160a01b038516600090815260066020526040902080546116f1918791849081106116c0576116c0614674565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316600080613805565b50806116fc8161474e565b915050611670565b505b8b6001600160a01b0385167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e1961173b84614769565b60408051918252600060208301520160405180910390a361175d6001876146a0565b82141561183b578461183b5760005460048a0180546001600160a01b03909216916108fc91908e90811061179357611793614674565b9060005260206000209060050201600101549081150290604051600060405180830381858888f1505060015460005460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018d90529116935063a9059cbb925060440190506020604051808303816000875af1158015611815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118399190614731565b505b50611c31565b60018801546001600160a01b0316634fe264fb8c8c6118608986614786565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa1580156118a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cd91906146b7565b91506127108211156118df5761271091505b876004018a815481106118f4576118f4614674565b906000526020600020906005020160040185826119119190614786565b8154811061192157611921614674565b9060005260206000200160009054906101000a90046001600160a01b0316925061271082896004018c8154811061195a5761195a614674565b90600052602060002090600502016000015461197691906146e8565b611980919061471d565b6001600160a01b03841660009081526006602090815260408083208c546001600160601b03168452600201909152812080549091906119c09084906146a0565b90915550506001600160a01b03831660009081526006602090815260408083208b546001600160601b03168452600101909152902054611acf57600160009054906101000a90046001600160a01b03166001600160a01b031663a9059cbb84612710858c6004018f81548110611a3857611a38614674565b906000526020600020906005020160000154611a5491906146e8565b611a5e919061471d565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acd9190614731565b505b600061271083611adf878a61471d565b611ae991906146e8565b611af3919061471d565b9050600061271084878c6004018f81548110611b1157611b11614674565b906000526020600020906005020160010154611b2d919061471d565b611b3791906146e8565b611b41919061471d565b60015460405163a9059cbb60e01b81526001600160a01b0388811660048301526024820186905292935091169063a9059cbb906044016020604051808303816000875af1158015611b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bba9190614731565b506040516001600160a01b0386169082156108fc029083906000818181858888f19350505050508c856001600160a01b03167f24f45c2b08bbde8c837d70b67991ccb7660537cf749de21a940ae4858b681e198484604051611c26929190918252602082015260400190565b60405180910390a350505b80611c3b8161474e565b915050611356565b5084876004018a81548110611c5a57611c5a614674565b90600052602060002090600502016003015414611c9d5784876004018a81548110611c8757611c87614674565b9060005260206000209060050201600301819055505b85876004018a81548110611cb357611cb3614674565b90600052602060002090600502016002018190555050505050505050505050565b611cdc613edd565b60006003836001600160601b031681548110611cfa57611cfa614674565b60009182526020909120604080516080810191829052600b9093029091019250600683019060049082845b815481526020019060010190808311611d25575050505050915050919050565b6000546001600160a01b03163314611d6f5760405162461bcd60e51b81526004016108f890614632565b6001600160601b0382161580611de0575080600380846001600160601b031681548110611d9e57611d9e614674565b60009182526020909120600b909102015481546001600160601b03909116908110611dcb57611dcb614674565b90600052602060002090600b02016002015411155b611de957600080fd5b60005b6003836001600160601b031681548110611e0857611e08614674565b90600052602060002090600b020160010180549050811015611f295781600380856001600160601b031681548110611e4257611e42614674565b90600052602060002090600b02016001018381548110611e6457611e64614674565b906000526020600020015481548110611e7f57611e7f614674565b90600052602060002090600b0201600201541015611f175760405162461bcd60e51b815260206004820152604960248201527f4120737562636f7572742063616e6e6f742062652074686520706172656e742060448201527f6f66206120737562636f75727420776974682061206c6f776572206d696e696d6064820152683ab69039ba30b5b29760b91b608482015260a4016108f8565b80611f218161474e565b915050611dec565b50806003836001600160601b031681548110611f4757611f47614674565b90600052602060002090600b0201600201819055505050565b600060058281548110611f7557611f75614674565b6000918252602090912060059091020160010154600160a81b900460ff1692915050565b6000546001600160a01b03163314611fc35760405162461bcd60e51b81526004016108f890614632565b60006003846001600160601b031681548110611fe157611fe1614674565b90600052602060002090600b0201905060005b83518110156120f557600084828151811061201157612011614674565b602002602001015160ff166001901b90508315612083578083600a01541982161461207e5760405162461bcd60e51b815260206004820152601d60248201527f44697370757465206b697420616c726561647920737570706f7274656400000060448201526064016108f8565b6120d8565b8083600a01548216146120d85760405162461bcd60e51b815260206004820152601c60248201527f44697370757465206b6974206973206e6f7420737570706f727465640000000060448201526064016108f8565b600a830180549091189055806120ed8161474e565b915050611ff4565b5050505050565b6005818154811061210c57600080fd5b600091825260209091206005909102018054600182015460028301546003909301546001600160601b03831694506001600160a01b03600160601b9093048316939282169260ff600160a01b8404811693600160a81b9004169187565b6000546001600160a01b031633146121935760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b0316815481106121b0576121b0614674565b90600052602060002090600b02016006019060046121cf929190613efb565b505050565b6000546001600160a01b031633146121fe5760405162461bcd60e51b81526004016108f890614632565b8660038a6001600160601b03168154811061221b5761221b614674565b90600052602060002090600b02016002015411156122b15760405162461bcd60e51b815260206004820152604760248201527f4120737562636f7572742063616e6e6f742062652061206368696c64206f662060448201527f6120737562636f7572742077697468206120686967686572206d696e696d756d6064820152661039ba30b5b29760c91b608482015260a4016108f8565b6003805460408051610120810182526001600160601b038d1681528b151560208201529192919081016000604051908082528060200260200182016040528015612305578160200160208202803683370190505b50815260208082018c905260408083018c9052606083018b9052608083018a905260a0830189905260c09092018690528354600181810186556000958652948290208451600b909202018054858401511515600160601b026cffffffffffffffffffffffffff199091166001600160601b03909316929092179190911781559183015180519394929361239f938501929190910190613f39565b50606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e0820151816006019060046123df929190613efb565b506101009190910151600a9091015560405163483abc4f60e11b815260076004820152602481018290526044810184905273__$52cf47af9c3c0d67e54ac2a3225447effa$__90639075789e9060640160006040518083038186803b15801561244757600080fd5b505af415801561245b573d6000803e3d6000fd5b5050505060038a6001600160601b03168154811061247b5761247b614674565b600091825260208083206001600b9093020182018054928301815583529091200155505050505050505050565b6000546001600160a01b031633146124d25760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b0316815481106124ef576124ef614674565b90600052602060002090600b0201600401819055505050565b6000806005838154811061251e5761251e614674565b60009182526020909120600590910201805460038054929350916001600160601b0390911690811061255257612552614674565b90600052602060002090600b02016005015481600301541061261b5780546001600160601b031661258c576001600160ff1b039150612672565b600381015461259c9060026146e8565b6125a79060016146d0565b815460038054909182916001600160601b039091169081106125cb576125cb614674565b60009182526020909120600b909102015481546001600160601b039091169081106125f8576125f8614674565b90600052602060002090600b02016004015461261491906146e8565b9150612672565b600381015461262b9060026146e8565b6126369060016146d0565b81546003805490916001600160601b031690811061265657612656614674565b90600052602060002090600b0201600401546110b391906146e8565b50919050565b6000546001600160a01b031633146126a25760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b0316815481106126bf576126bf614674565b90600052602060002090600b0201600301819055505050565b6000546001600160a01b031633146127025760405162461bcd60e51b81526004016108f890614632565b6000836001600160a01b0316838360405161271d91906147c6565b60006040518083038185875af1925050503d806000811461275a576040519150601f19603f3d011682016040523d82523d6000602084013e61275f565b606091505b50509050806127a45760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b60448201526064016108f8565b50505050565b6127b73383836000613805565b6127f45760405162461bcd60e51b815260206004820152600e60248201526d14dd185ada5b99c819985a5b195960921b60448201526064016108f8565b5050565b61280181612508565b34101561285c5760405162461bcd60e51b8152602060048201526024808201527f4e6f7420656e6f7567682045544820746f20636f7665722061707065616c206360448201526337b9ba1760e11b60648201526084016108f8565b60006005828154811061287157612871614674565b60009182526020909120600590910201905060036001820154600160a01b900460ff1660048111156128a5576128a5613fd6565b146128f25760405162461bcd60e51b815260206004820152601a60248201527f44697370757465206973206e6f742061707065616c61626c652e00000000000060448201526064016108f8565b60018101546001600160a01b0316331461295c5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2044697370757465204b69742060448201526437b7363c9760d91b60648201526084016108f8565b80546003805490916001600160601b031690811061297c5761297c614674565b90600052602060002090600b0201600501548160030154106129e95780546003805490916001600160601b03169081106129b8576129b8614674565b60009182526020909120600b909102015481546bffffffffffffffffffffffff19166001600160601b039091161781555b60018101805460ff60a01b1916905542600282015580546003805490916001600160601b0316908110612a1e57612a1e614674565b90600052602060002090600b02016004015434612a3b919061471d565b60038083019190915560048201805460018101825560009182526020909120835483546005909302909101926127109290916001600160601b0316908110612a8557612a85614674565b600091825260209091206003600b90920201810154845482549192916001600160601b03909116908110612abb57612abb614674565b90600052602060002090600b020160020154612ad791906146e8565b612ae1919061471d565b81553460018201558154604051600160601b9091046001600160a01b03169084907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3827f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612b59919061400e565b60405180910390a2505050565b6000806000806060600060058881548110612b8357612b83614674565b906000526020600020906005020190506000816004018881548110612baa57612baa614674565b9060005260206000209060050201905080600001548160010154826002015483600301548460040180805480602002602001604051908101604052809291908181526020018280548015612c2757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c09575b505050505090509650965096509650965050509295509295909350565b600060058281548110612c5957612c59614674565b60009182526020909120600590910201905060046001820154600160a01b900460ff166004811115612c8d57612c8d613fd6565b14612cda5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520657865637574696f6e20706572696f642e000000000060448201526064016108f8565b6001810154600160a81b900460ff1615612d365760405162461bcd60e51b815260206004820152601860248201527f52756c696e6720616c72656164792065786563757465642e000000000000000060448201526064016108f8565b6000612d418361101c565b60018301805460ff60a81b1916600160a81b179055825460405163188d362b60e11b815260048101869052602481018390529192506001600160a01b03600160601b909104169063311a6c5690604401600060405180830381600087803b158015612dab57600080fd5b505af1158015612dbf573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314612df25760405162461bcd60e51b81526004016108f890614632565b806003836001600160601b031681548110612e0f57612e0f614674565b90600052602060002090600b0201600501819055505050565b600080600060058481548110612e4057612e40614674565b60009182526020909120600590910201905060036001820154600160a01b900460ff166004811115612e7457612e74613fd6565b1415612ecd576002810154815460038054929550916001600160601b03909116908110612ea357612ea3614674565b600091825260209091206009600b9092020101546002820154612ec691906146d0565b9150612ed6565b60009250600091505b50915091565b6000612ee782613780565b341015612f485760405162461bcd60e51b815260206004820152602960248201527f4e6f7420656e6f7567682045544820746f20636f76657220617262697472617460448201526834b7b71031b7b9ba1760b91b60648201526084016108f8565b600080612f5484613e19565b925050915060008160ff166001901b9050806003846001600160601b031681548110612f8257612f82614674565b90600052602060002090600b0201600a0154821614612ffd5760405162461bcd60e51b815260206004820152603160248201527f5468652064697370757465206b6974206973206e6f7420737570706f7274656460448201527008189e481d1a1a5cc81cdd5898dbdd5c9d607a1b60648201526084016108f8565b60058054600181018255600160601b33026001600160601b038087168281179484027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810195865560ff88166000908152600460205260409020547f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1820180546001600160a01b0319166001600160a01b03929092169182179055427f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29092019190915560038054959a5090949093909216179081106130df576130df614674565b90600052602060002090600b020160040154346130fc919061471d565b60038084019190915560048301805460018101825560009182526020909120845483546005909302909101926127109290916001600160601b031690811061314657613146614674565b600091825260209091206003600b90920201810154855482549192916001600160601b0390911690811061317c5761317c614674565b90600052602060002090600b02016002015461319891906146e8565b6131a2919061471d565b8155346001820155604051638d31de6d60e01b81526001600160a01b03831690638d31de6d906131da908a908d908d906004016147e2565b600060405180830381600087803b1580156131f457600080fd5b505af1158015613208573d6000803e3d6000fd5b50506040513392508991507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505092915050565b6000546001600160a01b0316331461326f5760405162461bcd60e51b81526004016108f890614632565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000600583815481106132a6576132a6614674565b906000526020600020906005020190506000600182600401805490506132cc91906146a0565b905060008260040182815481106132e5576132e5614674565b60009182526020822060059091020191506001840154600160a01b900460ff16600481111561331657613316613fd6565b146133635760405162461bcd60e51b815260206004820152601a60248201527f53686f756c642062652065766964656e636520706572696f642e00000000000060448201526064016108f8565b6001830154600482015460038501546001600160a01b039092169160009061338b88846146d0565b111561339b5785600301546133a5565b6133a587836146d0565b9050815b8181101561359b57604051633b30414760e01b8152600481018a90526000906001600160a01b03861690633b304147906024016020604051808303816000875af11580156133fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061341f9190614823565b90506001600160a01b038116156135885785546001600160a01b03821660009081526006602090815260408083208c546001600160601b03168452600201909152812080549091906134729084906146d0565b90915550506001600160a01b03811660009081526006602090815260408083208b546001600160601b031684526002810183528184205460019091019092529091205410156135195760405162461bcd60e51b815260206004820152602d60248201527f4c6f636b656420616d6f756e742073686f756c646e277420657863656564207360448201526c3a30b5b2b21030b6b7bab73a1760991b60648201526084016108f8565b60048601805460018101825560009182526020918290200180546001600160a01b0319166001600160a01b038416908117909155604080518a81529283018590528c927f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b910160405180910390a35b50806135938161474e565b9150506133a9565b505050505050505050565b600081815260076020908152604091829020805460018201805485518186028101860190965280865291946060948594939192919083018282801561360a57602002820191906000526020600020905b8154815260200190600101908083116135f6575b505050505092508060020180548060200260200160405190810160405280929190818152602001828054801561365f57602002820191906000526020600020905b81548152602001906001019080831161364b575b50505050509150509193909250565b60006003828154811061368357613683614674565b60009182526020909120600b9091020154600160601b900460ff1692915050565b6000546001600160a01b031633146136ce5760405162461bcd60e51b81526004016108f890614632565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461371a5760405162461bcd60e51b81526004016108f890614632565b60ff16600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006005828154811061376057613760614674565b60009182526020909120600590910201546001600160601b031692915050565b600080600061378e84613e19565b5091509150806003836001600160601b0316815481106137b0576137b0614674565b90600052602060002090600b0201600401546137cc91906146e8565b949350505050565b600080600583815481106137ea576137ea614674565b60009182526020909120600460059092020101549392505050565b6001600160a01b0384166000908152600660205260408120816138288787613e95565b604051637521ccb160e01b8152600760048201526001600160601b03881660248201526044810182905290915060009073__$52cf47af9c3c0d67e54ac2a3225447effa$__90637521ccb190606401602060405180830381865af4158015613894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b891906146b7565b9050851561397f576003876001600160601b0316815481106138dc576138dc614674565b90600052602060002090600b02016002015486108061391457506001600160601b038716600090815260028401602052604090205486105b1561392557600093505050506137cc565b8061397a57825460041161393f57600093505050506137cc565b8254600180820185556000858152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918a16021790555b613acb565b60005b8354811015613ac957876001600160601b03168460000182815481106139aa576139aa614674565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03161415613ab757835484906139e7906001906146a0565b815481106139f7576139f7614674565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316846000018281548110613a3557613a35614674565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b0316021790555083600001805480613a8157613a81614840565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055613ac9565b80613ac18161474e565b915050613982565b505b6001600160601b03871660009081526001840160205260408120548790613af39084906146a0565b613afd91906146d0565b6001600160601b038916600081815260018701602052604081208390559192505b81613be157604051631712e1c560e11b81526007600482015260248101829052604481018a90526064810186905273__$52cf47af9c3c0d67e54ac2a3225447effa$__90632e25c38a9060840160006040518083038186803b158015613b8357600080fd5b505af4158015613b97573d6000803e3d6000fd5b505050508060001415613bad5760019150613b1e565b60038181548110613bc057613bc0614674565b60009182526020909120600b90910201546001600160601b03169050613b1e565b604080516001600160601b038c168152602081018b90529081018490526001600160a01b038c16907f70ca4ec64687bf265f39041896f3dbf10b9f650503cb38f2b3569fdce7489c369060600160405180910390a26000848a10613ce857613c49858b6146a0565b90508015613ce3576001546040516323b872dd60e01b81526001600160a01b038e8116600483015230602483015260448201849052909116906323b872dd906064015b6020604051808303816000875af1158015613cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ccf9190614731565b613ce35760009750505050505050506137cc565b613e07565b89613d5f576001600160601b038b1660009081526002880160205260409020548990613d1490876146a0565b613d1e91906146a0565b90508015613ce35760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb90604401613c8c565b88613d6a8b876146a0565b613d7491906146a0565b90508015613e075760015460405163a9059cbb60e01b81526001600160a01b038e81166004830152602482018490529091169063a9059cbb906044016020604051808303816000875af1158015613dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613df39190614731565b613e075760009750505050505050506137cc565b5060019b9a5050505050505050505050565b60008060006040845110613e83575050506020810151604082015160608301516003546001600160601b03841610613e5057600092505b81613e5a57600391505b60ff81166000908152600460205260409020546001600160a01b0316613e7e575060005b613e8e565b506000915060039050815b9193909250565b600060405160005b6014811015613eb8578481600c011a81830153600101613e9d565b5060145b6020811015613ed45783811a81830153600101613ebc565b50519392505050565b60405180608001604052806004906020820280368337509192915050565b8260048101928215613f29579160200282015b82811115613f29578251825591602001919060010190613f0e565b50613f35929150613f73565b5090565b828054828255906000526020600020908101928215613f295791602002820182811115613f29578251825591602001919060010190613f0e565b5b80821115613f355760008155600101613f74565b6001600160a01b0381168114613f9d57600080fd5b50565b600060208284031215613fb257600080fd5b81356110b381613f88565b600060208284031215613fcf57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6005811061400a57634e487b7160e01b600052602160045260246000fd5b9052565b6020810161401c8284613fec565b92915050565b60008060006060848603121561403757600080fd5b505081359360208301359350604090920135919050565b80356001600160601b038116811461406557600080fd5b919050565b60006020828403121561407c57600080fd5b6110b38261404e565b60808101818360005b60048110156140ad57815183526020928301929091019060010161408e565b50505092915050565b600080604083850312156140c957600080fd5b6140d28361404e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561411f5761411f6140e0565b604052919050565b803560ff8116811461406557600080fd5b8015158114613f9d57600080fd5b803561406581614138565b60008060006060848603121561416657600080fd5b61416f8461404e565b925060208085013567ffffffffffffffff8082111561418d57600080fd5b818701915087601f8301126141a157600080fd5b8135818111156141b3576141b36140e0565b8060051b91506141c48483016140f6565b818152918301840191848101908a8411156141de57600080fd5b938501935b83851015614203576141f485614127565b825293850193908501906141e3565b80975050505050505061421860408501614146565b90509250925092565b6001600160601b03881681526001600160a01b0387811660208301528616604082015260e081016142556060830187613fec565b931515608082015260a081019290925260c090910152949350505050565b600082601f83011261428457600080fd5b6040516080810181811067ffffffffffffffff821117156142a7576142a76140e0565b6040528060808401858111156142bc57600080fd5b845b818110156142d65780358352602092830192016142be565b509195945050505050565b60008060a083850312156142f457600080fd5b6142fd8361404e565b915061430c8460208501614273565b90509250929050565b60008060008060008060008060006101808a8c03121561433457600080fd5b61433d8a61404e565b985060208a013561434d81614138565b975060408a0135965060608a0135955060808a0135945060a08a013593506143788b60c08c01614273565b92506101408a013591506101608a013590509295985092959850929598565b600082601f8301126143a857600080fd5b813567ffffffffffffffff8111156143c2576143c26140e0565b6143d5601f8201601f19166020016140f6565b8181528460208386010111156143ea57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561441c57600080fd5b833561442781613f88565b925060208401359150604084013567ffffffffffffffff81111561444a57600080fd5b61445686828701614397565b9150509250925092565b6000806040838503121561447357600080fd5b50508035926020909101359150565b600060a082018783526020878185015286604085015285606085015260a0608085015281855180845260c086019150828701935060005b818110156144de5784516001600160a01b0316835293830193918301916001016144b9565b50909a9950505050505050505050565b6000806040838503121561450157600080fd5b82359150602083013567ffffffffffffffff81111561451f57600080fd5b61452b85828601614397565b9150509250929050565b6000806040838503121561454857600080fd5b823561455381613f88565b915061430c6020840161404e565b600081518084526020808501945080840160005b8381101561459157815187529582019590820190600101614575565b509495945050505050565b8381526060602082015260006145b56060830185614561565b82810360408401526145c78185614561565b9695505050505050565b600080604083850312156145e457600080fd5b82356145ef81613f88565b915061430c60208401614127565b60006020828403121561460f57600080fd5b813567ffffffffffffffff81111561462657600080fd5b6137cc84828501614397565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156146b2576146b261468a565b500390565b6000602082840312156146c957600080fd5b5051919050565b600082198211156146e3576146e361468a565b500190565b60008160001904831182151516156147025761470261468a565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261472c5761472c614707565b500490565b60006020828403121561474357600080fd5b81516110b381614138565b60006000198214156147625761476261468a565b5060010190565b6000600160ff1b82141561477f5761477f61468a565b5060000390565b60008261479557614795614707565b500690565b60005b838110156147b557818101518382015260200161479d565b838111156127a45750506000910152565b600082516147d881846020870161479a565b9190910192915050565b838152826020820152606060408201526000825180606084015261480d81608085016020870161479a565b601f01601f191691909101608001949350505050565b60006020828403121561483557600080fd5b81516110b381613f88565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ad09d81c74b0f536e4ee725a8c32bb4644f5f4ea81e800bd6c61b79e0918d69a64736f6c634300080a0033", "libraries": { "SortitionSumTreeFactory": "0xf02733d9e5CbfE67B54F165b0277E1995106D526" }, @@ -1327,6 +1346,15 @@ "_disputeID": "The ID of the dispute." } }, + "getTimesPerPeriod(uint96)": { + "details": "Gets the timesPerPeriod array for a given court.", + "params": { + "_subcourtID": "The ID of the court to get the times from." + }, + "returns": { + "timesPerPeriod": "The timesPerPeriod array for the given court." + } + }, "passPeriod(uint256)": { "details": "Passes the period of a specified dispute.", "params": { @@ -1360,7 +1388,7 @@ "storageLayout": { "storage": [ { - "astId": 2101, + "astId": 2123, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "governor", "offset": 0, @@ -1368,7 +1396,7 @@ "type": "t_address" }, { - "astId": 2104, + "astId": 2126, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "pinakion", "offset": 0, @@ -1376,7 +1404,7 @@ "type": "t_contract(IERC20)623" }, { - "astId": 2106, + "astId": 2128, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurorProsecutionModule", "offset": 0, @@ -1384,44 +1412,44 @@ "type": "t_address" }, { - "astId": 2110, + "astId": 2132, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "courts", "offset": 0, "slot": "3", - "type": "t_array(t_struct(Court)2034_storage)dyn_storage" + "type": "t_array(t_struct(Court)2056_storage)dyn_storage" }, { - "astId": 2115, + "astId": 2137, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKits", "offset": 0, "slot": "4", - "type": "t_mapping(t_uint256,t_contract(IDisputeKit)1992)" + "type": "t_mapping(t_uint256,t_contract(IDisputeKit)2014)" }, { - "astId": 2119, + "astId": 2141, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputes", "offset": 0, "slot": "5", - "type": "t_array(t_struct(Dispute)2056_storage)dyn_storage" + "type": "t_array(t_struct(Dispute)2078_storage)dyn_storage" }, { - "astId": 2124, + "astId": 2146, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurors", "offset": 0, "slot": "6", - "type": "t_mapping(t_address,t_struct(Juror)2080_storage)" + "type": "t_mapping(t_address,t_struct(Juror)2102_storage)" }, { - "astId": 2127, + "astId": 2149, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "sortitionSumTrees", "offset": 0, "slot": "7", - "type": "t_struct(SortitionSumTrees)8619_storage" + "type": "t_struct(SortitionSumTrees)8704_storage" } ], "types": { @@ -1436,20 +1464,20 @@ "label": "address[]", "numberOfBytes": "32" }, - "t_array(t_struct(Court)2034_storage)dyn_storage": { - "base": "t_struct(Court)2034_storage", + "t_array(t_struct(Court)2056_storage)dyn_storage": { + "base": "t_struct(Court)2056_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Court[]", "numberOfBytes": "32" }, - "t_array(t_struct(Dispute)2056_storage)dyn_storage": { - "base": "t_struct(Dispute)2056_storage", + "t_array(t_struct(Dispute)2078_storage)dyn_storage": { + "base": "t_struct(Dispute)2078_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Dispute[]", "numberOfBytes": "32" }, - "t_array(t_struct(Round)2068_storage)dyn_storage": { - "base": "t_struct(Round)2068_storage", + "t_array(t_struct(Round)2090_storage)dyn_storage": { + "base": "t_struct(Round)2090_storage", "encoding": "dynamic_array", "label": "struct KlerosCore.Round[]", "numberOfBytes": "32" @@ -1482,12 +1510,12 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IArbitrable)1858": { + "t_contract(IArbitrable)1880": { "encoding": "inplace", "label": "contract IArbitrable", "numberOfBytes": "20" }, - "t_contract(IDisputeKit)1992": { + "t_contract(IDisputeKit)2014": { "encoding": "inplace", "label": "contract IDisputeKit", "numberOfBytes": "20" @@ -1497,24 +1525,24 @@ "label": "contract IERC20", "numberOfBytes": "20" }, - "t_enum(Period)2012": { + "t_enum(Period)2034": { "encoding": "inplace", "label": "enum KlerosCore.Period", "numberOfBytes": "1" }, - "t_mapping(t_address,t_struct(Juror)2080_storage)": { + "t_mapping(t_address,t_struct(Juror)2102_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct KlerosCore.Juror)", "numberOfBytes": "32", - "value": "t_struct(Juror)2080_storage" + "value": "t_struct(Juror)2102_storage" }, - "t_mapping(t_bytes32,t_struct(SortitionSumTree)8613_storage)": { + "t_mapping(t_bytes32,t_struct(SortitionSumTree)8698_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct SortitionSumTreeFactory.SortitionSumTree)", "numberOfBytes": "32", - "value": "t_struct(SortitionSumTree)8613_storage" + "value": "t_struct(SortitionSumTree)8698_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -1530,12 +1558,12 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_uint256,t_contract(IDisputeKit)1992)": { + "t_mapping(t_uint256,t_contract(IDisputeKit)2014)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => contract IDisputeKit)", "numberOfBytes": "32", - "value": "t_contract(IDisputeKit)1992" + "value": "t_contract(IDisputeKit)2014" }, "t_mapping(t_uint96,t_uint256)": { "encoding": "mapping", @@ -1544,12 +1572,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(Court)2034_storage": { + "t_struct(Court)2056_storage": { "encoding": "inplace", "label": "struct KlerosCore.Court", "members": [ { - "astId": 2014, + "astId": 2036, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "parent", "offset": 0, @@ -1557,7 +1585,7 @@ "type": "t_uint96" }, { - "astId": 2016, + "astId": 2038, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "hiddenVotes", "offset": 12, @@ -1565,7 +1593,7 @@ "type": "t_bool" }, { - "astId": 2019, + "astId": 2041, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "children", "offset": 0, @@ -1573,7 +1601,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 2021, + "astId": 2043, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "minStake", "offset": 0, @@ -1581,7 +1609,7 @@ "type": "t_uint256" }, { - "astId": 2023, + "astId": 2045, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "alpha", "offset": 0, @@ -1589,7 +1617,7 @@ "type": "t_uint256" }, { - "astId": 2025, + "astId": 2047, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "feeForJuror", "offset": 0, @@ -1597,7 +1625,7 @@ "type": "t_uint256" }, { - "astId": 2027, + "astId": 2049, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "jurorsForCourtJump", "offset": 0, @@ -1605,7 +1633,7 @@ "type": "t_uint256" }, { - "astId": 2031, + "astId": 2053, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "timesPerPeriod", "offset": 0, @@ -1613,7 +1641,7 @@ "type": "t_array(t_uint256)4_storage" }, { - "astId": 2033, + "astId": 2055, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "supportedDisputeKits", "offset": 0, @@ -1623,12 +1651,12 @@ ], "numberOfBytes": "352" }, - "t_struct(Dispute)2056_storage": { + "t_struct(Dispute)2078_storage": { "encoding": "inplace", "label": "struct KlerosCore.Dispute", "members": [ { - "astId": 2036, + "astId": 2058, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "subcourtID", "offset": 0, @@ -1636,31 +1664,31 @@ "type": "t_uint96" }, { - "astId": 2039, + "astId": 2061, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "arbitrated", "offset": 12, "slot": "0", - "type": "t_contract(IArbitrable)1858" + "type": "t_contract(IArbitrable)1880" }, { - "astId": 2042, + "astId": 2064, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "disputeKit", "offset": 0, "slot": "1", - "type": "t_contract(IDisputeKit)1992" + "type": "t_contract(IDisputeKit)2014" }, { - "astId": 2045, + "astId": 2067, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "period", "offset": 20, "slot": "1", - "type": "t_enum(Period)2012" + "type": "t_enum(Period)2034" }, { - "astId": 2047, + "astId": 2069, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "ruled", "offset": 21, @@ -1668,7 +1696,7 @@ "type": "t_bool" }, { - "astId": 2049, + "astId": 2071, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "lastPeriodChange", "offset": 0, @@ -1676,7 +1704,7 @@ "type": "t_uint256" }, { - "astId": 2051, + "astId": 2073, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nbVotes", "offset": 0, @@ -1684,22 +1712,22 @@ "type": "t_uint256" }, { - "astId": 2055, + "astId": 2077, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "rounds", "offset": 0, "slot": "4", - "type": "t_array(t_struct(Round)2068_storage)dyn_storage" + "type": "t_array(t_struct(Round)2090_storage)dyn_storage" } ], "numberOfBytes": "160" }, - "t_struct(Juror)2080_storage": { + "t_struct(Juror)2102_storage": { "encoding": "inplace", "label": "struct KlerosCore.Juror", "members": [ { - "astId": 2071, + "astId": 2093, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "subcourtIDs", "offset": 0, @@ -1707,7 +1735,7 @@ "type": "t_array(t_uint96)dyn_storage" }, { - "astId": 2075, + "astId": 2097, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "stakedTokens", "offset": 0, @@ -1715,7 +1743,7 @@ "type": "t_mapping(t_uint96,t_uint256)" }, { - "astId": 2079, + "astId": 2101, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "lockedTokens", "offset": 0, @@ -1725,12 +1753,12 @@ ], "numberOfBytes": "96" }, - "t_struct(Round)2068_storage": { + "t_struct(Round)2090_storage": { "encoding": "inplace", "label": "struct KlerosCore.Round", "members": [ { - "astId": 2058, + "astId": 2080, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "tokensAtStakePerJuror", "offset": 0, @@ -1738,7 +1766,7 @@ "type": "t_uint256" }, { - "astId": 2060, + "astId": 2082, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "totalFeesForJurors", "offset": 0, @@ -1746,7 +1774,7 @@ "type": "t_uint256" }, { - "astId": 2062, + "astId": 2084, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "repartitions", "offset": 0, @@ -1754,7 +1782,7 @@ "type": "t_uint256" }, { - "astId": 2064, + "astId": 2086, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "penalties", "offset": 0, @@ -1762,7 +1790,7 @@ "type": "t_uint256" }, { - "astId": 2067, + "astId": 2089, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "drawnJurors", "offset": 0, @@ -1772,12 +1800,12 @@ ], "numberOfBytes": "160" }, - "t_struct(SortitionSumTree)8613_storage": { + "t_struct(SortitionSumTree)8698_storage": { "encoding": "inplace", "label": "struct SortitionSumTreeFactory.SortitionSumTree", "members": [ { - "astId": 8598, + "astId": 8683, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "K", "offset": 0, @@ -1785,7 +1813,7 @@ "type": "t_uint256" }, { - "astId": 8601, + "astId": 8686, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "stack", "offset": 0, @@ -1793,7 +1821,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 8604, + "astId": 8689, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nodes", "offset": 0, @@ -1801,7 +1829,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 8608, + "astId": 8693, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "IDsToNodeIndexes", "offset": 0, @@ -1809,7 +1837,7 @@ "type": "t_mapping(t_bytes32,t_uint256)" }, { - "astId": 8612, + "astId": 8697, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "nodeIndexesToIDs", "offset": 0, @@ -1819,17 +1847,17 @@ ], "numberOfBytes": "160" }, - "t_struct(SortitionSumTrees)8619_storage": { + "t_struct(SortitionSumTrees)8704_storage": { "encoding": "inplace", "label": "struct SortitionSumTreeFactory.SortitionSumTrees", "members": [ { - "astId": 8618, + "astId": 8703, "contract": "src/arbitration/KlerosCore.sol:KlerosCore", "label": "sortitionSumTrees", "offset": 0, "slot": "0", - "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)8613_storage)" + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)8698_storage)" } ], "numberOfBytes": "32" diff --git a/contracts/deployments/arbitrumRinkeby/SafeBridgeArbitrum.json b/contracts/deployments/arbitrumRinkeby/SafeBridgeArbitrum.json index b001e11f6..72cc7cb9d 100644 --- a/contracts/deployments/arbitrumRinkeby/SafeBridgeArbitrum.json +++ b/contracts/deployments/arbitrumRinkeby/SafeBridgeArbitrum.json @@ -1,5 +1,5 @@ { - "address": "0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD", + "address": "0x1406bC99873d16Cde3491F809f1Af9442cb5A338", "abi": [ { "anonymous": false, @@ -39,25 +39,25 @@ "type": "function" } ], - "transactionHash": "0x29b0ca8c481531a2209f2f268db8195d6d2398f9dc93c09401bd65482ba71bc3", + "transactionHash": "0xa7899bcb74e96e88994d8a9cccf51136680b236c2cfdab4ea2e7f3db5c4d797b", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD", + "contractAddress": "0x1406bC99873d16Cde3491F809f1Af9442cb5A338", "transactionIndex": 0, - "gasUsed": "1574087", + "gasUsed": "1575466", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x191b5cf71955a086a177cc63ee65b9def4d729d65b90f1b7d2e3b7c152a46c74", - "transactionHash": "0x29b0ca8c481531a2209f2f268db8195d6d2398f9dc93c09401bd65482ba71bc3", + "blockHash": "0x1129d518a7b3498206754578e5c8882dd2266ece37a097986b2b3a0429ae58b6", + "transactionHash": "0xa7899bcb74e96e88994d8a9cccf51136680b236c2cfdab4ea2e7f3db5c4d797b", "logs": [], - "blockNumber": 9361449, - "cumulativeGasUsed": "10087", + "blockNumber": 9610366, + "cumulativeGasUsed": "10086", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"withdrawalId\",\"type\":\"uint256\"}],\"name\":\"L2ToL1TxCreated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"sendSafe\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"sendSafe(address,bytes)\":{\"params\":{\"_calldata\":\"The L2 encoded message data.\",\"_receiver\":\"The L1 contract address who will receive the calldata\"},\"returns\":{\"_0\":\"Unique id to track the message request/transaction.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"sendSafe(address,bytes)\":{\"notice\":\"Sends an arbitrary message from one domain to another.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridge/SafeBridgeArbitrum.sol\":\"SafeBridgeArbitrum\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/bridge/SafeBridgeArbitrum.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 \\\"./interfaces/arbitrum/IArbSys.sol\\\";\\nimport \\\"./interfaces/arbitrum/AddressAliasHelper.sol\\\";\\n\\nimport \\\"./interfaces/ISafeBridge.sol\\\";\\n\\ncontract SafeBridgeArbitrum is ISafeBridge {\\n IArbSys constant arbsys = IArbSys(address(100));\\n\\n event L2ToL1TxCreated(uint256 indexed withdrawalId);\\n\\n function sendSafe(address _receiver, bytes memory _calldata) external payable override returns (uint256) {\\n uint256 withdrawalId = arbsys.sendTxToL1(_receiver, _calldata);\\n\\n emit L2ToL1TxCreated(withdrawalId);\\n return withdrawalId;\\n }\\n}\\n\",\"keccak256\":\"0x0079614dca40603a39d3f61fa9e31f0dbe267897b926774953c889a8c599e3fa\",\"license\":\"MIT\"},\"src/bridge/interfaces/ISafeBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface ISafeBridge {\\n /**\\n * Sends an arbitrary message from one domain to another.\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The L2 encoded message data.\\n * @return Unique id to track the message request/transaction.\\n */\\n function sendSafe(address _receiver, bytes memory _calldata) external payable returns (uint256);\\n}\\n\",\"keccak256\":\"0x2e7ab23dc7721f51f3d115ea3a06c590869e8671ed824987756ab4bb224845d1\",\"license\":\"MIT\"},\"src/bridge/interfaces/arbitrum/AddressAliasHelper.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n\\n/*\\n * Copyright 2019-2021, Offchain Labs, Inc.\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n * http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n\\npragma solidity >=0.7.0;\\n\\nlibrary AddressAliasHelper {\\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\\n\\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\\n /// the inbox to the msg.sender viewed in the L2\\n /// @param l1Address the address in the L1 that triggered the tx to L2\\n /// @return l2Address L2 address as viewed in msg.sender\\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\\n l2Address = address(uint160(l1Address) + offset);\\n }\\n\\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\\n /// address in the L1 that submitted a tx to the inbox\\n /// @param l2Address L2 address as viewed in msg.sender\\n /// @return l1Address the address in the L1 that triggered the tx to L2\\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\\n l1Address = address(uint160(l2Address) - offset);\\n }\\n}\\n\",\"keccak256\":\"0xdd595bb9f30932cb16758f5f561b80a8fcfbf239e68319615c39441b2781a9cd\",\"license\":\"Apache-2.0\"},\"src/bridge/interfaces/arbitrum/IArbSys.sol\":{\"content\":\"pragma solidity >=0.7.0;\\n\\n/**\\n * @title Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. Exposes a variety of system-level functionality.\\n */\\ninterface IArbSys {\\n /**\\n * @notice Get internal version number identifying an ArbOS build\\n * @return version number as int\\n */\\n function arbOSVersion() external pure returns (uint256);\\n\\n /**\\n * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0)\\n * @return block number as int\\n */\\n function arbBlockNumber() external view returns (uint256);\\n\\n /**\\n * @notice Send given amount of Eth to dest from sender.\\n * This is a convenience function, which is equivalent to calling sendTxToL1 with empty calldataForL1.\\n * @param destination recipient address on L1\\n * @return unique identifier for this L2-to-L1 transaction.\\n */\\n function withdrawEth(address destination) external payable returns (uint256);\\n\\n /**\\n * @notice Send a transaction to L1\\n * @param destination recipient address on L1\\n * @param calldataForL1 (optional) calldata for L1 contract call\\n * @return a unique identifier for this L2-to-L1 transaction.\\n */\\n function sendTxToL1(address destination, bytes calldata calldataForL1) external payable returns (uint256);\\n\\n /**\\n * @notice get the number of transactions issued by the given external account or the account sequence number of the given contract\\n * @param account target account\\n * @return the number of transactions issued by the given external account or the account sequence number of the given contract\\n */\\n function getTransactionCount(address account) external view returns (uint256);\\n\\n /**\\n * @notice get the value of target L2 storage slot\\n * This function is only callable from address 0 to prevent contracts from being able to call it\\n * @param account target account\\n * @param index target index of storage slot\\n * @return stotage value for the given account at the given index\\n */\\n function getStorageAt(address account, uint256 index) external view returns (uint256);\\n\\n /**\\n * @notice check if current call is coming from l1\\n * @return true if the caller of this was called directly from L1\\n */\\n function isTopLevelCall() external view returns (bool);\\n\\n event EthWithdrawal(address indexed destAddr, uint256 amount);\\n\\n event L2ToL1Transaction(\\n address caller,\\n address indexed destination,\\n uint256 indexed uniqueId,\\n uint256 indexed batchNumber,\\n uint256 indexInBatch,\\n uint256 arbBlockNum,\\n uint256 ethBlockNum,\\n uint256 timestamp,\\n uint256 callvalue,\\n bytes data\\n );\\n}\\n\",\"keccak256\":\"0xb4607d26251273b1f9307a845295fcb982d729eb5b40efeadefb21795fad9370\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50610285806100206000396000f3fe60806040526004361061001e5760003560e01c8063be44ae1c14610023575b600080fd5b610036610031366004610101565b610048565b60405190815260200160405180910390f35b6040516349460b4d60e11b8152600090819060649063928c169a9061007390879087906004016101d1565b6020604051808303816000875af1158015610092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b69190610236565b60405190915081907facd96f3817031b95eab52de9132d4a9dd13dac3d9dfcfe950ca9283c89b851a590600090a29392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561011457600080fd5b82356001600160a01b038116811461012b57600080fd5b9150602083013567ffffffffffffffff8082111561014857600080fd5b818501915085601f83011261015c57600080fd5b81358181111561016e5761016e6100eb565b604051601f8201601f19908116603f01168101908382118183101715610196576101966100eb565b816040528281528860208487010111156101af57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561020d578581018301518582016060015282016101f1565b8181111561021f576000606083870101525b50601f01601f191692909201606001949350505050565b60006020828403121561024857600080fd5b505191905056fea2646970667358221220691aeb3681b0b3a9b12bd40f31d52435b0fb90aeb41a724c79e99fdcc31d653c64736f6c634300080a0033", "deployedBytecode": "0x60806040526004361061001e5760003560e01c8063be44ae1c14610023575b600080fd5b610036610031366004610101565b610048565b60405190815260200160405180910390f35b6040516349460b4d60e11b8152600090819060649063928c169a9061007390879087906004016101d1565b6020604051808303816000875af1158015610092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b69190610236565b60405190915081907facd96f3817031b95eab52de9132d4a9dd13dac3d9dfcfe950ca9283c89b851a590600090a29392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561011457600080fd5b82356001600160a01b038116811461012b57600080fd5b9150602083013567ffffffffffffffff8082111561014857600080fd5b818501915085601f83011261015c57600080fd5b81358181111561016e5761016e6100eb565b604051601f8201601f19908116603f01168101908382118183101715610196576101966100eb565b816040528281528860208487010111156101af57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561020d578581018301518582016060015282016101f1565b8181111561021f576000606083870101525b50601f01601f191692909201606001949350505050565b60006020828403121561024857600080fd5b505191905056fea2646970667358221220691aeb3681b0b3a9b12bd40f31d52435b0fb90aeb41a724c79e99fdcc31d653c64736f6c634300080a0033", diff --git a/contracts/deployments/rinkeby/ArbitrableExample.json b/contracts/deployments/rinkeby/ArbitrableExample.json new file mode 100644 index 000000000..eed7c7fcb --- /dev/null +++ b/contracts/deployments/rinkeby/ArbitrableExample.json @@ -0,0 +1,387 @@ +{ + "address": "0xf2a59723c5d625D646668E0B615B5764c3F81540", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "string", + "name": "_metaEvidence", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "Dispute", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "MetaEvidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "externalIDtoLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x406582131f309fb50052581bc73096da106295ee90ecc87de51e5e8d7d89d08d", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0xf2a59723c5d625D646668E0B615B5764c3F81540", + "transactionIndex": 17, + "gasUsed": "436046", + "logsBloom": "0x00000000000000000000000000010000000000200000000000000004000000000000000000000008000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa268edbb4988b83fb267b8c94aa089bde23da30f079397fa7666e6ea7877fce8", + "transactionHash": "0x406582131f309fb50052581bc73096da106295ee90ecc87de51e5e8d7d89d08d", + "logs": [ + { + "transactionIndex": 17, + "blockNumber": 10190113, + "transactionHash": "0x406582131f309fb50052581bc73096da106295ee90ecc87de51e5e8d7d89d08d", + "address": "0xf2a59723c5d625D646668E0B615B5764c3F81540", + "topics": [ + "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000007b68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f6b6c65726f732f6b6c65726f732d76322f6d61737465722f636f6e7472616374732f6465706c6f796d656e74732f72696e6b6562792f4d65746145766964656e63655f41726269747261626c654578616d706c652e6a736f6e0000000000", + "logIndex": 22, + "blockHash": "0xa268edbb4988b83fb267b8c94aa089bde23da30f079397fa7666e6ea7877fce8" + } + ], + "blockNumber": 10190113, + "cumulativeGasUsed": "8543318", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf02733d9e5CbfE67B54F165b0277E1995106D526", + "https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json" + ], + "numDeployments": 3, + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"Dispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"Evidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_metaEvidence\":\"The URI of the meta evidence object for evidence submissions requests.\"}},\"createDispute(uint256,bytes,uint256)\":{\"details\":\"TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group that is linked to this dispute.\",\"_numberOfRulingOptions\":\"Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/arbitration/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\nimport \\\"../evidence/IMetaEvidence.sol\\\";\\n\\n/**\\n * @title ArbitrableExample\\n * An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\n */\\ncontract ArbitrableExample is IArbitrable, IMetaEvidence {\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n uint256 constant META_EVIDENCE_ID = 0;\\n\\n IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n /** @dev Constructor\\n * @param _arbitrator The arbitrator to rule on created disputes.\\n * @param _metaEvidence The URI of the meta evidence object for evidence submissions requests.\\n */\\n constructor(IArbitrator _arbitrator, string memory _metaEvidence) {\\n arbitrator = _arbitrator;\\n\\n emit MetaEvidence(META_EVIDENCE_ID, _metaEvidence);\\n }\\n\\n /** @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute.\\n Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n * @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\\n * @param _arbitratorExtraData Extra data for the arbitrator.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n * @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n */\\n function createDispute(uint256 _numberOfRulingOptions, bytes calldata _arbitratorExtraData, uint256 _evidenceGroupID)\\n external\\n payable\\n returns (uint256 disputeID)\\n {\\n require(_numberOfRulingOptions > 1, \\\"Incorrect number of choices\\\");\\n\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: _numberOfRulingOptions}));\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n emit Dispute(arbitrator, disputeID, META_EVIDENCE_ID, _evidenceGroupID);\\n }\\n\\n /** @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n * @param _externalDisputeID ID of the dispute in arbitrator contract.\\n * @param _ruling The ruling choice of the arbitration.\\n */\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n}\\n\",\"keccak256\":\"0x9143e8d6540935e1dd73d36b145440b3fb29d5e4b2afa43ecf3faa3c9ecd9e5f\",\"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/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 raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n */\\n event Evidence(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _evidenceGroupID,\\n address indexed _party,\\n string _evidence\\n );\\n}\\n\",\"keccak256\":\"0xbd6a3d07e2e192f521340f62965aae59e0ece36cf4ae6918d461725e6a51b70c\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"pragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\nimport \\\"./IEvidence.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IMetaEvidence is IEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\n /**\\n * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0x18ad77e96ca1592f7833c4d3a93a8a7de55bff137d357d66040f99ac13bf1f88\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b506040516108a73803806108a783398101604081905261002f916100c4565b6001600160a01b0382166080526040516000907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d9061006f908490610192565b60405180910390a250506101c5565b634e487b7160e01b600052604160045260246000fd5b60005b838110156100af578181015183820152602001610097565b838111156100be576000848401525b50505050565b600080604083850312156100d757600080fd5b82516001600160a01b03811681146100ee57600080fd5b60208401519092506001600160401b038082111561010b57600080fd5b818501915085601f83011261011f57600080fd5b8151818111156101315761013161007e565b604051601f8201601f19908116603f011681019083821181831017156101595761015961007e565b8160405282815288602084870101111561017257600080fd5b610183836020830160208801610094565b80955050505050509250929050565b60208152600082518060208401526101b1816040850160208701610094565b601f01601f19169190910160400192915050565b6080516106b36101f46000396000818160e6015281816101850152818161045401526104fe01526106b36000f3fe60806040526004361061004a5760003560e01c8063311a6c561461004f578063564a565d146100715780636137048c146100b35780636cc6cde1146100d4578063c21ae06114610120575b600080fd5b34801561005b57600080fd5b5061006f61006a36600461055b565b61014d565b005b34801561007d57600080fd5b5061009161008c36600461057d565b61030a565b6040805193151584526020840192909252908201526060015b60405180910390f35b6100c66100c1366004610596565b610341565b6040519081526020016100aa565b3480156100e057600080fd5b506101087f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100aa565b34801561012c57600080fd5b506100c661013b36600461057d565b60006020819052908152604090205481565b600082815260208190526040812054600180549192918390811061017357610173610618565b906000526020600020906003020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b0316146102175760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806002015483111561025d5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b604482015260640161020e565b805460ff16156102bb5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b606482015260840161020e565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6001818154811061031a57600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000600185116103935760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f696365730000000000604482015260640161020e565b60018054604080516060810182526000808252602082018181528284018b815285870187559590915290517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf660038502908101805460ff19169215159290921790915590517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf782015592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf890930192909255905163c13517e160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c13517e1903490610497908a908a908a9060040161062e565b60206040518083038185885af11580156104b5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906104da9190610664565b600081815260208181526040808320859055805192835290820186905291935083917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350949350505050565b6000806040838503121561056e57600080fd5b50508035926020909101359150565b60006020828403121561058f57600080fd5b5035919050565b600080600080606085870312156105ac57600080fd5b84359350602085013567ffffffffffffffff808211156105cb57600080fd5b818701915087601f8301126105df57600080fd5b8135818111156105ee57600080fd5b88602082850101111561060057600080fd5b95986020929092019750949560400135945092505050565b634e487b7160e01b600052603260045260246000fd5b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b60006020828403121561067657600080fd5b505191905056fea264697066735822122050c354a55dfdcbdc85fe9f5328450b0f078566ba2a66414be12209ccb90f11b464736f6c634300080a0033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063311a6c561461004f578063564a565d146100715780636137048c146100b35780636cc6cde1146100d4578063c21ae06114610120575b600080fd5b34801561005b57600080fd5b5061006f61006a36600461055b565b61014d565b005b34801561007d57600080fd5b5061009161008c36600461057d565b61030a565b6040805193151584526020840192909252908201526060015b60405180910390f35b6100c66100c1366004610596565b610341565b6040519081526020016100aa565b3480156100e057600080fd5b506101087f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100aa565b34801561012c57600080fd5b506100c661013b36600461057d565b60006020819052908152604090205481565b600082815260208190526040812054600180549192918390811061017357610173610618565b906000526020600020906003020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b0316146102175760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806002015483111561025d5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b604482015260640161020e565b805460ff16156102bb5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b606482015260840161020e565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6001818154811061031a57600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000600185116103935760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f696365730000000000604482015260640161020e565b60018054604080516060810182526000808252602082018181528284018b815285870187559590915290517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf660038502908101805460ff19169215159290921790915590517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf782015592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf890930192909255905163c13517e160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c13517e1903490610497908a908a908a9060040161062e565b60206040518083038185885af11580156104b5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906104da9190610664565b600081815260208181526040808320859055805192835290820186905291935083917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350949350505050565b6000806040838503121561056e57600080fd5b50508035926020909101359150565b60006020828403121561058f57600080fd5b5035919050565b600080600080606085870312156105ac57600080fd5b84359350602085013567ffffffffffffffff808211156105cb57600080fd5b818701915087601f8301126105df57600080fd5b8135818111156105ee57600080fd5b88602082850101111561060057600080fd5b95986020929092019750949560400135945092505050565b634e487b7160e01b600052603260045260246000fd5b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b60006020828403121561067657600080fd5b505191905056fea264697066735822122050c354a55dfdcbdc85fe9f5328450b0f078566ba2a66414be12209ccb90f11b464736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "The arbitrator to rule on created disputes.", + "_metaEvidence": "The URI of the meta evidence object for evidence submissions requests." + } + }, + "createDispute(uint256,bytes,uint256)": { + "details": "TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator.", + "_evidenceGroupID": "Unique identifier of the evidence group that is linked to this dispute.", + "_numberOfRulingOptions": "Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 696, + "contract": "src/arbitration/ArbitrableExample.sol:ArbitrableExample", + "label": "externalIDtoLocalID", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 700, + "contract": "src/arbitration/ArbitrableExample.sol:ArbitrableExample", + "label": "disputes", + "offset": 0, + "slot": "1", + "type": "t_array(t_struct(DisputeStruct)686_storage)dyn_storage" + } + ], + "types": { + "t_array(t_struct(DisputeStruct)686_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)686_storage", + "encoding": "dynamic_array", + "label": "struct ArbitrableExample.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)686_storage": { + "encoding": "inplace", + "label": "struct ArbitrableExample.DisputeStruct", + "members": [ + { + "astId": 681, + "contract": "src/arbitration/ArbitrableExample.sol:ArbitrableExample", + "label": "isRuled", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 683, + "contract": "src/arbitration/ArbitrableExample.sol:ArbitrableExample", + "label": "ruling", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 685, + "contract": "src/arbitration/ArbitrableExample.sol:ArbitrableExample", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/rinkeby/FastBridgeReceiver.json b/contracts/deployments/rinkeby/FastBridgeReceiver.json index fdfe1294f..47b7bccf5 100644 --- a/contracts/deployments/rinkeby/FastBridgeReceiver.json +++ b/contracts/deployments/rinkeby/FastBridgeReceiver.json @@ -1,5 +1,5 @@ { - "address": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "address": "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", "abi": [ { "inputs": [ @@ -192,19 +192,19 @@ "type": "function" } ], - "transactionHash": "0xcab257fdd573ac09f2c4f334398c75acc8b4b2aaf82027a36d2fd640def2d6ac", + "transactionHash": "0x15b12d9a11d91679f1ec9360ba1e410a110114f34334ac362efcd36d5eb812ea", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", - "transactionIndex": 31, + "contractAddress": "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", + "transactionIndex": 5, "gasUsed": "667272", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x59c065fd6d66687c3e4432b2f0e67748b16bdd05c35155d23e171a790ef65c08", - "transactionHash": "0xcab257fdd573ac09f2c4f334398c75acc8b4b2aaf82027a36d2fd640def2d6ac", + "blockHash": "0x070121f019f299b0e1b45539454cf8e31fc1fb4b0add90d2f9836a3f5562efb1", + "transactionHash": "0x15b12d9a11d91679f1ec9360ba1e410a110114f34334ac362efcd36d5eb812ea", "logs": [], - "blockNumber": 10134452, - "cumulativeGasUsed": "4060790", + "blockNumber": 10190111, + "cumulativeGasUsed": "1083833", "status": 1, "byzantium": true }, @@ -214,7 +214,7 @@ 3600 ], "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_claimDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_challengeDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimedAt\",\"type\":\"uint256\"}],\"name\":\"ClaimReceived\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"challenge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"challengeDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"claims\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"bridger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"claimedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimDeposit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relayed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_challengeDuration\",\"type\":\"uint256\"}],\"name\":\"setChallengePeriodDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_claimDeposit\",\"type\":\"uint256\"}],\"name\":\"setClaimDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_encodedData\",\"type\":\"bytes\"}],\"name\":\"verifyAndRelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawClaimDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridge/FastBridgeReceiver.sol\":\"FastBridgeReceiver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/bridge/FastBridgeReceiver.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 \\\"./interfaces/IFastBridgeReceiver.sol\\\";\\n\\ncontract FastBridgeReceiver is IFastBridgeReceiver {\\n address public governor;\\n uint256 public claimDeposit;\\n uint256 public challengeDuration;\\n\\n struct Claim {\\n address bridger;\\n uint256 claimedAt;\\n uint256 claimDeposit;\\n bool relayed;\\n }\\n\\n // messageHash => Claim\\n mapping(bytes32 => Claim) public claims;\\n\\n event ClaimReceived(bytes32 messageHash, uint256 claimedAt);\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(\\n address _governor,\\n uint256 _claimDeposit,\\n uint256 _challengeDuration\\n ) {\\n governor = _governor;\\n claimDeposit = _claimDeposit;\\n challengeDuration = _challengeDuration;\\n }\\n\\n function claim(bytes32 _messageHash) external payable {\\n require(msg.value >= claimDeposit, \\\"Not enough claim deposit\\\");\\n require(claims[_messageHash].bridger == address(0), \\\"Claimed already made\\\");\\n\\n claims[_messageHash] = Claim({\\n bridger: msg.sender,\\n claimedAt: block.timestamp,\\n claimDeposit: msg.value,\\n relayed: false\\n });\\n\\n emit ClaimReceived(_messageHash, block.timestamp);\\n }\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _encodedData) external {\\n require(keccak256(_encodedData) == _messageHash, \\\"Invalid hash\\\");\\n\\n Claim storage claim = claims[_messageHash];\\n require(claim.bridger != address(0), \\\"Claim does not exist\\\");\\n require(claim.claimedAt + challengeDuration < block.timestamp, \\\"Challenge period not over\\\");\\n require(claim.relayed == false, \\\"Message already relayed\\\");\\n\\n // Decode the receiver address from the data encoded by the IFastBridgeSender\\n (address receiver, bytes memory data) = abi.decode(_encodedData, (address, bytes));\\n (bool success, ) = address(receiver).call(data);\\n require(success, \\\"Failed to call contract\\\");\\n\\n claim.relayed = true;\\n }\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external {\\n Claim storage claim = claims[_messageHash];\\n require(claim.bridger != address(0), \\\"Claim does not exist\\\");\\n require(claim.claimedAt + challengeDuration < block.timestamp, \\\"Challenge period not over\\\");\\n\\n uint256 amount = claim.claimDeposit;\\n claim.claimDeposit = 0;\\n payable(claim.bridger).send(amount);\\n }\\n\\n function challenge() external {\\n revert(\\\"Not Implemented\\\");\\n }\\n\\n //**** Governor functions ****//\\n\\n function setClaimDeposit(uint256 _claimDeposit) external onlyByGovernor {\\n claimDeposit = _claimDeposit;\\n }\\n\\n function setChallengePeriodDuration(uint256 _challengeDuration) external onlyByGovernor {\\n challengeDuration = _challengeDuration;\\n }\\n}\\n\",\"keccak256\":\"0xf84287907e7101b142dddf2fd1b0357eb9d289a8dd7affbe9b7163238088cfc7\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n function claim(bytes32 _messageHash) external payable;\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _calldata) external;\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external;\\n\\n function claimDeposit() external view returns (uint256 amount);\\n}\\n\",\"keccak256\":\"0x1d7f6a6ed2c2b88f51833cba6091c57a43af2915a265395ad11aad08b1f7285d\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50604051610a88380380610a8883398101604081905261002f9161005b565b600080546001600160a01b0319166001600160a01b03949094169390931790925560015560025561009e565b60008060006060848603121561007057600080fd5b83516001600160a01b038116811461008757600080fd5b602085015160409095015190969495509392505050565b6109db806100ad6000396000f3fe6080604052600436106100915760003560e01c8063bc43b86511610059578063bc43b8651461014f578063bd66528a1461016f578063d2ef739814610182578063ee32cceb14610197578063eff0f592146101b757600080fd5b80630c340a241461009657806323d631ac146100d3578063292f2e0e146100f557806329d07a51146101195780634458e6091461012f575b600080fd5b3480156100a257600080fd5b506000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100df57600080fd5b506100f36100ee366004610746565b610234565b005b34801561010157600080fd5b5061010b60025481565b6040519081526020016100ca565b34801561012557600080fd5b5061010b60015481565b34801561013b57600080fd5b506100f361014a366004610746565b61032b565b34801561015b57600080fd5b506100f361016a366004610746565b61035a565b6100f361017d366004610746565b610389565b34801561018e57600080fd5b506100f36104de565b3480156101a357600080fd5b506100f36101b23660046107ce565b610518565b3480156101c357600080fd5b506102086101d2366004610746565b600360208190526000918252604090912080546001820154600283015492909301546001600160a01b0390911692919060ff1684565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016100ca565b600081815260036020526040902080546001600160a01b03166102955760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b60448201526064015b60405180910390fd5b4260025482600101546102a89190610858565b106102f15760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600281018054600091829055825460405191926001600160a01b039091169183156108fc0291849190818181858888f15050505050505050565b6000546001600160a01b031633146103555760405162461bcd60e51b815260040161028c9061087e565b600255565b6000546001600160a01b031633146103845760405162461bcd60e51b815260040161028c9061087e565b600155565b6001543410156103db5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820636c61696d206465706f7369740000000000000000604482015260640161028c565b6000818152600360205260409020546001600160a01b0316156104375760405162461bcd60e51b8152602060048201526014602482015273436c61696d656420616c7265616479206d61646560601b604482015260640161028c565b6040805160808101825233815242602080830182815234848601908152600060608601818152888252600380865291889020965187546001600160a01b0319166001600160a01b03909116178755925160018701559051600286015590519301805460ff1916931515939093179092558251848152918201527f32899d160dbf80374e3a2eacfc04011027c1542248d33c4cd7b80d61176c0463910160405180910390a150565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd08125b5c1b195b595b9d1959608a1b604482015260640161028c565b80516020820120821461055c5760405162461bcd60e51b815260206004820152600c60248201526b092dcecc2d8d2c840d0c2e6d60a31b604482015260640161028c565b600082815260036020526040902080546001600160a01b03166105b85760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161028c565b4260025482600101546105cb9190610858565b106106145760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600381015460ff16156106695760405162461bcd60e51b815260206004820152601760248201527f4d65737361676520616c72656164792072656c61796564000000000000000000604482015260640161028c565b6000808380602001905181019061068091906108f0565b915091506000826001600160a01b03168260405161069e9190610989565b6000604051808303816000865af19150503d80600081146106db576040519150601f19603f3d011682016040523d82523d6000602084013e6106e0565b606091505b50509050806107315760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f2063616c6c20636f6e7472616374000000000000000000604482015260640161028c565b505050600301805460ff191660011790555050565b60006020828403121561075857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561079e5761079e61075f565b604052919050565b600067ffffffffffffffff8211156107c0576107c061075f565b50601f01601f191660200190565b600080604083850312156107e157600080fd5b82359150602083013567ffffffffffffffff8111156107ff57600080fd5b8301601f8101851361081057600080fd5b803561082361081e826107a6565b610775565b81815286602083850101111561083857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000821982111561087957634e487b7160e01b600052601160045260246000fd5b500190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60005b838110156108db5781810151838201526020016108c3565b838111156108ea576000848401525b50505050565b6000806040838503121561090357600080fd5b82516001600160a01b038116811461091a57600080fd5b602084015190925067ffffffffffffffff81111561093757600080fd5b8301601f8101851361094857600080fd5b805161095661081e826107a6565b81815286602083850101111561096b57600080fd5b61097c8260208301602086016108c0565b8093505050509250929050565b6000825161099b8184602087016108c0565b919091019291505056fea2646970667358221220b68116d29aea33bc3a2cc26b85b6677740b9b028cfa86a109ebbcb6b98615f7c64736f6c634300080a0033", "deployedBytecode": "0x6080604052600436106100915760003560e01c8063bc43b86511610059578063bc43b8651461014f578063bd66528a1461016f578063d2ef739814610182578063ee32cceb14610197578063eff0f592146101b757600080fd5b80630c340a241461009657806323d631ac146100d3578063292f2e0e146100f557806329d07a51146101195780634458e6091461012f575b600080fd5b3480156100a257600080fd5b506000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100df57600080fd5b506100f36100ee366004610746565b610234565b005b34801561010157600080fd5b5061010b60025481565b6040519081526020016100ca565b34801561012557600080fd5b5061010b60015481565b34801561013b57600080fd5b506100f361014a366004610746565b61032b565b34801561015b57600080fd5b506100f361016a366004610746565b61035a565b6100f361017d366004610746565b610389565b34801561018e57600080fd5b506100f36104de565b3480156101a357600080fd5b506100f36101b23660046107ce565b610518565b3480156101c357600080fd5b506102086101d2366004610746565b600360208190526000918252604090912080546001820154600283015492909301546001600160a01b0390911692919060ff1684565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016100ca565b600081815260036020526040902080546001600160a01b03166102955760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b60448201526064015b60405180910390fd5b4260025482600101546102a89190610858565b106102f15760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600281018054600091829055825460405191926001600160a01b039091169183156108fc0291849190818181858888f15050505050505050565b6000546001600160a01b031633146103555760405162461bcd60e51b815260040161028c9061087e565b600255565b6000546001600160a01b031633146103845760405162461bcd60e51b815260040161028c9061087e565b600155565b6001543410156103db5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820636c61696d206465706f7369740000000000000000604482015260640161028c565b6000818152600360205260409020546001600160a01b0316156104375760405162461bcd60e51b8152602060048201526014602482015273436c61696d656420616c7265616479206d61646560601b604482015260640161028c565b6040805160808101825233815242602080830182815234848601908152600060608601818152888252600380865291889020965187546001600160a01b0319166001600160a01b03909116178755925160018701559051600286015590519301805460ff1916931515939093179092558251848152918201527f32899d160dbf80374e3a2eacfc04011027c1542248d33c4cd7b80d61176c0463910160405180910390a150565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd08125b5c1b195b595b9d1959608a1b604482015260640161028c565b80516020820120821461055c5760405162461bcd60e51b815260206004820152600c60248201526b092dcecc2d8d2c840d0c2e6d60a31b604482015260640161028c565b600082815260036020526040902080546001600160a01b03166105b85760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161028c565b4260025482600101546105cb9190610858565b106106145760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600381015460ff16156106695760405162461bcd60e51b815260206004820152601760248201527f4d65737361676520616c72656164792072656c61796564000000000000000000604482015260640161028c565b6000808380602001905181019061068091906108f0565b915091506000826001600160a01b03168260405161069e9190610989565b6000604051808303816000865af19150503d80600081146106db576040519150601f19603f3d011682016040523d82523d6000602084013e6106e0565b606091505b50509050806107315760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f2063616c6c20636f6e7472616374000000000000000000604482015260640161028c565b505050600301805460ff191660011790555050565b60006020828403121561075857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561079e5761079e61075f565b604052919050565b600067ffffffffffffffff8211156107c0576107c061075f565b50601f01601f191660200190565b600080604083850312156107e157600080fd5b82359150602083013567ffffffffffffffff8111156107ff57600080fd5b8301601f8101851361081057600080fd5b803561082361081e826107a6565b610775565b81815286602083850101111561083857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000821982111561087957634e487b7160e01b600052601160045260246000fd5b500190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60005b838110156108db5781810151838201526020016108c3565b838111156108ea576000848401525b50505050565b6000806040838503121561090357600080fd5b82516001600160a01b038116811461091a57600080fd5b602084015190925067ffffffffffffffff81111561093757600080fd5b8301601f8101851361094857600080fd5b805161095661081e826107a6565b81815286602083850101111561096b57600080fd5b61097c8260208301602086016108c0565b8093505050509250929050565b6000825161099b8184602087016108c0565b919091019291505056fea2646970667358221220b68116d29aea33bc3a2cc26b85b6677740b9b028cfa86a109ebbcb6b98615f7c64736f6c634300080a0033", @@ -231,7 +231,7 @@ "storageLayout": { "storage": [ { - "astId": 7265, + "astId": 7957, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "governor", "offset": 0, @@ -239,7 +239,7 @@ "type": "t_address" }, { - "astId": 7267, + "astId": 7959, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "claimDeposit", "offset": 0, @@ -247,7 +247,7 @@ "type": "t_uint256" }, { - "astId": 7269, + "astId": 7961, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "challengeDuration", "offset": 0, @@ -255,12 +255,12 @@ "type": "t_uint256" }, { - "astId": 7283, + "astId": 7975, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "claims", "offset": 0, "slot": "3", - "type": "t_mapping(t_bytes32,t_struct(Claim)7278_storage)" + "type": "t_mapping(t_bytes32,t_struct(Claim)7970_storage)" } ], "types": { @@ -279,19 +279,19 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_mapping(t_bytes32,t_struct(Claim)7278_storage)": { + "t_mapping(t_bytes32,t_struct(Claim)7970_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct FastBridgeReceiver.Claim)", "numberOfBytes": "32", - "value": "t_struct(Claim)7278_storage" + "value": "t_struct(Claim)7970_storage" }, - "t_struct(Claim)7278_storage": { + "t_struct(Claim)7970_storage": { "encoding": "inplace", "label": "struct FastBridgeReceiver.Claim", "members": [ { - "astId": 7271, + "astId": 7963, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "bridger", "offset": 0, @@ -299,7 +299,7 @@ "type": "t_address" }, { - "astId": 7273, + "astId": 7965, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "claimedAt", "offset": 0, @@ -307,7 +307,7 @@ "type": "t_uint256" }, { - "astId": 7275, + "astId": 7967, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "claimDeposit", "offset": 0, @@ -315,7 +315,7 @@ "type": "t_uint256" }, { - "astId": 7277, + "astId": 7969, "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", "label": "relayed", "offset": 0, diff --git a/contracts/deployments/rinkeby/ForeignGateway.json b/contracts/deployments/rinkeby/ForeignGateway.json index 5fad5af66..943cbac36 100644 --- a/contracts/deployments/rinkeby/ForeignGateway.json +++ b/contracts/deployments/rinkeby/ForeignGateway.json @@ -1,5 +1,5 @@ { - "address": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "address": "0xf02733d9e5CbfE67B54F165b0277E1995106D526", "abi": [ { "inputs": [ @@ -328,34 +328,34 @@ "type": "function" } ], - "transactionHash": "0x5a2014cb8fef4f14edd808cdd3782a028b51f3af87e1f2ea878c33997a20418a", + "transactionHash": "0x753a229ddbd008b59a418de840909137f658f38943d62e7bf4f9b8bc28617fe2", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", - "transactionIndex": 22, + "contractAddress": "0xf02733d9e5CbfE67B54F165b0277E1995106D526", + "transactionIndex": 25, "gasUsed": "946391", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x26b5e2f437445438c874788e475f518cf560ed094fb2059c3ed7ea0f38c83185", - "transactionHash": "0x5a2014cb8fef4f14edd808cdd3782a028b51f3af87e1f2ea878c33997a20418a", + "blockHash": "0xb23f10e1a9fea1fcf5602c0e133ff739bd0c51fe1cae20e5550c84a37883f3e0", + "transactionHash": "0x753a229ddbd008b59a418de840909137f658f38943d62e7bf4f9b8bc28617fe2", "logs": [], - "blockNumber": 10134453, - "cumulativeGasUsed": "3329468", + "blockNumber": 10190112, + "cumulativeGasUsed": "5563687", "status": 1, "byzantium": true }, "args": [ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "0xD78DCddE2C5a2Bd4BB246Bc7dB6994b95f7c442C", [ "1000", "10000" ], - "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "0x2Aa1f82d363f79c1E7a4CcF955Fb7E4306b9B260", "0x0000000000000000000000000000000000000000000000000000000000066eeb" ], "numDeployments": 1, - "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "solcInputHash": "0a1ec2a631b00a23a4a92b2eaceb36a5", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastbridge\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"_feeForJuror\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"_homeGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_homeChainID\",\"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\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"disputeHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockhash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"localDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"}],\"name\":\"OutgoingDispute\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToForeignID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoDisputeData\",\"outputs\":[{\"internalType\":\"uint248\",\"name\":\"id\",\"type\":\"uint248\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastbridge\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"homeChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"homeGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"}],\"name\":\"relayRule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"cost\":\"Required cost of arbitration.\"}},\"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.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_choices\":\"Amount of choices the arbitrator can make in this dispute.\",\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"disputeID\":\"ID of the dispute created.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"relayRule(bytes32,uint256,address)\":{\"notice\":\"Relay the rule call from the home gateway to the arbitrable.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/ForeignGateway.sol\":\"ForeignGateway\"},\"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/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n function claim(bytes32 _messageHash) external payable;\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _calldata) external;\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external;\\n\\n function claimDeposit() external view returns (uint256 amount);\\n}\\n\",\"keccak256\":\"0x1d7f6a6ed2c2b88f51833cba6091c57a43af2915a265395ad11aad08b1f7285d\",\"license\":\"MIT\"},\"src/gateway/ForeignGateway.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/IArbitrable.sol\\\";\\nimport \\\"../bridge/interfaces/IFastBridgeReceiver.sol\\\";\\n\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\n\\ncontract ForeignGateway is IForeignGateway {\\n // The global default minimum number of jurors in a dispute.\\n uint256 public constant MIN_JURORS = 3;\\n\\n // @dev Note the disputeID needs to start from one as\\n // the KlerosV1 proxy governor depends on this implementation.\\n // We now also depend on localDisputeID not being zero\\n // at any point.\\n uint256 internal localDisputeID = 1;\\n\\n // feeForJuror by subcourtID\\n uint256[] internal feeForJuror;\\n uint256 public chainID;\\n uint256 public homeChainID;\\n\\n struct DisputeData {\\n uint248 id;\\n bool ruled;\\n address arbitrable;\\n uint256 paid;\\n address relayer;\\n }\\n mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;\\n\\n address public governor;\\n IFastBridgeReceiver public fastbridge;\\n address public homeGateway;\\n\\n event OutgoingDispute(\\n bytes32 disputeHash,\\n bytes32 blockhash,\\n uint256 localDisputeID,\\n uint256 _choices,\\n bytes _extraData,\\n address arbitrable\\n );\\n\\n modifier onlyFromFastBridge() {\\n require(address(fastbridge) == msg.sender, \\\"Access not allowed: Fast Bridge only.\\\");\\n _;\\n }\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(\\n address _governor,\\n IFastBridgeReceiver _fastbridge,\\n uint256[] memory _feeForJuror,\\n address _homeGateway,\\n uint256 _homeChainID\\n ) {\\n governor = _governor;\\n fastbridge = _fastbridge;\\n feeForJuror = _feeForJuror;\\n homeGateway = _homeGateway;\\n homeChainID = _homeChainID;\\n\\n assembly {\\n sstore(chainID.slot, chainid())\\n }\\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 feeForJuror[_subcourtID] = _feeForJuror;\\n }\\n\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"Not paid enough for arbitration\\\");\\n\\n (uint96 subcourtID, ) = extraDataToSubcourtIDMinJurors(_extraData);\\n uint256 nbVotes = msg.value / feeForJuror[subcourtID];\\n\\n disputeID = localDisputeID++;\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n chainID,\\n blockhash(block.number - 1),\\n \\\"createDispute\\\",\\n disputeID,\\n _choices,\\n _extraData,\\n msg.sender\\n // TODO: actual arbitration Cost\\n // nbVotes * feeForJuror[subcourtID] // we calculate the min amount required for nbVotes\\n )\\n );\\n\\n disputeHashtoDisputeData[disputeHash] = DisputeData({\\n id: uint248(disputeID),\\n arbitrable: msg.sender,\\n paid: msg.value,\\n relayer: address(0),\\n ruled: false\\n });\\n\\n emit OutgoingDispute(disputeHash, blockhash(block.number - 1), disputeID, _choices, _extraData, msg.sender);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n function arbitrationCost(bytes calldata _extraData) public view returns (uint256 cost) {\\n (uint96 subcourtID, uint256 minJurors) = extraDataToSubcourtIDMinJurors(_extraData);\\n\\n cost = feeForJuror[subcourtID] * minJurors;\\n }\\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 _relayer\\n ) external onlyFromFastBridge {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(!dispute.ruled, \\\"Cannot rule twice\\\");\\n\\n dispute.ruled = true;\\n dispute.relayer = _relayer;\\n\\n IArbitrable arbitrable = IArbitrable(dispute.arbitrable);\\n arbitrable.rule(dispute.id, _ruling);\\n }\\n\\n function withdrawFees(bytes32 _disputeHash) external {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(dispute.ruled, \\\"Not ruled yet\\\");\\n\\n uint256 amount = dispute.paid;\\n dispute.paid = 0;\\n payable(dispute.relayer).transfer(amount);\\n }\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256) {\\n return disputeHashtoDisputeData[_disputeHash].id;\\n }\\n\\n function extraDataToSubcourtIDMinJurors(bytes memory _extraData)\\n internal\\n view\\n returns (uint96 subcourtID, uint256 minJurors)\\n {\\n // Note that here we ignore DisputeKitID\\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 }\\n if (subcourtID >= feeForJuror.length) subcourtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n } else {\\n subcourtID = 0;\\n minJurors = MIN_JURORS;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce68be8c82fe08b2b9f0361f549b4f022140209a22d66ab0c3f86b8062940c82\",\"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\"}},\"version\":1}", "bytecode": "0x608060405260016000553480156200001657600080fd5b5060405162000ed238038062000ed2833981016040819052620000399162000158565b600580546001600160a01b038088166001600160a01b031992831617909255600680549287169290911691909117905582516200007e906001906020860190620000b0565b50600780546001600160a01b0319166001600160a01b039390931692909217909155600355505046600255506200026c565b828054828255906000526020600020908101928215620000ee579160200282015b82811115620000ee578251825591602001919060010190620000d1565b50620000fc92915062000100565b5090565b5b80821115620000fc576000815560010162000101565b6001600160a01b03811681146200012d57600080fd5b50565b80516200013d8162000117565b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156200017157600080fd5b85516200017e8162000117565b80955050602080870151620001938162000117565b60408801519095506001600160401b0380821115620001b157600080fd5b818901915089601f830112620001c657600080fd5b815181811115620001db57620001db62000142565b8060051b604051601f19603f8301168101818110858211171562000203576200020362000142565b60405291825284820192508381018501918c8311156200022257600080fd5b938501935b82851015620002425784518452938501939285019262000227565b809850505050505050620002596060870162000130565b9150608086015190509295509295909350565b610c56806200027c6000396000f3fe6080604052600436106100c25760003560e01c8063adc879e91161007f578063d3c617ff11610059578063d3c617ff14610209578063eaff425a146102ab578063ebb71194146102c0578063f7434ea9146102e057600080fd5b8063adc879e9146101c0578063c13517e1146101d6578063d1d559c5146101e957600080fd5b80630c340a24146100c75780631fc6b556146101045780632e1db89014610128578063349698791461015e5780634d53c2a51461018057806359354c77146101a0575b600080fd5b3480156100d357600080fd5b506005546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011057600080fd5b5061011a60035481565b6040519081526020016100fb565b34801561013457600080fd5b5061011a610143366004610956565b6000908152600460205260409020546001600160f81b031690565b34801561016a57600080fd5b5061017e61017936600461096f565b610300565b005b34801561018c57600080fd5b506007546100e7906001600160a01b031681565b3480156101ac57600080fd5b5061017e6101bb3660046109b4565b6104b7565b3480156101cc57600080fd5b5061011a60025481565b61011a6101e4366004610a35565b610549565b3480156101f557600080fd5b506006546100e7906001600160a01b031681565b34801561021557600080fd5b5061026d610224366004610956565b60046020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a0016100fb565b3480156102b757600080fd5b5061011a600381565b3480156102cc57600080fd5b5061017e6102db366004610956565b610795565b3480156102ec57600080fd5b5061011a6102fb366004610a81565b61088a565b6006546001600160a01b0316331461036d5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b60648201526084015b60405180910390fd5b600083815260046020526040902080546001600160f81b03166103cb5760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff16156104185760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610364565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561049857600080fd5b505af11580156104ac573d6000803e3d6000fd5b505050505050505050565b6005546001600160a01b0316331461051c5760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610364565b806001836001600160601b03168154811061053957610539610ac3565b6000918252602090912001555050565b6000610555838361088a565b3410156105a45760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610364565b60006105e584848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b50905060006001826001600160601b03168154811061060657610606610ac3565b90600052602060002001543461061c9190610aef565b600080549192508061062d83610b11565b91905055925060006002546001436106459190610b2c565b4085898989336040516020016106619796959493929190610b43565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038089168552600085840181815233878701908152346060890190815260808901848152868552600490975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d88699824690829061073d9043610b2c565b40868a8a8a336040516107569796959493929190610ba3565b60405180910390a1604051339085907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050509392505050565b600081815260046020526040902080546001600160f81b03166107f35760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff1661083b5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610364565b600281018054600091829055600383015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015610884573d6000803e3d6000fd5b50505050565b60008060006108ce85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b91509150806001836001600160601b0316815481106108ef576108ef610ac3565b90600052602060002001546109049190610c01565b95945050505050565b600080604083511061094a575050602081015160408201516001546001600160601b0383161061093c57600091505b80610945575060035b915091565b50600090506003915091565b60006020828403121561096857600080fd5b5035919050565b60008060006060848603121561098457600080fd5b833592506020840135915060408401356001600160a01b03811681146109a957600080fd5b809150509250925092565b600080604083850312156109c757600080fd5b82356001600160601b03811681146109de57600080fd5b946020939093013593505050565b60008083601f8401126109fe57600080fd5b50813567ffffffffffffffff811115610a1657600080fd5b602083019150836020828501011115610a2e57600080fd5b9250929050565b600080600060408486031215610a4a57600080fd5b83359250602084013567ffffffffffffffff811115610a6857600080fd5b610a74868287016109ec565b9497909650939450505050565b60008060208385031215610a9457600080fd5b823567ffffffffffffffff811115610aab57600080fd5b610ab7858286016109ec565b90969095509350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082610b0c57634e487b7160e01b600052601260045260246000fd5b500490565b6000600019821415610b2557610b25610ad9565b5060010190565b600082821015610b3e57610b3e610ad9565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b6000816000190483118215151615610c1b57610c1b610ad9565b50029056fea264697066735822122030062d64f772d29638f563564e2f95fd618feffca8f904764e78cd95f09c137c64736f6c634300080a0033", "deployedBytecode": "0x6080604052600436106100c25760003560e01c8063adc879e91161007f578063d3c617ff11610059578063d3c617ff14610209578063eaff425a146102ab578063ebb71194146102c0578063f7434ea9146102e057600080fd5b8063adc879e9146101c0578063c13517e1146101d6578063d1d559c5146101e957600080fd5b80630c340a24146100c75780631fc6b556146101045780632e1db89014610128578063349698791461015e5780634d53c2a51461018057806359354c77146101a0575b600080fd5b3480156100d357600080fd5b506005546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011057600080fd5b5061011a60035481565b6040519081526020016100fb565b34801561013457600080fd5b5061011a610143366004610956565b6000908152600460205260409020546001600160f81b031690565b34801561016a57600080fd5b5061017e61017936600461096f565b610300565b005b34801561018c57600080fd5b506007546100e7906001600160a01b031681565b3480156101ac57600080fd5b5061017e6101bb3660046109b4565b6104b7565b3480156101cc57600080fd5b5061011a60025481565b61011a6101e4366004610a35565b610549565b3480156101f557600080fd5b506006546100e7906001600160a01b031681565b34801561021557600080fd5b5061026d610224366004610956565b60046020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a0016100fb565b3480156102b757600080fd5b5061011a600381565b3480156102cc57600080fd5b5061017e6102db366004610956565b610795565b3480156102ec57600080fd5b5061011a6102fb366004610a81565b61088a565b6006546001600160a01b0316331461036d5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b60648201526084015b60405180910390fd5b600083815260046020526040902080546001600160f81b03166103cb5760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff16156104185760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610364565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561049857600080fd5b505af11580156104ac573d6000803e3d6000fd5b505050505050505050565b6005546001600160a01b0316331461051c5760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610364565b806001836001600160601b03168154811061053957610539610ac3565b6000918252602090912001555050565b6000610555838361088a565b3410156105a45760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610364565b60006105e584848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b50905060006001826001600160601b03168154811061060657610606610ac3565b90600052602060002001543461061c9190610aef565b600080549192508061062d83610b11565b91905055925060006002546001436106459190610b2c565b4085898989336040516020016106619796959493929190610b43565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038089168552600085840181815233878701908152346060890190815260808901848152868552600490975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d88699824690829061073d9043610b2c565b40868a8a8a336040516107569796959493929190610ba3565b60405180910390a1604051339085907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050509392505050565b600081815260046020526040902080546001600160f81b03166107f35760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff1661083b5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610364565b600281018054600091829055600383015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015610884573d6000803e3d6000fd5b50505050565b60008060006108ce85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b91509150806001836001600160601b0316815481106108ef576108ef610ac3565b90600052602060002001546109049190610c01565b95945050505050565b600080604083511061094a575050602081015160408201516001546001600160601b0383161061093c57600091505b80610945575060035b915091565b50600090506003915091565b60006020828403121561096857600080fd5b5035919050565b60008060006060848603121561098457600080fd5b833592506020840135915060408401356001600160a01b03811681146109a957600080fd5b809150509250925092565b600080604083850312156109c757600080fd5b82356001600160601b03811681146109de57600080fd5b946020939093013593505050565b60008083601f8401126109fe57600080fd5b50813567ffffffffffffffff811115610a1657600080fd5b602083019150836020828501011115610a2e57600080fd5b9250929050565b600080600060408486031215610a4a57600080fd5b83359250602084013567ffffffffffffffff811115610a6857600080fd5b610a74868287016109ec565b9497909650939450505050565b60008060208385031215610a9457600080fd5b823567ffffffffffffffff811115610aab57600080fd5b610ab7858286016109ec565b90969095509350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082610b0c57634e487b7160e01b600052601260045260246000fd5b500490565b6000600019821415610b2557610b25610ad9565b5060010190565b600082821015610b3e57610b3e610ad9565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b6000816000190483118215151615610c1b57610c1b610ad9565b50029056fea264697066735822122030062d64f772d29638f563564e2f95fd618feffca8f904764e78cd95f09c137c64736f6c634300080a0033", @@ -403,7 +403,7 @@ "storageLayout": { "storage": [ { - "astId": 9919, + "astId": 10620, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "localDisputeID", "offset": 0, @@ -411,7 +411,7 @@ "type": "t_uint256" }, { - "astId": 9922, + "astId": 10623, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "feeForJuror", "offset": 0, @@ -419,7 +419,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 9924, + "astId": 10625, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "chainID", "offset": 0, @@ -427,7 +427,7 @@ "type": "t_uint256" }, { - "astId": 9926, + "astId": 10627, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "homeChainID", "offset": 0, @@ -435,15 +435,15 @@ "type": "t_uint256" }, { - "astId": 9942, + "astId": 10643, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "disputeHashtoDisputeData", "offset": 0, "slot": "4", - "type": "t_mapping(t_bytes32,t_struct(DisputeData)9937_storage)" + "type": "t_mapping(t_bytes32,t_struct(DisputeData)10638_storage)" }, { - "astId": 9944, + "astId": 10645, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "governor", "offset": 0, @@ -451,15 +451,15 @@ "type": "t_address" }, { - "astId": 9947, + "astId": 10648, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "fastbridge", "offset": 0, "slot": "6", - "type": "t_contract(IFastBridgeReceiver)7791" + "type": "t_contract(IFastBridgeReceiver)8483" }, { - "astId": 9949, + "astId": 10650, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "homeGateway", "offset": 0, @@ -489,24 +489,24 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IFastBridgeReceiver)7791": { + "t_contract(IFastBridgeReceiver)8483": { "encoding": "inplace", "label": "contract IFastBridgeReceiver", "numberOfBytes": "20" }, - "t_mapping(t_bytes32,t_struct(DisputeData)9937_storage)": { + "t_mapping(t_bytes32,t_struct(DisputeData)10638_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct ForeignGateway.DisputeData)", "numberOfBytes": "32", - "value": "t_struct(DisputeData)9937_storage" + "value": "t_struct(DisputeData)10638_storage" }, - "t_struct(DisputeData)9937_storage": { + "t_struct(DisputeData)10638_storage": { "encoding": "inplace", "label": "struct ForeignGateway.DisputeData", "members": [ { - "astId": 9928, + "astId": 10629, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "id", "offset": 0, @@ -514,7 +514,7 @@ "type": "t_uint248" }, { - "astId": 9930, + "astId": 10631, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "ruled", "offset": 31, @@ -522,7 +522,7 @@ "type": "t_bool" }, { - "astId": 9932, + "astId": 10633, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "arbitrable", "offset": 0, @@ -530,7 +530,7 @@ "type": "t_address" }, { - "astId": 9934, + "astId": 10635, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "paid", "offset": 0, @@ -538,7 +538,7 @@ "type": "t_uint256" }, { - "astId": 9936, + "astId": 10637, "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", "label": "relayer", "offset": 0, diff --git a/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json b/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json new file mode 100644 index 000000000..9177d7712 --- /dev/null +++ b/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json @@ -0,0 +1,27 @@ +{ + "type": "single-select", + "titles": [ + "Alice", + "Bob", + "Charlie" + ], + "descriptions": [ + "Alice is right.", + "Bob is right.", + "Charlie is right" + ], + "arbitratorChainID": 421611, + "arbitrableChainID": 4, + "arbitrableInterfaceURI": "https://my-awesomme.dapp.io/item/1234", + "dynamicScriptRequiredParams": [ + "arbitrableChainID", + "arbitrableContractAddress" + ], + "evidenceDisplayInterfaceRequiredParams": [ + "disputeID", + "arbitrableContractAddress", + "arbitratorContractAddress", + "arbitratorChainID" + ], + "_v": "1.0.0" +} diff --git a/contracts/src/arbitration/ArbitrableExample.sol b/contracts/src/arbitration/ArbitrableExample.sol index 328ea3b13..be01642df 100644 --- a/contracts/src/arbitration/ArbitrableExample.sol +++ b/contracts/src/arbitration/ArbitrableExample.sol @@ -3,42 +3,47 @@ pragma solidity ^0.8; import "./IArbitrable.sol"; +import "../evidence/IMetaEvidence.sol"; /** * @title ArbitrableExample * An example of an arbitrable contract which connects to the arbitator that implements the updated interface. */ -contract ArbitrableExample is IArbitrable { +contract ArbitrableExample is IArbitrable, IMetaEvidence { struct DisputeStruct { bool isRuled; // Whether the dispute has been ruled or not. uint256 ruling; // Ruling given by the arbitrator. uint256 numberOfRulingOptions; // The number of choices the arbitrator can give. } - IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed. + uint256 constant META_EVIDENCE_ID = 0; + IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed. mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs. - DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID]. /** @dev Constructor * @param _arbitrator The arbitrator to rule on created disputes. + * @param _metaEvidence The URI of the meta evidence object for evidence submissions requests. */ - constructor(IArbitrator _arbitrator) { + constructor(IArbitrator _arbitrator, string memory _metaEvidence) { arbitrator = _arbitrator; + + emit MetaEvidence(META_EVIDENCE_ID, _metaEvidence); } /** @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract. * @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from. * @param _arbitratorExtraData Extra data for the arbitrator. + * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute. * @return disputeID Dispute id (on arbitrator side) of the dispute created. */ - function createDispute(uint256 _numberOfRulingOptions, bytes calldata _arbitratorExtraData) - external - payable - returns (uint256 disputeID) - { + function createDispute( + uint256 _numberOfRulingOptions, + bytes calldata _arbitratorExtraData, + uint256 _evidenceGroupID + ) external payable returns (uint256 disputeID) { require(_numberOfRulingOptions > 1, "Incorrect number of choices"); uint256 localDisputeID = disputes.length; @@ -47,6 +52,8 @@ contract ArbitrableExample is IArbitrable { disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData); externalIDtoLocalID[disputeID] = localDisputeID; + + emit Dispute(arbitrator, disputeID, META_EVIDENCE_ID, _evidenceGroupID); } /** @dev To be called by the arbitrator of the dispute, to declare the winning ruling. diff --git a/contracts/test/arbitration/index.ts b/contracts/test/arbitration/index.ts index 8050e1f3f..7bd2b337a 100644 --- a/contracts/test/arbitration/index.ts +++ b/contracts/test/arbitration/index.ts @@ -74,7 +74,7 @@ async function deployContracts(deployer) { await disputeKit.changeCore(core.address); const ArbitrableFactory = await ethers.getContractFactory("ArbitrableExample", deployer); - const arbitrable = await ArbitrableFactory.deploy(core.address); + const arbitrable = await ArbitrableFactory.deploy(core.address, "uri://metaevidence.json"); await arbitrable.deployed(); return [core, disputeKit, arbitrable];