diff --git a/contracts/README.md b/contracts/README.md index d876db0d6..07fcf5c46 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -6,6 +6,21 @@ Smart contracts for Kleros v2 Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh` or `./scripts/populateReadme.sh`. +### V2 Neo (prelaunch) + +#### Arbitrum One + +- [DisputeKitClassicNeo: proxy](https://arbiscan.io/address/0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9), [implementation](https://arbiscan.io/address/0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3) +- [DisputeResolverNeo](https://arbiscan.io/address/0x95eCE455bD817D6adB92F2383617d36eBE10D6EB) +- [DisputeTemplateRegistry: proxy](https://arbiscan.io/address/0x52c9f5634361eD3641016e5d9783310f9EFf9e25), [implementation](https://arbiscan.io/address/0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb) +- [EvidenceModule: proxy](https://arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005), [implementation](https://arbiscan.io/address/0x827411b3e98bAe8c441efBf26842A1670f8f378F) +- [KlerosCoreNeo: proxy](https://arbiscan.io/address/0xCd415C03dfa85B02646C7e2977F22a480c4354F1), [implementation](https://arbiscan.io/address/0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284) +- [KlerosV2NeoEarlyUser](https://arbiscan.io/address/0xfE34a72c55e512601E7d491A9c5b36373cE34d63) +- [Pinakion](https://arbiscan.io/address/0x330bD769382cFc6d50175903434CCC8D206DCAE5) +- [PolicyRegistry: proxy](https://arbiscan.io/address/0x26c1980120F1C82cF611D666CE81D2b54d018547), [implementation](https://arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da) +- [RandomizerRNG: proxy](https://arbiscan.io/address/0xC3dB344755b15c8Edfd834db79af4f8860029FB4), [implementation](https://arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836) +- [SortitionModuleNeo: proxy](https://arbiscan.io/address/0x614498118850184c62f82d08261109334bFB050f), [implementation](https://arbiscan.io/address/0xf327200420F21BAafce8F1C03B1EEdF926074B95) + ### Official Testnet #### Arbitrum Sepolia @@ -55,18 +70,23 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments - [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5) - [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E) - [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x9426F127116C3652A262AE1eA48391AC8F44D35b), [implementation](https://sepolia.arbiscan.io/address/0x692CC78F2570181FFB99297965FeAA8352ab12E8) +- [DisputeKitClassicNeo: proxy](https://sepolia.arbiscan.io/address/0xd40aA608801a639E292e10C235B90488D04070b1), [implementation](https://sepolia.arbiscan.io/address/0xE636AB278fBfc8712E807c589A362dc2396d2d2F) - [DisputeKitClassicUniversity: proxy](https://sepolia.arbiscan.io/address/0xDaE66157D72Baa099cd63a833c353776206feea4), [implementation](https://sepolia.arbiscan.io/address/0xf36fa321Bb64b6E39f5DA3dbb053ccE63D077f8B) - [DisputeResolver](https://sepolia.arbiscan.io/address/0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6) +- [DisputeResolverNeo](https://sepolia.arbiscan.io/address/0xaBC213522c01354DC0Db2B3E89bDe0FCF44Acac6) - [DisputeResolverUniversity](https://sepolia.arbiscan.io/address/0x102Ba9488Df13842612e777aB16144cCACD38194) - [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x596D3B09E684D62217682216e9b7a0De75933391), [implementation](https://sepolia.arbiscan.io/address/0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6) - [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x57fd453FB0d16f8ca174E7386102D7170E17Be09), [implementation](https://sepolia.arbiscan.io/address/0x05AD81f245209b7f91885fd96e57c9da90554824) - [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xA54e7A16d7460e38a8F324eF46782FB520d58CE8), [implementation](https://sepolia.arbiscan.io/address/0x91a373BBdE0532F86410682F362e2Cf685e95085) +- [KlerosCoreNeo: proxy](https://sepolia.arbiscan.io/address/0x26bf077037550e437605F07e25EfcAd510715C3A), [implementation](https://sepolia.arbiscan.io/address/0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB) - [KlerosCoreUniversity: proxy](https://sepolia.arbiscan.io/address/0x10BaAFDe8B4d3164CA781571e2F1513317f57980), [implementation](https://sepolia.arbiscan.io/address/0x8466ab62E7c923e8F2E61d0358C495676D6F939b) +- [KlerosV2NeoEarlyUser](https://sepolia.arbiscan.io/address/0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F) - [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD) - [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225) - [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E) - [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005) - [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0x19cb28BAB40C3585955798f5EEabd71Eec14471C), [implementation](https://sepolia.arbiscan.io/address/0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3) +- [SortitionModuleNeo: proxy](https://sepolia.arbiscan.io/address/0x809533c303c10915BB5c0585f2d8D738e2a4fB64), [implementation](https://sepolia.arbiscan.io/address/0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0) - [SortitionModuleUniversity: proxy](https://sepolia.arbiscan.io/address/0xBEEb15EF1DEf96c569c97A703E649B0251ceFB04), [implementation](https://sepolia.arbiscan.io/address/0xaA2833b174D4e29ae2aFc0b11dF9160EDB28BF9d) - [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138) - [WETHFaucet](https://sepolia.arbiscan.io/address/0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd) diff --git a/contracts/deploy/00-home-chain-arbitration-neo.ts b/contracts/deploy/00-home-chain-arbitration-neo.ts new file mode 100644 index 000000000..eda64ca90 --- /dev/null +++ b/contracts/deploy/00-home-chain-arbitration-neo.ts @@ -0,0 +1,136 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { BigNumber, BigNumberish } from "ethers"; +import { getContractAddress } from "./utils/getContractAddress"; +import { deployUpgradable } from "./utils/deployUpgradable"; +import { changeCurrencyRate } from "./utils/klerosCoreHelper"; +import { HomeChains, isSkipped, isDevnet, PNK, ETH, isMainnet } from "./utils"; +import { getContractOrDeploy, getContractOrDeployUpgradable } from "./utils/getContractOrDeploy"; +import { deployERC20AndFaucet, deployERC721 } from "./utils/deployTokens"; +import { DisputeKitClassic, KlerosCoreNeo } from "../typechain-types"; + +const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { ethers, deployments, getNamedAccounts, getChainId } = hre; + const { deploy, execute } = deployments; + const { AddressZero } = hre.ethers.constants; + const RNG_LOOKAHEAD = 20; + + // 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 %s with deployer %s", HomeChains[chainId], deployer); + + const pnk = await deployERC20AndFaucet(hre, deployer, "PNK"); + const weth = await deployERC20AndFaucet(hre, deployer, "WETH"); + const nft = await deployERC721(hre, deployer, "Kleros V2 Neo Early User", "KlerosV2NeoEarlyUser"); + + const randomizerOracle = await getContractOrDeploy(hre, "RandomizerOracle", { + from: deployer, + contract: "RandomizerMock", + args: [], + log: true, + }); + + await deployUpgradable(deployments, "PolicyRegistry", { from: deployer, args: [deployer], log: true }); + + await deployUpgradable(deployments, "EvidenceModule", { from: deployer, args: [deployer], log: true }); + + const rng = await deployUpgradable(deployments, "RandomizerRNG", { + from: deployer, + args: [randomizerOracle.address, deployer], + log: true, + }); + + const disputeKit = await deployUpgradable(deployments, "DisputeKitClassicNeo", { + from: deployer, + contract: "DisputeKitClassic", + args: [deployer, AddressZero], + log: true, + }); + + let klerosCoreAddress = await deployments.getOrNull("KlerosCoreNeo").then((deployment) => deployment?.address); + if (!klerosCoreAddress) { + const nonce = await ethers.provider.getTransactionCount(deployer); + klerosCoreAddress = getContractAddress(deployer, nonce + 3); // deployed on the 4th tx (nonce+3): SortitionModule Impl tx, SortitionModule Proxy tx, KlerosCore Impl tx, KlerosCore Proxy tx + console.log("calculated future KlerosCoreNeo address for nonce %d: %s", nonce + 3, klerosCoreAddress); + } + const devnet = isDevnet(hre.network); + const minStakingTime = devnet ? 180 : 1800; + const maxFreezingTime = devnet ? 600 : 1800; + const maxStakePerJuror = PNK(2_000); + const maxTotalStaked = PNK(2_000_000); + const sortitionModule = await deployUpgradable(deployments, "SortitionModuleNeo", { + from: deployer, + args: [ + deployer, + klerosCoreAddress, + minStakingTime, + maxFreezingTime, + rng.address, + RNG_LOOKAHEAD, + maxStakePerJuror, + maxTotalStaked, + ], + log: true, + }); // nonce (implementation), nonce+1 (proxy) + + const minStake = PNK(200); + const alpha = 10000; + const feeForJuror = ETH(0.1); + const jurorsForCourtJump = 256; + const klerosCore = await deployUpgradable(deployments, "KlerosCoreNeo", { + from: deployer, + args: [ + deployer, + deployer, + pnk.address, + AddressZero, + disputeKit.address, + false, + [minStake, alpha, feeForJuror, jurorsForCourtJump], + [0, 0, 0, 10], // evidencePeriod, commitPeriod, votePeriod, appealPeriod + ethers.utils.hexlify(5), // Extra data for sortition module will return the default value of K + sortitionModule.address, + nft.address, + ], + log: true, + }); // nonce+2 (implementation), nonce+3 (proxy) + + // execute DisputeKitClassic.changeCore() only if necessary + const disputeKitContract = (await hre.ethers.getContract("DisputeKitClassicNeo")) as DisputeKitClassic; + const currentCore = await disputeKitContract.core(); + if (currentCore !== klerosCore.address) { + console.log(`disputeKit.changeCore(${klerosCore.address})`); + await disputeKitContract.changeCore(klerosCore.address); + } + + const core = (await hre.ethers.getContract("KlerosCoreNeo")) as KlerosCoreNeo; + try { + await changeCurrencyRate(core, weth.address, true, 1, 1); + } catch (e) { + console.error("failed to change currency rates:", e); + } + + const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistry", { + from: deployer, + args: [deployer], + log: true, + }); + + const resolver = await deploy("DisputeResolverNeo", { + from: deployer, + contract: "DisputeResolver", + args: [core.address, disputeTemplateRegistry.address], + log: true, + }); + + console.log(`core.changeArbitrableWhitelist(${resolver.address}, true)`); + await core.changeArbitrableWhitelist(resolver.address, true); +}; + +deployArbitration.tags = ["ArbitrationNeo"]; +deployArbitration.skip = async ({ network }) => { + return isSkipped(network, !HomeChains[network.config.chainId ?? 0]); +}; + +export default deployArbitration; diff --git a/contracts/deploy/00-home-chain-arbitration-university.ts b/contracts/deploy/00-home-chain-arbitration-university.ts index 943b0d326..92835fa37 100644 --- a/contracts/deploy/00-home-chain-arbitration-university.ts +++ b/contracts/deploy/00-home-chain-arbitration-university.ts @@ -3,9 +3,10 @@ import { DeployFunction } from "hardhat-deploy/types"; import { BigNumber, BigNumberish } from "ethers"; import { getContractAddress } from "./utils/getContractAddress"; import { deployUpgradable } from "./utils/deployUpgradable"; -import { HomeChains, isSkipped } from "./utils"; -import { deployERC20AndFaucet } from "./utils/deployERC20AndFaucet"; -import { DisputeKitClassic, KlerosCore } from "../typechain-types"; +import { changeCurrencyRate } from "./utils/klerosCoreHelper"; +import { ETH, HomeChains, PNK, isSkipped } from "./utils"; +import { deployERC20AndFaucet } from "./utils/deployTokens"; +import { DisputeKitClassic, KlerosCore, KlerosCoreUniversity } from "../typechain-types"; import { getContractOrDeployUpgradable } from "./utils/getContractOrDeploy"; const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { @@ -41,9 +42,10 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) log: true, }); // nonce (implementation), nonce+1 (proxy) - const minStake = BigNumber.from(10).pow(20).mul(2); + const minStake = PNK(200); const alpha = 10000; - const feeForJuror = BigNumber.from(10).pow(17); + const feeForJuror = ETH(0.1); + const jurorsForCourtJump = 256; const klerosCore = await deployUpgradable(deployments, "KlerosCoreUniversity", { from: deployer, args: [ @@ -53,7 +55,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) AddressZero, disputeKit.address, false, - [minStake, alpha, feeForJuror, 256], // minStake, alpha, feeForJuror, jurorsForCourtJump + [minStake, alpha, feeForJuror, jurorsForCourtJump], [0, 0, 0, 10], // evidencePeriod, commitPeriod, votePeriod, appealPeriod sortitionModule.address, ], @@ -64,32 +66,15 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) const disputeKitContract = (await ethers.getContract("DisputeKitClassicUniversity")) as DisputeKitClassic; const currentCore = await disputeKitContract.core(); if (currentCore !== klerosCore.address) { - console.log("changing DisputeKitClassicUniversity.core to %s", klerosCore.address); + console.log(`disputeKit.changeCore(${klerosCore.address})`); await disputeKitContract.changeCore(klerosCore.address); } - const changeCurrencyRate = async ( - erc20: string, - accepted: boolean, - rateInEth: BigNumberish, - rateDecimals: BigNumberish - ) => { - const core = (await ethers.getContract("KlerosCoreUniversity")) as KlerosCore; - const pnkRate = await core.currencyRates(erc20); - if (pnkRate.feePaymentAccepted !== accepted) { - console.log(`core.changeAcceptedFeeTokens(${erc20}, ${accepted})`); - await core.changeAcceptedFeeTokens(erc20, accepted); - } - if (!pnkRate.rateInEth.eq(rateInEth) || pnkRate.rateDecimals !== rateDecimals) { - console.log(`core.changeCurrencyRates(${erc20}, ${rateInEth}, ${rateDecimals})`); - await core.changeCurrencyRates(erc20, rateInEth, rateDecimals); - } - }; - + const core = (await hre.ethers.getContract("KlerosCoreUniversity")) as KlerosCoreUniversity; try { - await changeCurrencyRate(pnk.address, true, 12225583, 12); - await changeCurrencyRate(dai.address, true, 60327783, 11); - await changeCurrencyRate(weth.address, true, 1, 1); + await changeCurrencyRate(core, pnk.address, true, 12225583, 12); + await changeCurrencyRate(core, dai.address, true, 60327783, 11); + await changeCurrencyRate(core, weth.address, true, 1, 1); } catch (e) { console.error("failed to change currency rates:", e); } @@ -103,7 +88,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) await deploy("DisputeResolverUniversity", { from: deployer, contract: "DisputeResolver", - args: [klerosCore.address, disputeTemplateRegistry.address], + args: [core.address, disputeTemplateRegistry.address], log: true, }); }; diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index b5385de81..78b435aa5 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -3,14 +3,14 @@ import { DeployFunction } from "hardhat-deploy/types"; import { BigNumber, BigNumberish } from "ethers"; import { getContractAddress } from "./utils/getContractAddress"; import { deployUpgradable } from "./utils/deployUpgradable"; -import { HomeChains, isSkipped, isDevnet } from "./utils"; +import { changeCurrencyRate } from "./utils/klerosCoreHelper"; +import { HomeChains, isSkipped, isDevnet, PNK, ETH } from "./utils"; import { getContractOrDeploy } from "./utils/getContractOrDeploy"; -import { deployERC20AndFaucet } from "./utils/deployERC20AndFaucet"; -import { KlerosCore } from "../typechain-types"; +import { deployERC20AndFaucet } from "./utils/deployTokens"; +import { DisputeKitClassic, KlerosCore } from "../typechain-types"; const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId } = hre; - const { deploy, execute } = deployments; const { AddressZero } = hre.ethers.constants; const RNG_LOOKAHEAD = 20; @@ -61,18 +61,20 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) log: true, }); // nonce (implementation), nonce+1 (proxy) - const minStake = BigNumber.from(10).pow(20).mul(2); + const minStake = PNK(200); const alpha = 10000; - const feeForJuror = BigNumber.from(10).pow(17); + const feeForJuror = ETH(0.1); + const jurorsForCourtJump = 256; const klerosCore = await deployUpgradable(deployments, "KlerosCore", { from: deployer, args: [ + deployer, deployer, pnk.address, AddressZero, disputeKit.address, false, - [minStake, alpha, feeForJuror, 256], // minStake, alpha, feeForJuror, jurorsForCourtJump + [minStake, alpha, feeForJuror, jurorsForCourtJump], [0, 0, 0, 10], // evidencePeriod, commitPeriod, votePeriod, appealPeriod ethers.utils.hexlify(5), // Extra data for sortition module will return the default value of K sortitionModule.address, @@ -83,31 +85,16 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // execute DisputeKitClassic.changeCore() only if necessary const currentCore = await hre.ethers.getContractAt("DisputeKitClassic", disputeKit.address).then((dk) => dk.core()); if (currentCore !== klerosCore.address) { - await execute("DisputeKitClassic", { from: deployer, log: true }, "changeCore", klerosCore.address); + const dk = (await hre.ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; + console.log(`disputeKit.changeCore(${klerosCore.address})`); + dk.changeCore(klerosCore.address); } - const changeCurrencyRate = async ( - erc20: string, - accepted: boolean, - rateInEth: BigNumberish, - rateDecimals: BigNumberish - ) => { - const core = (await ethers.getContract("KlerosCore")) as KlerosCore; - const pnkRate = await core.currencyRates(erc20); - if (pnkRate.feePaymentAccepted !== accepted) { - console.log(`core.changeAcceptedFeeTokens(${erc20}, ${accepted})`); - await core.changeAcceptedFeeTokens(erc20, accepted); - } - if (!pnkRate.rateInEth.eq(rateInEth) || pnkRate.rateDecimals !== rateDecimals) { - console.log(`core.changeCurrencyRates(${erc20}, ${rateInEth}, ${rateDecimals})`); - await core.changeCurrencyRates(erc20, rateInEth, rateDecimals); - } - }; - + const core = (await hre.ethers.getContract("KlerosCore")) as KlerosCore; try { - await changeCurrencyRate(pnk.address, true, 12225583, 12); - await changeCurrencyRate(dai.address, true, 60327783, 11); - await changeCurrencyRate(weth.address, true, 1, 1); + await changeCurrencyRate(core, pnk.address, true, 12225583, 12); + await changeCurrencyRate(core, dai.address, true, 60327783, 11); + await changeCurrencyRate(core, weth.address, true, 1, 1); } catch (e) { console.error("failed to change currency rates:", e); } diff --git a/contracts/deploy/00-rng.ts b/contracts/deploy/00-rng.ts index 3433491e7..83d320b0b 100644 --- a/contracts/deploy/00-rng.ts +++ b/contracts/deploy/00-rng.ts @@ -1,15 +1,13 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import { SortitionModule, RandomizerRNG } from "../typechain-types"; +import { SortitionModule } from "../typechain-types"; import { HomeChains, isSkipped } from "./utils"; import { deployUpgradable } from "./utils/deployUpgradable"; import { getContractOrDeploy } from "./utils/getContractOrDeploy"; const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { deployments, getNamedAccounts, getChainId, ethers } = hre; - const { deploy, execute } = deployments; - const { getContract } = ethers; - const { AddressZero } = ethers.constants; + const { deploy } = deployments; const RNG_LOOKAHEAD = 20; // fallback to hardhat node signers on local network @@ -36,7 +34,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) log: true, }); - const sortitionModule = (await hre.ethers.getContract("SortitionModule")) as SortitionModule; + const sortitionModule = (await ethers.getContract("SortitionModuleNeo")) as SortitionModule; await sortitionModule.changeRandomNumberGenerator(rng2.address, RNG_LOOKAHEAD); }; diff --git a/contracts/deploy/utils/deployERC20AndFaucet.ts b/contracts/deploy/utils/deployTokens.ts similarity index 51% rename from contracts/deploy/utils/deployERC20AndFaucet.ts rename to contracts/deploy/utils/deployTokens.ts index ed0ce1a50..6dd7ed410 100644 --- a/contracts/deploy/utils/deployERC20AndFaucet.ts +++ b/contracts/deploy/utils/deployTokens.ts @@ -2,6 +2,7 @@ import { Contract } from "@ethersproject/contracts"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { BigNumber } from "ethers"; import { getContractOrDeploy } from "./getContractOrDeploy"; +import { isMainnet } from "."; export const deployERC20AndFaucet = async ( hre: HardhatRuntimeEnvironment, @@ -9,12 +10,33 @@ export const deployERC20AndFaucet = async ( ticker: string, faucetFundingAmount: BigNumber = hre.ethers.utils.parseUnits("100000") ): Promise => { - const erc20 = await getContractOrDeploy(hre, ticker, { + const erc20 = await deployERC20(hre, deployer, ticker); + if (!isMainnet(hre.network)) { + await deployFaucet(hre, deployer, ticker, erc20, faucetFundingAmount); + } + return erc20; +}; + +export const deployERC20 = async ( + hre: HardhatRuntimeEnvironment, + deployer: string, + ticker: string +): Promise => { + return await getContractOrDeploy(hre, ticker, { from: deployer, contract: "TestERC20", args: [ticker, ticker], log: true, }); +}; + +export const deployFaucet = async ( + hre: HardhatRuntimeEnvironment, + deployer: string, + ticker: string, + erc20: Contract, + faucetFundingAmount: BigNumber +): Promise => { const faucet = await getContractOrDeploy(hre, `${ticker}Faucet`, { from: deployer, contract: "Faucet", @@ -24,9 +46,22 @@ export const deployERC20AndFaucet = async ( const faucetBalance = await erc20.balanceOf(faucet.address); const deployerBalance = await erc20.balanceOf(deployer); if (deployerBalance.gte(faucetFundingAmount) && faucetBalance.lt(faucetFundingAmount.div(5))) { - // Fund the faucet if deployer has enough tokens and if the faucet has less than 20% of the faucetFundingAmount + // Fund the faucet if deployer has enough tokens and if the faucet has less than 20% of the faucetFundingAmount console.log(`funding ${ticker}Faucet with ${faucetFundingAmount}`); await erc20.transfer(faucet.address, faucetFundingAmount); } - return erc20; +}; + +export const deployERC721 = async ( + hre: HardhatRuntimeEnvironment, + deployer: string, + name: string, + ticker: string +): Promise => { + return getContractOrDeploy(hre, ticker, { + from: deployer, + contract: "TestERC721", + args: [name, ticker], + log: true, + }); }; diff --git a/contracts/deploy/utils/index.ts b/contracts/deploy/utils/index.ts index 2354a203f..71291f57d 100644 --- a/contracts/deploy/utils/index.ts +++ b/contracts/deploy/utils/index.ts @@ -1,3 +1,4 @@ +import { ethers } from "ethers"; import { Network } from "hardhat/types"; // TODO: derive this from hardhat.config and make it rely on viem/chains @@ -25,6 +26,7 @@ export enum Courts { GENERAL = 1, } +export const isMainnet = (network: Network) => network.tags.production ?? false; export const isDevnet = (network: Network) => network.name.endsWith("Devnet"); export const isSkipped = async (network: Network, skip: boolean) => { @@ -34,3 +36,6 @@ export const isSkipped = async (network: Network, skip: boolean) => { } return false; }; + +export const PNK = (n: number) => ethers.utils.parseUnits(String(n)); +export const ETH = (n: number) => ethers.utils.parseUnits(String(n)); diff --git a/contracts/deploy/utils/klerosCoreHelper.ts b/contracts/deploy/utils/klerosCoreHelper.ts new file mode 100644 index 000000000..b2eb70dc0 --- /dev/null +++ b/contracts/deploy/utils/klerosCoreHelper.ts @@ -0,0 +1,20 @@ +import { KlerosCore, KlerosCoreNeo, KlerosCoreUniversity } from "../../typechain-types"; +import { BigNumberish } from "ethers"; + +export const changeCurrencyRate = async ( + core: KlerosCore | KlerosCoreNeo | KlerosCoreUniversity, + erc20: string, + accepted: boolean, + rateInEth: BigNumberish, + rateDecimals: BigNumberish +) => { + const pnkRate = await core.currencyRates(erc20); + if (pnkRate.feePaymentAccepted !== accepted) { + console.log(`core.changeAcceptedFeeTokens(${erc20}, ${accepted})`); + await core.changeAcceptedFeeTokens(erc20, accepted); + } + if (!pnkRate.rateInEth.eq(rateInEth) || pnkRate.rateDecimals !== rateDecimals) { + console.log(`core.changeCurrencyRates(${erc20}, ${rateInEth}, ${rateDecimals})`); + await core.changeCurrencyRates(erc20, rateInEth, rateDecimals); + } +}; diff --git a/contracts/deployments/arbitrum/DisputeKitClassicNeo.json b/contracts/deployments/arbitrum/DisputeKitClassicNeo.json new file mode 100644 index 000000000..ba4083a3d --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeKitClassicNeo.json @@ -0,0 +1,1021 @@ +{ + "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x83bbf99250151bfa2d6c447cf28df352cc8148074af5096725595ec05a4500b4", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "transactionIndex": 2, + "gasUsed": "5403468", + "logsBloom": "0x00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa31c04677fc6a6a70f3714cf96105c68352d67a22d6b22af440b0e3d33d55856", + "transactionHash": "0x83bbf99250151bfa2d6c447cf28df352cc8148074af5096725595ec05a4500b4", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 190274518, + "transactionHash": "0x83bbf99250151bfa2d6c447cf28df352cc8148074af5096725595ec05a4500b4", + "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xa31c04677fc6a6a70f3714cf96105c68352d67a22d6b22af440b0e3d33d55856" + } + ], + "blockNumber": 190274518, + "cumulativeGasUsed": "6129030", + "status": 1, + "byzantium": true + }, + "args": [ + "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x0000000000000000000000000000000000000000" + ] + }, + "implementation": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/DisputeKitClassicNeo_Implementation.json b/contracts/deployments/arbitrum/DisputeKitClassicNeo_Implementation.json new file mode 100644 index 000000000..3ff57715f --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeKitClassicNeo_Implementation.json @@ -0,0 +1,1540 @@ +{ + "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x6300d47b56f66f0adf530ad46ebbb08bd2e62a12fa76ab6df41d0401a9f2a28a", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "transactionIndex": 3, + "gasUsed": "53499406", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xbb460c13a1875062b8e6474805e14f6e5677b1575b2e4dc0fb033ad4a5644c92", + "transactionHash": "0x6300d47b56f66f0adf530ad46ebbb08bd2e62a12fa76ab6df41d0401a9f2a28a", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274507, + "transactionHash": "0x6300d47b56f66f0adf530ad46ebbb08bd2e62a12fa76ab6df41d0401a9f2a28a", + "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 2, + "blockHash": "0xbb460c13a1875062b8e6474805e14f6e5677b1575b2e4dc0fb033ad4a5644c92" + } + ], + "blockNumber": 190274507, + "cumulativeGasUsed": "55769866", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "47a03c54c72f5d4984b62ca6f84025dc", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"CommitCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areCommitsAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areVotesAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_nbVotes\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"jumped\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"getFundedChoices\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"fundedChoices\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"ChoiceFunded(uint256,uint256,uint256)\":{\"details\":\"To be emitted when a choice is fully funded for an appeal.\",\"params\":{\"_choice\":\"The choice that is being funded.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"CommitCast(uint256,address,uint256[],bytes32)\":{\"details\":\"To be emitted when a vote commitment is cast.\",\"params\":{\"_commit\":\"The commitment of the juror.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"The address of the juror casting the vote commitment.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Contribution(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when a funding contribution is made.\",\"params\":{\"_amount\":\"The amount contributed.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"DisputeCreation(uint256,uint256,bytes)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_extraData\":\"The extra data for the dispute.\",\"_numberOfChoices\":\"The number of choices available in the dispute.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}},\"VoteCast(uint256,address,uint256[],uint256,string)\":{\"details\":\"Emitted when casting a vote to provide the justification of juror's choice.\",\"params\":{\"_choice\":\"The choice juror voted for.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"Address of the juror.\",\"_justification\":\"Justification of the choice.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Withdrawal(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when the contributed funds are withdrawn.\",\"params\":{\"_amount\":\"The amount withdrawn.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}}},\"kind\":\"dev\",\"methods\":{\"areCommitsAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their commits for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their commits for the last round.\"}},\"areVotesAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their votes for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their votes for the last round.\"}},\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit. Note that justification string is a part of the commit.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256,string)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_justification\":\"Justification of the choice.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createDispute(uint256,uint256,bytes,uint256)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_nbVotes\":\"Number of votes for this dispute.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_nonce\":\"Nonce of the drawing iteration.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"initialize(address,address)\":{\"details\":\"Initializer.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}},\"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. Note that withdrawals are not possible if the core contract is paused.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core contract.\",\"_coreRoundID\":\"The round in the Kleros Core contract the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCoreBase.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is KlerosCoreBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _guardian The guardian's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n _initialize(\\n _governor,\\n _guardian,\\n _pinakion,\\n _jurorProsecutionModule,\\n _disputeKit,\\n _hiddenVotes,\\n _courtParameters,\\n _timesPerPeriod,\\n _sortitionExtraData,\\n _sortitionModuleAddress\\n );\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n}\\n\",\"keccak256\":\"0x347240e5b541bb5df305e4e6ec8ab324a04effa722af31db03cd1d9fdcd039ec\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title KlerosCoreBase\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\nabstract contract KlerosCoreBase is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 feePerJurorInRound; // The fee per juror in the round.\\n uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private 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 address public guardian; // The guardian able to pause asset withdrawals.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n bool public paused; // Whether asset withdrawals are paused.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event Paused();\\n event Unpaused();\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n modifier onlyByGuardianOrGovernor() {\\n if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly();\\n _;\\n }\\n\\n modifier whenPaused() {\\n if (!paused) revert WhenPausedOnly();\\n _;\\n }\\n\\n modifier whenNotPaused() {\\n if (paused) revert WhenNotPausedOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) internal {\\n governor = _governor;\\n guardian = _guardian;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Pause staking and reward execution. Can only be done by guardian or governor.\\n function pause() external onlyByGuardianOrGovernor whenNotPaused {\\n paused = true;\\n emit Paused();\\n }\\n\\n /// @dev Unpause staking and reward execution. Can only be done by governor.\\n function unpause() external onlyByGovernor whenPaused {\\n paused = false;\\n emit Unpaused();\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `guardian` storage variable.\\n /// @param _guardian The new value for the `guardian` storage variable.\\n function changeGuardian(address _guardian) external onlyByGovernor {\\n guardian = _guardian;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal virtual returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// Note: Reward distributions are forbidden during pause.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused {\\n Round storage round;\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n round = dispute.rounds[_round];\\n } // stack too deep workaround\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound;\\n uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror;\\n uint256 coherentCount;\\n {\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n } // stack too deep workaround\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRound = _executePenalties(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRound) {\\n round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (stakingResult != StakingResult.Successful) {\\n _stakingFailed(_onError, stakingResult);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError, StakingResult.StakingTransferFailed);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError, StakingResult.UnstakingTransferFailed);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual {\\n if (_onError == OnError.Return) return;\\n if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed();\\n if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed();\\n if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts();\\n if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt();\\n if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error GuardianOrGovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingInTooManyCourts();\\n error StakingNotPossibeInThisCourt();\\n error StakingLessThanCourtMinStake();\\n error StakingTransferFailed();\\n error UnstakingTransferFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n error WhenNotPausedOnly();\\n error WhenPausedOnly();\\n}\\n\",\"keccak256\":\"0x53eb90e3209b47a218bd9eb25bd64bcff4edca51829cb7bfff35ed68f9cee05c\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../KlerosCore.sol\\\";\\nimport \\\"../interfaces/IDisputeKit.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title DisputeKitClassic\\n/// Dispute kit implementation of the Kleros v1 features including:\\n/// - a drawing system: proportional to staked PNK,\\n/// - a vote aggregation system: plurality,\\n/// - an incentive system: equal split between coherent votes,\\n/// - an appeal system: fund 2 choices only, vote on any choice.\\ncontract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n bool jumped; // True if dispute jumped to a parent dispute kit and won't be handled by this DK anymore.\\n mapping(uint256 => uint256) coreRoundIDToLocal; // Maps id of the round in the core contract to the index of the round of related local dispute.\\n bytes extraData; // Extradata for the dispute.\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n uint256 nbVotes; // Maximal number of votes this dispute can get.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\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 /// @dev To be emitted when a dispute is created.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _numberOfChoices The number of choices available in the dispute.\\n /// @param _extraData The extra data for the dispute.\\n event DisputeCreation(uint256 indexed _coreDisputeID, uint256 _numberOfChoices, bytes _extraData);\\n\\n /// @dev To be emitted when a vote commitment is cast.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror The address of the juror casting the vote commitment.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _commit The commitment of the juror.\\n event CommitCast(uint256 indexed _coreDisputeID, address indexed _juror, uint256[] _voteIDs, bytes32 _commit);\\n\\n /// @dev To be emitted when a funding contribution is made.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount contributed.\\n event Contribution(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when the contributed funds are withdrawn.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount withdrawn.\\n event Withdrawal(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when a choice is fully funded for an appeal.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n event ChoiceFunded(uint256 indexed _coreDisputeID, uint256 indexed _coreRoundID, uint256 indexed _choice);\\n\\n // ************************************* //\\n // * 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 modifier notJumped(uint256 _coreDisputeID) {\\n require(!disputes[coreDisputeIDToLocal[_coreDisputeID]].jumped, \\\"Dispute jumped to a parent DK!\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n /// @param _core The KlerosCore arbitrator.\\n function initialize(address _governor, KlerosCore _core) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `core` storage variable.\\n /// @param _core The new value for the `core` storage variable.\\n function changeCore(address _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n /// @param _nbVotes Number of votes for this dispute.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n dispute.extraData = _extraData;\\n\\n // New round in the Core should be created before the dispute creation in DK.\\n dispute.coreRoundIDToLocal[core.getNumberOfRounds(_coreDisputeID) - 1] = dispute.rounds.length;\\n\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = _nbVotes;\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;\\n emit DisputeCreation(_coreDisputeID, _numberOfChoices, _extraData);\\n }\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _nonce Nonce of the drawing iteration.\\n /// @return drawnAddress The drawn address.\\n function draw(\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) external override onlyByCore notJumped(_coreDisputeID) returns (address drawnAddress) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n ISortitionModule sortitionModule = core.sortitionModule();\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n bytes32 key = bytes32(uint256(courtID)); // Get the ID of the tree.\\n\\n // TODO: Handle the situation when no one has staked yet.\\n drawnAddress = sortitionModule.draw(key, _coreDisputeID, _nonce);\\n\\n if (_postDrawCheck(_coreDisputeID, drawnAddress)) {\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n } else {\\n drawnAddress = address(0);\\n }\\n }\\n\\n /// @dev Sets the caller's commit for the specified votes. It can be called multiple times during the\\n /// commit period, each call overrides the commits of the previous one.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _commit The commit. Note that justification string is a part of the commit.\\n function castCommit(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCoreBase.Period.commit, \\\"The dispute should be in Commit period.\\\");\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n emit CommitCast(_coreDisputeID, msg.sender, _voteIDs, _commit);\\n }\\n\\n /// @dev Sets the caller's choices for the specified votes.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _choice The choice.\\n /// @param _salt The salt for the commit if the votes were hidden.\\n /// @param _justification Justification of the choice.\\n function castVote(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt,\\n string memory _justification\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCoreBase.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, bool hiddenVotes, , , , , ) = core.courts(courtID);\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _salt)),\\n \\\"The commit must match the choice in courts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n emit VoteCast(_coreDisputeID, msg.sender, _voteIDs, _choice, _justification);\\n }\\n\\n /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n /// Note that the surplus deposit will be reimbursed.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _choice A choice that receives funding.\\n function fundAppeal(uint256 _coreDisputeID, uint256 _choice) external payable notJumped(_coreDisputeID) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n (uint256 ruling, , ) = this.currentRuling(_coreDisputeID);\\n if (ruling == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n uint256 coreRoundID = core.getNumberOfRounds(_coreDisputeID) - 1;\\n\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_coreDisputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_coreDisputeID, coreRoundID, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_coreDisputeID, coreRoundID, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n if (core.isDisputeKitJumping(_coreDisputeID)) {\\n // Don't create a new round in case of a jump, and remove local dispute from the flow.\\n dispute.jumped = true;\\n } else {\\n // Don't subtract 1 from length since both round arrays haven't been updated yet.\\n dispute.coreRoundIDToLocal[coreRoundID + 1] = dispute.rounds.length;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.nbVotes = core.getNumberOfVotes(_coreDisputeID);\\n newRound.tied = true;\\n }\\n core.appeal{value: appealCost}(_coreDisputeID, dispute.numberOfChoices, dispute.extraData);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n /// Note that withdrawals are not possible if the core contract is paused.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core contract.\\n /// @param _beneficiary The address whose rewards to withdraw.\\n /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from.\\n /// @param _choice The ruling option that the caller wants to withdraw from.\\n /// @return amount The withdrawn amount.\\n function withdrawFeesAndRewards(\\n uint256 _coreDisputeID,\\n address payable _beneficiary,\\n uint256 _coreRoundID,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n (, , , bool isRuled, ) = core.disputes(_coreDisputeID);\\n require(isRuled, \\\"Dispute should be resolved.\\\");\\n require(!core.paused(), \\\"Core is paused\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 finalRuling, , ) = core.currentRuling(_coreDisputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function getFundedChoices(uint256 _coreDisputeID) public view returns (uint256[] memory fundedChoices) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n return lastRound.fundedChoices;\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(\\n uint256 _coreDisputeID\\n ) external view override returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n tied = round.tied;\\n ruling = tied ? 0 : round.winningChoice;\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n // Override the final ruling if only one side funded the appeals.\\n if (period == KlerosCoreBase.Period.execution) {\\n uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID);\\n if (fundedChoices.length == 1) {\\n ruling = fundedChoices[0];\\n tied = false;\\n overridden = true;\\n }\\n }\\n }\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 /* _feePerJuror */,\\n uint256 /* _pnkAtStakePerJuror */\\n ) external view override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (vote.voted && (vote.choice == winningChoice || tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage currentRound = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (currentRound.totalVoted == 0 || (!tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalCommitted == round.votes.length;\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalVoted == round.votes.length;\\n }\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view returns (bool) {\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n uint256 lockedAmountPerJuror = core\\n .getRoundInfo(_coreDisputeID, core.getNumberOfRounds(_coreDisputeID) - 1)\\n .pnkAtStakePerJuror;\\n (uint256 totalStaked, uint256 totalLocked, , ) = core.sortitionModule().getJurorBalance(_juror, courtID);\\n return totalStaked >= totalLocked + lockedAmountPerJuror;\\n }\\n}\\n\",\"keccak256\":\"0x18bacae1d55cb3ebc4fa88cac18b2ce7c444a97b892bfca5d0a8ae38ee50c5f5\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// @dev When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7babeb6a4180e75dc50a42762f449b32ad0a67cf58a3cb6bf3e5306ac9364507\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @param _feePerJuror The fee per juror.\\n /// @param _pnkAtStakePerJuror The PNK at stake per juror.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 _feePerJuror,\\n uint256 _pnkAtStakePerJuror\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x72cdf621c11d1d84b851edb1ef7607ac950ba7038154c85005ccc86cdd43e71b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../../libraries/Constants.sol\\\";\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x47960dd772c9dafeefa2e6b9414c7045b5dcc68df735c1fccda6af48ca089858\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// Courts\\nuint96 constant FORKING_COURT = 0; // Index of the forking court.\\nuint96 constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n// Dispute Kits\\nuint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\nuint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n// Sortition Module\\nuint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\nuint256 constant DEFAULT_K = 6; // Default number of children per node.\\n\\n// Defaults\\nuint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\nIERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\\nenum StakingResult {\\n Successful,\\n StakingTransferFailed,\\n UnstakingTransferFailed,\\n CannotStakeInMoreCourts,\\n CannotStakeInThisCourt,\\n CannotStakeLessThanMinStake,\\n CannotStakeMoreThanMaxStakePerJuror,\\n CannotStakeMoreThanMaxTotalStaked\\n}\\n\",\"keccak256\":\"0xdc648a85f2816fa323e9f7f4accac3d9384187d0123bdfb1f9b89ce25ea64679\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051613eeb6200010360003960008181611588015281816115b101526117a90152613eeb6000f3fe6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c157806352d1902d146102d4578063564a565d146102e95780635c92e2f61461031857806365540b9614610338578063675926f61461036557806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a2366004613186565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f366004613186565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a366004613186565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046131b4565b610785565b34801561029857600080fd5b506102ac6102a73660046131f1565b610c10565b005b6102ac6102bc36600461322a565b610d0d565b6102ac6102cf366004613339565b611574565b3480156102e057600080fd5b5061022161179c565b3480156102f557600080fd5b50610309610304366004613186565b6117fa565b6040516101b3939291906133d8565b34801561032457600080fd5b506102ac610333366004613444565b6118c0565b34801561034457600080fd5b50610358610353366004613186565b611bcd565b6040516101b39190613496565b34801561037157600080fd5b506102216103803660046134da565b611c91565b34801561039157600080fd5b506103a56103a0366004613515565b611dd6565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed366004613186565b611e8e565b3480156103fe57600080fd5b506102ac61040d366004613541565b611f05565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac610443366004613599565b611fd1565b34801561045457600080fd5b506102ac610463366004613631565b6126ac565b34801561047457600080fd5b50610488610483366004613515565b6126f8565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461364e565b6127be565b3480156104f657600080fd5b506101a7610505366004613515565b612993565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b36600461322a565b612a2e565b34801561054c57600080fd5b5061022161055b36600461322a565b612d37565b34801561056c57600080fd5b506102ac61057b366004613631565b612e8a565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46136d5565b600091825260208220600590910201805490925082906105e690600190613701565b815481106105f6576105f66136d5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436136d5565b6000918252602082206005909102018054909250829061066590600190613701565b81548110610675576106756136d5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613740565b5090935060049250610726915050565b816004811115610738576107386137a7565b0361077b57600061074888611bcd565b905080516001036107795780600081518110610766576107666136d5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613740565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600160009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906137bd565b156109045760405162461bcd60e51b815260206004820152600e60248201526d10dbdc99481a5cc81c185d5cd95960921b6044820152606401610846565b600086815260036020526040812054600280549091908110610928576109286136d5565b6000918252602080832088845260036005909302019182019052604082205481549193508391811061095c5761095c6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db91906137d8565b5050600087815260078401602052604090205490915060ff16610a25576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610b6a565b808603610a9a576000868152600683016020526040902054610a48576000610a93565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b8652909352922054610a899190613814565b610a93919061382b565b9450610b6a565b600081815260078301602052604090205460ff16610b6a5781600601600083600a01600181548110610ace57610ace6136d5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610b0457610b046136d5565b9060005260206000200154815260200190815260200160002054610b28919061384d565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610b5d9190613814565b610b67919061382b565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610c04576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610c59575080546001600160401b03808416911610155b15610c765760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610d3157610d316136d5565b600091825260209091206002600590920201015460ff1615610d655760405162461bcd60e51b815260040161084690613860565b600083815260036020526040812054600280549091908110610d8957610d896136d5565b906000526020600020906005020190508060010154831115610ded5760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190613897565b91509150814210158015610e7157508042105b610eb65760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b91906137d8565b50509050868103610f30576127109150610fb1565b612710611388610f408686613701565b610f4a9190613814565b610f54919061382b565b610f5e8542613701565b10610fab5760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610fc490600190613701565b81548110610fd457610fd46136d5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015611033573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105791906138bb565b6110619190613701565b60008a815260078401602052604090205490915060ff16156110c55760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561110f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113391906138bb565b905060006127106111448784613814565b61114e919061382b565b611158908361384d565b60008c8152600686016020526040812054919250908211156112095760008c815260068601602052604090205434906111919084613701565b116111b65760008c81526006860160205260409020546111b19083613701565b6111b8565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f85604051611200929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061123590849061384d565b909155505060008c81526006860160205260408120805483929061125a90849061384d565b909155505060008c8152600686016020526040902054821161132c5760008c81526006860160205260408120546009870180549192909161129c90849061384d565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611537578285600901546113499190613701565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906137bd565b156113d45760028a01805460ff191660011790556114b7565b895460038b0160006113e787600161384d565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161146291815260200190565b602060405180830381865afa15801561147f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a391906138bb565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b81526004016115049392919061390e565b6000604051808303818588803b15801561151d57600080fd5b505af1158015611531573d6000803e3d6000fd5b50505050505b8034111561156557336108fc61154d8334613701565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b61157d82612ed6565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806115fb57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115ef600080516020613e968339815191525490565b6001600160a01b031614155b156116195760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611673575060408051601f3d908101601f19168201909252611670918101906138bb565b60015b61169b57604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613e9683398151915281146116cc57604051632a87526960e21b815260048101829052602401610846565b600080516020613e968339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611797576000836001600160a01b03168360405161173391906139a8565b600060405180830381855af49150503d806000811461176e576040519150601f19603f3d011682016040523d82523d6000602084013e611773565b606091505b5050905080611795576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117e75760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613e9683398151915290565b6002818154811061180a57600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff909116929161183d906138d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611869906138d4565b80156118b65780601f1061188b576101008083540402835291602001916118b6565b820191906000526020600020905b81548152906001019060200180831161189957829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118e4576118e46136d5565b600091825260209091206002600590920201015460ff16156119185760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611962573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119869190613740565b5090935060019250611996915050565b8160048111156119a8576119a86137a7565b14611a055760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611a425760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611a6657611a666136d5565b60009182526020822060059091020180549092508290611a8890600190613701565b81548110611a9857611a986136d5565b90600052602060002090600c0201905060005b86811015611b66573382898984818110611ac757611ac76136d5565b9050602002013581548110611ade57611ade6136d5565b60009182526020909120600490910201546001600160a01b031614611b155760405162461bcd60e51b8152600401610846906139c4565b8582898984818110611b2957611b296136d5565b9050602002013581548110611b4057611b406136d5565b600091825260209091206001600490920201015580611b5e816139fb565b915050611aab565b5086869050816005016000828254611b7e919061384d565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611bbb908b908b908b90613a46565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611bf357611bf36136d5565b60009182526020822060059091020180549092508290611c1590600190613701565b81548110611c2557611c256136d5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c8357602002820191906000526020600020905b815481526020019060010190808311611c6f575b505050505092505050919050565b600085815260036020526040812054600280548392908110611cb557611cb56136d5565b60009182526020808320898452600360059093020191820190526040822054815491935083918110611ce957611ce96136d5565b90600052602060002090600c02016000018681548110611d0b57611d0b6136d5565b600091825260208220600154604051631c3db16d60e01b815260048082018e905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8d91906137d8565b506003850154919350915060ff168015611db157508183600201541480611db15750805b15611dc457612710945050505050611dcd565b60009450505050505b95945050505050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611e0757611e076136d5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611e3b57611e3b6136d5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611eb257611eb26136d5565b60009182526020822060059091020180549092508290611ed490600190613701565b81548110611ee457611ee46136d5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611f2f5760405162461bcd60e51b815260040161084690613a6a565b6000836001600160a01b03168383604051611f4a91906139a8565b60006040518083038185875af1925050503d8060008114611f87576040519150601f19603f3d011682016040523d82523d6000602084013e611f8c565b606091505b50509050806117955760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611ff557611ff56136d5565b600091825260209091206002600590920201015460ff16156120295760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120979190613740565b50909350600292506120a7915050565b8160048111156120b9576120b96137a7565b146121145760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b856121565760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b60008881526003602052604081205460028054909190811061217a5761217a6136d5565b9060005260206000209060050201905080600101548611156121d55760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b805460009082906121e890600190613701565b815481106121f8576121f86136d5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa158015612253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122779190613740565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa1580156122d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f69190613aac565b505050505091505060005b8a8110156125725733848d8d8481811061231d5761231d6136d5565b9050602002013581548110612334576123346136d5565b60009182526020909120600490910201546001600160a01b03161461236b5760405162461bcd60e51b8152600401610846906139c4565b8115806123de575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106123b3576123b36136d5565b90506020020135815481106123ca576123ca6136d5565b906000526020600020906004020160010154145b6124505760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c83818110612463576124636136d5565b905060200201358154811061247a5761247a6136d5565b600091825260209091206003600490920201015460ff16156124d35760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d848181106124e7576124e76136d5565b90506020020135815481106124fe576124fe6136d5565b60009182526020909120600260049092020101556001848d8d84818110612527576125276136d5565b905060200201358154811061253e5761253e6136d5565b60009182526020909120600490910201600301805460ff19169115159190911790558061256a816139fb565b915050612301565b508a8a905083600401600082825461258a919061384d565b90915550506000898152600284016020526040812080548c92906125af90849061384d565b9091555050600183015489036125de57600383015460ff16156125d95760038301805460ff191690555b612657565b60018301546000908152600284016020526040808220548b83529120540361262057600383015460ff166125d95760038301805460ff19166001179055612657565b60018301546000908152600284016020526040808220548b83529120541115612657576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c60405161269693929190613b16565b60405180910390a4505050505050505050505050565b6000546001600160a01b031633146126d65760405162461bcd60e51b815260040161084690613a6a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a81526020019081526020016000205481548110612726576127266136d5565b600091825260208083208a845260036005909302019182019052604082205481549193508391811061275a5761275a6136d5565b90600052602060002090600c0201600001878154811061277c5761277c6136d5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127e85760405162461bcd60e51b815260040161084690613b46565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad201612873858783613bd8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156128ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ee91906138bb565b6128f89190613701565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890612981908a908a908a90613c98565b60405180910390a25050505050505050565b6000838152600360205260408120546002805483929081106129b7576129b76136d5565b600091825260208083208784526003600590930201918201905260408220548154919350839181106129eb576129eb6136d5565b90600052602060002090600c02016000018481548110612a0d57612a0d6136d5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b03163314612a5b5760405162461bcd60e51b815260040161084690613b46565b600083815260036020526040902054600280548592908110612a7f57612a7f6136d5565b600091825260209091206002600590920201015460ff1615612ab35760405162461bcd60e51b815260040161084690613860565b600084815260036020526040812054600280549091908110612ad757612ad76136d5565b60009182526020822060059091020180549092508290612af990600190613701565b81548110612b0957612b096136d5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b929190613cce565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c059190613740565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612c69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8d9190613cce565b9650612c998988612f03565b15612d2657604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612d2b565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612d5b57612d5b6136d5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612d8f57612d8f6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1291906137d8565b5091509150826004015460001480612e41575080158015612e4157506000828152600284016020526040902054155b15612e53576000945050505050612e84565b8015612e68575050600401549150612e849050565b506000908152600290910160205260409020549150612e849050565b92915050565b6000546001600160a01b03163314612eb45760405162461bcd60e51b815260040161084690613a6a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612f005760405162461bcd60e51b815260040161084690613a6a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f759190613740565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ff891906138bb565b6130029190613701565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015613043573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261306b9190810190613d7e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130eb9190613cce565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa158015613142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131669190613e5f565b5050915091508281613178919061384d565b909110159695505050505050565b60006020828403121561319857600080fd5b5035919050565b6001600160a01b0381168114612f0057600080fd5b600080600080608085870312156131ca57600080fd5b8435935060208501356131dc8161319f565b93969395505050506040820135916060013590565b6000806040838503121561320457600080fd5b823561320f8161319f565b9150602083013561321f8161319f565b809150509250929050565b6000806040838503121561323d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156132855761328561324c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156132b3576132b361324c565b604052919050565b60006001600160401b038311156132d4576132d461324c565b6132e7601f8401601f191660200161328b565b90508281528383830111156132fb57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261332357600080fd5b613332838335602085016132bb565b9392505050565b6000806040838503121561334c57600080fd5b82356133578161319f565b915060208301356001600160401b0381111561337257600080fd5b61337e85828601613312565b9150509250929050565b60005b838110156133a357818101518382015260200161338b565b50506000910152565b600081518084526133c4816020860160208601613388565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000611dcd60608301846133ac565b60008083601f84011261340b57600080fd5b5081356001600160401b0381111561342257600080fd5b6020830191508360208260051b850101111561343d57600080fd5b9250929050565b6000806000806060858703121561345a57600080fd5b8435935060208501356001600160401b0381111561347757600080fd5b613483878288016133f9565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b818110156134ce578351835292840192918401916001016134b2565b50909695505050505050565b600080600080600060a086880312156134f257600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60008060006060848603121561352a57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561355657600080fd5b83356135618161319f565b92506020840135915060408401356001600160401b0381111561358357600080fd5b61358f86828701613312565b9150509250925092565b60008060008060008060a087890312156135b257600080fd5b8635955060208701356001600160401b03808211156135d057600080fd5b6135dc8a838b016133f9565b90975095506040890135945060608901359350608089013591508082111561360357600080fd5b508701601f8101891361361557600080fd5b613624898235602084016132bb565b9150509295509295509295565b60006020828403121561364357600080fd5b81356133328161319f565b60008060008060006080868803121561366657600080fd5b853594506020860135935060408601356001600160401b038082111561368b57600080fd5b818801915088601f83011261369f57600080fd5b8135818111156136ae57600080fd5b8960208285010111156136c057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612e8457612e846136eb565b80516001600160601b038116811461372b57600080fd5b919050565b8051801515811461372b57600080fd5b600080600080600060a0868803121561375857600080fd5b61376186613714565b945060208601516137718161319f565b60408701519094506005811061378657600080fd5b925061379460608701613730565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156137cf57600080fd5b61333282613730565b6000806000606084860312156137ed57600080fd5b835192506137fd60208501613730565b915061380b60408501613730565b90509250925092565b8082028115828204841417612e8457612e846136eb565b60008261384857634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612e8457612e846136eb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b600080604083850312156138aa57600080fd5b505080516020909101519092909150565b6000602082840312156138cd57600080fd5b5051919050565b600181811c908216806138e857607f821691505b60208210810361390857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461392e816138d4565b8060608701526080600180841660008114613950576001811461396a57613998565b60ff1985168984015283151560051b890183019550613998565b896000528660002060005b858110156139905781548b8201860152908301908801613975565b8a0184019650505b50939a9950505050505050505050565b600082516139ba818460208701613388565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b600060018201613a0d57613a0d6136eb565b5060010190565b81835260006001600160fb1b03831115613a2d57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000613a5a604083018587613a14565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a031215613ac757600080fd5b613ad088613714565b9650613ade60208901613730565b955060408801519450606088015193506080880151925060a08801519150613b0860c08901613730565b905092959891949750929550565b604081526000613b2a604083018587613a14565b8281036020840152613b3c81856133ac565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f82111561179757600081815260208120601f850160051c81016020861015613bb15750805b601f850160051c820191505b81811015613bd057828155600101613bbd565b505050505050565b6001600160401b03831115613bef57613bef61324c565b613c0383613bfd83546138d4565b83613b8a565b6000601f841160018114613c375760008515613c1f5750838201355b600019600387901b1c1916600186901b178355613c91565b600083815260209020601f19861690835b82811015613c685786850135825560209485019460019092019101613c48565b5086821015613c855760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613ce057600080fd5b81516133328161319f565b600082601f830112613cfc57600080fd5b815160206001600160401b03821115613d1757613d1761324c565b8160051b613d2682820161328b565b9283528481018201928281019087851115613d4057600080fd5b83870192505b84831015613d68578251613d598161319f565b82529183019190830190613d46565b979650505050505050565b805161372b8161319f565b600060208284031215613d9057600080fd5b81516001600160401b0380821115613da757600080fd5b908301906101608286031215613dbc57600080fd5b613dc4613262565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613e0c57600080fd5b613e1887828601613ceb565b60c08301525060e0838101519082015261010080840151908201526101209150613e43828401613d73565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613e7557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122027208ff103467ed9323af634c5e37e1c1dd6321b1d0fa4cf70ec605004157b6064736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c157806352d1902d146102d4578063564a565d146102e95780635c92e2f61461031857806365540b9614610338578063675926f61461036557806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a2366004613186565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f366004613186565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a366004613186565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046131b4565b610785565b34801561029857600080fd5b506102ac6102a73660046131f1565b610c10565b005b6102ac6102bc36600461322a565b610d0d565b6102ac6102cf366004613339565b611574565b3480156102e057600080fd5b5061022161179c565b3480156102f557600080fd5b50610309610304366004613186565b6117fa565b6040516101b3939291906133d8565b34801561032457600080fd5b506102ac610333366004613444565b6118c0565b34801561034457600080fd5b50610358610353366004613186565b611bcd565b6040516101b39190613496565b34801561037157600080fd5b506102216103803660046134da565b611c91565b34801561039157600080fd5b506103a56103a0366004613515565b611dd6565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed366004613186565b611e8e565b3480156103fe57600080fd5b506102ac61040d366004613541565b611f05565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac610443366004613599565b611fd1565b34801561045457600080fd5b506102ac610463366004613631565b6126ac565b34801561047457600080fd5b50610488610483366004613515565b6126f8565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461364e565b6127be565b3480156104f657600080fd5b506101a7610505366004613515565b612993565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b36600461322a565b612a2e565b34801561054c57600080fd5b5061022161055b36600461322a565b612d37565b34801561056c57600080fd5b506102ac61057b366004613631565b612e8a565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46136d5565b600091825260208220600590910201805490925082906105e690600190613701565b815481106105f6576105f66136d5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436136d5565b6000918252602082206005909102018054909250829061066590600190613701565b81548110610675576106756136d5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613740565b5090935060049250610726915050565b816004811115610738576107386137a7565b0361077b57600061074888611bcd565b905080516001036107795780600081518110610766576107666136d5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613740565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600160009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906137bd565b156109045760405162461bcd60e51b815260206004820152600e60248201526d10dbdc99481a5cc81c185d5cd95960921b6044820152606401610846565b600086815260036020526040812054600280549091908110610928576109286136d5565b6000918252602080832088845260036005909302019182019052604082205481549193508391811061095c5761095c6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db91906137d8565b5050600087815260078401602052604090205490915060ff16610a25576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610b6a565b808603610a9a576000868152600683016020526040902054610a48576000610a93565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b8652909352922054610a899190613814565b610a93919061382b565b9450610b6a565b600081815260078301602052604090205460ff16610b6a5781600601600083600a01600181548110610ace57610ace6136d5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610b0457610b046136d5565b9060005260206000200154815260200190815260200160002054610b28919061384d565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610b5d9190613814565b610b67919061382b565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610c04576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610c59575080546001600160401b03808416911610155b15610c765760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610d3157610d316136d5565b600091825260209091206002600590920201015460ff1615610d655760405162461bcd60e51b815260040161084690613860565b600083815260036020526040812054600280549091908110610d8957610d896136d5565b906000526020600020906005020190508060010154831115610ded5760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190613897565b91509150814210158015610e7157508042105b610eb65760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b91906137d8565b50509050868103610f30576127109150610fb1565b612710611388610f408686613701565b610f4a9190613814565b610f54919061382b565b610f5e8542613701565b10610fab5760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610fc490600190613701565b81548110610fd457610fd46136d5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015611033573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105791906138bb565b6110619190613701565b60008a815260078401602052604090205490915060ff16156110c55760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561110f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113391906138bb565b905060006127106111448784613814565b61114e919061382b565b611158908361384d565b60008c8152600686016020526040812054919250908211156112095760008c815260068601602052604090205434906111919084613701565b116111b65760008c81526006860160205260409020546111b19083613701565b6111b8565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f85604051611200929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061123590849061384d565b909155505060008c81526006860160205260408120805483929061125a90849061384d565b909155505060008c8152600686016020526040902054821161132c5760008c81526006860160205260408120546009870180549192909161129c90849061384d565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611537578285600901546113499190613701565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906137bd565b156113d45760028a01805460ff191660011790556114b7565b895460038b0160006113e787600161384d565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161146291815260200190565b602060405180830381865afa15801561147f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a391906138bb565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b81526004016115049392919061390e565b6000604051808303818588803b15801561151d57600080fd5b505af1158015611531573d6000803e3d6000fd5b50505050505b8034111561156557336108fc61154d8334613701565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b61157d82612ed6565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806115fb57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115ef600080516020613e968339815191525490565b6001600160a01b031614155b156116195760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611673575060408051601f3d908101601f19168201909252611670918101906138bb565b60015b61169b57604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613e9683398151915281146116cc57604051632a87526960e21b815260048101829052602401610846565b600080516020613e968339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611797576000836001600160a01b03168360405161173391906139a8565b600060405180830381855af49150503d806000811461176e576040519150601f19603f3d011682016040523d82523d6000602084013e611773565b606091505b5050905080611795576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117e75760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613e9683398151915290565b6002818154811061180a57600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff909116929161183d906138d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611869906138d4565b80156118b65780601f1061188b576101008083540402835291602001916118b6565b820191906000526020600020905b81548152906001019060200180831161189957829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118e4576118e46136d5565b600091825260209091206002600590920201015460ff16156119185760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611962573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119869190613740565b5090935060019250611996915050565b8160048111156119a8576119a86137a7565b14611a055760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611a425760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611a6657611a666136d5565b60009182526020822060059091020180549092508290611a8890600190613701565b81548110611a9857611a986136d5565b90600052602060002090600c0201905060005b86811015611b66573382898984818110611ac757611ac76136d5565b9050602002013581548110611ade57611ade6136d5565b60009182526020909120600490910201546001600160a01b031614611b155760405162461bcd60e51b8152600401610846906139c4565b8582898984818110611b2957611b296136d5565b9050602002013581548110611b4057611b406136d5565b600091825260209091206001600490920201015580611b5e816139fb565b915050611aab565b5086869050816005016000828254611b7e919061384d565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611bbb908b908b908b90613a46565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611bf357611bf36136d5565b60009182526020822060059091020180549092508290611c1590600190613701565b81548110611c2557611c256136d5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c8357602002820191906000526020600020905b815481526020019060010190808311611c6f575b505050505092505050919050565b600085815260036020526040812054600280548392908110611cb557611cb56136d5565b60009182526020808320898452600360059093020191820190526040822054815491935083918110611ce957611ce96136d5565b90600052602060002090600c02016000018681548110611d0b57611d0b6136d5565b600091825260208220600154604051631c3db16d60e01b815260048082018e905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8d91906137d8565b506003850154919350915060ff168015611db157508183600201541480611db15750805b15611dc457612710945050505050611dcd565b60009450505050505b95945050505050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611e0757611e076136d5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611e3b57611e3b6136d5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611eb257611eb26136d5565b60009182526020822060059091020180549092508290611ed490600190613701565b81548110611ee457611ee46136d5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611f2f5760405162461bcd60e51b815260040161084690613a6a565b6000836001600160a01b03168383604051611f4a91906139a8565b60006040518083038185875af1925050503d8060008114611f87576040519150601f19603f3d011682016040523d82523d6000602084013e611f8c565b606091505b50509050806117955760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611ff557611ff56136d5565b600091825260209091206002600590920201015460ff16156120295760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120979190613740565b50909350600292506120a7915050565b8160048111156120b9576120b96137a7565b146121145760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b856121565760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b60008881526003602052604081205460028054909190811061217a5761217a6136d5565b9060005260206000209060050201905080600101548611156121d55760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b805460009082906121e890600190613701565b815481106121f8576121f86136d5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa158015612253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122779190613740565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa1580156122d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f69190613aac565b505050505091505060005b8a8110156125725733848d8d8481811061231d5761231d6136d5565b9050602002013581548110612334576123346136d5565b60009182526020909120600490910201546001600160a01b03161461236b5760405162461bcd60e51b8152600401610846906139c4565b8115806123de575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106123b3576123b36136d5565b90506020020135815481106123ca576123ca6136d5565b906000526020600020906004020160010154145b6124505760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c83818110612463576124636136d5565b905060200201358154811061247a5761247a6136d5565b600091825260209091206003600490920201015460ff16156124d35760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d848181106124e7576124e76136d5565b90506020020135815481106124fe576124fe6136d5565b60009182526020909120600260049092020101556001848d8d84818110612527576125276136d5565b905060200201358154811061253e5761253e6136d5565b60009182526020909120600490910201600301805460ff19169115159190911790558061256a816139fb565b915050612301565b508a8a905083600401600082825461258a919061384d565b90915550506000898152600284016020526040812080548c92906125af90849061384d565b9091555050600183015489036125de57600383015460ff16156125d95760038301805460ff191690555b612657565b60018301546000908152600284016020526040808220548b83529120540361262057600383015460ff166125d95760038301805460ff19166001179055612657565b60018301546000908152600284016020526040808220548b83529120541115612657576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c60405161269693929190613b16565b60405180910390a4505050505050505050505050565b6000546001600160a01b031633146126d65760405162461bcd60e51b815260040161084690613a6a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a81526020019081526020016000205481548110612726576127266136d5565b600091825260208083208a845260036005909302019182019052604082205481549193508391811061275a5761275a6136d5565b90600052602060002090600c0201600001878154811061277c5761277c6136d5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127e85760405162461bcd60e51b815260040161084690613b46565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad201612873858783613bd8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156128ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ee91906138bb565b6128f89190613701565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890612981908a908a908a90613c98565b60405180910390a25050505050505050565b6000838152600360205260408120546002805483929081106129b7576129b76136d5565b600091825260208083208784526003600590930201918201905260408220548154919350839181106129eb576129eb6136d5565b90600052602060002090600c02016000018481548110612a0d57612a0d6136d5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b03163314612a5b5760405162461bcd60e51b815260040161084690613b46565b600083815260036020526040902054600280548592908110612a7f57612a7f6136d5565b600091825260209091206002600590920201015460ff1615612ab35760405162461bcd60e51b815260040161084690613860565b600084815260036020526040812054600280549091908110612ad757612ad76136d5565b60009182526020822060059091020180549092508290612af990600190613701565b81548110612b0957612b096136d5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b929190613cce565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c059190613740565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612c69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8d9190613cce565b9650612c998988612f03565b15612d2657604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612d2b565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612d5b57612d5b6136d5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612d8f57612d8f6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1291906137d8565b5091509150826004015460001480612e41575080158015612e4157506000828152600284016020526040902054155b15612e53576000945050505050612e84565b8015612e68575050600401549150612e849050565b506000908152600290910160205260409020549150612e849050565b92915050565b6000546001600160a01b03163314612eb45760405162461bcd60e51b815260040161084690613a6a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612f005760405162461bcd60e51b815260040161084690613a6a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f759190613740565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ff891906138bb565b6130029190613701565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015613043573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261306b9190810190613d7e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130eb9190613cce565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa158015613142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131669190613e5f565b5050915091508281613178919061384d565b909110159695505050505050565b60006020828403121561319857600080fd5b5035919050565b6001600160a01b0381168114612f0057600080fd5b600080600080608085870312156131ca57600080fd5b8435935060208501356131dc8161319f565b93969395505050506040820135916060013590565b6000806040838503121561320457600080fd5b823561320f8161319f565b9150602083013561321f8161319f565b809150509250929050565b6000806040838503121561323d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156132855761328561324c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156132b3576132b361324c565b604052919050565b60006001600160401b038311156132d4576132d461324c565b6132e7601f8401601f191660200161328b565b90508281528383830111156132fb57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261332357600080fd5b613332838335602085016132bb565b9392505050565b6000806040838503121561334c57600080fd5b82356133578161319f565b915060208301356001600160401b0381111561337257600080fd5b61337e85828601613312565b9150509250929050565b60005b838110156133a357818101518382015260200161338b565b50506000910152565b600081518084526133c4816020860160208601613388565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000611dcd60608301846133ac565b60008083601f84011261340b57600080fd5b5081356001600160401b0381111561342257600080fd5b6020830191508360208260051b850101111561343d57600080fd5b9250929050565b6000806000806060858703121561345a57600080fd5b8435935060208501356001600160401b0381111561347757600080fd5b613483878288016133f9565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b818110156134ce578351835292840192918401916001016134b2565b50909695505050505050565b600080600080600060a086880312156134f257600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60008060006060848603121561352a57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561355657600080fd5b83356135618161319f565b92506020840135915060408401356001600160401b0381111561358357600080fd5b61358f86828701613312565b9150509250925092565b60008060008060008060a087890312156135b257600080fd5b8635955060208701356001600160401b03808211156135d057600080fd5b6135dc8a838b016133f9565b90975095506040890135945060608901359350608089013591508082111561360357600080fd5b508701601f8101891361361557600080fd5b613624898235602084016132bb565b9150509295509295509295565b60006020828403121561364357600080fd5b81356133328161319f565b60008060008060006080868803121561366657600080fd5b853594506020860135935060408601356001600160401b038082111561368b57600080fd5b818801915088601f83011261369f57600080fd5b8135818111156136ae57600080fd5b8960208285010111156136c057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612e8457612e846136eb565b80516001600160601b038116811461372b57600080fd5b919050565b8051801515811461372b57600080fd5b600080600080600060a0868803121561375857600080fd5b61376186613714565b945060208601516137718161319f565b60408701519094506005811061378657600080fd5b925061379460608701613730565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156137cf57600080fd5b61333282613730565b6000806000606084860312156137ed57600080fd5b835192506137fd60208501613730565b915061380b60408501613730565b90509250925092565b8082028115828204841417612e8457612e846136eb565b60008261384857634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612e8457612e846136eb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b600080604083850312156138aa57600080fd5b505080516020909101519092909150565b6000602082840312156138cd57600080fd5b5051919050565b600181811c908216806138e857607f821691505b60208210810361390857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461392e816138d4565b8060608701526080600180841660008114613950576001811461396a57613998565b60ff1985168984015283151560051b890183019550613998565b896000528660002060005b858110156139905781548b8201860152908301908801613975565b8a0184019650505b50939a9950505050505050505050565b600082516139ba818460208701613388565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b600060018201613a0d57613a0d6136eb565b5060010190565b81835260006001600160fb1b03831115613a2d57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000613a5a604083018587613a14565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a031215613ac757600080fd5b613ad088613714565b9650613ade60208901613730565b955060408801519450606088015193506080880151925060a08801519150613b0860c08901613730565b905092959891949750929550565b604081526000613b2a604083018587613a14565b8281036020840152613b3c81856133ac565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f82111561179757600081815260208120601f850160051c81016020861015613bb15750805b601f850160051c820191505b81811015613bd057828155600101613bbd565b505050505050565b6001600160401b03831115613bef57613bef61324c565b613c0383613bfd83546138d4565b83613b8a565b6000601f841160018114613c375760008515613c1f5750838201355b600019600387901b1c1916600186901b178355613c91565b600083815260209020601f19861690835b82811015613c685786850135825560209485019460019092019101613c48565b5086821015613c855760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613ce057600080fd5b81516133328161319f565b600082601f830112613cfc57600080fd5b815160206001600160401b03821115613d1757613d1761324c565b8160051b613d2682820161328b565b9283528481018201928281019087851115613d4057600080fd5b83870192505b84831015613d68578251613d598161319f565b82529183019190830190613d46565b979650505050505050565b805161372b8161319f565b600060208284031215613d9057600080fd5b81516001600160401b0380821115613da757600080fd5b908301906101608286031215613dbc57600080fd5b613dc4613262565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613e0c57600080fd5b613e1887828601613ceb565b60c08301525060e0838101519082015261010080840151908201526101209150613e43828401613d73565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613e7557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122027208ff103467ed9323af634c5e37e1c1dd6321b1d0fa4cf70ec605004157b6064736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "ChoiceFunded(uint256,uint256,uint256)": { + "details": "To be emitted when a choice is fully funded for an appeal.", + "params": { + "_choice": "The choice that is being funded.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "CommitCast(uint256,address,uint256[],bytes32)": { + "details": "To be emitted when a vote commitment is cast.", + "params": { + "_commit": "The commitment of the juror.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "The address of the juror casting the vote commitment.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Contribution(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when a funding contribution is made.", + "params": { + "_amount": "The amount contributed.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "DisputeCreation(uint256,uint256,bytes)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_extraData": "The extra data for the dispute.", + "_numberOfChoices": "The number of choices available in the dispute." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + }, + "VoteCast(uint256,address,uint256[],uint256,string)": { + "details": "Emitted when casting a vote to provide the justification of juror's choice.", + "params": { + "_choice": "The choice juror voted for.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "Address of the juror.", + "_justification": "Justification of the choice.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Withdrawal(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when the contributed funds are withdrawn.", + "params": { + "_amount": "The amount withdrawn.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + } + }, + "kind": "dev", + "methods": { + "areCommitsAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their commits for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their commits for the last round." + } + }, + "areVotesAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their votes for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their votes for the last round." + } + }, + "castCommit(uint256,uint256[],bytes32)": { + "details": "Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.", + "params": { + "_commit": "The commit. Note that justification string is a part of the commit.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_voteIDs": "The IDs of the votes." + } + }, + "castVote(uint256,uint256[],uint256,uint256,string)": { + "details": "Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.", + "params": { + "_choice": "The choice.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_justification": "Justification of the choice.", + "_salt": "The salt for the commit if the votes were hidden.", + "_voteIDs": "The IDs of the votes." + } + }, + "changeCore(address)": { + "details": "Changes the `core` storage variable.", + "params": { + "_core": "The new value for the `core` storage variable." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createDispute(uint256,uint256,bytes,uint256)": { + "details": "Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_extraData": "Additional info about the dispute, for possible use in future dispute kits.", + "_nbVotes": "Number of votes for this dispute.", + "_numberOfChoices": "Number of choices of the dispute" + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_nonce": "Nonce of the drawing iteration." + }, + "returns": { + "drawnAddress": "The drawn address." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "fundAppeal(uint256,uint256)": { + "details": "Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.", + "params": { + "_choice": "A choice that receives funding.", + "_coreDisputeID": "Index of the dispute in Kleros Core." + } + }, + "getCoherentCount(uint256,uint256)": { + "details": "Gets the number of jurors who are eligible to a reward in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit." + }, + "returns": { + "_0": "The number of coherent jurors." + } + }, + "getDegreeOfCoherence(uint256,uint256,uint256,uint256,uint256)": { + "details": "Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the vote." + }, + "returns": { + "_0": "The degree of coherence in basis points." + } + }, + "initialize(address,address)": { + "details": "Initializer.", + "params": { + "_core": "The KlerosCore arbitrator.", + "_governor": "The governor's address." + } + }, + "isVoteActive(uint256,uint256,uint256)": { + "details": "Returns true if the specified voter was active in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the voter." + }, + "returns": { + "_0": "Whether the voter was active or not." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + }, + "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. Note that withdrawals are not possible if the core contract is paused.", + "params": { + "_beneficiary": "The address whose rewards to withdraw.", + "_choice": "The ruling option that the caller wants to withdraw from.", + "_coreDisputeID": "Index of the dispute in Kleros Core contract.", + "_coreRoundID": "The round in the Kleros Core contract the caller wants to withdraw from." + }, + "returns": { + "amount": "The withdrawn amount." + } + } + }, + "title": "DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10426, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 10429, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)1891" + }, + { + "astId": 10433, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(Dispute)10365_storage)dyn_storage" + }, + { + "astId": 10437, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreDisputeIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Dispute)10365_storage)dyn_storage": { + "base": "t_struct(Dispute)10365_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)10403_storage)dyn_storage": { + "base": "t_struct(Round)10403_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Vote)10412_storage)dyn_storage": { + "base": "t_struct(Vote)10412_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Vote[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)1891": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_uint256)" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(Dispute)10365_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Dispute", + "members": [ + { + "astId": 10354, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "rounds", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Round)10403_storage)dyn_storage" + }, + { + "astId": 10356, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "numberOfChoices", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 10358, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "jumped", + "offset": 0, + "slot": "2", + "type": "t_bool" + }, + { + "astId": 10362, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreRoundIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 10364, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "extraData", + "offset": 0, + "slot": "4", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(Round)10403_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Round", + "members": [ + { + "astId": 10369, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "votes", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Vote)10412_storage)dyn_storage" + }, + { + "astId": 10371, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "winningChoice", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 10375, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "counts", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 10377, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "tied", + "offset": 0, + "slot": "3", + "type": "t_bool" + }, + { + "astId": 10379, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalVoted", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 10381, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalCommitted", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 10385, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "paidFees", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 10389, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "hasPaid", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 10395, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "contributions", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 10397, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "feeRewards", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 10400, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "fundedChoices", + "offset": 0, + "slot": "10", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 10402, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "nbVotes", + "offset": 0, + "slot": "11", + "type": "t_uint256" + } + ], + "numberOfBytes": "384" + }, + "t_struct(Vote)10412_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Vote", + "members": [ + { + "astId": 10405, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 10407, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "commit", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 10409, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "choice", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10411, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "voted", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrum/DisputeKitClassicNeo_Proxy.json b/contracts/deployments/arbitrum/DisputeKitClassicNeo_Proxy.json new file mode 100644 index 000000000..849cb4f08 --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeKitClassicNeo_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x83bbf99250151bfa2d6c447cf28df352cc8148074af5096725595ec05a4500b4", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "transactionIndex": 2, + "gasUsed": "5403468", + "logsBloom": "0x00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa31c04677fc6a6a70f3714cf96105c68352d67a22d6b22af440b0e3d33d55856", + "transactionHash": "0x83bbf99250151bfa2d6c447cf28df352cc8148074af5096725595ec05a4500b4", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 190274518, + "transactionHash": "0x83bbf99250151bfa2d6c447cf28df352cc8148074af5096725595ec05a4500b4", + "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xa31c04677fc6a6a70f3714cf96105c68352d67a22d6b22af440b0e3d33d55856" + } + ], + "blockNumber": 190274518, + "cumulativeGasUsed": "6129030", + "status": 1, + "byzantium": true + }, + "args": [ + "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/DisputeResolverNeo.json b/contracts/deployments/arbitrum/DisputeResolverNeo.json new file mode 100644 index 000000000..bf9c48f37 --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeResolverNeo.json @@ -0,0 +1,522 @@ +{ + "address": "0x95eCE455bD817D6adB92F2383617d36eBE10D6EB", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplate", + "type": "string" + }, + { + "internalType": "string", + "name": "_disputeTemplateDataMappings", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplateUri", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplateUri", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_arbitratorDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x47dc9b02e48cd2d2c2fb306b627e458a3d1d694ed56fff1877b02b46a4a4e14f", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x95eCE455bD817D6adB92F2383617d36eBE10D6EB", + "transactionIndex": 1, + "gasUsed": "16675612", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7583de5952d7ca82480e017e87c396a71e889b810e5bd6e7eff1e6790008c864", + "transactionHash": "0x47dc9b02e48cd2d2c2fb306b627e458a3d1d694ed56fff1877b02b46a4a4e14f", + "logs": [], + "blockNumber": 190274719, + "cumulativeGasUsed": "16675612", + "status": 1, + "byzantium": true + }, + "args": [ + "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "0x52c9f5634361eD3641016e5d9783310f9EFf9e25" + ], + "numDeployments": 1, + "solcInputHash": "47a03c54c72f5d4984b62ca6f84025dc", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateDataMappings\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_arbitratorDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_disputeTemplateDataMappings\":\"The data mappings.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_arbitratorDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator, IDisputeTemplateRegistry _templateRegistry) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _disputeTemplateDataMappings The data mappings.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return\\n _createDispute(\\n _arbitratorExtraData,\\n _disputeTemplate,\\n _disputeTemplateDataMappings,\\n \\\"\\\",\\n _numberOfRulingOptions\\n );\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _arbitratorDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _arbitratorDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_arbitratorDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _arbitratorDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n uint256 templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _disputeTemplate, _disputeTemplateDataMappings);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x76af575d9dcf7b5a3dad88406832569a15d1c6f21d1ff23093ef59560a5b8eeb\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// @dev When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7babeb6a4180e75dc50a42762f449b32ad0a67cf58a3cb6bf3e5306ac9364507\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610ed5380380610ed583398101604081905261002f91610083565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100bd565b6001600160a01b038116811461008057600080fd5b50565b6000806040838503121561009657600080fd5b82516100a18161006b565b60208401519092506100b28161006b565b809150509250929050565b610e09806100cc6000396000f3fe60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea264697066735822122030bb92279669c59559edbe94ae812fb395eac88df0aef34a5f95543bf653912364736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea264697066735822122030bb92279669c59559edbe94ae812fb395eac88df0aef34a5f95543bf653912364736f6c63430008120033", + "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor.", + "params": { + "_governor": "The address of the new governor." + } + }, + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "Target global arbitrator for any disputes." + } + }, + "createDisputeForTemplate(bytes,string,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplate": "Dispute template.", + "_disputeTemplateDataMappings": "The data mappings.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "createDisputeForTemplateUri(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_arbitratorDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 9776, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 9779, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitrator", + "offset": 0, + "slot": "1", + "type": "t_contract(IArbitratorV2)15734" + }, + { + "astId": 9782, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "templateRegistry", + "offset": 0, + "slot": "2", + "type": "t_contract(IDisputeTemplateRegistry)15905" + }, + { + "astId": 9786, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "disputes", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(DisputeStruct)9774_storage)dyn_storage" + }, + { + "astId": 9790, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorDisputeIDToLocalID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)9774_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)9774_storage", + "encoding": "dynamic_array", + "label": "struct DisputeResolver.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)15734": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)15905": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)9774_storage": { + "encoding": "inplace", + "label": "struct DisputeResolver.DisputeStruct", + "members": [ + { + "astId": 9767, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "0", + "type": "t_bytes_storage" + }, + { + "astId": 9769, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "isRuled", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 9771, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "ruling", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9773, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrum/DisputeTemplateRegistry.json b/contracts/deployments/arbitrum/DisputeTemplateRegistry.json new file mode 100644 index 000000000..4f4cb137c --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeTemplateRegistry.json @@ -0,0 +1,311 @@ +{ + "address": "0x52c9f5634361eD3641016e5d9783310f9EFf9e25", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "setDisputeTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "templateId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xe1333e26dfa0e2d8ce79566792006d3e200d9edb6527ccf95498dd2bf5ef014f", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x52c9f5634361eD3641016e5d9783310f9EFf9e25", + "transactionIndex": 1, + "gasUsed": "5371417", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xc03c1213d3813fe680268f81116f23e12776f1f34f5d12f56346e8fadef35991", + "transactionHash": "0xe1333e26dfa0e2d8ce79566792006d3e200d9edb6527ccf95498dd2bf5ef014f", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274710, + "transactionHash": "0xe1333e26dfa0e2d8ce79566792006d3e200d9edb6527ccf95498dd2bf5ef014f", + "address": "0x52c9f5634361eD3641016e5d9783310f9EFf9e25", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xc03c1213d3813fe680268f81116f23e12776f1f34f5d12f56346e8fadef35991" + } + ], + "blockNumber": 190274710, + "cumulativeGasUsed": "5371417", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/DisputeTemplateRegistry_Implementation.json b/contracts/deployments/arbitrum/DisputeTemplateRegistry_Implementation.json new file mode 100644 index 000000000..e30818460 --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeTemplateRegistry_Implementation.json @@ -0,0 +1,400 @@ +{ + "address": "0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "setDisputeTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "templateId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x9fabdce3bf382d4cc9c1d89adcf76bc8757997c8cd982efbbb7d422e2c88969f", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb", + "transactionIndex": 1, + "gasUsed": "11112509", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000004000000000000000000000000000000000200000000000000000000000000000000000000000000000000", + "blockHash": "0x70bf531c7737f422055468c1ef315500525d65152d0178e7966c83f15b49f523", + "transactionHash": "0x9fabdce3bf382d4cc9c1d89adcf76bc8757997c8cd982efbbb7d422e2c88969f", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274683, + "transactionHash": "0x9fabdce3bf382d4cc9c1d89adcf76bc8757997c8cd982efbbb7d422e2c88969f", + "address": "0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x70bf531c7737f422055468c1ef315500525d65152d0178e7966c83f15b49f523" + } + ], + "blockNumber": 190274683, + "cumulativeGasUsed": "11112509", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"setDisputeTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"templateId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract to maintain a registry of dispute templates.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"DisputeTemplate(uint256,string,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateData\":\"The template data.\",\"_templateDataMappings\":\"The data mappings.\",\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Initializer\",\"params\":{\"_governor\":\"Governor of the contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setDisputeTemplate(string,string,string)\":{\"details\":\"Registers a new dispute template.\",\"params\":{\"_templateData\":\"The data of the template.\",\"_templateDataMappings\":\"The data mappings of the template.\",\"_templateTag\":\"The tag of the template (optional).\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"stateVariables\":{\"governor\":{\"details\":\"The governor of the contract.\"},\"templates\":{\"details\":\"The number of templates.\"}},\"title\":\"Dispute Template Registry\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/DisputeTemplateRegistry.sol\":\"DisputeTemplateRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/DisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"./interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\n/// @title Dispute Template Registry\\n/// @dev A contract to maintain a registry of dispute templates.\\ncontract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /// @dev The governor of the contract.\\n address public governor;\\n\\n /// @dev The number of templates.\\n uint256 public templates;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer\\n /// @param _governor Governor of the contract.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Registers a new dispute template.\\n /// @param _templateTag The tag of the template (optional).\\n /// @param _templateData The data of the template.\\n /// @param _templateDataMappings The data mappings of the template.\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId) {\\n templateId = templates++;\\n emit DisputeTemplate(templateId, _templateTag, _templateData, _templateDataMappings);\\n }\\n}\\n\",\"keccak256\":\"0x71dbee3e78a5bdc33f5abef3f76b314fc1ea4c41ea0f8e419133dee61679dc11\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516108d66100fc600039600081816101d1015281816101fa01526103f701526108d66000f3fe6080604052600436106100605760003560e01c80630c340a24146100655780633a283d7d146100a25780634a994174146100c65780634f1ef286146100e657806352d1902d146100fb578063c4d66de814610110578063e4c0aaf414610130575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100b860015481565b604051908152602001610099565b3480156100d257600080fd5b506100b86100e136600461065e565b610150565b6100f96100f4366004610702565b6101bd565b005b34801561010757600080fd5b506100b86103ea565b34801561011c57600080fd5b506100f961012b366004610764565b610448565b34801561013c57600080fd5b506100f961014b366004610764565b610532565b60018054600091826101618361077f565b9190505590508360405161017591906107ca565b6040518091039020817ef7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff992485856040516101ae929190610812565b60405180910390a39392505050565b6101c68261057e565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061024457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166102386000805160206108818339815191525490565b6001600160a01b031614155b156102625760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156102bc575060408051601f3d908101601f191682019092526102b991810190610840565b60015b6102e957604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610881833981519152811461031a57604051632a87526960e21b8152600481018290526024016102e0565b6000805160206108818339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156103e5576000836001600160a01b03168360405161038191906107ca565b600060405180830381855af49150503d80600081146103bc576040519150601f19603f3d011682016040523d82523d6000602084013e6103c1565b606091505b50509050806103e3576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104355760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061088183398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104925750805467ffffffffffffffff808416911610155b156104af5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016102e090610859565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b81526004016102e090610859565b50565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156105dc576105dc6105ab565b604051601f8501601f19908116603f01168101908282118183101715610604576106046105ab565b8160405280935085815286868601111561061d57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261064857600080fd5b610657838335602085016105c1565b9392505050565b60008060006060848603121561067357600080fd5b833567ffffffffffffffff8082111561068b57600080fd5b61069787838801610637565b945060208601359150808211156106ad57600080fd5b6106b987838801610637565b935060408601359150808211156106cf57600080fd5b506106dc86828701610637565b9150509250925092565b80356001600160a01b03811681146106fd57600080fd5b919050565b6000806040838503121561071557600080fd5b61071e836106e6565b9150602083013567ffffffffffffffff81111561073a57600080fd5b8301601f8101851361074b57600080fd5b61075a858235602084016105c1565b9150509250929050565b60006020828403121561077657600080fd5b610657826106e6565b60006001820161079f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156107c15781810151838201526020016107a9565b50506000910152565b600082516107dc8184602087016107a6565b9190910192915050565b600081518084526107fe8160208601602086016107a6565b601f01601f19169290920160200192915050565b60408152600061082560408301856107e6565b828103602084015261083781856107e6565b95945050505050565b60006020828403121561085257600080fd5b5051919050565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b60408201526060019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122015d1bbce6086c1434ece6b4aa9d74ae473176448e9bdd9e5b84f97f81b81664064736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a24146100655780633a283d7d146100a25780634a994174146100c65780634f1ef286146100e657806352d1902d146100fb578063c4d66de814610110578063e4c0aaf414610130575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100b860015481565b604051908152602001610099565b3480156100d257600080fd5b506100b86100e136600461065e565b610150565b6100f96100f4366004610702565b6101bd565b005b34801561010757600080fd5b506100b86103ea565b34801561011c57600080fd5b506100f961012b366004610764565b610448565b34801561013c57600080fd5b506100f961014b366004610764565b610532565b60018054600091826101618361077f565b9190505590508360405161017591906107ca565b6040518091039020817ef7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff992485856040516101ae929190610812565b60405180910390a39392505050565b6101c68261057e565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061024457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166102386000805160206108818339815191525490565b6001600160a01b031614155b156102625760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156102bc575060408051601f3d908101601f191682019092526102b991810190610840565b60015b6102e957604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610881833981519152811461031a57604051632a87526960e21b8152600481018290526024016102e0565b6000805160206108818339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156103e5576000836001600160a01b03168360405161038191906107ca565b600060405180830381855af49150503d80600081146103bc576040519150601f19603f3d011682016040523d82523d6000602084013e6103c1565b606091505b50509050806103e3576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104355760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061088183398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104925750805467ffffffffffffffff808416911610155b156104af5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016102e090610859565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b81526004016102e090610859565b50565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156105dc576105dc6105ab565b604051601f8501601f19908116603f01168101908282118183101715610604576106046105ab565b8160405280935085815286868601111561061d57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261064857600080fd5b610657838335602085016105c1565b9392505050565b60008060006060848603121561067357600080fd5b833567ffffffffffffffff8082111561068b57600080fd5b61069787838801610637565b945060208601359150808211156106ad57600080fd5b6106b987838801610637565b935060408601359150808211156106cf57600080fd5b506106dc86828701610637565b9150509250925092565b80356001600160a01b03811681146106fd57600080fd5b919050565b6000806040838503121561071557600080fd5b61071e836106e6565b9150602083013567ffffffffffffffff81111561073a57600080fd5b8301601f8101851361074b57600080fd5b61075a858235602084016105c1565b9150509250929050565b60006020828403121561077657600080fd5b610657826106e6565b60006001820161079f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156107c15781810151838201526020016107a9565b50506000910152565b600082516107dc8184602087016107a6565b9190910192915050565b600081518084526107fe8160208601602086016107a6565b601f01601f19169290920160200192915050565b60408152600061082560408301856107e6565b828103602084015261083781856107e6565b95945050505050565b60006020828403121561085257600080fd5b5051919050565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b60408201526060019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122015d1bbce6086c1434ece6b4aa9d74ae473176448e9bdd9e5b84f97f81b81664064736f6c63430008120033", + "devdoc": { + "details": "A contract to maintain a registry of dispute templates.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "DisputeTemplate(uint256,string,string,string)": { + "details": "To be emitted when a new dispute template is created.", + "params": { + "_templateData": "The template data.", + "_templateDataMappings": "The data mappings.", + "_templateId": "The identifier of the dispute template.", + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\"." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Initializer", + "params": { + "_governor": "Governor of the contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setDisputeTemplate(string,string,string)": { + "details": "Registers a new dispute template.", + "params": { + "_templateData": "The data of the template.", + "_templateDataMappings": "The data mappings of the template.", + "_templateTag": "The tag of the template (optional)." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "stateVariables": { + "governor": { + "details": "The governor of the contract." + }, + "templates": { + "details": "The number of templates." + } + }, + "title": "Dispute Template Registry", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5254, + "contract": "src/arbitration/DisputeTemplateRegistry.sol:DisputeTemplateRegistry", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5257, + "contract": "src/arbitration/DisputeTemplateRegistry.sol:DisputeTemplateRegistry", + "label": "templates", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrum/DisputeTemplateRegistry_Proxy.json b/contracts/deployments/arbitrum/DisputeTemplateRegistry_Proxy.json new file mode 100644 index 000000000..6245741f4 --- /dev/null +++ b/contracts/deployments/arbitrum/DisputeTemplateRegistry_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x52c9f5634361eD3641016e5d9783310f9EFf9e25", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xe1333e26dfa0e2d8ce79566792006d3e200d9edb6527ccf95498dd2bf5ef014f", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x52c9f5634361eD3641016e5d9783310f9EFf9e25", + "transactionIndex": 1, + "gasUsed": "5371417", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xc03c1213d3813fe680268f81116f23e12776f1f34f5d12f56346e8fadef35991", + "transactionHash": "0xe1333e26dfa0e2d8ce79566792006d3e200d9edb6527ccf95498dd2bf5ef014f", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274710, + "transactionHash": "0xe1333e26dfa0e2d8ce79566792006d3e200d9edb6527ccf95498dd2bf5ef014f", + "address": "0x52c9f5634361eD3641016e5d9783310f9EFf9e25", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xc03c1213d3813fe680268f81116f23e12776f1f34f5d12f56346e8fadef35991" + } + ], + "blockNumber": 190274710, + "cumulativeGasUsed": "5371417", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4Ce87329d40f15509D5F9bF4D9Ce1A081A80CeFb", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/EvidenceModule.json b/contracts/deployments/arbitrum/EvidenceModule.json new file mode 100644 index 000000000..7a7a1e2bb --- /dev/null +++ b/contracts/deployments/arbitrum/EvidenceModule.json @@ -0,0 +1,268 @@ +{ + "address": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x209385fe4a2fa64e1241c0a5b93e027cf1059724b0385df32851a86a7065ef8f", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "transactionIndex": 3, + "gasUsed": "5342039", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000400000000000000000000000000000100000000000080", + "blockHash": "0x0a5b4182237e39e332bed794964d094fe2efbe1f22d1157305f16aa28aac3ab0", + "transactionHash": "0x209385fe4a2fa64e1241c0a5b93e027cf1059724b0385df32851a86a7065ef8f", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274441, + "transactionHash": "0x209385fe4a2fa64e1241c0a5b93e027cf1059724b0385df32851a86a7065ef8f", + "address": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 6, + "blockHash": "0x0a5b4182237e39e332bed794964d094fe2efbe1f22d1157305f16aa28aac3ab0" + } + ], + "blockNumber": 190274441, + "cumulativeGasUsed": "7385404", + "status": 1, + "byzantium": true + }, + "args": [ + "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/EvidenceModule_Implementation.json b/contracts/deployments/arbitrum/EvidenceModule_Implementation.json new file mode 100644 index 000000000..8ed78b10e --- /dev/null +++ b/contracts/deployments/arbitrum/EvidenceModule_Implementation.json @@ -0,0 +1,327 @@ +{ + "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x6a1bf67af1366f78f0863f2fa1e72362c86f432bbc9ffb699fe26461a546e043", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "transactionIndex": 6, + "gasUsed": "10124687", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000008000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8b61458ccb051d2f92cc638b230525bc7ff1b858ba2b17ae63a6d8123aa0d6d9", + "transactionHash": "0x6a1bf67af1366f78f0863f2fa1e72362c86f432bbc9ffb699fe26461a546e043", + "logs": [ + { + "transactionIndex": 6, + "blockNumber": 190274430, + "transactionHash": "0x6a1bf67af1366f78f0863f2fa1e72362c86f432bbc9ffb699fe26461a546e043", + "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 7, + "blockHash": "0x8b61458ccb051d2f92cc638b230525bc7ff1b858ba2b17ae63a6d8123aa0d6d9" + } + ], + "blockNumber": 190274430, + "cumulativeGasUsed": "15648605", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "47a03c54c72f5d4984b62ca6f84025dc", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"Evidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Evidence(uint256,address,string)\":{\"details\":\"To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\",\"_party\":\"The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Initializer.\",\"params\":{\"_governor\":\"The governor's address.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"submitEvidence(uint256,string)\":{\"details\":\"Submits evidence for a dispute.\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Evidence Module\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/evidence/EvidenceModule.sol\":\"EvidenceModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/evidence/EvidenceModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @fnanni-0]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n/// @custom:tools: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../interfaces/IArbitratorV2.sol\\\";\\nimport \\\"../interfaces/IEvidence.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title Evidence Module\\ncontract EvidenceModule is IEvidence, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /// @dev Submits evidence for a dispute.\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\\n function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {\\n emit Evidence(_externalDisputeID, msg.sender, _evidence);\\n }\\n}\\n\",\"keccak256\":\"0x32d2c14255a266083094597f009f557e2db62727fb8a8fa9cf3f1760be58300c\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// @dev When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7babeb6a4180e75dc50a42762f449b32ad0a67cf58a3cb6bf3e5306ac9364507\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IEvidence\\ninterface IEvidence {\\n /// @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\\n /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence);\\n}\\n\",\"keccak256\":\"0x3350da62267a5dad4616dafd9916fe3bfa4cdabfce124709ac3b7d087361e8c4\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516107896100fc6000396000818161011801528181610141015261033e01526107896000f3fe60806040526004361061004a5760003560e01c80630c340a241461004f5780634f1ef2861461008c57806352d1902d146100a1578063a6a7f0eb146100c4578063c4d66de8146100e4575b600080fd5b34801561005b57600080fd5b5060005461006f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61009f61009a36600461055c565b610104565b005b3480156100ad57600080fd5b506100b6610331565b604051908152602001610083565b3480156100d057600080fd5b5061009f6100df36600461061e565b61038f565b3480156100f057600080fd5b5061009f6100ff36600461069a565b6103d8565b61010d826104c2565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061018b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661017f6000805160206107348339815191525490565b6001600160a01b031614155b156101a95760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610203575060408051601f3d908101601f19168201909252610200918101906106bc565b60015b61023057604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610734833981519152811461026157604051632a87526960e21b815260048101829052602401610227565b6000805160206107348339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561032c576000836001600160a01b0316836040516102c891906106d5565b600060405180830381855af49150503d8060008114610303576040519150601f19603f3d011682016040523d82523d6000602084013e610308565b606091505b505090508061032a576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461037c5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061073483398151915290565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516103cb929190610704565b60405180910390a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104225750805467ffffffffffffffff808416911610155b1561043f5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b031633146105275760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610227565b50565b80356001600160a01b038116811461054157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561056f57600080fd5b6105788361052a565b9150602083013567ffffffffffffffff8082111561059557600080fd5b818501915085601f8301126105a957600080fd5b8135818111156105bb576105bb610546565b604051601f8201601f19908116603f011681019083821181831017156105e3576105e3610546565b816040528281528860208487010111156105fc57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006040848603121561063357600080fd5b83359250602084013567ffffffffffffffff8082111561065257600080fd5b818601915086601f83011261066657600080fd5b81358181111561067557600080fd5b87602082850101111561068757600080fd5b6020830194508093505050509250925092565b6000602082840312156106ac57600080fd5b6106b58261052a565b9392505050565b6000602082840312156106ce57600080fd5b5051919050565b6000825160005b818110156106f657602081860181015185830152016106dc565b506000920191825250919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212205fc8c90f1a2225055493c5f6b104c59445091844b74319a7bfee8e88d28bd25664736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c80630c340a241461004f5780634f1ef2861461008c57806352d1902d146100a1578063a6a7f0eb146100c4578063c4d66de8146100e4575b600080fd5b34801561005b57600080fd5b5060005461006f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61009f61009a36600461055c565b610104565b005b3480156100ad57600080fd5b506100b6610331565b604051908152602001610083565b3480156100d057600080fd5b5061009f6100df36600461061e565b61038f565b3480156100f057600080fd5b5061009f6100ff36600461069a565b6103d8565b61010d826104c2565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061018b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661017f6000805160206107348339815191525490565b6001600160a01b031614155b156101a95760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610203575060408051601f3d908101601f19168201909252610200918101906106bc565b60015b61023057604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610734833981519152811461026157604051632a87526960e21b815260048101829052602401610227565b6000805160206107348339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561032c576000836001600160a01b0316836040516102c891906106d5565b600060405180830381855af49150503d8060008114610303576040519150601f19603f3d011682016040523d82523d6000602084013e610308565b606091505b505090508061032a576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461037c5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061073483398151915290565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516103cb929190610704565b60405180910390a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104225750805467ffffffffffffffff808416911610155b1561043f5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b031633146105275760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610227565b50565b80356001600160a01b038116811461054157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561056f57600080fd5b6105788361052a565b9150602083013567ffffffffffffffff8082111561059557600080fd5b818501915085601f8301126105a957600080fd5b8135818111156105bb576105bb610546565b604051601f8201601f19908116603f011681019083821181831017156105e3576105e3610546565b816040528281528860208487010111156105fc57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006040848603121561063357600080fd5b83359250602084013567ffffffffffffffff8082111561065257600080fd5b818601915086601f83011261066657600080fd5b81358181111561067557600080fd5b87602082850101111561068757600080fd5b6020830194508093505050509250925092565b6000602082840312156106ac57600080fd5b6106b58261052a565b9392505050565b6000602082840312156106ce57600080fd5b5051919050565b6000825160005b818110156106f657602081860181015185830152016106dc565b506000920191825250919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212205fc8c90f1a2225055493c5f6b104c59445091844b74319a7bfee8e88d28bd25664736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Evidence(uint256,address,string)": { + "details": "To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.", + "_party": "The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Initializer.", + "params": { + "_governor": "The governor's address." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "submitEvidence(uint256,string)": { + "details": "Submits evidence for a dispute.", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Evidence Module", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 14252, + "contract": "src/arbitration/evidence/EvidenceModule.sol:EvidenceModule", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/contracts/deployments/arbitrum/EvidenceModule_Proxy.json b/contracts/deployments/arbitrum/EvidenceModule_Proxy.json new file mode 100644 index 000000000..66d67e975 --- /dev/null +++ b/contracts/deployments/arbitrum/EvidenceModule_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x209385fe4a2fa64e1241c0a5b93e027cf1059724b0385df32851a86a7065ef8f", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "transactionIndex": 3, + "gasUsed": "5342039", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000400000000000000000000000000000100000000000080", + "blockHash": "0x0a5b4182237e39e332bed794964d094fe2efbe1f22d1157305f16aa28aac3ab0", + "transactionHash": "0x209385fe4a2fa64e1241c0a5b93e027cf1059724b0385df32851a86a7065ef8f", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274441, + "transactionHash": "0x209385fe4a2fa64e1241c0a5b93e027cf1059724b0385df32851a86a7065ef8f", + "address": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 6, + "blockHash": "0x0a5b4182237e39e332bed794964d094fe2efbe1f22d1157305f16aa28aac3ab0" + } + ], + "blockNumber": 190274441, + "cumulativeGasUsed": "7385404", + "status": 1, + "byzantium": true + }, + "args": [ + "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/KlerosCoreNeo.json b/contracts/deployments/arbitrum/KlerosCoreNeo.json new file mode 100644 index 000000000..f232baee2 --- /dev/null +++ b/contracts/deployments/arbitrum/KlerosCoreNeo.json @@ -0,0 +1,2100 @@ +{ + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrableNotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "GuardianOrGovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEligibleForStaking", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingInTooManyCourts", + "type": "error" + }, + { + "inputs": [], + "name": "StakingLessThanCourtMinStake", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxStakePerJuror", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxTotalStaked", + "type": "error" + }, + { + "inputs": [], + "name": "StakingNotPossibeInThisCourt", + "type": "error" + }, + { + "inputs": [], + "name": "StakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnstakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WhenNotPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WhenPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCoreBase.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "arbitrableWhitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_arbitrable", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "changeArbitrableWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guardian", + "type": "address" + } + ], + "name": "changeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "changeJurorNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCoreBase.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "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" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCoreBase.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_guardian", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + }, + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorNft", + "outputs": [ + { + "internalType": "contract IERC721", + "name": "", + "type": "address" + } + ], + "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": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "transactionIndex": 1, + "gasUsed": "6872493", + "logsBloom": "0x00800000000000000000000020000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000801402000000000000008000000000000000000000000000000080a00000000000000000000000080000000000000000000000000000000000008000000000000000000000200000000000000000000000000000000000000000000000000000000000000000004000000000000000060000000001201000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594", + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000b7c292cd9fd3d20de84a71ae1caf054eeb6374a9" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + }, + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 1, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + }, + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + }, + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "logIndex": 3, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + } + ], + "blockNumber": 190274596, + "cumulativeGasUsed": "6872493", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0x2c053739000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000330bd769382cfc6d50175903434ccc8d206dcae50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b7c292cd9fd3d20de84a71ae1caf054eeb6374a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000220000000000000000000000000614498118850184c62f82d08261109334bfb050f000000000000000000000000fe34a72c55e512601e7d491a9c5b36373ce34d6300000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x330bD769382cFc6d50175903434CCC8D206DCAE5", + "0x0000000000000000000000000000000000000000", + "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + false, + [ + { + "type": "BigNumber", + "hex": "0x0ad78ebc5ac6200000" + }, + 10000, + { + "type": "BigNumber", + "hex": "0x016345785d8a0000" + }, + 256 + ], + [ + 0, + 0, + 0, + 10 + ], + "0x05", + "0x614498118850184c62f82d08261109334bFB050f", + "0xfE34a72c55e512601E7d491A9c5b36373cE34d63" + ] + }, + "implementation": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/KlerosCoreNeo_Implementation.json b/contracts/deployments/arbitrum/KlerosCoreNeo_Implementation.json new file mode 100644 index 000000000..59235f52d --- /dev/null +++ b/contracts/deployments/arbitrum/KlerosCoreNeo_Implementation.json @@ -0,0 +1,2835 @@ +{ + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrableNotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "GuardianOrGovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEligibleForStaking", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingInTooManyCourts", + "type": "error" + }, + { + "inputs": [], + "name": "StakingLessThanCourtMinStake", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxStakePerJuror", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxTotalStaked", + "type": "error" + }, + { + "inputs": [], + "name": "StakingNotPossibeInThisCourt", + "type": "error" + }, + { + "inputs": [], + "name": "StakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnstakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WhenNotPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WhenPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCoreBase.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "arbitrableWhitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_arbitrable", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "changeArbitrableWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guardian", + "type": "address" + } + ], + "name": "changeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "changeJurorNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCoreBase.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "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" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCoreBase.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_guardian", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + }, + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorNft", + "outputs": [ + { + "internalType": "contract IERC721", + "name": "", + "type": "address" + } + ], + "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": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x15041bed9edfbecc26711e8c3b8ba9aeacca656a2dd114c347b4a1a3fdfc8ab8", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "transactionIndex": 1, + "gasUsed": "79108010", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000800000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000004000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x2a076e231ed11bd4d8f71ed89478ab0633426ba0610ae805aaa634ec922576ee", + "transactionHash": "0x15041bed9edfbecc26711e8c3b8ba9aeacca656a2dd114c347b4a1a3fdfc8ab8", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274584, + "transactionHash": "0x15041bed9edfbecc26711e8c3b8ba9aeacca656a2dd114c347b4a1a3fdfc8ab8", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x2a076e231ed11bd4d8f71ed89478ab0633426ba0610ae805aaa634ec922576ee" + } + ], + "blockNumber": 190274584, + "cumulativeGasUsed": "79108010", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "47a03c54c72f5d4984b62ca6f84025dc", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrableNotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrationFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArraysLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotDisableClassicDK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepthLevelMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitNotSupportedByCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeNotAppealable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodIsFinal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeStillDrawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EvidenceNotPassedAndNotAppeal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GuardianOrGovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDisputKitParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidForkingCourtAsParent\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinStakeLowerThanParentCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSupportDisputeKitClassic\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEligibleForStaking\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEvidencePeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotExecutionPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RulingAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SortitionModuleOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingInTooManyCourts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingLessThanCourtMinStake\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingMoreThanMaxStakePerJuror\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingMoreThanMaxTotalStaked\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingNotPossibeInThisCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotAccepted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnstakingTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsuccessfulCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedDisputeKit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VotePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WhenNotPausedOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WhenPausedOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongDisputeKitIndex\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"AcceptedFeeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"CourtCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_fromCourtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"_toCourtID\",\"type\":\"uint96\"}],\"name\":\"CourtJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"CourtModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"DisputeKitCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"DisputeKitEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_fromDisputeKitID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toDisputeKitID\",\"type\":\"uint256\"}],\"name\":\"DisputeKitJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_pnkAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"LeftoverRewardSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"NewCurrencyRate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum KlerosCoreBase.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_degreeOfCoherency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_pnkAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_feeAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"arbitrableWhitelist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"changeAcceptedFeeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_allowed\",\"type\":\"bool\"}],\"name\":\"changeArbitrableWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeCourtParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"changeCurrencyRates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_guardian\",\"type\":\"address\"}],\"name\":\"changeGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC721\",\"name\":\"_jurorNft\",\"type\":\"address\"}],\"name\":\"changeJurorNft\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"}],\"name\":\"changeJurorProsecutionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_toToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amountInEth\",\"type\":\"uint256\"}],\"name\":\"convertEthToTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"createCourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"currencyRates\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"feePaymentAccepted\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"rateDecimals\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKits\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrableV2\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCoreBase.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"enableDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"executeRuling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeKitsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"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\"}],\"name\":\"getNumberOfVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"disputeKitID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkAtStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repartitions\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkPenalties\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"drawnJurors\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"sumFeeRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumPnkRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"drawIterations\",\"type\":\"uint256\"}],\"internalType\":\"struct KlerosCoreBase.Round\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"guardian\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_guardian\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKit\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModuleAddress\",\"type\":\"address\"},{\"internalType\":\"contract IERC721\",\"name\":\"_jurorNft\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"isDisputeKitJumping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"isSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"jurorNft\",\"outputs\":[{\"internalType\":\"contract IERC721\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStakeBySortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"AcceptedFeeToken(address,bool)\":{\"details\":\"To be emitted when an ERC20 token is added or removed as a method to pay fees.\",\"params\":{\"_accepted\":\"Whether the token is accepted or not.\",\"_token\":\"The ERC20 token.\"}},\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"NewCurrencyRate(address,uint64,uint8)\":{\"details\":\"To be emitted when the fee for a particular ERC20 token is updated.\",\"params\":{\"_feeToken\":\"The ERC20 token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\"}},\"appeal(uint256,uint256,bytes)\":{\"details\":\"Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Extradata for the dispute. Can be required during court jump.\",\"_numberOfChoices\":\"Number of choices for the dispute. Can be required during court jump.\"}},\"appealCost(uint256)\":{\"details\":\"Gets the cost of appealing a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"cost\":\"The appeal cost.\"}},\"appealPeriod(uint256)\":{\"details\":\"Gets the start and the end of a specified dispute's current appeal period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"end\":\"The end of the appeal period.\",\"start\":\"The start of the appeal period.\"}},\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost in ETH.\"}},\"arbitrationCost(bytes,address)\":{\"details\":\"Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeToken\":\"The ERC20 token used to pay fees.\"},\"returns\":{\"cost\":\"The arbitration cost in `_feeToken`.\"}},\"changeAcceptedFeeTokens(address,bool)\":{\"details\":\"Changes the supported fee tokens.\",\"params\":{\"_accepted\":\"Whether the token is supported or not as a method of fee payment.\",\"_feeToken\":\"The fee token.\"}},\"changeArbitrableWhitelist(address,bool)\":{\"details\":\"Adds or removes an arbitrable from whitelist.\",\"params\":{\"_allowed\":\"Whether add or remove permission.\",\"_arbitrable\":\"Arbitrable address.\"}},\"changeCurrencyRates(address,uint64,uint8)\":{\"details\":\"Changes the currency rate of a fee token.\",\"params\":{\"_feeToken\":\"The fee token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeGuardian(address)\":{\"details\":\"Changes the `guardian` storage variable.\",\"params\":{\"_guardian\":\"The new value for the `guardian` storage variable.\"}},\"changeJurorNft(address)\":{\"details\":\"Changes the `jurorNft` storage variable.\",\"params\":{\"_jurorNft\":\"The new value for the `jurorNft` storage variable.\"}},\"changeJurorProsecutionModule(address)\":{\"details\":\"Changes the `jurorProsecutionModule` storage variable.\",\"params\":{\"_jurorProsecutionModule\":\"The new value for the `jurorProsecutionModule` storage variable.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.\",\"params\":{\"_sortitionModule\":\"The new value for the `sortitionModule` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])\":{\"details\":\"Creates a court under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the court.\",\"_feeForJuror\":\"The `feeForJuror` property value of the court.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the court.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the court.\",\"_minStake\":\"The `minStake` property value of the court.\",\"_parent\":\"The `parent` property value of the court.\",\"_sortitionExtraData\":\"Extra data for sortition module.\",\"_supportedDisputeKits\":\"Indexes of dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the court.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"createDispute(uint256,bytes,address,uint256)\":{\"details\":\"Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeAmount\":\"Amount of the ERC20 token used to pay fees.\",\"_feeToken\":\"The ERC20 token used to pay fees.\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws jurors for the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"enableDisputeKits(uint96,uint256[],bool)\":{\"details\":\"Adds/removes court's support for specified dispute kits.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_disputeKitIDs\":\"The IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the court.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts. Note: Reward distributions are forbidden during pause.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\",\"_round\":\"The appeal round.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"executeRuling(uint256)\":{\"details\":\"Executes a specified dispute's ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getNumberOfVotes(uint256)\":{\"details\":\"Gets the number of votes permitted for the specified dispute in the latest round.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_courtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"initialize(address,address,address,address,address,bool,uint256[4],uint256[4],bytes,address,address)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_courtParameters\":\"Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_governor\":\"The governor's address.\",\"_guardian\":\"The guardian's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_jurorNft\":\"NFT contract to vet the jurors.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionExtraData\":\"The extra data for sortition module.\",\"_sortitionModuleAddress\":\"The sortition module responsible for sortition of the jurors.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\"}},\"isDisputeKitJumping(uint256)\":{\"details\":\"Returns true if the dispute kit will be switched to a parent DK.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"_0\":\"Whether DK will be switched or not.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"pause()\":{\"details\":\"Pause staking and reward execution. Can only be done by guardian or governor.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a court. Note: Staking and unstaking is forbidden during pause.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake. Note that the existing delayed stake will be nullified as non-relevant.\"}},\"setStakeBySortitionModule(address,uint96,uint256,bool)\":{\"details\":\"Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\",\"params\":{\"_account\":\"The account whose stake is being set.\",\"_alreadyTransferred\":\"Whether the PNKs have already been transferred to the contract.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"}},\"unpause()\":{\"details\":\"Unpause staking and reward execution. Can only be done by governor.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"KlerosCoreNeo Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCoreNeo.sol\":\"KlerosCoreNeo\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5bce51e11f7d194b79ea59fe00c9e8de9fa2c5530124960f29a24d4c740a3266\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title KlerosCoreBase\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\nabstract contract KlerosCoreBase is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 feePerJurorInRound; // The fee per juror in the round.\\n uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private 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 address public guardian; // The guardian able to pause asset withdrawals.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n bool public paused; // Whether asset withdrawals are paused.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event Paused();\\n event Unpaused();\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n modifier onlyByGuardianOrGovernor() {\\n if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly();\\n _;\\n }\\n\\n modifier whenPaused() {\\n if (!paused) revert WhenPausedOnly();\\n _;\\n }\\n\\n modifier whenNotPaused() {\\n if (paused) revert WhenNotPausedOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) internal {\\n governor = _governor;\\n guardian = _guardian;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Pause staking and reward execution. Can only be done by guardian or governor.\\n function pause() external onlyByGuardianOrGovernor whenNotPaused {\\n paused = true;\\n emit Paused();\\n }\\n\\n /// @dev Unpause staking and reward execution. Can only be done by governor.\\n function unpause() external onlyByGovernor whenPaused {\\n paused = false;\\n emit Unpaused();\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `guardian` storage variable.\\n /// @param _guardian The new value for the `guardian` storage variable.\\n function changeGuardian(address _guardian) external onlyByGovernor {\\n guardian = _guardian;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal virtual returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// Note: Reward distributions are forbidden during pause.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused {\\n Round storage round;\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n round = dispute.rounds[_round];\\n } // stack too deep workaround\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound;\\n uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror;\\n uint256 coherentCount;\\n {\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n } // stack too deep workaround\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRound = _executePenalties(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRound) {\\n round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (stakingResult != StakingResult.Successful) {\\n _stakingFailed(_onError, stakingResult);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError, StakingResult.StakingTransferFailed);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError, StakingResult.UnstakingTransferFailed);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual {\\n if (_onError == OnError.Return) return;\\n if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed();\\n if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed();\\n if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts();\\n if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt();\\n if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error GuardianOrGovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingInTooManyCourts();\\n error StakingNotPossibeInThisCourt();\\n error StakingLessThanCourtMinStake();\\n error StakingTransferFailed();\\n error UnstakingTransferFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n error WhenNotPausedOnly();\\n error WhenPausedOnly();\\n}\\n\",\"keccak256\":\"0x53eb90e3209b47a218bd9eb25bd64bcff4edca51829cb7bfff35ed68f9cee05c\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreNeo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCoreBase.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\n/// @title KlerosCoreNeo\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCoreNeo is KlerosCoreBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n mapping(address => bool) public arbitrableWhitelist; // Arbitrable whitelist.\\n IERC721 public jurorNft; // Eligible jurors NFT.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _guardian The guardian's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n /// @param _jurorNft NFT contract to vet the jurors.\\n function initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress,\\n IERC721 _jurorNft\\n ) external reinitializer(2) {\\n super._initialize(\\n _governor,\\n _guardian,\\n _pinakion,\\n _jurorProsecutionModule,\\n _disputeKit,\\n _hiddenVotes,\\n _courtParameters,\\n _timesPerPeriod,\\n _sortitionExtraData,\\n _sortitionModuleAddress\\n );\\n jurorNft = _jurorNft;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `jurorNft` storage variable.\\n /// @param _jurorNft The new value for the `jurorNft` storage variable.\\n function changeJurorNft(IERC721 _jurorNft) external onlyByGovernor {\\n jurorNft = _jurorNft;\\n }\\n\\n /// @dev Adds or removes an arbitrable from whitelist.\\n /// @param _arbitrable Arbitrable address.\\n /// @param _allowed Whether add or remove permission.\\n function changeArbitrableWhitelist(address _arbitrable, bool _allowed) external onlyByGovernor {\\n arbitrableWhitelist[_arbitrable] = _allowed;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// Note: Staking and unstaking is forbidden during pause.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external override whenNotPaused {\\n if (jurorNft.balanceOf(msg.sender) == 0) revert NotEligibleForStaking();\\n super._setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal override returns (uint256 disputeID) {\\n if (!arbitrableWhitelist[msg.sender]) revert ArbitrableNotWhitelisted();\\n return super._createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure override {\\n super._stakingFailed(_onError, _result);\\n if (_result == StakingResult.CannotStakeMoreThanMaxStakePerJuror) revert StakingMoreThanMaxStakePerJuror();\\n if (_result == StakingResult.CannotStakeMoreThanMaxTotalStaked) revert StakingMoreThanMaxTotalStaked();\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error NotEligibleForStaking();\\n error StakingMoreThanMaxStakePerJuror();\\n error StakingMoreThanMaxTotalStaked();\\n error ArbitrableNotWhitelisted();\\n}\\n\",\"keccak256\":\"0x22538831e9b64ad57629e609f95d6a19cb1c25524da3d764878e51fd8bf9b29d\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// @dev When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7babeb6a4180e75dc50a42762f449b32ad0a67cf58a3cb6bf3e5306ac9364507\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @param _feePerJuror The fee per juror.\\n /// @param _pnkAtStakePerJuror The PNK at stake per juror.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 _feePerJuror,\\n uint256 _pnkAtStakePerJuror\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x72cdf621c11d1d84b851edb1ef7607ac950ba7038154c85005ccc86cdd43e71b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../../libraries/Constants.sol\\\";\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x47960dd772c9dafeefa2e6b9414c7045b5dcc68df735c1fccda6af48ca089858\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// Courts\\nuint96 constant FORKING_COURT = 0; // Index of the forking court.\\nuint96 constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n// Dispute Kits\\nuint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\nuint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n// Sortition Module\\nuint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\nuint256 constant DEFAULT_K = 6; // Default number of children per node.\\n\\n// Defaults\\nuint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\nIERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\\nenum StakingResult {\\n Successful,\\n StakingTransferFailed,\\n UnstakingTransferFailed,\\n CannotStakeInMoreCourts,\\n CannotStakeInThisCourt,\\n CannotStakeLessThanMinStake,\\n CannotStakeMoreThanMaxStakePerJuror,\\n CannotStakeMoreThanMaxTotalStaked\\n}\\n\",\"keccak256\":\"0xdc648a85f2816fa323e9f7f4accac3d9384187d0123bdfb1f9b89ce25ea64679\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051615ba462000103600039600081816119040152818161192d0152611b240152615ba46000f3fe6080604052600436106102c95760003560e01c806382d022371161017b578063c71f4253116100d7578063f6506db411610085578063f6506db414610968578063f7434ea914610988578063fbb519e7146109a8578063fbf405b0146109c8578063fc6f8f16146109e8578063fe4037e614610a08578063fe524c3914610a2857600080fd5b8063c71f425314610893578063cf0c38f8146108b3578063d07368bd146108d3578063d2b8035a146108f3578063d4d1d76a14610913578063d98493f614610928578063e4c0aaf41461094857600080fd5b8063acdbf51d11610134578063acdbf51d146107a8578063afe15cfb146107c8578063b0049637146107fd578063b44d573c1461081d578063c13517e11461084d578063c258bb1914610860578063c35699021461088057600080fd5b806382d02237146106e65780638456cb591461070657806386541b241461071b5780638a9bb02a1461073b5780638bb0487514610768578063a072b86c1461078857600080fd5b80632e2e936a1161022a57806352d1902d116101e357806352d1902d14610606578063564a565d1461061b57806359ec827e1461064c5780635c975abb1461066c578063751accd0146106865780637717a6e8146106a65780637934c0be146106c657600080fd5b80632e2e936a146105515780632fcb4f04146105715780633cfd1184146105915780633f4ba83a146105be578063452a9320146105d35780634f1ef286146105f357600080fd5b806319b815291161028757806319b81529146104035780631c3db16d146104335780631d7e6892146104705780631f5a0dd2146104905780632c053739146104f15780632d29a47b146105115780632e1daf2f1461053157600080fd5b8062f5822c146102ce5780630219da79146102f05780630b7414bc146103685780630c340a2414610388578063115d5376146103b55780631860592b146103d5575b600080fd5b3480156102da57600080fd5b506102ee6102e9366004614d05565b610a48565b005b3480156102fc57600080fd5b5061033b61030b366004614d05565b60086020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561037457600080fd5b506102ee610383366004614e13565b610a95565b34801561039457600080fd5b506000546103a8906001600160a01b031681565b60405161035f9190614e74565b3480156103c157600080fd5b506102ee6103d0366004614e88565b610bd6565b3480156103e157600080fd5b506103f56103f0366004614ea1565b61110d565b60405190815260200161035f565b34801561040f57600080fd5b5061042361041e366004614e88565b611167565b604051901515815260200161035f565b34801561043f57600080fd5b5061045361044e366004614e88565b611260565b60408051938452911515602084015215159082015260600161035f565b34801561047c57600080fd5b506102ee61048b366004614ecd565b611361565b34801561049c57600080fd5b506104b06104ab366004614e88565b6113b7565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e00161035f565b3480156104fd57600080fd5b506102ee61050c366004614fe2565b611416565b34801561051d57600080fd5b506102ee61052c3660046150cf565b611520565b34801561053d57600080fd5b506004546103a8906001600160a01b031681565b34801561055d57600080fd5b50600b546103a8906001600160a01b031681565b34801561057d57600080fd5b506102ee61058c366004614d05565b6117b6565b34801561059d57600080fd5b506105b16105ac3660046150fb565b611803565b60405161035f9190615139565b3480156105ca57600080fd5b506102ee61186d565b3480156105df57600080fd5b506001546103a8906001600160a01b031681565b6102ee610601366004615147565b6118f0565b34801561061257600080fd5b506103f5611b17565b34801561062757600080fd5b5061063b610636366004614e88565b611b75565b60405161035f9594939291906151ce565b34801561065857600080fd5b506103f5610667366004614e88565b611bd1565b34801561067857600080fd5b506009546104239060ff1681565b34801561069257600080fd5b506102ee6106a136600461520d565b611d26565b3480156106b257600080fd5b506102ee6106c1366004615265565b611dd0565b3480156106d257600080fd5b506102ee6106e1366004614ecd565b611e93565b3480156106f257600080fd5b506102ee610701366004615281565b611f12565b34801561071257600080fd5b506102ee611fcf565b34801561072757600080fd5b506102ee6107363660046152d3565b61206f565b34801561074757600080fd5b5061075b610756366004615341565b612256565b60405161035f91906153a7565b34801561077457600080fd5b506102ee610783366004614e88565b6123e2565b34801561079457600080fd5b506102ee6107a336600461544c565b612546565b3480156107b457600080fd5b506103a86107c3366004614e88565b6128b7565b3480156107d457600080fd5b506107e86107e3366004614e88565b6128e1565b6040805192835260208301919091520161035f565b34801561080957600080fd5b506102ee610818366004614d05565b61298d565b34801561082957600080fd5b50610423610838366004614d05565b600a6020526000908152604090205460ff1681565b6103f561085b36600461550c565b6129da565b34801561086c57600080fd5b506102ee61087b366004614d05565b612a12565b6102ee61088e36600461553c565b612a5f565b34801561089f57600080fd5b506103f56108ae366004614e88565b612f33565b3480156108bf57600080fd5b506003546103a8906001600160a01b031681565b3480156108df57600080fd5b506102ee6108ee366004614d05565b612f9b565b3480156108ff57600080fd5b506102ee61090e366004615341565b613044565b34801561091f57600080fd5b506006546103f5565b34801561093457600080fd5b506103f56109433660046155bd565b613359565b34801561095457600080fd5b506102ee610963366004614d05565b6133a6565b34801561097457600080fd5b506103f5610983366004615608565b6133f3565b34801561099457600080fd5b506103f56109a336600461566e565b6134d9565b3480156109b457600080fd5b506102ee6109c33660046156a2565b613525565b3480156109d457600080fd5b506002546103a8906001600160a01b031681565b3480156109f457600080fd5b506103f5610a03366004614e88565b613565565b348015610a1457600080fd5b506102ee610a23366004614d05565b613594565b348015610a3457600080fd5b50610423610a43366004615265565b6135e1565b6000546001600160a01b03163314610a735760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ac05760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610bd0578115610b5f57828181518110610ae457610ae46156f3565b602002602001015160001480610b1757506006548351849083908110610b0c57610b0c6156f3565b602002602001015110155b15610b3557604051633d58a98960e11b815260040160405180910390fd5b610b5a84848381518110610b4b57610b4b6156f3565b60200260200101516001613629565b610bbe565b6001838281518110610b7357610b736156f3565b602002602001015103610b99576040516356d111fd60e11b815260040160405180910390fd5b610bbe84848381518110610baf57610baf6156f3565b60200260200101516000613629565b80610bc88161571f565b915050610ac3565b50505050565b600060078281548110610beb57610beb6156f3565b600091825260208220600490910201805460058054929450916001600160601b03909116908110610c1e57610c1e6156f3565b6000918252602082206003850154600c909202019250610c4090600190615738565b90506000836003018281548110610c5957610c596156f3565b600091825260208220600b909102019150600185015460ff166004811115610c8357610c83615196565b03610d5e5781158015610cd257506001840154600684019060ff166004811115610caf57610caf615196565b60048110610cbf57610cbf6156f3565b01546002850154610cd09042615738565b105b15610cf057604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610d18576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610d2f576002610d32565b60015b60018086018054909160ff1990911690836004811115610d5457610d54615196565b02179055506110bf565b60018085015460ff166004811115610d7857610d78615196565b03610e88576001840154600684019060ff166004811115610d9b57610d9b615196565b60048110610dab57610dab6156f3565b01546002850154610dbc9042615738565b108015610e5357506006816000015481548110610ddb57610ddb6156f3565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e51919061574b565b155b15610e7157604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610d54565b6002600185015460ff166004811115610ea357610ea3615196565b03610ff1576001840154600684019060ff166004811115610ec657610ec6615196565b60048110610ed657610ed66156f3565b01546002850154610ee79042615738565b108015610f7e57506006816000015481548110610f0657610f066156f3565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c919061574b565b155b15610f9c57604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a36110bf565b6003600185015460ff16600481111561100c5761100c615196565b03611086576001840154600684019060ff16600481111561102f5761102f615196565b6004811061103f5761103f6156f3565b015460028501546110509042615738565b101561106f57604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610d54565b6004600185015460ff1660048111156110a1576110a1615196565b036110bf576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916110fe9160ff1690615768565b60405180910390a25050505050565b6001600160a01b03821660009081526008602052604081205461010081046001600160401b03169061114a90600160481b900460ff16600a61585a565b6111549084615869565b61115e9190615896565b90505b92915050565b6000806007838154811061117d5761117d6156f3565b60009182526020822060036004909202019081018054919350906111a390600190615738565b815481106111b3576111b36156f3565b600091825260208220845460058054600b909402909201945090916001600160601b039091169081106111e8576111e86156f3565b90600052602060002090600c0201905080600501548260030154101561121357506000949350505050565b80546005805490916001600160601b0316908110611233576112336156f3565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b60008060008060078581548110611279576112796156f3565b600091825260208220600360049092020190810180549193509061129f90600190615738565b815481106112af576112af6156f3565b90600052602060002090600b02019050600060068260000154815481106112d8576112d86156f3565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa15801561132d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135191906158aa565b9199909850909650945050505050565b6000546001600160a01b0316331461138c5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600581815481106113c757600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff168061145f575080546001600160401b03808416911610155b1561147c5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556114af8d8d8d8d8d8d8d8d8d8d6136b1565b600b80546001600160a01b0319166001600160a01b038516179055805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050505050565b60095460ff161561154457604051636f1dac1d60e01b815260040160405180910390fd5b6000806007858154811061155a5761155a6156f3565b600091825260209091206004918202019150600182015460ff16600481111561158557611585615196565b146115a357604051638794ce4b60e01b815260040160405180910390fd5b8060030184815481106115b8576115b86156f3565b6000918252602082206004600b909202019081015490935091506115dc84836158e2565b60058401546006850154600286015492935090916000906115fe908390615896565b90506000866001015490506000806006896000015481548110611623576116236156f3565b60009182526020909120015460405163368efae360e21b8152600481018e9052602481018d90526001600160a01b039091169150819063da3beb8c90604401602060405180830381865afa15801561167f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a391906158f5565b915050806000036116bf57838611156116ba578395505b6116df565b6116ca846002615869565b8611156116df576116dc846002615869565b95505b60048801869055865b8681101561179557848110156117415761173a6040518061010001604052808e81526020018d81526020018481526020018781526020018681526020018581526020018881526020018381525061396c565b9550611783565b6117836040518061010001604052808e81526020018d815260200184815260200187815260200186815260200185815260200188815260200183815250613e3d565b8061178d8161571f565b9150506116e8565b50848860050154146117a957600588018590555b5050505050505050505050565b6000546001600160a01b031633146117e15760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61180b614c35565b6005826001600160601b031681548110611827576118276156f3565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b81548152602001906001019080831161184e5750505050509050919050565b6000546001600160a01b031633146118985760405163c383977560e01b815260040160405180910390fd5b60095460ff166118bb5760405163b4143dc760e01b815260040160405180910390fd5b6009805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b6118f982614375565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061197757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661196b600080516020615b4f8339815191525490565b6001600160a01b031614155b156119955760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119ef575060408051601f3d908101601f191682019092526119ec918101906158f5565b60015b611a175781604051630c76093760e01b8152600401611a0e9190614e74565b60405180910390fd5b600080516020615b4f8339815191528114611a4857604051632a87526960e21b815260048101829052602401611a0e565b600080516020615b4f8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611b11576000836001600160a01b031683604051611aaf9190615932565b600060405180830381855af49150503d8060008114611aea576040519150601f19603f3d011682016040523d82523d6000602084013e611aef565b606091505b5050905080610bd0576040516339b21b5d60e11b815260040160405180910390fd5b505b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611b625760405163703e46dd60e11b815260040160405180910390fd5b50600080516020615b4f83398151915290565b60078181548110611b8557600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b60008060078381548110611be757611be76156f3565b6000918252602082206003600490920201908101805491935090611c0d90600190615738565b81548110611c1d57611c1d6156f3565b600091825260208220845460058054600b909402909201945090916001600160601b03909116908110611c5257611c526156f3565b90600052602060002090600c020190508060050154826003015410611cf15782546001600160601b031660001901611c93576001600160ff1b039350611d1e565b6003820154611ca3906002615869565b611cae9060016158e2565b81546005805490916001600160601b0316908110611cce57611cce6156f3565b90600052602060002090600c020160040154611cea9190615869565b9350611d1e565b6003820154611d01906002615869565b611d0c9060016158e2565b8160040154611d1b9190615869565b93505b505050919050565b6000546001600160a01b03163314611d515760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611d6c9190615932565b60006040518083038185875af1925050503d8060008114611da9576040519150601f19603f3d011682016040523d82523d6000602084013e611dae565b606091505b5050905080610bd0576040516322092f2f60e11b815260040160405180910390fd5b60095460ff1615611df457604051636f1dac1d60e01b815260040160405180910390fd5b600b546040516370a0823160e01b81526001600160a01b03909116906370a0823190611e24903390600401614e74565b602060405180830381865afa158015611e41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6591906158f5565b600003611e85576040516326b551e560e11b815260040160405180910390fd5b611b113383836000806143a3565b6000546001600160a01b03163314611ebe5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611f3d5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260086020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6001546001600160a01b03163314801590611ff557506000546001600160a01b03163314155b1561201357604051636b29334f60e01b815260040160405180910390fd5b60095460ff161561203757604051636f1dac1d60e01b815260040160405180910390fd5b6009805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000546001600160a01b0316331461209a5760405163c383977560e01b815260040160405180910390fd5b60006005886001600160601b0316815481106120b8576120b86156f3565b90600052602060002090600c0201905060016001600160601b0316886001600160601b03161415801561211a575080546005805488926001600160601b0316908110612106576121066156f3565b90600052602060002090600c020160020154115b1561213857604051639717078960e01b815260040160405180910390fd5b60005b60018201548110156121bd5786600583600101838154811061215f5761215f6156f3565b90600052602060002001548154811061217a5761217a6156f3565b90600052602060002090600c02016002015410156121ab57604051639717078960e01b815260040160405180910390fd5b806121b58161571f565b91505061213b565b5060028101869055805460ff60601b1916600160601b88151502178155600381018590556004808201859055600582018490556122009060068301908490614c53565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a8888888888886040516122449695949392919061594e565b60405180910390a25050505050505050565b6122bc60405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b600783815481106122cf576122cf6156f3565b906000526020600020906004020160030182815481106122f1576122f16156f3565b90600052602060002090600b020160405180610160016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201548152602001600682018054806020026020016040519081016040528092919081815260200182805480156123a057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612382575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b6000600782815481106123f7576123f76156f3565b600091825260209091206004918202019150600182015460ff16600481111561242257612422615196565b1461244057604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff161561246b5760405163c977f8d360e01b815260040160405180910390fd5b600061247683611260565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b15801561252957600080fd5b505af115801561253d573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146125715760405163c383977560e01b815260040160405180910390fd5b8660058a6001600160601b03168154811061258e5761258e6156f3565b90600052602060002090600c02016002015411156125bf57604051639717078960e01b815260040160405180910390fd5b80516000036125e15760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661260857604051631ef4f64960e01b815260040160405180910390fd5b60058054600181018255600091825290600c82027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001905b83518110156127065783818151811061265b5761265b6156f3565b60200260200101516000148061268e57506006548451859083908110612683576126836156f3565b602002602001015110155b156126ac57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106126c6576126c66156f3565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806126fe9061571f565b915050612640565b5060016000908152600a8201602052604090205460ff1661273a576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c161781556040805160008152602081019182905251612772916001840191614c91565b50805460ff60601b1916600160601b8b15150217815560028101899055600381018890556004808201889055600582018790556127b59060068301908790614c53565b50600480546040516311de995760e21b81526001600160a01b039091169163477a655c916127e79186918991016159ad565b600060405180830381600087803b15801561280157600080fd5b505af1158015612815573d6000803e3d6000fd5b5050505060058b6001600160601b031681548110612835576128356156f3565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d906128a2908e908e908e908e908e908e908d906159c6565b60405180910390a35050505050505050505050565b600681815481106128c757600080fd5b6000918252602090912001546001600160a01b0316905081565b6000806000600784815481106128f9576128f96156f3565b6000918252602090912060049091020190506003600182015460ff16600481111561292657612926615196565b0361297e576002810154815460058054929550916001600160601b03909116908110612954576129546156f3565b600091825260209091206009600c909202010154600282015461297791906158e2565b9150612987565b60009250600091505b50915091565b6000546001600160a01b031633146129b85760405163c383977560e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006129e5826134d9565b341015612a0557604051630e3360f160e21b815260040160405180910390fd5b61115e838360003461455d565b6000546001600160a01b03163314612a3d5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612a6883611bd1565b341015612a8857604051633191f8f160e01b815260040160405180910390fd5b600060078481548110612a9d57612a9d6156f3565b6000918252602090912060049091020190506003600182015460ff166004811115612aca57612aca615196565b14612ae8576040516337cdefcb60e21b815260040160405180910390fd5b60038101805460009190612afe90600190615738565b81548110612b0e57612b0e6156f3565b90600052602060002090600b020190506006816000015481548110612b3557612b356156f3565b6000918252602090912001546001600160a01b03163314612b695760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600580546001600160601b0390951694600b9093029091019184908110612bac57612bac6156f3565b90600052602060002090600c020160050154846003015410612cb5576005836001600160601b031681548110612be457612be46156f3565b60009182526020909120600c9091020154600580546001600160601b0390921694509084908110612c1757612c176156f3565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612c4357600191505b84546001600160601b03848116911614612cb557845460038601546001600160601b0390911690612c7690600190615738565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560058054600092908110612cf857612cf86156f3565b90600052602060002090600c02019050806004015434612d189190615896565b826003018190555061271081600301548260020154612d379190615869565b612d419190615896565b60018084019190915534600284015583835560045460038801546001600160a01b039091169163d09f392d918c91612d7891615738565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612db657600080fd5b505af1158015612dca573d6000803e3d6000fd5b505086548454149150612eb090505784546003870154612dec90600190615738565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46006826000015481548110612e3a57612e3a6156f3565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612e7d918d918d918d9190600401615a43565b600060405180830381600087803b158015612e9757600080fd5b505af1158015612eab573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612f209190615768565b60405180910390a2505050505050505050565b60008060078381548110612f4957612f496156f3565b906000526020600020906004020190508060030160018260030180549050612f719190615738565b81548110612f8157612f816156f3565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612fc65760405163c383977560e01b815260040160405180910390fd5b6006805460018101825560009182527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b600060078381548110613059576130596156f3565b9060005260206000209060040201905060006001826003018054905061307f9190615738565b90506000826003018281548110613098576130986156f3565b600091825260208220600b909102019150600184015460ff1660048111156130c2576130c2615196565b146130e057604051638285c4ef60e01b815260040160405180910390fd5b600060068260000154815481106130f9576130f96156f3565b6000918252602082200154600a8401546001600160a01b039091169250905b868110801561312e575060038401546006850154105b156133365760006001600160a01b03841663d2b8035a8a8461314f8161571f565b955061315b90876158e2565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af115801561319e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c29190615a73565b90506001600160a01b0381166131d85750613118565b6004805460018701546040516310f0b12f60e11b81526001600160a01b03909216926321e1625e9261320e928692909101615a90565b600060405180830381600087803b15801561322857600080fd5b505af115801561323c573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b91613289918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b03841617905560038601549054036133305760048054604051632e96bc2360e11b81529182018b9052602482018890526001600160a01b031690635d2d784690604401600060405180830381600087803b15801561331757600080fd5b505af115801561332b573d6000803e3d6000fd5b505050505b50613118565b8084600a01600082825461334a91906158e2565b90915550505050505050505050565b600061339e826103f086868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134d992505050565b949350505050565b6000546001600160a01b031633146133d15760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526008602052604081205460ff1661342c5760405163e51cf7bf60e01b815260040160405180910390fd5b613437858585613359565b82101561345757604051630e3360f160e21b815260040160405180910390fd5b61346c6001600160a01b038416333085614599565b613489576040516312171d8360e31b815260040160405180910390fd5b6134cd8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925087915061455d9050565b90505b95945050505050565b60008060006134e784614675565b5091509150806005836001600160601b031681548110613509576135096156f3565b90600052602060002090600c02016004015461339e9190615869565b6004546001600160a01b0316331461355057604051639d6cab9960e01b815260040160405180910390fd5b61355e8484848460016143a3565b5050505050565b60006007828154811061357a5761357a6156f3565b600091825260209091206003600490920201015492915050565b6000546001600160a01b031633146135bf5760405163c383977560e01b815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006005836001600160601b0316815481106135ff576135ff6156f3565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806005846001600160601b031681548110613646576136466156f3565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b600080546001600160a01b03199081166001600160a01b038d81169190911783556001805483168d83161781556002805484168d84161781556003805485168d85161790556004805485168785161790556006805481875291820190557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d40018054909316918a1691821790925560405190927f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a36005805460010181556000908152600480546040516311de995760e21b81526001600160a01b039091169263477a655c926137a3928791016159ad565b600060405180830381600087803b1580156137bd57600080fd5b505af11580156137d1573d6000803e3d6000fd5b5050600580546001810182556000918252600c027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160601b03191681556040805183815260208101909152909350915050805161383f916001840191602090910190614c91565b50805460ff60601b1916600160601b87151502178155845160028201556020850151600382015560408501516004808301919091556060860151600583015561388e9060068301908690614c53565b50600480546040516311de995760e21b81526001600160a01b039091169163477a655c916138c1916001918891016159ad565b600060405180830381600087803b1580156138db57600080fd5b505af11580156138ef573d6000803e3d6000fd5b5050825487516020808a01516040808c015160608d0151825160008152948501928390526001600160601b039096169750600196507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d95613957958f959094938e91906159c6565b60405180910390a36117a96001806001613629565b6000806007836000015181548110613986576139866156f3565b906000526020600020906004020190506000816003018460200151815481106139b1576139b16156f3565b90600052602060002090600b02019050600060068260000154815481106139da576139da6156f3565b60009182526020808320919091015487519188015160e089015160808a015160a08b01516040516333ac937b60e11b8152600481019690965260248601939093526044850191909152606484015260848301526001600160a01b03169250829063675926f69060a401602060405180830381865afa158015613a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a8491906158f5565b9050612710811115613a9557506127105b6000612710613aa48382615738565b8560010154613ab39190615869565b613abd9190615896565b9050808760c001818151613ad191906158e2565b90525060e0870151600685018054600092908110613af157613af16156f3565b6000918252602090912001546004805460405163965af6c760e01b81526001600160a01b03938416945092169163965af6c791613b32918591879101615a90565b600060405180830381600087803b158015613b4c57600080fd5b505af1158015613b60573d6000803e3d6000fd5b505060048054604051633c85b79360e21b81526001600160a01b03909116935063f216de4c9250613b95918591879101615a90565b600060405180830381600087803b158015613baf57600080fd5b505af1158015613bc3573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e786613c0387615aa9565b60098b0154604051613c259392916000916001600160a01b0390911690615ac5565b60405180910390a48751602089015160e08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa158015613c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cb0919061574b565b613d16576004805460405163b5d69e9960e01b81526001600160a01b039091169163b5d69e9991613ce391859101614e74565b600060405180830381600087803b158015613cfd57600080fd5b505af1158015613d11573d6000803e3d6000fd5b505050505b60018860600151613d279190615738565b8860e00151148015613d3b57506040880151155b15613e2c5760098501546001600160a01b0316613d84576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1935050505050613dab565b60005460028601546009870154613da9926001600160a01b03918216929116906146fc565b505b60005460c0890151600254613dce926001600160a01b03918216929116906146fc565b506020880151885160c08a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf493613e2393909290916001600160a01b0390911690615ae9565b60405180910390a35b50505060c090940151949350505050565b60006007826000015181548110613e5657613e566156f3565b90600052602060002090600402019050600081600301836020015181548110613e8157613e816156f3565b90600052602060002090600b0201905060006006826000015481548110613eaa57613eaa6156f3565b6000918252602080832090910154865191870151606088015160e08901516001600160a01b039093169550859363675926f693909291613ee991615b08565b60808a015160a08b01516040516001600160e01b031960e088901b1681526004810195909552602485019390935260448401919091526064830152608482015260a401602060405180830381865afa158015613f49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f6d91906158f5565b9050612710811115613f7e57506127105b60008360060186606001518760e00151613f989190615b08565b81548110613fa857613fa86156f3565b600091825260208220015460018601546001600160a01b03909116925061271090613fd4908590615869565b613fde9190615896565b6004805460405163965af6c760e01b81529293506001600160a01b03169163965af6c791614010918691869101615a90565b600060405180830381600087803b15801561402a57600080fd5b505af115801561403e573d6000803e3d6000fd5b505060048054604051636624192f60e01b81526001600160a01b039091169350636624192f925061407191869101614e74565b602060405180830381865afa15801561408e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140b2919061574b565b6140cf576002546140cd906001600160a01b031683836146fc565b505b60006127108489604001518a60c001516140e99190615896565b6140f39190615869565b6140fd9190615896565b90508086600801600082825461411391906158e2565b925050819055506000612710858a6040015189600201546141349190615896565b61413e9190615869565b6141489190615896565b90508087600701600082825461415e91906158e2565b909155505060025461417a906001600160a01b031685846146fc565b5060098701546001600160a01b03166141b8576040516001600160a01b0385169082156108fc029083906000818181858888f19350505050506141d3565b60098701546141d1906001600160a01b031685836146fc565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792614223928c928a928a9290911690615ac5565b60405180910390a460018960600151600261423e9190615869565b6142489190615738565b8960e001510361436a57600087600801548a60c001516142689190615738565b90506000886007015489600201546142809190615738565b90508115158061428f57508015155b156117a95781156142b9576000546002546142b7916001600160a01b039182169116846146fc565b505b80156143205760098901546001600160a01b03166142ff57600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050614320565b60005460098a015461431e916001600160a01b039182169116836146fc565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf4916128a291879187916001600160a01b0390911690615ae9565b505050505050505050565b6000546001600160a01b031633146143a05760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b03851615806143c557506005546001600160601b038616115b156143dd576143d58260046147c9565b5060006134d0565b831580159061441857506005856001600160601b031681548110614403576144036156f3565b90600052602060002090600c02016002015484105b15614428576143d58260056147c9565b60048054604051630a5861b960e41b81526001600160a01b03898116938201939093526001600160601b03881660248201526044810187905285151560648201526000928392839291169063a5861b90906084016060604051808303816000875af115801561449b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144bf9190615b1c565b9194509250905060008160078111156144da576144da615196565b146144f5576144e985826147c9565b600093505050506134d0565b821561452257600254614513906001600160a01b03168a3086614599565b614522576144e98560016147c9565b811561454e5760025461453f906001600160a01b03168a846146fc565b61454e576144e98560026147c9565b50600198975050505050505050565b336000908152600a602052604081205460ff1661458d57604051630407618360e31b815260040160405180910390fd5b6134d085858585614837565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516145fe9190615932565b6000604051808303816000865af19150503d806000811461463b576040519150601f19603f3d011682016040523d82523d6000602084013e614640565b606091505b509150915081801561466a57508051158061466a57508080602001905181019061466a919061574b565b979650505050505050565b600080600060408451106146ea575050506020810151604082015160608301516001600160601b03831615806146b657506005546001600160601b03841610155b156146c057600192505b816000036146cd57600391505b8015806146dc57506006548110155b156146e5575060015b6146f5565b506001915060039050815b9193909250565b6000806000856001600160a01b0316858560405160240161471e929190615a90565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516147539190615932565b6000604051808303816000865af19150503d8060008114614790576040519150601f19603f3d011682016040523d82523d6000602084013e614795565b606091505b50915091508180156147bf5750805115806147bf5750808060200190518101906147bf919061574b565b9695505050505050565b6147d38282614b1e565b60068160078111156147e7576147e7615196565b0361480557604051636590e91560e01b815260040160405180910390fd5b600781600781111561481957614819615196565b03611b13576040516358859f1d60e01b815260040160405180910390fd5b600080600061484586614675565b92505091506005826001600160601b031681548110614866576148666156f3565b60009182526020808320848452600a600c90930201919091019052604090205460ff166148a65760405163b34eb75d60e01b815260040160405180910390fd5b600780546001810182556000918252600160601b33026001600160601b03851617600482027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888101918255427fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101556006805492965090929184908110614931576149316156f3565b6000918252602082200154600580546001600160a01b039092169350906001600160601b038716908110614967576149676156f3565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156149b2576149ad8a846004015461110d565b6149b8565b82600401545b90506149c4818a615896565b6003808401919091558683558301546002840154612710916149e591615869565b6149ef9190615896565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c8116919091179091556004805460405163d09f392d60e01b81529182018b9052600060248301529091169063d09f392d90604401600060405180830381600087803b158015614a6257600080fd5b505af1158015614a76573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b8152600401614ab09493929190615a43565b600060405180830381600087803b158015614aca57600080fd5b505af1158015614ade573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6001826001811115614b3257614b32615196565b03614b3b575050565b6001816007811115614b4f57614b4f615196565b03614b6d57604051630f323ed960e11b815260040160405180910390fd5b6002816007811115614b8157614b81615196565b03614b9f5760405163e45e13a360e01b815260040160405180910390fd5b6003816007811115614bb357614bb3615196565b03614bd157604051631d91d0ed60e31b815260040160405180910390fd5b6004816007811115614be557614be5615196565b03614c03576040516321f1774b60e11b815260040160405180910390fd5b6005816007811115614c1757614c17615196565b03611b1357604051630caac6b360e31b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b8260048101928215614c81579160200282015b82811115614c81578251825591602001919060010190614c66565b50614c8d929150614ccb565b5090565b828054828255906000526020600020908101928215614c815791602002820182811115614c81578251825591602001919060010190614c66565b5b80821115614c8d5760008155600101614ccc565b6001600160a01b03811681146143a057600080fd5b8035614d0081614ce0565b919050565b600060208284031215614d1757600080fd5b8135614d2281614ce0565b9392505050565b80356001600160601b0381168114614d0057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614d7e57614d7e614d40565b604052919050565b600082601f830112614d9757600080fd5b813560206001600160401b03821115614db257614db2614d40565b8160051b614dc1828201614d56565b9283528481018201928281019087851115614ddb57600080fd5b83870192505b8483101561466a57823582529183019190830190614de1565b80151581146143a057600080fd5b8035614d0081614dfa565b600080600060608486031215614e2857600080fd5b614e3184614d29565b925060208401356001600160401b03811115614e4c57600080fd5b614e5886828701614d86565b9250506040840135614e6981614dfa565b809150509250925092565b6001600160a01b0391909116815260200190565b600060208284031215614e9a57600080fd5b5035919050565b60008060408385031215614eb457600080fd5b8235614ebf81614ce0565b946020939093013593505050565b60008060408385031215614ee057600080fd5b8235614eeb81614ce0565b91506020830135614efb81614dfa565b809150509250929050565b600082601f830112614f1757600080fd5b604051608081018181106001600160401b0382111715614f3957614f39614d40565b604052806080840185811115614f4e57600080fd5b845b81811015614f68578035835260209283019201614f50565b509195945050505050565b600082601f830112614f8457600080fd5b81356001600160401b03811115614f9d57614f9d614d40565b614fb0601f8201601f1916602001614d56565b818152846020838601011115614fc557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060008060006102208c8e03121561500457600080fd5b8b3561500f81614ce0565b9a5060208c013561501f81614ce0565b995061502d60408d01614cf5565b985061503b60608d01614cf5565b975061504960808d01614cf5565b965061505760a08d01614e08565b95506150668d60c08e01614f06565b94506150768d6101408e01614f06565b93506101c08c01356001600160401b0381111561509257600080fd5b61509e8e828f01614f73565b9350506150ae6101e08d01614cf5565b91506150bd6102008d01614cf5565b90509295989b509295989b9093969950565b6000806000606084860312156150e457600080fd5b505081359360208301359350604090920135919050565b60006020828403121561510d57600080fd5b61115e82614d29565b8060005b6004811015610bd057815184526020938401939091019060010161511a565b608081016111618284615116565b6000806040838503121561515a57600080fd5b823561516581614ce0565b915060208301356001600160401b0381111561518057600080fd5b61518c85828601614f73565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b600581106151ca57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a081016151fa60408301866151ac565b9215156060820152608001529392505050565b60008060006060848603121561522257600080fd5b833561522d81614ce0565b92506020840135915060408401356001600160401b0381111561524f57600080fd5b61525b86828701614f73565b9150509250925092565b6000806040838503121561527857600080fd5b614ebf83614d29565b60008060006060848603121561529657600080fd5b83356152a181614ce0565b925060208401356001600160401b03811681146152bd57600080fd5b9150604084013560ff81168114614e6957600080fd5b6000806000806000806000610140888a0312156152ef57600080fd5b6152f888614d29565b9650602088013561530881614dfa565b955060408801359450606088013593506080880135925060a088013591506153338960c08a01614f06565b905092959891949750929550565b6000806040838503121561535457600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b8381101561539c5781516001600160a01b031687529582019590820190600101615377565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e0850152615402610180850183615363565b60e0860151610100868101919091528601516101208087019190915286015190925061014061543b818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101808a8c03121561546b57600080fd5b6154748a614d29565b985060208a013561548481614dfa565b975060408a0135965060608a0135955060808a0135945060a08a013593506154af8b60c08c01614f06565b92506101408a01356001600160401b03808211156154cc57600080fd5b6154d88d838e01614f73565b93506101608c01359150808211156154ef57600080fd5b506154fc8c828d01614d86565b9150509295985092959850929598565b6000806040838503121561551f57600080fd5b8235915060208301356001600160401b0381111561518057600080fd5b60008060006060848603121561555157600080fd5b833592506020840135915060408401356001600160401b0381111561524f57600080fd5b60008083601f84011261558757600080fd5b5081356001600160401b0381111561559e57600080fd5b6020830191508360208285010111156155b657600080fd5b9250929050565b6000806000604084860312156155d257600080fd5b83356001600160401b038111156155e857600080fd5b6155f486828701615575565b9094509250506020840135614e6981614ce0565b60008060008060006080868803121561562057600080fd5b8535945060208601356001600160401b0381111561563d57600080fd5b61564988828901615575565b909550935050604086013561565d81614ce0565b949793965091946060013592915050565b60006020828403121561568057600080fd5b81356001600160401b0381111561569657600080fd5b61339e84828501614f73565b600080600080608085870312156156b857600080fd5b84356156c381614ce0565b93506156d160208601614d29565b92506040850135915060608501356156e881614dfa565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161573157615731615709565b5060010190565b8181038181111561116157611161615709565b60006020828403121561575d57600080fd5b8151614d2281614dfa565b6020810161116182846151ac565b600181815b808511156157b157816000190482111561579757615797615709565b808516156157a457918102915b93841c939080029061577b565b509250929050565b6000826157c857506001611161565b816157d557506000611161565b81600181146157eb57600281146157f557615811565b6001915050611161565b60ff84111561580657615806615709565b50506001821b611161565b5060208310610133831016604e8410600b8410161715615834575081810a611161565b61583e8383615776565b806000190482111561585257615852615709565b029392505050565b600061115e60ff8416836157b9565b808202811582820484141761116157611161615709565b634e487b7160e01b600052601260045260246000fd5b6000826158a5576158a5615880565b500490565b6000806000606084860312156158bf57600080fd5b8351925060208401516158d181614dfa565b6040850151909250614e6981614dfa565b8082018082111561116157611161615709565b60006020828403121561590757600080fd5b5051919050565b60005b83811015615929578181015183820152602001615911565b50506000910152565b6000825161594481846020870161590e565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261466a60a0830184615116565b6000815180845261599981602086016020860161590e565b601f01601f19169290920160200192915050565b82815260406020820152600061339e6040830184615981565b60006101408083018a1515845260208a818601528960408601528860608601528760808601526159f960a0860188615116565b6101208501929092528451908190526101608401918086019160005b81811015615a3157835185529382019392820192600101615a15565b50929c9b505050505050505050505050565b848152836020820152608060408201526000615a626080830185615981565b905082606083015295945050505050565b600060208284031215615a8557600080fd5b8151614d2281614ce0565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b8201615abe57615abe615709565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615b1757615b17615880565b500690565b600080600060608486031215615b3157600080fd5b8351925060208401519150604084015160088110614e6957600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201f0b9f849845b8b65a615034f5f999cef3db03f8c4028737a0791e145cb079e964736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102c95760003560e01c806382d022371161017b578063c71f4253116100d7578063f6506db411610085578063f6506db414610968578063f7434ea914610988578063fbb519e7146109a8578063fbf405b0146109c8578063fc6f8f16146109e8578063fe4037e614610a08578063fe524c3914610a2857600080fd5b8063c71f425314610893578063cf0c38f8146108b3578063d07368bd146108d3578063d2b8035a146108f3578063d4d1d76a14610913578063d98493f614610928578063e4c0aaf41461094857600080fd5b8063acdbf51d11610134578063acdbf51d146107a8578063afe15cfb146107c8578063b0049637146107fd578063b44d573c1461081d578063c13517e11461084d578063c258bb1914610860578063c35699021461088057600080fd5b806382d02237146106e65780638456cb591461070657806386541b241461071b5780638a9bb02a1461073b5780638bb0487514610768578063a072b86c1461078857600080fd5b80632e2e936a1161022a57806352d1902d116101e357806352d1902d14610606578063564a565d1461061b57806359ec827e1461064c5780635c975abb1461066c578063751accd0146106865780637717a6e8146106a65780637934c0be146106c657600080fd5b80632e2e936a146105515780632fcb4f04146105715780633cfd1184146105915780633f4ba83a146105be578063452a9320146105d35780634f1ef286146105f357600080fd5b806319b815291161028757806319b81529146104035780631c3db16d146104335780631d7e6892146104705780631f5a0dd2146104905780632c053739146104f15780632d29a47b146105115780632e1daf2f1461053157600080fd5b8062f5822c146102ce5780630219da79146102f05780630b7414bc146103685780630c340a2414610388578063115d5376146103b55780631860592b146103d5575b600080fd5b3480156102da57600080fd5b506102ee6102e9366004614d05565b610a48565b005b3480156102fc57600080fd5b5061033b61030b366004614d05565b60086020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561037457600080fd5b506102ee610383366004614e13565b610a95565b34801561039457600080fd5b506000546103a8906001600160a01b031681565b60405161035f9190614e74565b3480156103c157600080fd5b506102ee6103d0366004614e88565b610bd6565b3480156103e157600080fd5b506103f56103f0366004614ea1565b61110d565b60405190815260200161035f565b34801561040f57600080fd5b5061042361041e366004614e88565b611167565b604051901515815260200161035f565b34801561043f57600080fd5b5061045361044e366004614e88565b611260565b60408051938452911515602084015215159082015260600161035f565b34801561047c57600080fd5b506102ee61048b366004614ecd565b611361565b34801561049c57600080fd5b506104b06104ab366004614e88565b6113b7565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e00161035f565b3480156104fd57600080fd5b506102ee61050c366004614fe2565b611416565b34801561051d57600080fd5b506102ee61052c3660046150cf565b611520565b34801561053d57600080fd5b506004546103a8906001600160a01b031681565b34801561055d57600080fd5b50600b546103a8906001600160a01b031681565b34801561057d57600080fd5b506102ee61058c366004614d05565b6117b6565b34801561059d57600080fd5b506105b16105ac3660046150fb565b611803565b60405161035f9190615139565b3480156105ca57600080fd5b506102ee61186d565b3480156105df57600080fd5b506001546103a8906001600160a01b031681565b6102ee610601366004615147565b6118f0565b34801561061257600080fd5b506103f5611b17565b34801561062757600080fd5b5061063b610636366004614e88565b611b75565b60405161035f9594939291906151ce565b34801561065857600080fd5b506103f5610667366004614e88565b611bd1565b34801561067857600080fd5b506009546104239060ff1681565b34801561069257600080fd5b506102ee6106a136600461520d565b611d26565b3480156106b257600080fd5b506102ee6106c1366004615265565b611dd0565b3480156106d257600080fd5b506102ee6106e1366004614ecd565b611e93565b3480156106f257600080fd5b506102ee610701366004615281565b611f12565b34801561071257600080fd5b506102ee611fcf565b34801561072757600080fd5b506102ee6107363660046152d3565b61206f565b34801561074757600080fd5b5061075b610756366004615341565b612256565b60405161035f91906153a7565b34801561077457600080fd5b506102ee610783366004614e88565b6123e2565b34801561079457600080fd5b506102ee6107a336600461544c565b612546565b3480156107b457600080fd5b506103a86107c3366004614e88565b6128b7565b3480156107d457600080fd5b506107e86107e3366004614e88565b6128e1565b6040805192835260208301919091520161035f565b34801561080957600080fd5b506102ee610818366004614d05565b61298d565b34801561082957600080fd5b50610423610838366004614d05565b600a6020526000908152604090205460ff1681565b6103f561085b36600461550c565b6129da565b34801561086c57600080fd5b506102ee61087b366004614d05565b612a12565b6102ee61088e36600461553c565b612a5f565b34801561089f57600080fd5b506103f56108ae366004614e88565b612f33565b3480156108bf57600080fd5b506003546103a8906001600160a01b031681565b3480156108df57600080fd5b506102ee6108ee366004614d05565b612f9b565b3480156108ff57600080fd5b506102ee61090e366004615341565b613044565b34801561091f57600080fd5b506006546103f5565b34801561093457600080fd5b506103f56109433660046155bd565b613359565b34801561095457600080fd5b506102ee610963366004614d05565b6133a6565b34801561097457600080fd5b506103f5610983366004615608565b6133f3565b34801561099457600080fd5b506103f56109a336600461566e565b6134d9565b3480156109b457600080fd5b506102ee6109c33660046156a2565b613525565b3480156109d457600080fd5b506002546103a8906001600160a01b031681565b3480156109f457600080fd5b506103f5610a03366004614e88565b613565565b348015610a1457600080fd5b506102ee610a23366004614d05565b613594565b348015610a3457600080fd5b50610423610a43366004615265565b6135e1565b6000546001600160a01b03163314610a735760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ac05760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610bd0578115610b5f57828181518110610ae457610ae46156f3565b602002602001015160001480610b1757506006548351849083908110610b0c57610b0c6156f3565b602002602001015110155b15610b3557604051633d58a98960e11b815260040160405180910390fd5b610b5a84848381518110610b4b57610b4b6156f3565b60200260200101516001613629565b610bbe565b6001838281518110610b7357610b736156f3565b602002602001015103610b99576040516356d111fd60e11b815260040160405180910390fd5b610bbe84848381518110610baf57610baf6156f3565b60200260200101516000613629565b80610bc88161571f565b915050610ac3565b50505050565b600060078281548110610beb57610beb6156f3565b600091825260208220600490910201805460058054929450916001600160601b03909116908110610c1e57610c1e6156f3565b6000918252602082206003850154600c909202019250610c4090600190615738565b90506000836003018281548110610c5957610c596156f3565b600091825260208220600b909102019150600185015460ff166004811115610c8357610c83615196565b03610d5e5781158015610cd257506001840154600684019060ff166004811115610caf57610caf615196565b60048110610cbf57610cbf6156f3565b01546002850154610cd09042615738565b105b15610cf057604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610d18576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610d2f576002610d32565b60015b60018086018054909160ff1990911690836004811115610d5457610d54615196565b02179055506110bf565b60018085015460ff166004811115610d7857610d78615196565b03610e88576001840154600684019060ff166004811115610d9b57610d9b615196565b60048110610dab57610dab6156f3565b01546002850154610dbc9042615738565b108015610e5357506006816000015481548110610ddb57610ddb6156f3565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e51919061574b565b155b15610e7157604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610d54565b6002600185015460ff166004811115610ea357610ea3615196565b03610ff1576001840154600684019060ff166004811115610ec657610ec6615196565b60048110610ed657610ed66156f3565b01546002850154610ee79042615738565b108015610f7e57506006816000015481548110610f0657610f066156f3565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c919061574b565b155b15610f9c57604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a36110bf565b6003600185015460ff16600481111561100c5761100c615196565b03611086576001840154600684019060ff16600481111561102f5761102f615196565b6004811061103f5761103f6156f3565b015460028501546110509042615738565b101561106f57604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610d54565b6004600185015460ff1660048111156110a1576110a1615196565b036110bf576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916110fe9160ff1690615768565b60405180910390a25050505050565b6001600160a01b03821660009081526008602052604081205461010081046001600160401b03169061114a90600160481b900460ff16600a61585a565b6111549084615869565b61115e9190615896565b90505b92915050565b6000806007838154811061117d5761117d6156f3565b60009182526020822060036004909202019081018054919350906111a390600190615738565b815481106111b3576111b36156f3565b600091825260208220845460058054600b909402909201945090916001600160601b039091169081106111e8576111e86156f3565b90600052602060002090600c0201905080600501548260030154101561121357506000949350505050565b80546005805490916001600160601b0316908110611233576112336156f3565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b60008060008060078581548110611279576112796156f3565b600091825260208220600360049092020190810180549193509061129f90600190615738565b815481106112af576112af6156f3565b90600052602060002090600b02019050600060068260000154815481106112d8576112d86156f3565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa15801561132d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135191906158aa565b9199909850909650945050505050565b6000546001600160a01b0316331461138c5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600581815481106113c757600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff168061145f575080546001600160401b03808416911610155b1561147c5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556114af8d8d8d8d8d8d8d8d8d8d6136b1565b600b80546001600160a01b0319166001600160a01b038516179055805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050505050565b60095460ff161561154457604051636f1dac1d60e01b815260040160405180910390fd5b6000806007858154811061155a5761155a6156f3565b600091825260209091206004918202019150600182015460ff16600481111561158557611585615196565b146115a357604051638794ce4b60e01b815260040160405180910390fd5b8060030184815481106115b8576115b86156f3565b6000918252602082206004600b909202019081015490935091506115dc84836158e2565b60058401546006850154600286015492935090916000906115fe908390615896565b90506000866001015490506000806006896000015481548110611623576116236156f3565b60009182526020909120015460405163368efae360e21b8152600481018e9052602481018d90526001600160a01b039091169150819063da3beb8c90604401602060405180830381865afa15801561167f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a391906158f5565b915050806000036116bf57838611156116ba578395505b6116df565b6116ca846002615869565b8611156116df576116dc846002615869565b95505b60048801869055865b8681101561179557848110156117415761173a6040518061010001604052808e81526020018d81526020018481526020018781526020018681526020018581526020018881526020018381525061396c565b9550611783565b6117836040518061010001604052808e81526020018d815260200184815260200187815260200186815260200185815260200188815260200183815250613e3d565b8061178d8161571f565b9150506116e8565b50848860050154146117a957600588018590555b5050505050505050505050565b6000546001600160a01b031633146117e15760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61180b614c35565b6005826001600160601b031681548110611827576118276156f3565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b81548152602001906001019080831161184e5750505050509050919050565b6000546001600160a01b031633146118985760405163c383977560e01b815260040160405180910390fd5b60095460ff166118bb5760405163b4143dc760e01b815260040160405180910390fd5b6009805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b6118f982614375565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061197757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661196b600080516020615b4f8339815191525490565b6001600160a01b031614155b156119955760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119ef575060408051601f3d908101601f191682019092526119ec918101906158f5565b60015b611a175781604051630c76093760e01b8152600401611a0e9190614e74565b60405180910390fd5b600080516020615b4f8339815191528114611a4857604051632a87526960e21b815260048101829052602401611a0e565b600080516020615b4f8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611b11576000836001600160a01b031683604051611aaf9190615932565b600060405180830381855af49150503d8060008114611aea576040519150601f19603f3d011682016040523d82523d6000602084013e611aef565b606091505b5050905080610bd0576040516339b21b5d60e11b815260040160405180910390fd5b505b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611b625760405163703e46dd60e11b815260040160405180910390fd5b50600080516020615b4f83398151915290565b60078181548110611b8557600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b60008060078381548110611be757611be76156f3565b6000918252602082206003600490920201908101805491935090611c0d90600190615738565b81548110611c1d57611c1d6156f3565b600091825260208220845460058054600b909402909201945090916001600160601b03909116908110611c5257611c526156f3565b90600052602060002090600c020190508060050154826003015410611cf15782546001600160601b031660001901611c93576001600160ff1b039350611d1e565b6003820154611ca3906002615869565b611cae9060016158e2565b81546005805490916001600160601b0316908110611cce57611cce6156f3565b90600052602060002090600c020160040154611cea9190615869565b9350611d1e565b6003820154611d01906002615869565b611d0c9060016158e2565b8160040154611d1b9190615869565b93505b505050919050565b6000546001600160a01b03163314611d515760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611d6c9190615932565b60006040518083038185875af1925050503d8060008114611da9576040519150601f19603f3d011682016040523d82523d6000602084013e611dae565b606091505b5050905080610bd0576040516322092f2f60e11b815260040160405180910390fd5b60095460ff1615611df457604051636f1dac1d60e01b815260040160405180910390fd5b600b546040516370a0823160e01b81526001600160a01b03909116906370a0823190611e24903390600401614e74565b602060405180830381865afa158015611e41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6591906158f5565b600003611e85576040516326b551e560e11b815260040160405180910390fd5b611b113383836000806143a3565b6000546001600160a01b03163314611ebe5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611f3d5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260086020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6001546001600160a01b03163314801590611ff557506000546001600160a01b03163314155b1561201357604051636b29334f60e01b815260040160405180910390fd5b60095460ff161561203757604051636f1dac1d60e01b815260040160405180910390fd5b6009805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000546001600160a01b0316331461209a5760405163c383977560e01b815260040160405180910390fd5b60006005886001600160601b0316815481106120b8576120b86156f3565b90600052602060002090600c0201905060016001600160601b0316886001600160601b03161415801561211a575080546005805488926001600160601b0316908110612106576121066156f3565b90600052602060002090600c020160020154115b1561213857604051639717078960e01b815260040160405180910390fd5b60005b60018201548110156121bd5786600583600101838154811061215f5761215f6156f3565b90600052602060002001548154811061217a5761217a6156f3565b90600052602060002090600c02016002015410156121ab57604051639717078960e01b815260040160405180910390fd5b806121b58161571f565b91505061213b565b5060028101869055805460ff60601b1916600160601b88151502178155600381018590556004808201859055600582018490556122009060068301908490614c53565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a8888888888886040516122449695949392919061594e565b60405180910390a25050505050505050565b6122bc60405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b600783815481106122cf576122cf6156f3565b906000526020600020906004020160030182815481106122f1576122f16156f3565b90600052602060002090600b020160405180610160016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815260200160058201548152602001600682018054806020026020016040519081016040528092919081815260200182805480156123a057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612382575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b6000600782815481106123f7576123f76156f3565b600091825260209091206004918202019150600182015460ff16600481111561242257612422615196565b1461244057604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff161561246b5760405163c977f8d360e01b815260040160405180910390fd5b600061247683611260565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b15801561252957600080fd5b505af115801561253d573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146125715760405163c383977560e01b815260040160405180910390fd5b8660058a6001600160601b03168154811061258e5761258e6156f3565b90600052602060002090600c02016002015411156125bf57604051639717078960e01b815260040160405180910390fd5b80516000036125e15760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661260857604051631ef4f64960e01b815260040160405180910390fd5b60058054600181018255600091825290600c82027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001905b83518110156127065783818151811061265b5761265b6156f3565b60200260200101516000148061268e57506006548451859083908110612683576126836156f3565b602002602001015110155b156126ac57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106126c6576126c66156f3565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806126fe9061571f565b915050612640565b5060016000908152600a8201602052604090205460ff1661273a576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c161781556040805160008152602081019182905251612772916001840191614c91565b50805460ff60601b1916600160601b8b15150217815560028101899055600381018890556004808201889055600582018790556127b59060068301908790614c53565b50600480546040516311de995760e21b81526001600160a01b039091169163477a655c916127e79186918991016159ad565b600060405180830381600087803b15801561280157600080fd5b505af1158015612815573d6000803e3d6000fd5b5050505060058b6001600160601b031681548110612835576128356156f3565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d906128a2908e908e908e908e908e908e908d906159c6565b60405180910390a35050505050505050505050565b600681815481106128c757600080fd5b6000918252602090912001546001600160a01b0316905081565b6000806000600784815481106128f9576128f96156f3565b6000918252602090912060049091020190506003600182015460ff16600481111561292657612926615196565b0361297e576002810154815460058054929550916001600160601b03909116908110612954576129546156f3565b600091825260209091206009600c909202010154600282015461297791906158e2565b9150612987565b60009250600091505b50915091565b6000546001600160a01b031633146129b85760405163c383977560e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006129e5826134d9565b341015612a0557604051630e3360f160e21b815260040160405180910390fd5b61115e838360003461455d565b6000546001600160a01b03163314612a3d5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612a6883611bd1565b341015612a8857604051633191f8f160e01b815260040160405180910390fd5b600060078481548110612a9d57612a9d6156f3565b6000918252602090912060049091020190506003600182015460ff166004811115612aca57612aca615196565b14612ae8576040516337cdefcb60e21b815260040160405180910390fd5b60038101805460009190612afe90600190615738565b81548110612b0e57612b0e6156f3565b90600052602060002090600b020190506006816000015481548110612b3557612b356156f3565b6000918252602090912001546001600160a01b03163314612b695760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600580546001600160601b0390951694600b9093029091019184908110612bac57612bac6156f3565b90600052602060002090600c020160050154846003015410612cb5576005836001600160601b031681548110612be457612be46156f3565b60009182526020909120600c9091020154600580546001600160601b0390921694509084908110612c1757612c176156f3565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612c4357600191505b84546001600160601b03848116911614612cb557845460038601546001600160601b0390911690612c7690600190615738565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560058054600092908110612cf857612cf86156f3565b90600052602060002090600c02019050806004015434612d189190615896565b826003018190555061271081600301548260020154612d379190615869565b612d419190615896565b60018084019190915534600284015583835560045460038801546001600160a01b039091169163d09f392d918c91612d7891615738565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612db657600080fd5b505af1158015612dca573d6000803e3d6000fd5b505086548454149150612eb090505784546003870154612dec90600190615738565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46006826000015481548110612e3a57612e3a6156f3565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612e7d918d918d918d9190600401615a43565b600060405180830381600087803b158015612e9757600080fd5b505af1158015612eab573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612f209190615768565b60405180910390a2505050505050505050565b60008060078381548110612f4957612f496156f3565b906000526020600020906004020190508060030160018260030180549050612f719190615738565b81548110612f8157612f816156f3565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612fc65760405163c383977560e01b815260040160405180910390fd5b6006805460018101825560009182527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b600060078381548110613059576130596156f3565b9060005260206000209060040201905060006001826003018054905061307f9190615738565b90506000826003018281548110613098576130986156f3565b600091825260208220600b909102019150600184015460ff1660048111156130c2576130c2615196565b146130e057604051638285c4ef60e01b815260040160405180910390fd5b600060068260000154815481106130f9576130f96156f3565b6000918252602082200154600a8401546001600160a01b039091169250905b868110801561312e575060038401546006850154105b156133365760006001600160a01b03841663d2b8035a8a8461314f8161571f565b955061315b90876158e2565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af115801561319e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c29190615a73565b90506001600160a01b0381166131d85750613118565b6004805460018701546040516310f0b12f60e11b81526001600160a01b03909216926321e1625e9261320e928692909101615a90565b600060405180830381600087803b15801561322857600080fd5b505af115801561323c573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b91613289918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b03841617905560038601549054036133305760048054604051632e96bc2360e11b81529182018b9052602482018890526001600160a01b031690635d2d784690604401600060405180830381600087803b15801561331757600080fd5b505af115801561332b573d6000803e3d6000fd5b505050505b50613118565b8084600a01600082825461334a91906158e2565b90915550505050505050505050565b600061339e826103f086868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134d992505050565b949350505050565b6000546001600160a01b031633146133d15760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526008602052604081205460ff1661342c5760405163e51cf7bf60e01b815260040160405180910390fd5b613437858585613359565b82101561345757604051630e3360f160e21b815260040160405180910390fd5b61346c6001600160a01b038416333085614599565b613489576040516312171d8360e31b815260040160405180910390fd5b6134cd8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925087915061455d9050565b90505b95945050505050565b60008060006134e784614675565b5091509150806005836001600160601b031681548110613509576135096156f3565b90600052602060002090600c02016004015461339e9190615869565b6004546001600160a01b0316331461355057604051639d6cab9960e01b815260040160405180910390fd5b61355e8484848460016143a3565b5050505050565b60006007828154811061357a5761357a6156f3565b600091825260209091206003600490920201015492915050565b6000546001600160a01b031633146135bf5760405163c383977560e01b815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006005836001600160601b0316815481106135ff576135ff6156f3565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806005846001600160601b031681548110613646576136466156f3565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b600080546001600160a01b03199081166001600160a01b038d81169190911783556001805483168d83161781556002805484168d84161781556003805485168d85161790556004805485168785161790556006805481875291820190557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d40018054909316918a1691821790925560405190927f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a36005805460010181556000908152600480546040516311de995760e21b81526001600160a01b039091169263477a655c926137a3928791016159ad565b600060405180830381600087803b1580156137bd57600080fd5b505af11580156137d1573d6000803e3d6000fd5b5050600580546001810182556000918252600c027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160601b03191681556040805183815260208101909152909350915050805161383f916001840191602090910190614c91565b50805460ff60601b1916600160601b87151502178155845160028201556020850151600382015560408501516004808301919091556060860151600583015561388e9060068301908690614c53565b50600480546040516311de995760e21b81526001600160a01b039091169163477a655c916138c1916001918891016159ad565b600060405180830381600087803b1580156138db57600080fd5b505af11580156138ef573d6000803e3d6000fd5b5050825487516020808a01516040808c015160608d0151825160008152948501928390526001600160601b039096169750600196507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d95613957958f959094938e91906159c6565b60405180910390a36117a96001806001613629565b6000806007836000015181548110613986576139866156f3565b906000526020600020906004020190506000816003018460200151815481106139b1576139b16156f3565b90600052602060002090600b02019050600060068260000154815481106139da576139da6156f3565b60009182526020808320919091015487519188015160e089015160808a015160a08b01516040516333ac937b60e11b8152600481019690965260248601939093526044850191909152606484015260848301526001600160a01b03169250829063675926f69060a401602060405180830381865afa158015613a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a8491906158f5565b9050612710811115613a9557506127105b6000612710613aa48382615738565b8560010154613ab39190615869565b613abd9190615896565b9050808760c001818151613ad191906158e2565b90525060e0870151600685018054600092908110613af157613af16156f3565b6000918252602090912001546004805460405163965af6c760e01b81526001600160a01b03938416945092169163965af6c791613b32918591879101615a90565b600060405180830381600087803b158015613b4c57600080fd5b505af1158015613b60573d6000803e3d6000fd5b505060048054604051633c85b79360e21b81526001600160a01b03909116935063f216de4c9250613b95918591879101615a90565b600060405180830381600087803b158015613baf57600080fd5b505af1158015613bc3573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e786613c0387615aa9565b60098b0154604051613c259392916000916001600160a01b0390911690615ac5565b60405180910390a48751602089015160e08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa158015613c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cb0919061574b565b613d16576004805460405163b5d69e9960e01b81526001600160a01b039091169163b5d69e9991613ce391859101614e74565b600060405180830381600087803b158015613cfd57600080fd5b505af1158015613d11573d6000803e3d6000fd5b505050505b60018860600151613d279190615738565b8860e00151148015613d3b57506040880151155b15613e2c5760098501546001600160a01b0316613d84576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1935050505050613dab565b60005460028601546009870154613da9926001600160a01b03918216929116906146fc565b505b60005460c0890151600254613dce926001600160a01b03918216929116906146fc565b506020880151885160c08a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf493613e2393909290916001600160a01b0390911690615ae9565b60405180910390a35b50505060c090940151949350505050565b60006007826000015181548110613e5657613e566156f3565b90600052602060002090600402019050600081600301836020015181548110613e8157613e816156f3565b90600052602060002090600b0201905060006006826000015481548110613eaa57613eaa6156f3565b6000918252602080832090910154865191870151606088015160e08901516001600160a01b039093169550859363675926f693909291613ee991615b08565b60808a015160a08b01516040516001600160e01b031960e088901b1681526004810195909552602485019390935260448401919091526064830152608482015260a401602060405180830381865afa158015613f49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f6d91906158f5565b9050612710811115613f7e57506127105b60008360060186606001518760e00151613f989190615b08565b81548110613fa857613fa86156f3565b600091825260208220015460018601546001600160a01b03909116925061271090613fd4908590615869565b613fde9190615896565b6004805460405163965af6c760e01b81529293506001600160a01b03169163965af6c791614010918691869101615a90565b600060405180830381600087803b15801561402a57600080fd5b505af115801561403e573d6000803e3d6000fd5b505060048054604051636624192f60e01b81526001600160a01b039091169350636624192f925061407191869101614e74565b602060405180830381865afa15801561408e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140b2919061574b565b6140cf576002546140cd906001600160a01b031683836146fc565b505b60006127108489604001518a60c001516140e99190615896565b6140f39190615869565b6140fd9190615896565b90508086600801600082825461411391906158e2565b925050819055506000612710858a6040015189600201546141349190615896565b61413e9190615869565b6141489190615896565b90508087600701600082825461415e91906158e2565b909155505060025461417a906001600160a01b031685846146fc565b5060098701546001600160a01b03166141b8576040516001600160a01b0385169082156108fc029083906000818181858888f19350505050506141d3565b60098701546141d1906001600160a01b031685836146fc565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792614223928c928a928a9290911690615ac5565b60405180910390a460018960600151600261423e9190615869565b6142489190615738565b8960e001510361436a57600087600801548a60c001516142689190615738565b90506000886007015489600201546142809190615738565b90508115158061428f57508015155b156117a95781156142b9576000546002546142b7916001600160a01b039182169116846146fc565b505b80156143205760098901546001600160a01b03166142ff57600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050614320565b60005460098a015461431e916001600160a01b039182169116836146fc565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf4916128a291879187916001600160a01b0390911690615ae9565b505050505050505050565b6000546001600160a01b031633146143a05760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b03851615806143c557506005546001600160601b038616115b156143dd576143d58260046147c9565b5060006134d0565b831580159061441857506005856001600160601b031681548110614403576144036156f3565b90600052602060002090600c02016002015484105b15614428576143d58260056147c9565b60048054604051630a5861b960e41b81526001600160a01b03898116938201939093526001600160601b03881660248201526044810187905285151560648201526000928392839291169063a5861b90906084016060604051808303816000875af115801561449b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144bf9190615b1c565b9194509250905060008160078111156144da576144da615196565b146144f5576144e985826147c9565b600093505050506134d0565b821561452257600254614513906001600160a01b03168a3086614599565b614522576144e98560016147c9565b811561454e5760025461453f906001600160a01b03168a846146fc565b61454e576144e98560026147c9565b50600198975050505050505050565b336000908152600a602052604081205460ff1661458d57604051630407618360e31b815260040160405180910390fd5b6134d085858585614837565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516145fe9190615932565b6000604051808303816000865af19150503d806000811461463b576040519150601f19603f3d011682016040523d82523d6000602084013e614640565b606091505b509150915081801561466a57508051158061466a57508080602001905181019061466a919061574b565b979650505050505050565b600080600060408451106146ea575050506020810151604082015160608301516001600160601b03831615806146b657506005546001600160601b03841610155b156146c057600192505b816000036146cd57600391505b8015806146dc57506006548110155b156146e5575060015b6146f5565b506001915060039050815b9193909250565b6000806000856001600160a01b0316858560405160240161471e929190615a90565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516147539190615932565b6000604051808303816000865af19150503d8060008114614790576040519150601f19603f3d011682016040523d82523d6000602084013e614795565b606091505b50915091508180156147bf5750805115806147bf5750808060200190518101906147bf919061574b565b9695505050505050565b6147d38282614b1e565b60068160078111156147e7576147e7615196565b0361480557604051636590e91560e01b815260040160405180910390fd5b600781600781111561481957614819615196565b03611b13576040516358859f1d60e01b815260040160405180910390fd5b600080600061484586614675565b92505091506005826001600160601b031681548110614866576148666156f3565b60009182526020808320848452600a600c90930201919091019052604090205460ff166148a65760405163b34eb75d60e01b815260040160405180910390fd5b600780546001810182556000918252600160601b33026001600160601b03851617600482027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888101918255427fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101556006805492965090929184908110614931576149316156f3565b6000918252602082200154600580546001600160a01b039092169350906001600160601b038716908110614967576149676156f3565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156149b2576149ad8a846004015461110d565b6149b8565b82600401545b90506149c4818a615896565b6003808401919091558683558301546002840154612710916149e591615869565b6149ef9190615896565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c8116919091179091556004805460405163d09f392d60e01b81529182018b9052600060248301529091169063d09f392d90604401600060405180830381600087803b158015614a6257600080fd5b505af1158015614a76573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b8152600401614ab09493929190615a43565b600060405180830381600087803b158015614aca57600080fd5b505af1158015614ade573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6001826001811115614b3257614b32615196565b03614b3b575050565b6001816007811115614b4f57614b4f615196565b03614b6d57604051630f323ed960e11b815260040160405180910390fd5b6002816007811115614b8157614b81615196565b03614b9f5760405163e45e13a360e01b815260040160405180910390fd5b6003816007811115614bb357614bb3615196565b03614bd157604051631d91d0ed60e31b815260040160405180910390fd5b6004816007811115614be557614be5615196565b03614c03576040516321f1774b60e11b815260040160405180910390fd5b6005816007811115614c1757614c17615196565b03611b1357604051630caac6b360e31b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b8260048101928215614c81579160200282015b82811115614c81578251825591602001919060010190614c66565b50614c8d929150614ccb565b5090565b828054828255906000526020600020908101928215614c815791602002820182811115614c81578251825591602001919060010190614c66565b5b80821115614c8d5760008155600101614ccc565b6001600160a01b03811681146143a057600080fd5b8035614d0081614ce0565b919050565b600060208284031215614d1757600080fd5b8135614d2281614ce0565b9392505050565b80356001600160601b0381168114614d0057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614d7e57614d7e614d40565b604052919050565b600082601f830112614d9757600080fd5b813560206001600160401b03821115614db257614db2614d40565b8160051b614dc1828201614d56565b9283528481018201928281019087851115614ddb57600080fd5b83870192505b8483101561466a57823582529183019190830190614de1565b80151581146143a057600080fd5b8035614d0081614dfa565b600080600060608486031215614e2857600080fd5b614e3184614d29565b925060208401356001600160401b03811115614e4c57600080fd5b614e5886828701614d86565b9250506040840135614e6981614dfa565b809150509250925092565b6001600160a01b0391909116815260200190565b600060208284031215614e9a57600080fd5b5035919050565b60008060408385031215614eb457600080fd5b8235614ebf81614ce0565b946020939093013593505050565b60008060408385031215614ee057600080fd5b8235614eeb81614ce0565b91506020830135614efb81614dfa565b809150509250929050565b600082601f830112614f1757600080fd5b604051608081018181106001600160401b0382111715614f3957614f39614d40565b604052806080840185811115614f4e57600080fd5b845b81811015614f68578035835260209283019201614f50565b509195945050505050565b600082601f830112614f8457600080fd5b81356001600160401b03811115614f9d57614f9d614d40565b614fb0601f8201601f1916602001614d56565b818152846020838601011115614fc557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060008060006102208c8e03121561500457600080fd5b8b3561500f81614ce0565b9a5060208c013561501f81614ce0565b995061502d60408d01614cf5565b985061503b60608d01614cf5565b975061504960808d01614cf5565b965061505760a08d01614e08565b95506150668d60c08e01614f06565b94506150768d6101408e01614f06565b93506101c08c01356001600160401b0381111561509257600080fd5b61509e8e828f01614f73565b9350506150ae6101e08d01614cf5565b91506150bd6102008d01614cf5565b90509295989b509295989b9093969950565b6000806000606084860312156150e457600080fd5b505081359360208301359350604090920135919050565b60006020828403121561510d57600080fd5b61115e82614d29565b8060005b6004811015610bd057815184526020938401939091019060010161511a565b608081016111618284615116565b6000806040838503121561515a57600080fd5b823561516581614ce0565b915060208301356001600160401b0381111561518057600080fd5b61518c85828601614f73565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b600581106151ca57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a081016151fa60408301866151ac565b9215156060820152608001529392505050565b60008060006060848603121561522257600080fd5b833561522d81614ce0565b92506020840135915060408401356001600160401b0381111561524f57600080fd5b61525b86828701614f73565b9150509250925092565b6000806040838503121561527857600080fd5b614ebf83614d29565b60008060006060848603121561529657600080fd5b83356152a181614ce0565b925060208401356001600160401b03811681146152bd57600080fd5b9150604084013560ff81168114614e6957600080fd5b6000806000806000806000610140888a0312156152ef57600080fd5b6152f888614d29565b9650602088013561530881614dfa565b955060408801359450606088013593506080880135925060a088013591506153338960c08a01614f06565b905092959891949750929550565b6000806040838503121561535457600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b8381101561539c5781516001600160a01b031687529582019590820190600101615377565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e0850152615402610180850183615363565b60e0860151610100868101919091528601516101208087019190915286015190925061014061543b818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101808a8c03121561546b57600080fd5b6154748a614d29565b985060208a013561548481614dfa565b975060408a0135965060608a0135955060808a0135945060a08a013593506154af8b60c08c01614f06565b92506101408a01356001600160401b03808211156154cc57600080fd5b6154d88d838e01614f73565b93506101608c01359150808211156154ef57600080fd5b506154fc8c828d01614d86565b9150509295985092959850929598565b6000806040838503121561551f57600080fd5b8235915060208301356001600160401b0381111561518057600080fd5b60008060006060848603121561555157600080fd5b833592506020840135915060408401356001600160401b0381111561524f57600080fd5b60008083601f84011261558757600080fd5b5081356001600160401b0381111561559e57600080fd5b6020830191508360208285010111156155b657600080fd5b9250929050565b6000806000604084860312156155d257600080fd5b83356001600160401b038111156155e857600080fd5b6155f486828701615575565b9094509250506020840135614e6981614ce0565b60008060008060006080868803121561562057600080fd5b8535945060208601356001600160401b0381111561563d57600080fd5b61564988828901615575565b909550935050604086013561565d81614ce0565b949793965091946060013592915050565b60006020828403121561568057600080fd5b81356001600160401b0381111561569657600080fd5b61339e84828501614f73565b600080600080608085870312156156b857600080fd5b84356156c381614ce0565b93506156d160208601614d29565b92506040850135915060608501356156e881614dfa565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161573157615731615709565b5060010190565b8181038181111561116157611161615709565b60006020828403121561575d57600080fd5b8151614d2281614dfa565b6020810161116182846151ac565b600181815b808511156157b157816000190482111561579757615797615709565b808516156157a457918102915b93841c939080029061577b565b509250929050565b6000826157c857506001611161565b816157d557506000611161565b81600181146157eb57600281146157f557615811565b6001915050611161565b60ff84111561580657615806615709565b50506001821b611161565b5060208310610133831016604e8410600b8410161715615834575081810a611161565b61583e8383615776565b806000190482111561585257615852615709565b029392505050565b600061115e60ff8416836157b9565b808202811582820484141761116157611161615709565b634e487b7160e01b600052601260045260246000fd5b6000826158a5576158a5615880565b500490565b6000806000606084860312156158bf57600080fd5b8351925060208401516158d181614dfa565b6040850151909250614e6981614dfa565b8082018082111561116157611161615709565b60006020828403121561590757600080fd5b5051919050565b60005b83811015615929578181015183820152602001615911565b50506000910152565b6000825161594481846020870161590e565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261466a60a0830184615116565b6000815180845261599981602086016020860161590e565b601f01601f19169290920160200192915050565b82815260406020820152600061339e6040830184615981565b60006101408083018a1515845260208a818601528960408601528860608601528760808601526159f960a0860188615116565b6101208501929092528451908190526101608401918086019160005b81811015615a3157835185529382019392820192600101615a15565b50929c9b505050505050505050505050565b848152836020820152608060408201526000615a626080830185615981565b905082606083015295945050505050565b600060208284031215615a8557600080fd5b8151614d2281614ce0565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b8201615abe57615abe615709565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615b1757615b17615880565b500690565b600080600060608486031215615b3157600080fd5b8351925060208401519150604084015160088110614e6957600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201f0b9f849845b8b65a615034f5f999cef3db03f8c4028737a0791e145cb079e964736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "AcceptedFeeToken(address,bool)": { + "details": "To be emitted when an ERC20 token is added or removed as a method to pay fees.", + "params": { + "_accepted": "Whether the token is accepted or not.", + "_token": "The ERC20 token." + } + }, + "DisputeCreation(uint256,address)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_arbitrable": "The contract which created the dispute.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "NewCurrencyRate(address,uint64,uint8)": { + "details": "To be emitted when the fee for a particular ERC20 token is updated.", + "params": { + "_feeToken": "The ERC20 token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrable": "The arbitrable receiving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "addNewDisputeKit(address)": { + "details": "Add a new supported dispute kit module to the court.", + "params": { + "_disputeKitAddress": "The address of the dispute kit contract." + } + }, + "appeal(uint256,uint256,bytes)": { + "details": "Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.", + "params": { + "_disputeID": "The ID of the dispute.", + "_extraData": "Extradata for the dispute. Can be required during court jump.", + "_numberOfChoices": "Number of choices for the dispute. Can be required during court jump." + } + }, + "appealCost(uint256)": { + "details": "Gets the cost of appealing a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "cost": "The appeal cost." + } + }, + "appealPeriod(uint256)": { + "details": "Gets the start and the end of a specified dispute's current appeal period.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "end": "The end of the appeal period.", + "start": "The start of the appeal period." + } + }, + "arbitrationCost(bytes)": { + "details": "Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes)." + }, + "returns": { + "cost": "The arbitration cost in ETH." + } + }, + "arbitrationCost(bytes,address)": { + "details": "Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeToken": "The ERC20 token used to pay fees." + }, + "returns": { + "cost": "The arbitration cost in `_feeToken`." + } + }, + "changeAcceptedFeeTokens(address,bool)": { + "details": "Changes the supported fee tokens.", + "params": { + "_accepted": "Whether the token is supported or not as a method of fee payment.", + "_feeToken": "The fee token." + } + }, + "changeArbitrableWhitelist(address,bool)": { + "details": "Adds or removes an arbitrable from whitelist.", + "params": { + "_allowed": "Whether add or remove permission.", + "_arbitrable": "Arbitrable address." + } + }, + "changeCurrencyRates(address,uint64,uint8)": { + "details": "Changes the currency rate of a fee token.", + "params": { + "_feeToken": "The fee token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "changeGuardian(address)": { + "details": "Changes the `guardian` storage variable.", + "params": { + "_guardian": "The new value for the `guardian` storage variable." + } + }, + "changeJurorNft(address)": { + "details": "Changes the `jurorNft` storage variable.", + "params": { + "_jurorNft": "The new value for the `jurorNft` storage variable." + } + }, + "changeJurorProsecutionModule(address)": { + "details": "Changes the `jurorProsecutionModule` storage variable.", + "params": { + "_jurorProsecutionModule": "The new value for the `jurorProsecutionModule` storage variable." + } + }, + "changePinakion(address)": { + "details": "Changes the `pinakion` storage variable.", + "params": { + "_pinakion": "The new value for the `pinakion` storage variable." + } + }, + "changeSortitionModule(address)": { + "details": "Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.", + "params": { + "_sortitionModule": "The new value for the `sortitionModule` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])": { + "details": "Creates a court under a specified parent court.", + "params": { + "_alpha": "The `alpha` property value of the court.", + "_feeForJuror": "The `feeForJuror` property value of the court.", + "_hiddenVotes": "The `hiddenVotes` property value of the court.", + "_jurorsForCourtJump": "The `jurorsForCourtJump` property value of the court.", + "_minStake": "The `minStake` property value of the court.", + "_parent": "The `parent` property value of the court.", + "_sortitionExtraData": "Extra data for sortition module.", + "_supportedDisputeKits": "Indexes of dispute kits that this court will support.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the court." + } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "createDispute(uint256,bytes,address,uint256)": { + "details": "Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeAmount": "Amount of the ERC20 token used to pay fees.", + "_feeToken": "The ERC20 token used to pay fees.", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws jurors for the dispute. Can be called in parts.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run." + } + }, + "enableDisputeKits(uint96,uint256[],bool)": { + "details": "Adds/removes court's support for specified dispute kits.", + "params": { + "_courtID": "The ID of the court.", + "_disputeKitIDs": "The IDs of dispute kits which support should be added/removed.", + "_enable": "Whether add or remove the dispute kits from the court." + } + }, + "execute(uint256,uint256,uint256)": { + "details": "Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts. Note: Reward distributions are forbidden during pause.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run.", + "_round": "The appeal round." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "executeRuling(uint256)": { + "details": "Executes a specified dispute's ruling.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getNumberOfVotes(uint256)": { + "details": "Gets the number of votes permitted for the specified dispute in the latest round.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getTimesPerPeriod(uint96)": { + "details": "Gets the timesPerPeriod array for a given court.", + "params": { + "_courtID": "The ID of the court to get the times from." + }, + "returns": { + "timesPerPeriod": "The timesPerPeriod array for the given court." + } + }, + "initialize(address,address,address,address,address,bool,uint256[4],uint256[4],bytes,address,address)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_courtParameters": "Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).", + "_disputeKit": "The address of the default dispute kit.", + "_governor": "The governor's address.", + "_guardian": "The guardian's address.", + "_hiddenVotes": "The `hiddenVotes` property value of the general court.", + "_jurorNft": "NFT contract to vet the jurors.", + "_jurorProsecutionModule": "The address of the juror prosecution module.", + "_pinakion": "The address of the token contract.", + "_sortitionExtraData": "The extra data for sortition module.", + "_sortitionModuleAddress": "The sortition module responsible for sortition of the jurors.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the general court." + } + }, + "isDisputeKitJumping(uint256)": { + "details": "Returns true if the dispute kit will be switched to a parent DK.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "_0": "Whether DK will be switched or not." + } + }, + "passPeriod(uint256)": { + "details": "Passes the period of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "pause()": { + "details": "Pause staking and reward execution. Can only be done by guardian or governor." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setStake(uint96,uint256)": { + "details": "Sets the caller's stake in a court. Note: Staking and unstaking is forbidden during pause.", + "params": { + "_courtID": "The ID of the court.", + "_newStake": "The new stake. Note that the existing delayed stake will be nullified as non-relevant." + } + }, + "setStakeBySortitionModule(address,uint96,uint256,bool)": { + "details": "Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.", + "params": { + "_account": "The account whose stake is being set.", + "_alreadyTransferred": "Whether the PNKs have already been transferred to the contract.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + } + }, + "unpause()": { + "details": "Unpause staking and reward execution. Can only be done by governor." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "KlerosCoreNeo Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2024, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2026, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "guardian", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 2029, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "pinakion", + "offset": 0, + "slot": "2", + "type": "t_contract(IERC20)293" + }, + { + "astId": 2031, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "jurorProsecutionModule", + "offset": 0, + "slot": "3", + "type": "t_address" + }, + { + "astId": 2034, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "sortitionModule", + "offset": 0, + "slot": "4", + "type": "t_contract(ISortitionModule)16042" + }, + { + "astId": 2038, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "courts", + "offset": 0, + "slot": "5", + "type": "t_array(t_struct(Court)1943_storage)dyn_storage" + }, + { + "astId": 2042, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disputeKits", + "offset": 0, + "slot": "6", + "type": "t_array(t_contract(IDisputeKit)15879)dyn_storage" + }, + { + "astId": 2046, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disputes", + "offset": 0, + "slot": "7", + "type": "t_array(t_struct(Dispute)1960_storage)dyn_storage" + }, + { + "astId": 2052, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "currencyRates", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_contract(IERC20)293,t_struct(CurrencyRate)2009_storage)" + }, + { + "astId": 2054, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "paused", + "offset": 0, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 5494, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "arbitrableWhitelist", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 5497, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "jurorNft", + "offset": 0, + "slot": "11", + "type": "t_contract(IERC721)409" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "base": "t_address", + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_contract(IDisputeKit)15879)dyn_storage": { + "base": "t_contract(IDisputeKit)15879", + "encoding": "dynamic_array", + "label": "contract IDisputeKit[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Court)1943_storage)dyn_storage": { + "base": "t_struct(Court)1943_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCoreBase.Court[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Dispute)1960_storage)dyn_storage": { + "base": "t_struct(Dispute)1960_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCoreBase.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)1985_storage)dyn_storage": { + "base": "t_struct(Round)1985_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCoreBase.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)4_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[4]", + "numberOfBytes": "128" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IArbitrableV2)15636": { + "encoding": "inplace", + "label": "contract IArbitrableV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeKit)15879": { + "encoding": "inplace", + "label": "contract IDisputeKit", + "numberOfBytes": "20" + }, + "t_contract(IERC20)293": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IERC721)409": { + "encoding": "inplace", + "label": "contract IERC721", + "numberOfBytes": "20" + }, + "t_contract(ISortitionModule)16042": { + "encoding": "inplace", + "label": "contract ISortitionModule", + "numberOfBytes": "20" + }, + "t_enum(Period)1917": { + "encoding": "inplace", + "label": "enum KlerosCoreBase.Period", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_contract(IERC20)293,t_struct(CurrencyRate)2009_storage)": { + "encoding": "mapping", + "key": "t_contract(IERC20)293", + "label": "mapping(contract IERC20 => struct KlerosCoreBase.CurrencyRate)", + "numberOfBytes": "32", + "value": "t_struct(CurrencyRate)2009_storage" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_struct(Court)1943_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.Court", + "members": [ + { + "astId": 1919, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "parent", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 1921, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "hiddenVotes", + "offset": 12, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1924, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "children", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 1926, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "minStake", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 1928, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "alpha", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 1930, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "feeForJuror", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 1932, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "jurorsForCourtJump", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 1936, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "timesPerPeriod", + "offset": 0, + "slot": "6", + "type": "t_array(t_uint256)4_storage" + }, + { + "astId": 1940, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "supportedDisputeKits", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 1942, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disabled", + "offset": 0, + "slot": "11", + "type": "t_bool" + } + ], + "numberOfBytes": "384" + }, + "t_struct(CurrencyRate)2009_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.CurrencyRate", + "members": [ + { + "astId": 2004, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "feePaymentAccepted", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 2006, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "rateInEth", + "offset": 1, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2008, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "rateDecimals", + "offset": 9, + "slot": "0", + "type": "t_uint8" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Dispute)1960_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.Dispute", + "members": [ + { + "astId": 1945, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "courtID", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 1948, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "arbitrated", + "offset": 12, + "slot": "0", + "type": "t_contract(IArbitrableV2)15636" + }, + { + "astId": 1951, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "period", + "offset": 0, + "slot": "1", + "type": "t_enum(Period)1917" + }, + { + "astId": 1953, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "ruled", + "offset": 1, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 1955, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "lastPeriodChange", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 1959, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "rounds", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(Round)1985_storage)dyn_storage" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Round)1985_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.Round", + "members": [ + { + "astId": 1962, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disputeKitID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 1964, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "pnkAtStakePerJuror", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 1966, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "totalFeesForJurors", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 1968, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "nbVotes", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 1970, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "repartitions", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 1972, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "pnkPenalties", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 1975, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "drawnJurors", + "offset": 0, + "slot": "6", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 1977, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "sumFeeRewardPaid", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 1979, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "sumPnkRewardPaid", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 1982, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "feeToken", + "offset": 0, + "slot": "9", + "type": "t_contract(IERC20)293" + }, + { + "astId": 1984, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "drawIterations", + "offset": 0, + "slot": "10", + "type": "t_uint256" + } + ], + "numberOfBytes": "352" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrum/KlerosCoreNeo_Proxy.json b/contracts/deployments/arbitrum/KlerosCoreNeo_Proxy.json new file mode 100644 index 000000000..56da04ecd --- /dev/null +++ b/contracts/deployments/arbitrum/KlerosCoreNeo_Proxy.json @@ -0,0 +1,136 @@ +{ + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "transactionIndex": 1, + "gasUsed": "6872493", + "logsBloom": "0x00800000000000000000000020000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000801402000000000000008000000000000000000000000000000080a00000000000000000000000080000000000000000000000000000000000008000000000000000000000200000000000000000000000000000000000000000000000000000000000000000004000000000000000060000000001201000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594", + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000b7c292cd9fd3d20de84a71ae1caf054eeb6374a9" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + }, + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 1, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + }, + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + }, + { + "transactionIndex": 1, + "blockNumber": 190274596, + "transactionHash": "0x964e8f3d8d9933941872cdc0598fc11352fdfa491c18d0d27bfe79d68ff07cb7", + "address": "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "logIndex": 3, + "blockHash": "0xfe834fe86a0537e6dac3ff6454862875c740aeb8d8e3b4c91602a14bdb5ce594" + } + ], + "blockNumber": 190274596, + "cumulativeGasUsed": "6872493", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0x2c053739000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000330bd769382cfc6d50175903434ccc8d206dcae50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b7c292cd9fd3d20de84a71ae1caf054eeb6374a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000220000000000000000000000000614498118850184c62f82d08261109334bfb050f000000000000000000000000fe34a72c55e512601e7d491a9c5b36373ce34d6300000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/KlerosV2NeoEarlyUser.json b/contracts/deployments/arbitrum/KlerosV2NeoEarlyUser.json new file mode 100644 index 000000000..6557302a1 --- /dev/null +++ b/contracts/deployments/arbitrum/KlerosV2NeoEarlyUser.json @@ -0,0 +1,723 @@ +{ + "address": "0xfE34a72c55e512601E7d491A9c5b36373cE34d63", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newMinter", + "type": "address" + } + ], + "name": "EventMinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldMinter", + "type": "address" + } + ], + "name": "EventMinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "burnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "cid", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumMinted", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "isOwnerOf", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cid", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "cidArr", + "type": "uint256[]" + } + ], + "name": "mintBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSymbol", + "type": "string" + } + ], + "name": "setSymbol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "transferable", + "type": "bool" + } + ], + "name": "setTransferable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newURI", + "type": "string" + } + ], + "name": "setURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "transferable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/contracts/deployments/arbitrum/PNK.json b/contracts/deployments/arbitrum/PNK.json new file mode 120000 index 000000000..3bc687fa7 --- /dev/null +++ b/contracts/deployments/arbitrum/PNK.json @@ -0,0 +1 @@ +Pinakion.json \ No newline at end of file diff --git a/contracts/deployments/arbitrum/PNKFaucet.json b/contracts/deployments/arbitrum/PNKFaucet.json new file mode 100644 index 000000000..f880395bc --- /dev/null +++ b/contracts/deployments/arbitrum/PNKFaucet.json @@ -0,0 +1,127 @@ +{ + "address": "0x0000000000000000000000000000000000000000", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/contracts/deployments/arbitrum/PolicyRegistry.json b/contracts/deployments/arbitrum/PolicyRegistry.json new file mode 100644 index 000000000..7502d31df --- /dev/null +++ b/contracts/deployments/arbitrum/PolicyRegistry.json @@ -0,0 +1,305 @@ +{ + "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xb2c370c53d49714cf74d7ae82da3b5da160f22f97529e5f4d6c5786e4615f7eb", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "transactionIndex": 1, + "gasUsed": "5300939", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080010000000000000000000000000000000000000000000000000000800000000000000000000000000000000010000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x419ba6ad860f99d54faacf3d36d879239522e20fad6adfa78cf12f278b385f3b", + "transactionHash": "0xb2c370c53d49714cf74d7ae82da3b5da160f22f97529e5f4d6c5786e4615f7eb", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274403, + "transactionHash": "0xb2c370c53d49714cf74d7ae82da3b5da160f22f97529e5f4d6c5786e4615f7eb", + "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x419ba6ad860f99d54faacf3d36d879239522e20fad6adfa78cf12f278b385f3b" + } + ], + "blockNumber": 190274403, + "cumulativeGasUsed": "5300939", + "status": 1, + "byzantium": true + }, + "args": [ + "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/PolicyRegistry_Implementation.json b/contracts/deployments/arbitrum/PolicyRegistry_Implementation.json new file mode 100644 index 000000000..efda74ccb --- /dev/null +++ b/contracts/deployments/arbitrum/PolicyRegistry_Implementation.json @@ -0,0 +1,397 @@ +{ + "address": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x7c6ce61603d007ae06bc34c3d5948daaed0cbfeb91b5a365745cda961d3d5e0b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "transactionIndex": 3, + "gasUsed": "14058404", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000008000080000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000004000000000000000000000000000000000000000", + "blockHash": "0xe72d71e9c52704089606cc63d2d7e7910982fad2992e706428fa9cf780594f23", + "transactionHash": "0x7c6ce61603d007ae06bc34c3d5948daaed0cbfeb91b5a365745cda961d3d5e0b", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274392, + "transactionHash": "0x7c6ce61603d007ae06bc34c3d5948daaed0cbfeb91b5a365745cda961d3d5e0b", + "address": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 2, + "blockHash": "0xe72d71e9c52704089606cc63d2d7e7910982fad2992e706428fa9cf780594f23" + } + ], + "blockNumber": 190274392, + "cumulativeGasUsed": "17366934", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_courtName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_policy\",\"type\":\"string\"}],\"name\":\"PolicyUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"policies\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_courtName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_policy\",\"type\":\"string\"}],\"name\":\"setPolicy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract to maintain a policy for each court.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"PolicyUpdate(uint256,string,string)\":{\"details\":\"Emitted when a policy is updated.\",\"params\":{\"_courtID\":\"The ID of the policy's court.\",\"_courtName\":\"The name of the policy's court.\",\"_policy\":\"The URI of the policy JSON.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Constructs the `PolicyRegistry` contract.\",\"params\":{\"_governor\":\"The governor's address.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setPolicy(uint256,string,string)\":{\"details\":\"Sets the policy for the specified court.\",\"params\":{\"_courtID\":\"The ID of the specified court.\",\"_courtName\":\"The name of the specified court.\",\"_policy\":\"The URI of the policy JSON.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"PolicyRegistry\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/PolicyRegistry.sol\":\"PolicyRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/PolicyRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title PolicyRegistry\\n/// @dev A contract to maintain a policy for each court.\\ncontract PolicyRegistry is UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev Emitted when a policy is updated.\\n /// @param _courtID The ID of the policy's court.\\n /// @param _courtName The name of the policy's court.\\n /// @param _policy The URI of the policy JSON.\\n event PolicyUpdate(uint256 indexed _courtID, string _courtName, string _policy);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor;\\n mapping(uint256 => string) public policies;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /// @dev Requires that the sender is the governor.\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"No allowed: governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Constructs the `PolicyRegistry` contract.\\n /// @param _governor The governor's address.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the policy for the specified court.\\n /// @param _courtID The ID of the specified court.\\n /// @param _courtName The name of the specified court.\\n /// @param _policy The URI of the policy JSON.\\n function setPolicy(uint256 _courtID, string calldata _courtName, string calldata _policy) external onlyByGovernor {\\n policies[_courtID] = _policy;\\n emit PolicyUpdate(_courtID, _courtName, policies[_courtID]);\\n }\\n}\\n\",\"keccak256\":\"0x24154360b94aa45b0699b65d31087e475f9d43b42771c62440f3d5741f7419a4\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051610b926100fc6000396000818161017b015281816101a401526103a10152610b926000f3fe6080604052600436106100605760003560e01c80630c340a24146100655780634f1ef286146100a257806352d1902d146100b7578063bdf73780146100da578063c4d66de8146100fa578063d3e894831461011a578063e4c0aaf414610147575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b56100b03660046106ba565b610167565b005b3480156100c357600080fd5b506100cc610394565b604051908152602001610099565b3480156100e657600080fd5b506100b56100f53660046107c5565b6103f2565b34801561010657600080fd5b506100b561011536600461083f565b61048b565b34801561012657600080fd5b5061013a610135366004610861565b610575565b604051610099919061089e565b34801561015357600080fd5b506100b561016236600461083f565b61060f565b6101708261065b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806101ee57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166101e2600080516020610b3d8339815191525490565b6001600160a01b031614155b1561020c5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610266575060408051601f3d908101601f19168201909252610263918101906108d1565b60015b61029357604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610b3d83398151915281146102c457604051632a87526960e21b81526004810182905260240161028a565b600080516020610b3d8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561038f576000836001600160a01b03168360405161032b91906108ea565b600060405180830381855af49150503d8060008114610366576040519150601f19603f3d011682016040523d82523d6000602084013e61036b565b606091505b505090508061038d576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103df5760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610b3d83398151915290565b6000546001600160a01b0316331461041c5760405162461bcd60e51b815260040161028a90610906565b60008581526001602052604090206104358284836109c1565b50847f61f7110245e82eddd3b134d1e1607420d4a4dcdab30f5abdbbc9c3485b5dd2a48585600160008a815260200190815260200160002060405161047c93929190610a82565b60405180910390a25050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104d55750805467ffffffffffffffff808416911610155b156104f25760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6001602052600090815260409020805461058e90610939565b80601f01602080910402602001604051908101604052809291908181526020018280546105ba90610939565b80156106075780601f106105dc57610100808354040283529160200191610607565b820191906000526020600020905b8154815290600101906020018083116105ea57829003601f168201915b505050505081565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161028a90610906565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161028a90610906565b50565b80356001600160a01b038116811461069f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156106cd57600080fd5b6106d683610688565b9150602083013567ffffffffffffffff808211156106f357600080fd5b818501915085601f83011261070757600080fd5b813581811115610719576107196106a4565b604051601f8201601f19908116603f01168101908382118183101715610741576107416106a4565b8160405282815288602084870101111561075a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f84011261078e57600080fd5b50813567ffffffffffffffff8111156107a657600080fd5b6020830191508360208285010111156107be57600080fd5b9250929050565b6000806000806000606086880312156107dd57600080fd5b85359450602086013567ffffffffffffffff808211156107fc57600080fd5b61080889838a0161077c565b9096509450604088013591508082111561082157600080fd5b5061082e8882890161077c565b969995985093965092949392505050565b60006020828403121561085157600080fd5b61085a82610688565b9392505050565b60006020828403121561087357600080fd5b5035919050565b60005b8381101561089557818101518382015260200161087d565b50506000910152565b60208152600082518060208401526108bd81604085016020870161087a565b601f01601f19169190910160400192915050565b6000602082840312156108e357600080fd5b5051919050565b600082516108fc81846020870161087a565b9190910192915050565b6020808252601990820152784e6f20616c6c6f7765643a20676f7665726e6f72206f6e6c7960381b604082015260600190565b600181811c9082168061094d57607f821691505b60208210810361096d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561038f57600081815260208120601f850160051c8101602086101561099a5750805b601f850160051c820191505b818110156109b9578281556001016109a6565b505050505050565b67ffffffffffffffff8311156109d9576109d96106a4565b6109ed836109e78354610939565b83610973565b6000601f841160018114610a215760008515610a095750838201355b600019600387901b1c1916600186901b178355610a7b565b600083815260209020601f19861690835b82811015610a525786850135825560209485019460019092019101610a32565b5086821015610a6f5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60408152826040820152828460608301376000606084830101526000601f19601f850116820160206060848303018185015260008554610ac181610939565b8060608601526080600180841660008114610ae35760018114610afd57610b2b565b60ff1985168884015283151560051b880183019550610b2b565b8a6000528660002060005b85811015610b235781548a8201860152908301908801610b08565b890184019650505b50939b9a505050505050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122013474a11eb4f083f97a82a4223662ae3b08f8ebecfcac55156e710f84b21048b64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a24146100655780634f1ef286146100a257806352d1902d146100b7578063bdf73780146100da578063c4d66de8146100fa578063d3e894831461011a578063e4c0aaf414610147575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b56100b03660046106ba565b610167565b005b3480156100c357600080fd5b506100cc610394565b604051908152602001610099565b3480156100e657600080fd5b506100b56100f53660046107c5565b6103f2565b34801561010657600080fd5b506100b561011536600461083f565b61048b565b34801561012657600080fd5b5061013a610135366004610861565b610575565b604051610099919061089e565b34801561015357600080fd5b506100b561016236600461083f565b61060f565b6101708261065b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806101ee57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166101e2600080516020610b3d8339815191525490565b6001600160a01b031614155b1561020c5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610266575060408051601f3d908101601f19168201909252610263918101906108d1565b60015b61029357604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610b3d83398151915281146102c457604051632a87526960e21b81526004810182905260240161028a565b600080516020610b3d8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561038f576000836001600160a01b03168360405161032b91906108ea565b600060405180830381855af49150503d8060008114610366576040519150601f19603f3d011682016040523d82523d6000602084013e61036b565b606091505b505090508061038d576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103df5760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610b3d83398151915290565b6000546001600160a01b0316331461041c5760405162461bcd60e51b815260040161028a90610906565b60008581526001602052604090206104358284836109c1565b50847f61f7110245e82eddd3b134d1e1607420d4a4dcdab30f5abdbbc9c3485b5dd2a48585600160008a815260200190815260200160002060405161047c93929190610a82565b60405180910390a25050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104d55750805467ffffffffffffffff808416911610155b156104f25760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6001602052600090815260409020805461058e90610939565b80601f01602080910402602001604051908101604052809291908181526020018280546105ba90610939565b80156106075780601f106105dc57610100808354040283529160200191610607565b820191906000526020600020905b8154815290600101906020018083116105ea57829003601f168201915b505050505081565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161028a90610906565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161028a90610906565b50565b80356001600160a01b038116811461069f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156106cd57600080fd5b6106d683610688565b9150602083013567ffffffffffffffff808211156106f357600080fd5b818501915085601f83011261070757600080fd5b813581811115610719576107196106a4565b604051601f8201601f19908116603f01168101908382118183101715610741576107416106a4565b8160405282815288602084870101111561075a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f84011261078e57600080fd5b50813567ffffffffffffffff8111156107a657600080fd5b6020830191508360208285010111156107be57600080fd5b9250929050565b6000806000806000606086880312156107dd57600080fd5b85359450602086013567ffffffffffffffff808211156107fc57600080fd5b61080889838a0161077c565b9096509450604088013591508082111561082157600080fd5b5061082e8882890161077c565b969995985093965092949392505050565b60006020828403121561085157600080fd5b61085a82610688565b9392505050565b60006020828403121561087357600080fd5b5035919050565b60005b8381101561089557818101518382015260200161087d565b50506000910152565b60208152600082518060208401526108bd81604085016020870161087a565b601f01601f19169190910160400192915050565b6000602082840312156108e357600080fd5b5051919050565b600082516108fc81846020870161087a565b9190910192915050565b6020808252601990820152784e6f20616c6c6f7765643a20676f7665726e6f72206f6e6c7960381b604082015260600190565b600181811c9082168061094d57607f821691505b60208210810361096d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561038f57600081815260208120601f850160051c8101602086101561099a5750805b601f850160051c820191505b818110156109b9578281556001016109a6565b505050505050565b67ffffffffffffffff8311156109d9576109d96106a4565b6109ed836109e78354610939565b83610973565b6000601f841160018114610a215760008515610a095750838201355b600019600387901b1c1916600186901b178355610a7b565b600083815260209020601f19861690835b82811015610a525786850135825560209485019460019092019101610a32565b5086821015610a6f5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60408152826040820152828460608301376000606084830101526000601f19601f850116820160206060848303018185015260008554610ac181610939565b8060608601526080600180841660008114610ae35760018114610afd57610b2b565b60ff1985168884015283151560051b880183019550610b2b565b8a6000528660002060005b85811015610b235781548a8201860152908301908801610b08565b890184019650505b50939b9a505050505050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122013474a11eb4f083f97a82a4223662ae3b08f8ebecfcac55156e710f84b21048b64736f6c63430008120033", + "devdoc": { + "details": "A contract to maintain a policy for each court.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "PolicyUpdate(uint256,string,string)": { + "details": "Emitted when a policy is updated.", + "params": { + "_courtID": "The ID of the policy's court.", + "_courtName": "The name of the policy's court.", + "_policy": "The URI of the policy JSON." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Constructs the `PolicyRegistry` contract.", + "params": { + "_governor": "The governor's address." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setPolicy(uint256,string,string)": { + "details": "Sets the policy for the specified court.", + "params": { + "_courtID": "The ID of the specified court.", + "_courtName": "The name of the specified court.", + "_policy": "The URI of the policy JSON." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "PolicyRegistry", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10625, + "contract": "src/arbitration/PolicyRegistry.sol:PolicyRegistry", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 10629, + "contract": "src/arbitration/PolicyRegistry.sol:PolicyRegistry", + "label": "policies", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_string_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_string_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrum/PolicyRegistry_Proxy.json b/contracts/deployments/arbitrum/PolicyRegistry_Proxy.json new file mode 100644 index 000000000..03135a8d1 --- /dev/null +++ b/contracts/deployments/arbitrum/PolicyRegistry_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xb2c370c53d49714cf74d7ae82da3b5da160f22f97529e5f4d6c5786e4615f7eb", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "transactionIndex": 1, + "gasUsed": "5300939", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080010000000000000000000000000000000000000000000000000000800000000000000000000000000000000010000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x419ba6ad860f99d54faacf3d36d879239522e20fad6adfa78cf12f278b385f3b", + "transactionHash": "0xb2c370c53d49714cf74d7ae82da3b5da160f22f97529e5f4d6c5786e4615f7eb", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274403, + "transactionHash": "0xb2c370c53d49714cf74d7ae82da3b5da160f22f97529e5f4d6c5786e4615f7eb", + "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x419ba6ad860f99d54faacf3d36d879239522e20fad6adfa78cf12f278b385f3b" + } + ], + "blockNumber": 190274403, + "cumulativeGasUsed": "5300939", + "status": 1, + "byzantium": true + }, + "args": [ + "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/RandomizerRNG.json b/contracts/deployments/arbitrum/RandomizerRNG.json new file mode 100644 index 000000000..8aa02a413 --- /dev/null +++ b/contracts/deployments/arbitrum/RandomizerRNG.json @@ -0,0 +1,397 @@ +{ + "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomizer", + "name": "_randomizer", + "type": "address" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomizer", + "outputs": [ + { + "internalType": "contract IRandomizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "randomizerCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "randomizerWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requesterToID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_randomizer", + "type": "address" + } + ], + "name": "setRandomizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x844c158d67f22dc917fc3f60ae72ff48b6aa45af986bb9dce85872a6e4eeeba7", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "transactionIndex": 3, + "gasUsed": "5563050", + "logsBloom": "0x00000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000004000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xaf8bc1d36ade1d4cd71a13af8fe170a37a1a6ca161b36d800002b1dfea2c5d9d", + "transactionHash": "0x844c158d67f22dc917fc3f60ae72ff48b6aa45af986bb9dce85872a6e4eeeba7", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274480, + "transactionHash": "0x844c158d67f22dc917fc3f60ae72ff48b6aa45af986bb9dce85872a6e4eeeba7", + "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 10, + "blockHash": "0xaf8bc1d36ade1d4cd71a13af8fe170a37a1a6ca161b36d800002b1dfea2c5d9d" + } + ], + "blockNumber": 190274480, + "cumulativeGasUsed": "8678913", + "status": 1, + "byzantium": true + }, + "args": [ + "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "0x485cc9550000000000000000000000005b8bb80f2d72d0c85cab8fb169e8170a05c94baf000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF", + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/RandomizerRNG_Implementation.json b/contracts/deployments/arbitrum/RandomizerRNG_Implementation.json new file mode 100644 index 000000000..e32a54f93 --- /dev/null +++ b/contracts/deployments/arbitrum/RandomizerRNG_Implementation.json @@ -0,0 +1,533 @@ +{ + "address": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomizer", + "name": "_randomizer", + "type": "address" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomizer", + "outputs": [ + { + "internalType": "contract IRandomizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "randomizerCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "randomizerWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requesterToID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_randomizer", + "type": "address" + } + ], + "name": "setRandomizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xbd583dfb978a2e401178bac24f3776dba1c28cc8603c1f622173e378154408b5", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "transactionIndex": 3, + "gasUsed": "12553895", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400020000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xef7521fbc369332c5a84eebdee6026696805343881b40f6cdc7003cc69661437", + "transactionHash": "0xbd583dfb978a2e401178bac24f3776dba1c28cc8603c1f622173e378154408b5", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274469, + "transactionHash": "0xbd583dfb978a2e401178bac24f3776dba1c28cc8603c1f622173e378154408b5", + "address": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 2, + "blockHash": "0xef7521fbc369332c5a84eebdee6026696805343881b40f6cdc7003cc69661437" + } + ], + "blockNumber": 190274469, + "cumulativeGasUsed": "18235579", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"callbackGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRandomizer\",\"name\":\"_randomizer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"randomNumbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomizer\",\"outputs\":[{\"internalType\":\"contract IRandomizer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_value\",\"type\":\"bytes32\"}],\"name\":\"randomizerCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"randomizerWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"receiveRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requestRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"requesterToID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"setCallbackGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_randomizer\",\"type\":\"address\"}],\"name\":\"setRandomizer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address,address)\":{\"details\":\"Initializer\",\"params\":{\"_governor\":\"Governor of the contract.\",\"_randomizer\":\"Randomizer contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"randomizerCallback(uint256,bytes32)\":{\"details\":\"Callback function called by the randomizer contract when the random value is generated.\"},\"randomizerWithdraw(uint256)\":{\"details\":\"Allows the governor to withdraw randomizer funds.\",\"params\":{\"_amount\":\"Amount to withdraw in wei.\"}},\"receiveRandomness(uint256)\":{\"details\":\"Return the random number.\",\"returns\":{\"randomNumber\":\"The random number or 0 if it is not ready or has not been requested.\"}},\"requestRandomness(uint256)\":{\"details\":\"Request a random number. The id of the request is tied to the sender.\"},\"setCallbackGasLimit(uint256)\":{\"details\":\"Change the Randomizer callback gas limit.\",\"params\":{\"_callbackGasLimit\":\"the new limit.\"}},\"setRandomizer(address)\":{\"details\":\"Change the Randomizer address.\",\"params\":{\"_randomizer\":\"the new Randomizer address.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Random Number Generator that uses Randomizer.ai https://randomizer.ai/\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/rng/RandomizerRNG.sol\":\"RandomizerRNG\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/IRandomizer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n// Randomizer protocol interface\\ninterface IRandomizer {\\n function request(uint256 callbackGasLimit) external returns (uint256);\\n\\n function clientWithdrawTo(address _to, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0xe71bbdd9470eeb89f5d10aee07fda95b6ccc13aa845c0d8c0bc7a9ec20b6356e\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"},\"src/rng/RandomizerRNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./RNG.sol\\\";\\nimport \\\"./IRandomizer.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title Random Number Generator that uses Randomizer.ai\\n/// https://randomizer.ai/\\ncontract RandomizerRNG is RNG, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The address that can withdraw funds.\\n uint256 public callbackGasLimit; // Gas limit for the randomizer callback\\n IRandomizer public randomizer; // Randomizer address.\\n mapping(uint256 => uint256) public randomNumbers; // randomNumbers[requestID] is the random number for this request id, 0 otherwise.\\n mapping(address => uint256) public requesterToID; // Maps the requester to his latest request ID.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer\\n /// @param _randomizer Randomizer contract.\\n /// @param _governor Governor of the contract.\\n function initialize(IRandomizer _randomizer, address _governor) external reinitializer(1) {\\n randomizer = _randomizer;\\n governor = _governor;\\n callbackGasLimit = 50000;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Change the Randomizer callback gas limit.\\n /// @param _callbackGasLimit the new limit.\\n function setCallbackGasLimit(uint256 _callbackGasLimit) external onlyByGovernor {\\n callbackGasLimit = _callbackGasLimit;\\n }\\n\\n /// @dev Change the Randomizer address.\\n /// @param _randomizer the new Randomizer address.\\n function setRandomizer(address _randomizer) external onlyByGovernor {\\n randomizer = IRandomizer(_randomizer);\\n }\\n\\n /// @dev Allows the governor to withdraw randomizer funds.\\n /// @param _amount Amount to withdraw in wei.\\n function randomizerWithdraw(uint256 _amount) external onlyByGovernor {\\n randomizer.clientWithdrawTo(msg.sender, _amount);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Request a random number. The id of the request is tied to the sender.\\n function requestRandomness(uint256 /*_block*/) external override {\\n uint256 id = randomizer.request(callbackGasLimit);\\n requesterToID[msg.sender] = id;\\n }\\n\\n /// @dev Callback function called by the randomizer contract when the random value is generated.\\n function randomizerCallback(uint256 _id, bytes32 _value) external {\\n require(msg.sender == address(randomizer), \\\"Randomizer only\\\");\\n randomNumbers[_id] = uint256(_value);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Return the random number.\\n /// @return randomNumber The random number or 0 if it is not ready or has not been requested.\\n function receiveRandomness(uint256 /*_block*/) external view override returns (uint256 randomNumber) {\\n // Get the latest request ID for this requester.\\n uint256 id = requesterToID[msg.sender];\\n randomNumber = randomNumbers[id];\\n }\\n}\\n\",\"keccak256\":\"0x4285391be2975df0c7d1fa2fcdcd8abe8458e3228961ba32dec1e97325598df0\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051610b396100fc600039600081816104a1015281816104ca01526106c20152610b396000f3fe6080604052600436106100c85760003560e01c806352d1902d1161007a57806352d1902d146101ec57806371d4b00b146102015780637363ae1f1461022e578063767bcab51461024e5780638a54942f1461026e578063e4c0aaf41461028e578063ebe93caf146102ae578063f10fb584146102ce57600080fd5b80630c340a24146100cd57806313cf90541461010a57806324f7469714610154578063485cc9551461016a5780634e07c9391461018c5780634f1ef286146101ac5780635257cd90146101bf575b600080fd5b3480156100d957600080fd5b506000546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011657600080fd5b506101466101253660046108ed565b50336000908152600460209081526040808320548352600390915290205490565b604051908152602001610101565b34801561016057600080fd5b5061014660015481565b34801561017657600080fd5b5061018a61018536600461091b565b6102ee565b005b34801561019857600080fd5b5061018a6101a73660046108ed565b6103f3565b61018a6101ba36600461096a565b61048d565b3480156101cb57600080fd5b506101466101da3660046108ed565b60036020526000908152604090205481565b3480156101f857600080fd5b506101466106b5565b34801561020d57600080fd5b5061014661021c366004610a2e565b60046020526000908152604090205481565b34801561023a57600080fd5b5061018a6102493660046108ed565b610713565b34801561025a57600080fd5b5061018a610269366004610a2e565b61079b565b34801561027a57600080fd5b5061018a6102893660046108ed565b6107e7565b34801561029a57600080fd5b5061018a6102a9366004610a2e565b610816565b3480156102ba57600080fd5b5061018a6102c9366004610a52565b610862565b3480156102da57600080fd5b506002546100ed906001600160a01b031681565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806103385750805467ffffffffffffffff808416911610155b156103555760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600280546001600160a01b038781166001600160a01b031992831617909255600080549287169290911691909117905561c350600155815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90610a74565b60405180910390fd5b600254604051632465f8f560e01b8152336004820152602481018390526001600160a01b0390911690632465f8f590604401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b5050505050565b610496826108c0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061051457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610508600080516020610ae48339815191525490565b6001600160a01b031614155b156105325760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561058c575060408051601f3d908101601f1916820190925261058991810190610a9b565b60015b6105b457604051630c76093760e01b81526001600160a01b038316600482015260240161041d565b600080516020610ae483398151915281146105e557604051632a87526960e21b81526004810182905260240161041d565b600080516020610ae48339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156106b0576000836001600160a01b03168360405161064c9190610ab4565b600060405180830381855af49150503d8060008114610687576040519150601f19603f3d011682016040523d82523d6000602084013e61068c565b606091505b50509050806106ae576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610ae483398151915290565b60025460015460405163d845a4b360e01b815260048101919091526000916001600160a01b03169063d845a4b3906024016020604051808303816000875af1158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190610a9b565b336000908152600460205260409020555050565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161041d90610a74565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161041d90610a74565b600155565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161041d90610a74565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146108ae5760405162461bcd60e51b815260206004820152600f60248201526e52616e646f6d697a6572206f6e6c7960881b604482015260640161041d565b60009182526003602052604090912055565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161041d90610a74565b50565b6000602082840312156108ff57600080fd5b5035919050565b6001600160a01b03811681146108ea57600080fd5b6000806040838503121561092e57600080fd5b823561093981610906565b9150602083013561094981610906565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097d57600080fd5b823561098881610906565b9150602083013567ffffffffffffffff808211156109a557600080fd5b818501915085601f8301126109b957600080fd5b8135818111156109cb576109cb610954565b604051601f8201601f19908116603f011681019083821181831017156109f3576109f3610954565b81604052828152886020848701011115610a0c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a4057600080fd5b8135610a4b81610906565b9392505050565b60008060408385031215610a6557600080fd5b50508035926020909101359150565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b600060208284031215610aad57600080fd5b5051919050565b6000825160005b81811015610ad55760208186018101518583015201610abb565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220aec03dad51a46b09534bed3ffa73b065bf3cda8ee37f8b3126efdc48f7db06ed64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100c85760003560e01c806352d1902d1161007a57806352d1902d146101ec57806371d4b00b146102015780637363ae1f1461022e578063767bcab51461024e5780638a54942f1461026e578063e4c0aaf41461028e578063ebe93caf146102ae578063f10fb584146102ce57600080fd5b80630c340a24146100cd57806313cf90541461010a57806324f7469714610154578063485cc9551461016a5780634e07c9391461018c5780634f1ef286146101ac5780635257cd90146101bf575b600080fd5b3480156100d957600080fd5b506000546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011657600080fd5b506101466101253660046108ed565b50336000908152600460209081526040808320548352600390915290205490565b604051908152602001610101565b34801561016057600080fd5b5061014660015481565b34801561017657600080fd5b5061018a61018536600461091b565b6102ee565b005b34801561019857600080fd5b5061018a6101a73660046108ed565b6103f3565b61018a6101ba36600461096a565b61048d565b3480156101cb57600080fd5b506101466101da3660046108ed565b60036020526000908152604090205481565b3480156101f857600080fd5b506101466106b5565b34801561020d57600080fd5b5061014661021c366004610a2e565b60046020526000908152604090205481565b34801561023a57600080fd5b5061018a6102493660046108ed565b610713565b34801561025a57600080fd5b5061018a610269366004610a2e565b61079b565b34801561027a57600080fd5b5061018a6102893660046108ed565b6107e7565b34801561029a57600080fd5b5061018a6102a9366004610a2e565b610816565b3480156102ba57600080fd5b5061018a6102c9366004610a52565b610862565b3480156102da57600080fd5b506002546100ed906001600160a01b031681565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806103385750805467ffffffffffffffff808416911610155b156103555760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600280546001600160a01b038781166001600160a01b031992831617909255600080549287169290911691909117905561c350600155815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90610a74565b60405180910390fd5b600254604051632465f8f560e01b8152336004820152602481018390526001600160a01b0390911690632465f8f590604401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b5050505050565b610496826108c0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061051457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610508600080516020610ae48339815191525490565b6001600160a01b031614155b156105325760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561058c575060408051601f3d908101601f1916820190925261058991810190610a9b565b60015b6105b457604051630c76093760e01b81526001600160a01b038316600482015260240161041d565b600080516020610ae483398151915281146105e557604051632a87526960e21b81526004810182905260240161041d565b600080516020610ae48339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156106b0576000836001600160a01b03168360405161064c9190610ab4565b600060405180830381855af49150503d8060008114610687576040519150601f19603f3d011682016040523d82523d6000602084013e61068c565b606091505b50509050806106ae576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610ae483398151915290565b60025460015460405163d845a4b360e01b815260048101919091526000916001600160a01b03169063d845a4b3906024016020604051808303816000875af1158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190610a9b565b336000908152600460205260409020555050565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161041d90610a74565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161041d90610a74565b600155565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161041d90610a74565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146108ae5760405162461bcd60e51b815260206004820152600f60248201526e52616e646f6d697a6572206f6e6c7960881b604482015260640161041d565b60009182526003602052604090912055565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161041d90610a74565b50565b6000602082840312156108ff57600080fd5b5035919050565b6001600160a01b03811681146108ea57600080fd5b6000806040838503121561092e57600080fd5b823561093981610906565b9150602083013561094981610906565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097d57600080fd5b823561098881610906565b9150602083013567ffffffffffffffff808211156109a557600080fd5b818501915085601f8301126109b957600080fd5b8135818111156109cb576109cb610954565b604051601f8201601f19908116603f011681019083821181831017156109f3576109f3610954565b81604052828152886020848701011115610a0c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a4057600080fd5b8135610a4b81610906565b9392505050565b60008060408385031215610a6557600080fd5b50508035926020909101359150565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b600060208284031215610aad57600080fd5b5051919050565b6000825160005b81811015610ad55760208186018101518583015201610abb565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220aec03dad51a46b09534bed3ffa73b065bf3cda8ee37f8b3126efdc48f7db06ed64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address,address)": { + "details": "Initializer", + "params": { + "_governor": "Governor of the contract.", + "_randomizer": "Randomizer contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "randomizerCallback(uint256,bytes32)": { + "details": "Callback function called by the randomizer contract when the random value is generated." + }, + "randomizerWithdraw(uint256)": { + "details": "Allows the governor to withdraw randomizer funds.", + "params": { + "_amount": "Amount to withdraw in wei." + } + }, + "receiveRandomness(uint256)": { + "details": "Return the random number.", + "returns": { + "randomNumber": "The random number or 0 if it is not ready or has not been requested." + } + }, + "requestRandomness(uint256)": { + "details": "Request a random number. The id of the request is tied to the sender." + }, + "setCallbackGasLimit(uint256)": { + "details": "Change the Randomizer callback gas limit.", + "params": { + "_callbackGasLimit": "the new limit." + } + }, + "setRandomizer(address)": { + "details": "Change the Randomizer address.", + "params": { + "_randomizer": "the new Randomizer address." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Random Number Generator that uses Randomizer.ai https://randomizer.ai/", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 31004, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 31006, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 31009, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "randomizer", + "offset": 0, + "slot": "2", + "type": "t_contract(IRandomizer)30932" + }, + { + "astId": 31013, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "randomNumbers", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 31017, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "requesterToID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_address,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IRandomizer)30932": { + "encoding": "inplace", + "label": "contract IRandomizer", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrum/RandomizerRNG_Proxy.json b/contracts/deployments/arbitrum/RandomizerRNG_Proxy.json new file mode 100644 index 000000000..1272a7293 --- /dev/null +++ b/contracts/deployments/arbitrum/RandomizerRNG_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x844c158d67f22dc917fc3f60ae72ff48b6aa45af986bb9dce85872a6e4eeeba7", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "transactionIndex": 3, + "gasUsed": "5563050", + "logsBloom": "0x00000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000004000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xaf8bc1d36ade1d4cd71a13af8fe170a37a1a6ca161b36d800002b1dfea2c5d9d", + "transactionHash": "0x844c158d67f22dc917fc3f60ae72ff48b6aa45af986bb9dce85872a6e4eeeba7", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 190274480, + "transactionHash": "0x844c158d67f22dc917fc3f60ae72ff48b6aa45af986bb9dce85872a6e4eeeba7", + "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 10, + "blockHash": "0xaf8bc1d36ade1d4cd71a13af8fe170a37a1a6ca161b36d800002b1dfea2c5d9d" + } + ], + "blockNumber": 190274480, + "cumulativeGasUsed": "8678913", + "status": 1, + "byzantium": true + }, + "args": [ + "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "0x485cc9550000000000000000000000005b8bb80f2d72d0c85cab8fb169e8170a05c94baf000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/SortitionModuleNeo.json b/contracts/deployments/arbitrum/SortitionModuleNeo.json new file mode 100644 index 000000000..4813d0b21 --- /dev/null +++ b/contracts/deployments/arbitrum/SortitionModuleNeo.json @@ -0,0 +1,1110 @@ +{ + "address": "0x614498118850184c62f82d08261109334bFB050f", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + } + ], + "name": "changeMaxStakePerJuror", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "changeMaxTotalStaked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxStakePerJuror", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "enum StakingResult", + "name": "stakingResult", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x4dad2ef2209d6c819bdbc3704034bb913fd74ca1b20e8b187c34baf634b006a0", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x614498118850184c62f82d08261109334bFB050f", + "transactionIndex": 5, + "gasUsed": "6154647", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000002000000000000000000000000000000000000000000000000", + "blockHash": "0xfec7cddde35e0d9bb2699727a0d38cdcd0c4ed98a9309943a606d02cbfb9ad96", + "transactionHash": "0x4dad2ef2209d6c819bdbc3704034bb913fd74ca1b20e8b187c34baf634b006a0", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 190274557, + "transactionHash": "0x4dad2ef2209d6c819bdbc3704034bb913fd74ca1b20e8b187c34baf634b006a0", + "address": "0x614498118850184c62f82d08261109334bFB050f", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "logIndex": 20, + "blockHash": "0xfec7cddde35e0d9bb2699727a0d38cdcd0c4ed98a9309943a606d02cbfb9ad96" + } + ], + "blockNumber": 190274557, + "cumulativeGasUsed": "17302456", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "0x498c752c000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000cd415c03dfa85b02646c7e2977f22a480c4354f100000000000000000000000000000000000000000000000000000000000007080000000000000000000000000000000000000000000000000000000000000708000000000000000000000000c3db344755b15c8edfd834db79af4f8860029fb4000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000006c6b935b8bbd40000000000000000000000000000000000000000000000001a784379d99db42000000" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0xCd415C03dfa85B02646C7e2977F22a480c4354F1", + 1800, + 1800, + "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + 20, + { + "type": "BigNumber", + "hex": "0x6c6b935b8bbd400000" + }, + { + "type": "BigNumber", + "hex": "0x01a784379d99db42000000" + } + ] + }, + "implementation": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrum/SortitionModuleNeo_Implementation.json b/contracts/deployments/arbitrum/SortitionModuleNeo_Implementation.json new file mode 100644 index 000000000..135b2b471 --- /dev/null +++ b/contracts/deployments/arbitrum/SortitionModuleNeo_Implementation.json @@ -0,0 +1,1609 @@ +{ + "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + } + ], + "name": "changeMaxStakePerJuror", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "changeMaxTotalStaked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxStakePerJuror", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "enum StakingResult", + "name": "stakingResult", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x3f08513b7ba4a0a94f692ed916416203fb03220223ee597c1b2878dac148619e", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "transactionIndex": 1, + "gasUsed": "46053192", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000100000000000400000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x86d583ef34ea61771081fceb06a6e853924d79a318915dd16d6e661b4c0c8ce2", + "transactionHash": "0x3f08513b7ba4a0a94f692ed916416203fb03220223ee597c1b2878dac148619e", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 190274547, + "transactionHash": "0x3f08513b7ba4a0a94f692ed916416203fb03220223ee597c1b2878dac148619e", + "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x86d583ef34ea61771081fceb06a6e853924d79a318915dd16d6e661b4c0c8ce2" + } + ], + "blockNumber": 190274547, + "cumulativeGasUsed": "46053192", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "47a03c54c72f5d4984b62ca6f84025dc", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferredWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedNotTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_unlock\",\"type\":\"bool\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxStakePerJuror\",\"type\":\"uint256\"}],\"name\":\"changeMaxStakePerJuror\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxTotalStaked\",\"type\":\"uint256\"}],\"name\":\"changeMaxTotalStaked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"alreadyTransferred\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalLocked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakedInCourt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxTotalStaked\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"isJurorStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedPnk\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedPnk\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"latestDelayedStakeIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"lockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxStakePerJuror\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxTotalStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"penalizeStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"pnkDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkWithdrawal\",\"type\":\"uint256\"},{\"internalType\":\"enum StakingResult\",\"name\":\"stakingResult\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_ID\",\"type\":\"bytes32\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_nonce\":\"Nonce to hash with random number.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"initialize(address,address,uint256,uint256,address,uint256,uint256,uint256)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_core\":\"The KlerosCore.\",\"_governor\":\"The governor.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_maxStakePerJuror\":\"The maximum amount of PNK a juror can stake in a court.\",\"_maxTotalStaked\":\"The maximum amount of PNK that can be staked in all courts.\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256,bool)\":{\"details\":\"Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The address of the juror.\",\"_alreadyTransferred\":\"True if the tokens were already transferred from juror. Only relevant for delayed stakes.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"},\"returns\":{\"pnkDeposit\":\"The amount of PNK to be deposited.\",\"pnkWithdrawal\":\"The amount of PNK to be withdrawn.\",\"stakingResult\":\"The result of the staking operation.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_juror\":\"The address of the juror.\"},\"returns\":{\"_0\":\"value The stake of the juror in the court.\"}},\"stakeOf(bytes32,bytes32)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_ID\":\"The stake path ID, corresponding to a juror.\",\"_key\":\"The key of the tree, corresponding to a court.\"},\"returns\":{\"_0\":\"The stake of the juror in the court.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"SortitionModuleNeo\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModuleNeo.sol\":\"SortitionModuleNeo\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCoreBase.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is KlerosCoreBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _guardian The guardian's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n _initialize(\\n _governor,\\n _guardian,\\n _pinakion,\\n _jurorProsecutionModule,\\n _disputeKit,\\n _hiddenVotes,\\n _courtParameters,\\n _timesPerPeriod,\\n _sortitionExtraData,\\n _sortitionModuleAddress\\n );\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n}\\n\",\"keccak256\":\"0x347240e5b541bb5df305e4e6ec8ab324a04effa722af31db03cd1d9fdcd039ec\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title KlerosCoreBase\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\nabstract contract KlerosCoreBase is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 feePerJurorInRound; // The fee per juror in the round.\\n uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private 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 address public guardian; // The guardian able to pause asset withdrawals.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n bool public paused; // Whether asset withdrawals are paused.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event Paused();\\n event Unpaused();\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n modifier onlyByGuardianOrGovernor() {\\n if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly();\\n _;\\n }\\n\\n modifier whenPaused() {\\n if (!paused) revert WhenPausedOnly();\\n _;\\n }\\n\\n modifier whenNotPaused() {\\n if (paused) revert WhenNotPausedOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) internal {\\n governor = _governor;\\n guardian = _guardian;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Pause staking and reward execution. Can only be done by guardian or governor.\\n function pause() external onlyByGuardianOrGovernor whenNotPaused {\\n paused = true;\\n emit Paused();\\n }\\n\\n /// @dev Unpause staking and reward execution. Can only be done by governor.\\n function unpause() external onlyByGovernor whenPaused {\\n paused = false;\\n emit Unpaused();\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `guardian` storage variable.\\n /// @param _guardian The new value for the `guardian` storage variable.\\n function changeGuardian(address _guardian) external onlyByGovernor {\\n guardian = _guardian;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal virtual returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// Note: Reward distributions are forbidden during pause.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused {\\n Round storage round;\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n round = dispute.rounds[_round];\\n } // stack too deep workaround\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound;\\n uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror;\\n uint256 coherentCount;\\n {\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n } // stack too deep workaround\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRound = _executePenalties(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRound) {\\n round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (stakingResult != StakingResult.Successful) {\\n _stakingFailed(_onError, stakingResult);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError, StakingResult.StakingTransferFailed);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError, StakingResult.UnstakingTransferFailed);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual {\\n if (_onError == OnError.Return) return;\\n if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed();\\n if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed();\\n if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts();\\n if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt();\\n if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error GuardianOrGovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingInTooManyCourts();\\n error StakingNotPossibeInThisCourt();\\n error StakingLessThanCourtMinStake();\\n error StakingTransferFailed();\\n error UnstakingTransferFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n error WhenNotPausedOnly();\\n error WhenPausedOnly();\\n}\\n\",\"keccak256\":\"0x53eb90e3209b47a218bd9eb25bd64bcff4edca51829cb7bfff35ed68f9cee05c\",\"license\":\"MIT\"},\"src/arbitration/SortitionModuleBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @jaybuidl, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title SortitionModuleBase\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\nabstract contract SortitionModuleBase is ISortitionModule {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum PreStakeHookResult {\\n ok, // Correct phase. All checks are passed.\\n stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance.\\n stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update.\\n failed // Checks didn't pass. Do no changes.\\n }\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance.\\n uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(address => Juror) public jurors; // The jurors.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount);\\n event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) internal {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n delayedStakeReadIndex = 1;\\n }\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n require(delayedStakeWriteIndex >= delayedStakeReadIndex, \\\"No delayed stake to execute.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n // Delayed stake could've been manually removed already. In this case simply move on to the next item.\\n if (delayedStake.account != address(0)) {\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.alreadyTransferred\\n );\\n delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID];\\n delete delayedStakes[i];\\n }\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes.\\n /// @return pnkDeposit The amount of PNK to be deposited.\\n /// @return pnkWithdrawal The amount of PNK to be withdrawn.\\n /// @return stakingResult The result of the staking operation.\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) {\\n (pnkDeposit, pnkWithdrawal, stakingResult) = _setStake(_account, _courtID, _newStake, _alreadyTransferred);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// Note: no state changes should be made when returning `succeeded` = false, otherwise delayed stakes might break invariants.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) internal virtual returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) {\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = stakeOf(_account, _courtID);\\n\\n uint256 nbCourts = juror.courtIDs.length;\\n if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) {\\n return (0, 0, StakingResult.CannotStakeInMoreCourts); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n }\\n\\n if (phase != Phase.staking) {\\n pnkWithdrawal = _deleteDelayedStake(_courtID, _account);\\n\\n // Store the stake change as delayed, to be applied when the phase switches back to Staking.\\n DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex];\\n delayedStake.account = _account;\\n delayedStake.courtID = _courtID;\\n delayedStake.stake = _newStake;\\n latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex;\\n if (_newStake > currentStake) {\\n // PNK deposit: tokens are transferred now.\\n delayedStake.alreadyTransferred = true;\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake);\\n } else {\\n // PNK withdrawal: tokens are not transferred yet.\\n emit StakeDelayedNotTransferred(_account, _courtID, _newStake);\\n }\\n return (pnkDeposit, pnkWithdrawal, StakingResult.Successful);\\n }\\n\\n // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred).\\n if (_newStake >= currentStake) {\\n if (!_alreadyTransferred) {\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n } else {\\n pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n\\n // Update the sortition sum tree.\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID);\\n if (currenCourtID == GENERAL_COURT) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID); // Get the parent court.\\n }\\n }\\n emit StakeSet(_account, _courtID, _newStake);\\n return (pnkDeposit, pnkWithdrawal, StakingResult.Successful);\\n }\\n\\n /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it.\\n /// @param _courtID ID of the court.\\n /// @param _juror Juror whose stake to check.\\n function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) {\\n uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID];\\n if (latestIndex != 0) {\\n DelayedStake storage delayedStake = delayedStakes[latestIndex];\\n if (delayedStake.alreadyTransferred) {\\n // Sortition stake represents the stake value that was last updated during Staking phase.\\n uint256 sortitionStake = stakeOf(_juror, _courtID);\\n\\n // Withdraw the tokens that were added with the latest delayed stake.\\n uint256 amountToWithdraw = delayedStake.stake - sortitionStake;\\n actualAmountToWithdraw = amountToWithdraw;\\n Juror storage juror = jurors[_juror];\\n if (juror.stakedPnk <= actualAmountToWithdraw) {\\n actualAmountToWithdraw = juror.stakedPnk;\\n }\\n\\n // StakePnk can become lower because of penalty.\\n juror.stakedPnk -= actualAmountToWithdraw;\\n emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw);\\n\\n if (sortitionStake == 0) {\\n // Cleanup: delete the court otherwise it will be duplicated after staking.\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n }\\n delete delayedStakes[latestIndex];\\n delete latestDelayedStakeIndex[_juror][_courtID];\\n }\\n }\\n\\n function _increaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stake increase\\n // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror.\\n // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked.\\n uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard\\n transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard\\n ? _newStake - _currentStake - previouslyLocked\\n : 0;\\n if (_currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function _decreaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stakes can be partially delayed only when stake is increased.\\n // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution.\\n if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) {\\n // We have enough pnk staked to afford withdrawal while keeping locked tokens.\\n transferredAmount = _currentStake - _newStake;\\n } else if (juror.stakedPnk >= juror.lockedPnk) {\\n // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens.\\n transferredAmount = juror.stakedPnk - juror.lockedPnk;\\n }\\n if (_newStake == 0) {\\n // Cleanup\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk += _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, false);\\n }\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk -= _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, true);\\n }\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n Juror storage juror = jurors[_account];\\n if (juror.stakedPnk >= _relativeAmount) {\\n juror.stakedPnk -= _relativeAmount;\\n } else {\\n juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference.\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _nonce Nonce to hash with random number.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n if (tree.nodes[0] == 0) {\\n return address(0); // No jurors staked.\\n }\\n\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n uint256 treeIndex = 0;\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _juror The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @return value The stake of the juror in the court.\\n function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID);\\n return stakeOf(bytes32(uint256(_courtID)), stakePathID);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _key The key of the tree, corresponding to a court.\\n /// @param _ID The stake path ID, corresponding to a juror.\\n /// @return The stake of the juror in the court.\\n function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n if (treeIndex == 0) {\\n return 0;\\n }\\n return tree.nodes[treeIndex];\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n )\\n external\\n view\\n override\\n returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)\\n {\\n Juror storage juror = jurors[_juror];\\n totalStaked = juror.stakedPnk;\\n totalLocked = juror.lockedPnk;\\n stakedInCourt = stakeOf(_juror, _courtID);\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function isJurorStaked(address _juror) external view override returns (bool) {\\n return jurors[_juror].stakedPnk > 0;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7b525db5494a064f8d6de3ce7c1e2a7612bb5107036064222cfd796924a02dfe\",\"license\":\"MIT\"},\"src/arbitration/SortitionModuleNeo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@jaybuidl, @unknownunknown1]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./SortitionModuleBase.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title SortitionModuleNeo\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModuleNeo is SortitionModuleBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public maxStakePerJuror;\\n uint256 public maxTotalStaked;\\n uint256 public totalStaked;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor.\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n /// @param _maxStakePerJuror The maximum amount of PNK a juror can stake in a court.\\n /// @param _maxTotalStaked The maximum amount of PNK that can be staked in all courts.\\n function initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead,\\n uint256 _maxStakePerJuror,\\n uint256 _maxTotalStaked\\n ) external reinitializer(2) {\\n super._initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead);\\n maxStakePerJuror = _maxStakePerJuror;\\n maxTotalStaked = _maxTotalStaked;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n function changeMaxStakePerJuror(uint256 _maxStakePerJuror) external onlyByGovernor {\\n maxStakePerJuror = _maxStakePerJuror;\\n }\\n\\n function changeMaxTotalStaked(uint256 _maxTotalStaked) external onlyByGovernor {\\n maxTotalStaked = _maxTotalStaked;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) internal override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) {\\n uint256 currentStake = stakeOf(_account, _courtID);\\n bool stakeIncrease = _newStake > currentStake;\\n uint256 stakeChange = stakeIncrease ? _newStake - currentStake : currentStake - _newStake;\\n Juror storage juror = jurors[_account];\\n if (stakeIncrease && !_alreadyTransferred) {\\n if (juror.stakedPnk + stakeChange > maxStakePerJuror) {\\n return (0, 0, StakingResult.CannotStakeMoreThanMaxStakePerJuror);\\n }\\n if (totalStaked + stakeChange > maxTotalStaked) {\\n return (0, 0, StakingResult.CannotStakeMoreThanMaxTotalStaked);\\n }\\n }\\n if (phase == Phase.staking) {\\n if (stakeIncrease) {\\n totalStaked += stakeChange;\\n } else {\\n totalStaked -= stakeChange;\\n }\\n }\\n (pnkDeposit, pnkWithdrawal, stakingResult) = super._setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n }\\n}\\n\",\"keccak256\":\"0x112a8c221aadb71c98f6422b590f190c16d489658fae71a35c90faa32fe01670\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// @dev When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x7babeb6a4180e75dc50a42762f449b32ad0a67cf58a3cb6bf3e5306ac9364507\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @param _feePerJuror The fee per juror.\\n /// @param _pnkAtStakePerJuror The PNK at stake per juror.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 _feePerJuror,\\n uint256 _pnkAtStakePerJuror\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x72cdf621c11d1d84b851edb1ef7607ac950ba7038154c85005ccc86cdd43e71b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../../libraries/Constants.sol\\\";\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x47960dd772c9dafeefa2e6b9414c7045b5dcc68df735c1fccda6af48ca089858\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// Courts\\nuint96 constant FORKING_COURT = 0; // Index of the forking court.\\nuint96 constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n// Dispute Kits\\nuint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\nuint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n// Sortition Module\\nuint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\nuint256 constant DEFAULT_K = 6; // Default number of children per node.\\n\\n// Defaults\\nuint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\nIERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\\nenum StakingResult {\\n Successful,\\n StakingTransferFailed,\\n UnstakingTransferFailed,\\n CannotStakeInMoreCourts,\\n CannotStakeInThisCourt,\\n CannotStakeLessThanMinStake,\\n CannotStakeMoreThanMaxStakePerJuror,\\n CannotStakeMoreThanMaxTotalStaked\\n}\\n\",\"keccak256\":\"0xdc648a85f2816fa323e9f7f4accac3d9384187d0123bdfb1f9b89ce25ea64679\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516131686200010360003960008181611481015281816114aa01526116a201526131686000f3fe6080604052600436106102675760003560e01c80637dc38f1411610144578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b014610731578063dd5e5cb51461077d578063e534710d1461079d578063f216de4c146107d5578063f2f4eb26146107f5578063f6b4d82d1461081557600080fd5b8063c157261814610685578063ccbac9f51461069b578063d09f392d146106b1578063d1c1df48146106d1578063d605787b1461071157600080fd5b8063a2473cc111610108578063a2473cc1146105bc578063a5861b90146105dc578063b1c9fe6e1461060b578063b5d69e9914610639578063b888adfa14610659578063c057eca71461066f57600080fd5b80637dc38f1414610530578063817b1cd214610546578063823cfd701461055c5780638d3771bb1461057c578063965af6c71461059c57600080fd5b8063498c752c116101dd578063543f8a36116101a1578063543f8a361461044c57806356acb050146104795780635a68c1541461048f5780635d2d7846146104a55780636624192f146104c557806376fa9fc51461051057600080fd5b8063498c752c146103c45780634c70a0d6146103e45780634dbbebbc146104045780634f1ef2861461042457806352d1902d1461043757600080fd5b80631b92bbbe1161022f5780631b92bbbe1461031a57806321e1625e1461033057806321ea9b3f1461035057806323f61de41461036e57806335975f4a14610384578063477a655c146103a457600080fd5b8063034327441461026c57806306dfc967146102955780630b274f2e146102b75780630c340a24146102cc5780630e083ec914610304575b600080fd5b34801561027857600080fd5b5061028260065481565b6040519081526020015b60405180910390f35b3480156102a157600080fd5b506102b56102b0366004612af8565b61087f565b005b3480156102c357600080fd5b506102b56108b7565b3480156102d857600080fd5b506000546102ec906001600160a01b031681565b6040516001600160a01b03909116815260200161028c565b34801561031057600080fd5b50610282600a5481565b34801561032657600080fd5b5061028260035481565b34801561033c57600080fd5b506102b561034b366004612b26565b610c8a565b34801561035c57600080fd5b506102b561036b366004612af8565b50565b34801561037a57600080fd5b5061028260105481565b34801561039057600080fd5b506102b561039f366004612af8565b610d2d565b3480156103b057600080fd5b506102b56103bf366004612bf5565b610f6f565b3480156103d057600080fd5b506102b56103df366004612c3c565b611066565b3480156103f057600080fd5b506102ec6103ff366004612cb4565b6111a0565b34801561041057600080fd5b506102b561041f366004612b26565b611384565b6102b5610432366004612ce0565b61146d565b34801561044357600080fd5b50610282611695565b34801561045857600080fd5b5061046c610467366004612d1a565b6116f3565b60405161028c9190612d37565b34801561048557600080fd5b50610282600b5481565b34801561049b57600080fd5b5061028260115481565b3480156104b157600080fd5b506102b56104c0366004612d84565b611791565b3480156104d157600080fd5b506105006104e0366004612d1a565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161028c565b34801561051c57600080fd5b5061028261052b366004612d84565b6117d4565b34801561053c57600080fd5b5061028260095481565b34801561055257600080fd5b5061028260125481565b34801561056857600080fd5b506102b5610577366004612af8565b61182f565b34801561058857600080fd5b506102b5610597366004612af8565b61185e565b3480156105a857600080fd5b506102b56105b7366004612b26565b61188d565b3480156105c857600080fd5b506102826105d7366004612dbb565b611928565b3480156105e857600080fd5b506105fc6105f7366004612e02565b611952565b60405161028c93929190612e6b565b34801561061757600080fd5b5060015461062c90600160a01b900460ff1681565b60405161028c9190612e97565b34801561064557600080fd5b506102b5610654366004612d1a565b61199f565b34801561066557600080fd5b5061028260045481565b34801561067b57600080fd5b5061028260025481565b34801561069157600080fd5b5061028260055481565b3480156106a757600080fd5b5061028260085481565b3480156106bd57600080fd5b506102b56106cc366004612d84565b611a81565b3480156106dd57600080fd5b506106f16106ec366004612dbb565b611abb565b60408051948552602085019390935291830152606082015260800161028c565b34801561071d57600080fd5b506007546102ec906001600160a01b031681565b34801561073d57600080fd5b5061076861074c366004612d1a565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161028c565b34801561078957600080fd5b506102b5610798366004612af8565b611afa565b3480156107a957600080fd5b506102826107b8366004612dbb565b600f60209081526000928352604080842090915290825290205481565b3480156107e157600080fd5b506102b56107f0366004612b26565b611b29565b34801561080157600080fd5b506001546102ec906001600160a01b031681565b34801561082157600080fd5b5061086f610830366004612af8565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161028c9493929190612eb1565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016108a990612ee2565b60405180910390fd5b601055565b6000600154600160a01b900460ff1660028111156108d7576108d7612e55565b03610a45576002546004546108ec9042612f3a565b101561094f5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084016108a9565b6000600654116109b15760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a9565b6007546009546001600160a01b0390911690637363ae1f906109d39043612f4d565b6040518263ffffffff1660e01b81526004016109f191815260200190565b600060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610c3f565b60018054600160a01b900460ff166002811115610a6457610a64612e55565b03610b5c576007546009546005546001600160a01b03909216916313cf905491610a8d91612f4d565b6040518263ffffffff1660e01b8152600401610aab91815260200190565b6020604051808303816000875af1158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190612f60565b6008819055600003610b425760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a9565b600180546002919060ff60a01b1916600160a01b83610a3b565b6002600154600160a01b900460ff166002811115610b7c57610b7c612e55565b03610c3f576006541580610b9e5750600354600454610b9b9042612f3a565b10155b610c315760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a9565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610c8091600160a01b90910460ff1690612e97565b60405180910390a1565b6001546001600160a01b03163314610cb45760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d602052604081206002018054839290610cdf908490612f4d565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610d4d57610d4d612e55565b14610d9a5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a9565b600b54600a541015610dee5760405162461bcd60e51b815260206004820152601c60248201527f4e6f2064656c61796564207374616b6520746f20657865637574652e0000000060448201526064016108a9565b6000600a54600183600b54610e039190612f4d565b610e0d9190612f3a565b11610e185781610e33565b600b54600a54610e289190612f3a565b610e33906001612f4d565b9050600081600b54610e459190612f4d565b600b549091505b81811015610f67576000818152600e6020526040902080546001600160a01b031615610f545760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610ec89490821693600160a01b9092046001600160601b031692909160ff1690600401612eb1565b600060405180830381600087803b158015610ee257600080fd5b505af1158015610ef6573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610f5f81612fbd565b915050610e4c565b50600b555050565b6001546001600160a01b03163314610f995760405162461bcd60e51b81526004016108a990612f79565b6000828152600c6020526040812090610fb183611ba1565b825490915015610ffa5760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a9565b6001811161104a5760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a9565b8155600201805460018101825560009182526020822001555050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff16806110b05750805467ffffffffffffffff808416911610155b156110cd5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155600080546001600160a01b038c81166001600160a01b031992831617909255600180548c841690831617815560028b905560038a90554260045560078054938a16939092169290921790556009869055600b5560108490556011839055805460ff60401b1916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050565b60006002600154600160a01b900460ff1660028111156111c2576111c2612e55565b146111fe5760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a9565b6000848152600c602052604081206002810180549192909161122257611222612fd6565b906000526020600020015460000361123e57600091505061137d565b60008160020160008154811061125657611256612fd6565b90600052602060002001546008548686604051602001611289939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6112ac9190613002565b905060005b600283015483546112c3908390613016565b6112ce906001612f4d565b101561135d5760015b83548111611357576000818386600001546112f29190613016565b6112fc9190612f4d565b9050600085600201828154811061131557611315612fd6565b9060005260206000200154905080851061133a576113338186612f3a565b9450611342565b509150611357565b5050808061134f90612fbd565b9150506112d7565b506112b1565b600081815260048401602052604090205461137790611bbc565b93505050505b9392505050565b6000546001600160a01b031633146113ae5760405162461bcd60e51b81526004016108a990612ee2565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156113ed576113ed612e55565b03611469576007546009546001600160a01b0390911690637363ae1f906114149043612f4d565b6040518263ffffffff1660e01b815260040161143291815260200190565b600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b50504360055550505b5050565b61147682611be7565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806114f457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166114e86000805160206131138339815191525490565b6001600160a01b031614155b156115125760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561156c575060408051601f3d908101601f1916820190925261156991810190612f60565b60015b61159457604051630c76093760e01b81526001600160a01b03831660048201526024016108a9565b60008051602061311383398151915281146115c557604051632a87526960e21b8152600481018290526024016108a9565b6000805160206131138339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611690576000836001600160a01b03168360405161162c919061302d565b600060405180830381855af49150503d8060008114611667576040519150601f19603f3d011682016040523d82523d6000602084013e61166c565b606091505b505090508061168e576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116e05760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061311383398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561178557602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116117425790505b50505050509050919050565b6001546001600160a01b031633146117bb5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb8361305c565b91905055505050565b6000828152600c602090815260408083208484526003810190925282205480830361180457600092505050611829565b81600201818154811061181957611819612fd6565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146118595760405162461bcd60e51b81526004016108a990612ee2565b600255565b6000546001600160a01b031633146118885760405162461bcd60e51b81526004016108a990612ee2565b601155565b6001546001600160a01b031633146118b75760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040812060020180548392906118e2908490612f3a565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610d21565b6000806119358484611c11565b905061194a6001600160601b038416826117d4565b949350505050565b600154600090819081906001600160a01b031633146119835760405162461bcd60e51b81526004016108a990612f79565b61198f87878787611c59565b9199909850909650945050505050565b6001546001600160a01b031633146119c95760405162461bcd60e51b81526004016108a990612f79565b60006119d4826116f3565b80519091505b801561169057600180546001600160a01b03169063fbb519e79085908590611a029086612f3a565b81518110611a1257611a12612fd6565b60200260200101516000806040518563ffffffff1660e01b8152600401611a3c9493929190612eb1565b600060405180830381600087803b158015611a5657600080fd5b505af1158015611a6a573d6000803e3d6000fd5b505050508080611a799061305c565b9150506119da565b6001546001600160a01b03163314611aab5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb83612fbd565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611aed8787611928565b9054949793965094505050565b6000546001600160a01b03163314611b245760405162461bcd60e51b81526004016108a990612ee2565b600355565b6001546001600160a01b03163314611b535760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040902060018101548211611b955781816001016000828254611b8a9190612f3a565b909155506116909050565b60006001820155505050565b60006020825110611bb457506020015190565b506006919050565b600060405160005b6014811015611bdf5783811a81600c84010153600101611bc4565b505192915050565b6000546001600160a01b0316331461036b5760405162461bcd60e51b81526004016108a990612ee2565b600060405160005b6014811015611c34578481600c011a81830153600101611c19565b5060145b6020811015611c505783811a81830153600101611c38565b50519392505050565b600154600090819081906001600160a01b03163314611c8a5760405162461bcd60e51b81526004016108a990612f79565b6000611c968888611928565b9050808611600081611cb157611cac8884612f3a565b611cbb565b611cbb8389612f3a565b6001600160a01b038b166000908152600d60205260409020909150828015611ce1575087155b15611d3e57601054828260010154611cf99190612f4d565b1115611d1357600080600696509650965050505050611db6565b60115482601254611d249190612f4d565b1115611d3e57600080600796509650965050505050611db6565b6000600154600160a01b900460ff166002811115611d5e57611d5e612e55565b03611d9e578215611d86578160126000828254611d7b9190612f4d565b90915550611d9e9050565b8160126000828254611d989190612f3a565b90915550505b611daa8b8b8b8b611dc0565b91985096509450505050505b9450945094915050565b6001600160a01b0384166000908152600d602052604081208190819081611de78989611928565b825490915087158015611e035750600481101580611e03575081155b15611e1b576000806003955095509550505050611db6565b6000600154600160a01b900460ff166002811115611e3b57611e3b612e55565b14611ff557611e4a898b612159565b94506000600e6000600a60008154611e6190612fbd565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611f995760028101805460ff19166001179055611f44848b8b86612410565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611fe7565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060009350611db692505050565b81881061201557866120105761200d838a8a85612410565b95505b61202e565b612021838a8a856124f0565b61202b9086612f4d565b94505b600061203a8b8b611c11565b905060008a5b816120f8576120596001600160601b0382168c856126e7565b6000196001600160601b038216016120745760019150612040565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa1580156120c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e99190613073565b50949550612040945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506000955050505050509450945094915050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b03861684529091528120548015612409576000818152600e60205260409020600281015460ff16156123bc5760006121b38587611928565b905060008183600101546121c79190612f3a565b6001600160a01b0387166000908152600d6020526040902060018101549196508692509082106121f957806001015495505b8581600101600082825461220d9190612f3a565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036123b85780545b80156123b6576001600160601b03891682612282600184612f3a565b8154811061229257612292612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123a457815482906122ce90600190612f3a565b815481106122de576122de612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906123129084612f3a565b8154811061232257612322612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b031602179055508160000180548061236e5761236e6130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123b6565b806123ae8161305c565b915050612266565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561242a57600061243e565b8560010154866002015461243e9190612f3a565b905061244a8184612f4d565b84101561245857600061246d565b806124638486612f3a565b61246d9190612f3a565b9150826000036124b2578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156124c457836124df565b838387600101546124d59190612f3a565b6124df9190612f4d565b866001018190555050949350505050565b60028401546000906125028484612f3a565b61250c9190612f4d565b856001015410612527576125208383612f3a565b905061254d565b846002015485600101541061254d578460020154856001015461254a9190612f3a565b90505b826000036126aa5784545b80156126a8576001600160601b03851686612574600184612f3a565b8154811061258457612584612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03160361269657855486906125c090600190612f3a565b815481106125d0576125d0612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906126049084612f3a565b8154811061261457612614612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b0316021790555085600001805480612660576126606130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556126a8565b806126a08161305c565b915050612558565b505b81856001015410156126bc57826126d7565b828286600101546126cd9190612f3a565b6126d79190612f4d565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036128b45783156128af57600182015460000361280257506002810180546001808201835560009283526020909220810185905590811480159061276157508154612755600183612f3a565b61275f9190613002565b155b156127fd57815460009061277590836130fe565b6000818152600485016020526040812054919250612794846001612f4d565b9050846002018560020184815481106127af576127af612fd6565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b61287d565b60018083018054909161281491612f3a565b8154811061282457612824612fd6565b9060005260206000200154905081600101805480612844576128446130e8565b600190038181906000526020600020016000905590558382600201828154811061287057612870612fd6565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556128af8582600187612a3b565b612a34565b836000036129525760008260020182815481106128d3576128d3612fd6565b9060005260206000200154905060008360020183815481106128f7576128f7612fd6565b600091825260208083209091019290925560018086018054918201815582528282200184905585815260038501825260408082208290558482526004860190925290812081905561294c908790849084612a3b565b50612a34565b81600201818154811061296757612967612fd6565b90600052602060002001548414612a345760008483600201838154811061299057612990612fd6565b9060005260206000200154111590506000816129d657858460020184815481106129bc576129bc612fd6565b90600052602060002001546129d19190612f3a565b612a01565b8360020183815481106129eb576129eb612fd6565b906000526020600020015486612a019190612f3a565b905085846002018481548110612a1957612a19612fd6565b600091825260209091200155612a3187848484612a3b565b50505b5050505050565b6000848152600c60205260409020835b8015612af0578154612a5e600183612f3a565b612a6891906130fe565b905083612a9f5782826002018281548110612a8557612a85612fd6565b9060005260206000200154612a9a9190612f3a565b612aca565b82826002018281548110612ab557612ab5612fd6565b9060005260206000200154612aca9190612f4d565b826002018281548110612adf57612adf612fd6565b600091825260209091200155612a4b565b505050505050565b600060208284031215612b0a57600080fd5b5035919050565b6001600160a01b038116811461036b57600080fd5b60008060408385031215612b3957600080fd5b8235612b4481612b11565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612b7957600080fd5b813567ffffffffffffffff80821115612b9457612b94612b52565b604051601f8301601f19908116603f01168101908282118183101715612bbc57612bbc612b52565b81604052838152866020858801011115612bd557600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612c0857600080fd5b82359150602083013567ffffffffffffffff811115612c2657600080fd5b612c3285828601612b68565b9150509250929050565b600080600080600080600080610100898b031215612c5957600080fd5b8835612c6481612b11565b97506020890135612c7481612b11565b965060408901359550606089013594506080890135612c9281612b11565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600080600060608486031215612cc957600080fd5b505081359360208301359350604090920135919050565b60008060408385031215612cf357600080fd5b8235612cfe81612b11565b9150602083013567ffffffffffffffff811115612c2657600080fd5b600060208284031215612d2c57600080fd5b813561137d81612b11565b6020808252825182820181905260009190848201906040850190845b81811015612d785783516001600160601b031683529284019291840191600101612d53565b50909695505050505050565b60008060408385031215612d9757600080fd5b50508035926020909101359150565b6001600160601b038116811461036b57600080fd5b60008060408385031215612dce57600080fd5b8235612dd981612b11565b91506020830135612de981612da6565b809150509250929050565b801515811461036b57600080fd5b60008060008060808587031215612e1857600080fd5b8435612e2381612b11565b93506020850135612e3381612da6565b9250604085013591506060850135612e4a81612df4565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b838152602081018390526060810160088310612e8957612e89612e55565b826040830152949350505050565b6020810160038310612eab57612eab612e55565b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561182957611829612f24565b8082018082111561182957611829612f24565b600060208284031215612f7257600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612fcf57612fcf612f24565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261301157613011612fec565b500690565b808202811582820484141761182957611829612f24565b6000825160005b8181101561304e5760208186018101518583015201613034565b506000920191825250919050565b60008161306b5761306b612f24565b506000190190565b600080600080600080600060e0888a03121561308e57600080fd5b875161309981612da6565b60208901519097506130aa81612df4565b8096505060408801519450606088015193506080880151925060a0880151915060c08801516130d881612df4565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b60008261310d5761310d612fec565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122070cafa237d94a0a535845c96380de621aebe98feb13953eda208afcadd3e163a64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102675760003560e01c80637dc38f1411610144578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b014610731578063dd5e5cb51461077d578063e534710d1461079d578063f216de4c146107d5578063f2f4eb26146107f5578063f6b4d82d1461081557600080fd5b8063c157261814610685578063ccbac9f51461069b578063d09f392d146106b1578063d1c1df48146106d1578063d605787b1461071157600080fd5b8063a2473cc111610108578063a2473cc1146105bc578063a5861b90146105dc578063b1c9fe6e1461060b578063b5d69e9914610639578063b888adfa14610659578063c057eca71461066f57600080fd5b80637dc38f1414610530578063817b1cd214610546578063823cfd701461055c5780638d3771bb1461057c578063965af6c71461059c57600080fd5b8063498c752c116101dd578063543f8a36116101a1578063543f8a361461044c57806356acb050146104795780635a68c1541461048f5780635d2d7846146104a55780636624192f146104c557806376fa9fc51461051057600080fd5b8063498c752c146103c45780634c70a0d6146103e45780634dbbebbc146104045780634f1ef2861461042457806352d1902d1461043757600080fd5b80631b92bbbe1161022f5780631b92bbbe1461031a57806321e1625e1461033057806321ea9b3f1461035057806323f61de41461036e57806335975f4a14610384578063477a655c146103a457600080fd5b8063034327441461026c57806306dfc967146102955780630b274f2e146102b75780630c340a24146102cc5780630e083ec914610304575b600080fd5b34801561027857600080fd5b5061028260065481565b6040519081526020015b60405180910390f35b3480156102a157600080fd5b506102b56102b0366004612af8565b61087f565b005b3480156102c357600080fd5b506102b56108b7565b3480156102d857600080fd5b506000546102ec906001600160a01b031681565b6040516001600160a01b03909116815260200161028c565b34801561031057600080fd5b50610282600a5481565b34801561032657600080fd5b5061028260035481565b34801561033c57600080fd5b506102b561034b366004612b26565b610c8a565b34801561035c57600080fd5b506102b561036b366004612af8565b50565b34801561037a57600080fd5b5061028260105481565b34801561039057600080fd5b506102b561039f366004612af8565b610d2d565b3480156103b057600080fd5b506102b56103bf366004612bf5565b610f6f565b3480156103d057600080fd5b506102b56103df366004612c3c565b611066565b3480156103f057600080fd5b506102ec6103ff366004612cb4565b6111a0565b34801561041057600080fd5b506102b561041f366004612b26565b611384565b6102b5610432366004612ce0565b61146d565b34801561044357600080fd5b50610282611695565b34801561045857600080fd5b5061046c610467366004612d1a565b6116f3565b60405161028c9190612d37565b34801561048557600080fd5b50610282600b5481565b34801561049b57600080fd5b5061028260115481565b3480156104b157600080fd5b506102b56104c0366004612d84565b611791565b3480156104d157600080fd5b506105006104e0366004612d1a565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161028c565b34801561051c57600080fd5b5061028261052b366004612d84565b6117d4565b34801561053c57600080fd5b5061028260095481565b34801561055257600080fd5b5061028260125481565b34801561056857600080fd5b506102b5610577366004612af8565b61182f565b34801561058857600080fd5b506102b5610597366004612af8565b61185e565b3480156105a857600080fd5b506102b56105b7366004612b26565b61188d565b3480156105c857600080fd5b506102826105d7366004612dbb565b611928565b3480156105e857600080fd5b506105fc6105f7366004612e02565b611952565b60405161028c93929190612e6b565b34801561061757600080fd5b5060015461062c90600160a01b900460ff1681565b60405161028c9190612e97565b34801561064557600080fd5b506102b5610654366004612d1a565b61199f565b34801561066557600080fd5b5061028260045481565b34801561067b57600080fd5b5061028260025481565b34801561069157600080fd5b5061028260055481565b3480156106a757600080fd5b5061028260085481565b3480156106bd57600080fd5b506102b56106cc366004612d84565b611a81565b3480156106dd57600080fd5b506106f16106ec366004612dbb565b611abb565b60408051948552602085019390935291830152606082015260800161028c565b34801561071d57600080fd5b506007546102ec906001600160a01b031681565b34801561073d57600080fd5b5061076861074c366004612d1a565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161028c565b34801561078957600080fd5b506102b5610798366004612af8565b611afa565b3480156107a957600080fd5b506102826107b8366004612dbb565b600f60209081526000928352604080842090915290825290205481565b3480156107e157600080fd5b506102b56107f0366004612b26565b611b29565b34801561080157600080fd5b506001546102ec906001600160a01b031681565b34801561082157600080fd5b5061086f610830366004612af8565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161028c9493929190612eb1565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016108a990612ee2565b60405180910390fd5b601055565b6000600154600160a01b900460ff1660028111156108d7576108d7612e55565b03610a45576002546004546108ec9042612f3a565b101561094f5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084016108a9565b6000600654116109b15760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a9565b6007546009546001600160a01b0390911690637363ae1f906109d39043612f4d565b6040518263ffffffff1660e01b81526004016109f191815260200190565b600060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610c3f565b60018054600160a01b900460ff166002811115610a6457610a64612e55565b03610b5c576007546009546005546001600160a01b03909216916313cf905491610a8d91612f4d565b6040518263ffffffff1660e01b8152600401610aab91815260200190565b6020604051808303816000875af1158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190612f60565b6008819055600003610b425760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a9565b600180546002919060ff60a01b1916600160a01b83610a3b565b6002600154600160a01b900460ff166002811115610b7c57610b7c612e55565b03610c3f576006541580610b9e5750600354600454610b9b9042612f3a565b10155b610c315760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a9565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610c8091600160a01b90910460ff1690612e97565b60405180910390a1565b6001546001600160a01b03163314610cb45760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d602052604081206002018054839290610cdf908490612f4d565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610d4d57610d4d612e55565b14610d9a5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a9565b600b54600a541015610dee5760405162461bcd60e51b815260206004820152601c60248201527f4e6f2064656c61796564207374616b6520746f20657865637574652e0000000060448201526064016108a9565b6000600a54600183600b54610e039190612f4d565b610e0d9190612f3a565b11610e185781610e33565b600b54600a54610e289190612f3a565b610e33906001612f4d565b9050600081600b54610e459190612f4d565b600b549091505b81811015610f67576000818152600e6020526040902080546001600160a01b031615610f545760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610ec89490821693600160a01b9092046001600160601b031692909160ff1690600401612eb1565b600060405180830381600087803b158015610ee257600080fd5b505af1158015610ef6573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610f5f81612fbd565b915050610e4c565b50600b555050565b6001546001600160a01b03163314610f995760405162461bcd60e51b81526004016108a990612f79565b6000828152600c6020526040812090610fb183611ba1565b825490915015610ffa5760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a9565b6001811161104a5760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a9565b8155600201805460018101825560009182526020822001555050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff16806110b05750805467ffffffffffffffff808416911610155b156110cd5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155600080546001600160a01b038c81166001600160a01b031992831617909255600180548c841690831617815560028b905560038a90554260045560078054938a16939092169290921790556009869055600b5560108490556011839055805460ff60401b1916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050565b60006002600154600160a01b900460ff1660028111156111c2576111c2612e55565b146111fe5760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a9565b6000848152600c602052604081206002810180549192909161122257611222612fd6565b906000526020600020015460000361123e57600091505061137d565b60008160020160008154811061125657611256612fd6565b90600052602060002001546008548686604051602001611289939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6112ac9190613002565b905060005b600283015483546112c3908390613016565b6112ce906001612f4d565b101561135d5760015b83548111611357576000818386600001546112f29190613016565b6112fc9190612f4d565b9050600085600201828154811061131557611315612fd6565b9060005260206000200154905080851061133a576113338186612f3a565b9450611342565b509150611357565b5050808061134f90612fbd565b9150506112d7565b506112b1565b600081815260048401602052604090205461137790611bbc565b93505050505b9392505050565b6000546001600160a01b031633146113ae5760405162461bcd60e51b81526004016108a990612ee2565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156113ed576113ed612e55565b03611469576007546009546001600160a01b0390911690637363ae1f906114149043612f4d565b6040518263ffffffff1660e01b815260040161143291815260200190565b600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b50504360055550505b5050565b61147682611be7565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806114f457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166114e86000805160206131138339815191525490565b6001600160a01b031614155b156115125760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561156c575060408051601f3d908101601f1916820190925261156991810190612f60565b60015b61159457604051630c76093760e01b81526001600160a01b03831660048201526024016108a9565b60008051602061311383398151915281146115c557604051632a87526960e21b8152600481018290526024016108a9565b6000805160206131138339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611690576000836001600160a01b03168360405161162c919061302d565b600060405180830381855af49150503d8060008114611667576040519150601f19603f3d011682016040523d82523d6000602084013e61166c565b606091505b505090508061168e576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116e05760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061311383398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561178557602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116117425790505b50505050509050919050565b6001546001600160a01b031633146117bb5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb8361305c565b91905055505050565b6000828152600c602090815260408083208484526003810190925282205480830361180457600092505050611829565b81600201818154811061181957611819612fd6565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146118595760405162461bcd60e51b81526004016108a990612ee2565b600255565b6000546001600160a01b031633146118885760405162461bcd60e51b81526004016108a990612ee2565b601155565b6001546001600160a01b031633146118b75760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040812060020180548392906118e2908490612f3a565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610d21565b6000806119358484611c11565b905061194a6001600160601b038416826117d4565b949350505050565b600154600090819081906001600160a01b031633146119835760405162461bcd60e51b81526004016108a990612f79565b61198f87878787611c59565b9199909850909650945050505050565b6001546001600160a01b031633146119c95760405162461bcd60e51b81526004016108a990612f79565b60006119d4826116f3565b80519091505b801561169057600180546001600160a01b03169063fbb519e79085908590611a029086612f3a565b81518110611a1257611a12612fd6565b60200260200101516000806040518563ffffffff1660e01b8152600401611a3c9493929190612eb1565b600060405180830381600087803b158015611a5657600080fd5b505af1158015611a6a573d6000803e3d6000fd5b505050508080611a799061305c565b9150506119da565b6001546001600160a01b03163314611aab5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb83612fbd565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611aed8787611928565b9054949793965094505050565b6000546001600160a01b03163314611b245760405162461bcd60e51b81526004016108a990612ee2565b600355565b6001546001600160a01b03163314611b535760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040902060018101548211611b955781816001016000828254611b8a9190612f3a565b909155506116909050565b60006001820155505050565b60006020825110611bb457506020015190565b506006919050565b600060405160005b6014811015611bdf5783811a81600c84010153600101611bc4565b505192915050565b6000546001600160a01b0316331461036b5760405162461bcd60e51b81526004016108a990612ee2565b600060405160005b6014811015611c34578481600c011a81830153600101611c19565b5060145b6020811015611c505783811a81830153600101611c38565b50519392505050565b600154600090819081906001600160a01b03163314611c8a5760405162461bcd60e51b81526004016108a990612f79565b6000611c968888611928565b9050808611600081611cb157611cac8884612f3a565b611cbb565b611cbb8389612f3a565b6001600160a01b038b166000908152600d60205260409020909150828015611ce1575087155b15611d3e57601054828260010154611cf99190612f4d565b1115611d1357600080600696509650965050505050611db6565b60115482601254611d249190612f4d565b1115611d3e57600080600796509650965050505050611db6565b6000600154600160a01b900460ff166002811115611d5e57611d5e612e55565b03611d9e578215611d86578160126000828254611d7b9190612f4d565b90915550611d9e9050565b8160126000828254611d989190612f3a565b90915550505b611daa8b8b8b8b611dc0565b91985096509450505050505b9450945094915050565b6001600160a01b0384166000908152600d602052604081208190819081611de78989611928565b825490915087158015611e035750600481101580611e03575081155b15611e1b576000806003955095509550505050611db6565b6000600154600160a01b900460ff166002811115611e3b57611e3b612e55565b14611ff557611e4a898b612159565b94506000600e6000600a60008154611e6190612fbd565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611f995760028101805460ff19166001179055611f44848b8b86612410565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611fe7565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060009350611db692505050565b81881061201557866120105761200d838a8a85612410565b95505b61202e565b612021838a8a856124f0565b61202b9086612f4d565b94505b600061203a8b8b611c11565b905060008a5b816120f8576120596001600160601b0382168c856126e7565b6000196001600160601b038216016120745760019150612040565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa1580156120c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e99190613073565b50949550612040945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506000955050505050509450945094915050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b03861684529091528120548015612409576000818152600e60205260409020600281015460ff16156123bc5760006121b38587611928565b905060008183600101546121c79190612f3a565b6001600160a01b0387166000908152600d6020526040902060018101549196508692509082106121f957806001015495505b8581600101600082825461220d9190612f3a565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036123b85780545b80156123b6576001600160601b03891682612282600184612f3a565b8154811061229257612292612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123a457815482906122ce90600190612f3a565b815481106122de576122de612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906123129084612f3a565b8154811061232257612322612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b031602179055508160000180548061236e5761236e6130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123b6565b806123ae8161305c565b915050612266565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561242a57600061243e565b8560010154866002015461243e9190612f3a565b905061244a8184612f4d565b84101561245857600061246d565b806124638486612f3a565b61246d9190612f3a565b9150826000036124b2578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156124c457836124df565b838387600101546124d59190612f3a565b6124df9190612f4d565b866001018190555050949350505050565b60028401546000906125028484612f3a565b61250c9190612f4d565b856001015410612527576125208383612f3a565b905061254d565b846002015485600101541061254d578460020154856001015461254a9190612f3a565b90505b826000036126aa5784545b80156126a8576001600160601b03851686612574600184612f3a565b8154811061258457612584612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03160361269657855486906125c090600190612f3a565b815481106125d0576125d0612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906126049084612f3a565b8154811061261457612614612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b0316021790555085600001805480612660576126606130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556126a8565b806126a08161305c565b915050612558565b505b81856001015410156126bc57826126d7565b828286600101546126cd9190612f3a565b6126d79190612f4d565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036128b45783156128af57600182015460000361280257506002810180546001808201835560009283526020909220810185905590811480159061276157508154612755600183612f3a565b61275f9190613002565b155b156127fd57815460009061277590836130fe565b6000818152600485016020526040812054919250612794846001612f4d565b9050846002018560020184815481106127af576127af612fd6565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b61287d565b60018083018054909161281491612f3a565b8154811061282457612824612fd6565b9060005260206000200154905081600101805480612844576128446130e8565b600190038181906000526020600020016000905590558382600201828154811061287057612870612fd6565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556128af8582600187612a3b565b612a34565b836000036129525760008260020182815481106128d3576128d3612fd6565b9060005260206000200154905060008360020183815481106128f7576128f7612fd6565b600091825260208083209091019290925560018086018054918201815582528282200184905585815260038501825260408082208290558482526004860190925290812081905561294c908790849084612a3b565b50612a34565b81600201818154811061296757612967612fd6565b90600052602060002001548414612a345760008483600201838154811061299057612990612fd6565b9060005260206000200154111590506000816129d657858460020184815481106129bc576129bc612fd6565b90600052602060002001546129d19190612f3a565b612a01565b8360020183815481106129eb576129eb612fd6565b906000526020600020015486612a019190612f3a565b905085846002018481548110612a1957612a19612fd6565b600091825260209091200155612a3187848484612a3b565b50505b5050505050565b6000848152600c60205260409020835b8015612af0578154612a5e600183612f3a565b612a6891906130fe565b905083612a9f5782826002018281548110612a8557612a85612fd6565b9060005260206000200154612a9a9190612f3a565b612aca565b82826002018281548110612ab557612ab5612fd6565b9060005260206000200154612aca9190612f4d565b826002018281548110612adf57612adf612fd6565b600091825260209091200155612a4b565b505050505050565b600060208284031215612b0a57600080fd5b5035919050565b6001600160a01b038116811461036b57600080fd5b60008060408385031215612b3957600080fd5b8235612b4481612b11565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612b7957600080fd5b813567ffffffffffffffff80821115612b9457612b94612b52565b604051601f8301601f19908116603f01168101908282118183101715612bbc57612bbc612b52565b81604052838152866020858801011115612bd557600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612c0857600080fd5b82359150602083013567ffffffffffffffff811115612c2657600080fd5b612c3285828601612b68565b9150509250929050565b600080600080600080600080610100898b031215612c5957600080fd5b8835612c6481612b11565b97506020890135612c7481612b11565b965060408901359550606089013594506080890135612c9281612b11565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600080600060608486031215612cc957600080fd5b505081359360208301359350604090920135919050565b60008060408385031215612cf357600080fd5b8235612cfe81612b11565b9150602083013567ffffffffffffffff811115612c2657600080fd5b600060208284031215612d2c57600080fd5b813561137d81612b11565b6020808252825182820181905260009190848201906040850190845b81811015612d785783516001600160601b031683529284019291840191600101612d53565b50909695505050505050565b60008060408385031215612d9757600080fd5b50508035926020909101359150565b6001600160601b038116811461036b57600080fd5b60008060408385031215612dce57600080fd5b8235612dd981612b11565b91506020830135612de981612da6565b809150509250929050565b801515811461036b57600080fd5b60008060008060808587031215612e1857600080fd5b8435612e2381612b11565b93506020850135612e3381612da6565b9250604085013591506060850135612e4a81612df4565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b838152602081018390526060810160088310612e8957612e89612e55565b826040830152949350505050565b6020810160038310612eab57612eab612e55565b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561182957611829612f24565b8082018082111561182957611829612f24565b600060208284031215612f7257600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612fcf57612fcf612f24565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261301157613011612fec565b500690565b808202811582820484141761182957611829612f24565b6000825160005b8181101561304e5760208186018101518583015201613034565b506000920191825250919050565b60008161306b5761306b612f24565b506000190190565b600080600080600080600060e0888a03121561308e57600080fd5b875161309981612da6565b60208901519097506130aa81612df4565b8096505060408801519450606088015193506080880151925060a0880151915060c08801516130d881612df4565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b60008261310d5761310d612fec565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122070cafa237d94a0a535845c96380de621aebe98feb13953eda208afcadd3e163a64736f6c63430008120033", + "devdoc": { + "details": "A factory of trees that keeps track of staked values for sortition.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeMaxDrawingTime(uint256)": { + "details": "Changes the `maxDrawingTime` storage variable.", + "params": { + "_maxDrawingTime": "The new value for the `maxDrawingTime` storage variable." + } + }, + "changeMinStakingTime(uint256)": { + "details": "Changes the `minStakingTime` storage variable.", + "params": { + "_minStakingTime": "The new value for the `minStakingTime` storage variable." + } + }, + "changeRandomNumberGenerator(address,uint256)": { + "details": "Changes the `_rng` and `_rngLookahead` storage variables.", + "params": { + "_rng": "The new value for the `RNGenerator` storage variable.", + "_rngLookahead": "The new value for the `rngLookahead` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createTree(bytes32,bytes)": { + "details": "Create a sortition sum tree at the specified key.", + "params": { + "_extraData": "Extra data that contains the number of children each node in the tree should have.", + "_key": "The key of the new tree." + } + }, + "draw(bytes32,uint256,uint256)": { + "details": "Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.", + "params": { + "_coreDisputeID": "Index of the dispute in Kleros Core.", + "_key": "The key of the tree.", + "_nonce": "Nonce to hash with random number." + }, + "returns": { + "drawnAddress": "The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended." + } + }, + "executeDelayedStakes(uint256)": { + "details": "Executes the next delayed stakes.", + "params": { + "_iterations": "The number of delayed stakes to execute." + } + }, + "getJurorCourtIDs(address)": { + "details": "Gets the court identifiers where a specific `_juror` has staked.", + "params": { + "_juror": "The address of the juror." + } + }, + "initialize(address,address,uint256,uint256,address,uint256,uint256,uint256)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_core": "The KlerosCore.", + "_governor": "The governor.", + "_maxDrawingTime": "Time after which the drawing phase can be switched", + "_maxStakePerJuror": "The maximum amount of PNK a juror can stake in a court.", + "_maxTotalStaked": "The maximum amount of PNK that can be staked in all courts.", + "_minStakingTime": "Minimal time to stake", + "_rng": "The random number generator.", + "_rngLookahead": "Lookahead value for rng." + } + }, + "notifyRandomNumber(uint256)": { + "details": "Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().", + "params": { + "_randomNumber": "Random number returned by RNG contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setJurorInactive(address)": { + "details": "Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The juror to unstake." + } + }, + "setStake(address,uint96,uint256,bool)": { + "details": "Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The address of the juror.", + "_alreadyTransferred": "True if the tokens were already transferred from juror. Only relevant for delayed stakes.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + }, + "returns": { + "pnkDeposit": "The amount of PNK to be deposited.", + "pnkWithdrawal": "The amount of PNK to be withdrawn.", + "stakingResult": "The result of the staking operation." + } + }, + "stakeOf(address,uint96)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_courtID": "The ID of the court.", + "_juror": "The address of the juror." + }, + "returns": { + "_0": "value The stake of the juror in the court." + } + }, + "stakeOf(bytes32,bytes32)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_ID": "The stake path ID, corresponding to a juror.", + "_key": "The key of the tree, corresponding to a court." + }, + "returns": { + "_0": "The stake of the juror in the court." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "SortitionModuleNeo", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7190, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7193, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)1891" + }, + { + "astId": 7196, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "phase", + "offset": 20, + "slot": "1", + "type": "t_enum(Phase)15925" + }, + { + "astId": 7198, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "minStakingTime", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 7200, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "maxDrawingTime", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 7202, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "lastPhaseChange", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 7204, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "randomNumberRequestBlock", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 7206, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "disputesWithoutJurors", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 7209, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "rng", + "offset": 0, + "slot": "7", + "type": "t_contract(RNG)26598" + }, + { + "astId": 7211, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "randomNumber", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 7213, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "rngLookahead", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 7215, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "delayedStakeWriteIndex", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 7217, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "delayedStakeReadIndex", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 7222, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "sortitionSumTrees", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)7171_storage)" + }, + { + "astId": 7227, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "jurors", + "offset": 0, + "slot": "13", + "type": "t_mapping(t_address,t_struct(Juror)7188_storage)" + }, + { + "astId": 7232, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "delayedStakes", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_uint256,t_struct(DelayedStake)7180_storage)" + }, + { + "astId": 7238, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "latestDelayedStakeIndex", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_mapping(t_uint96,t_uint256))" + }, + { + "astId": 9139, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "maxStakePerJuror", + "offset": 0, + "slot": "16", + "type": "t_uint256" + }, + { + "astId": 9141, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "maxTotalStaked", + "offset": 0, + "slot": "17", + "type": "t_uint256" + }, + { + "astId": 9143, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "totalStaked", + "offset": 0, + "slot": "18", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_array(t_uint96)dyn_storage": { + "base": "t_uint96", + "encoding": "dynamic_array", + "label": "uint96[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)1891": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_contract(RNG)26598": { + "encoding": "inplace", + "label": "contract RNG", + "numberOfBytes": "20" + }, + "t_enum(Phase)15925": { + "encoding": "inplace", + "label": "enum ISortitionModule.Phase", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint96,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint96 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint96,t_uint256)" + }, + "t_mapping(t_address,t_struct(Juror)7188_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SortitionModuleBase.Juror)", + "numberOfBytes": "32", + "value": "t_struct(Juror)7188_storage" + }, + "t_mapping(t_bytes32,t_struct(SortitionSumTree)7171_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct SortitionModuleBase.SortitionSumTree)", + "numberOfBytes": "32", + "value": "t_struct(SortitionSumTree)7171_storage" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(DelayedStake)7180_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct SortitionModuleBase.DelayedStake)", + "numberOfBytes": "32", + "value": "t_struct(DelayedStake)7180_storage" + }, + "t_mapping(t_uint96,t_uint256)": { + "encoding": "mapping", + "key": "t_uint96", + "label": "mapping(uint96 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DelayedStake)7180_storage": { + "encoding": "inplace", + "label": "struct SortitionModuleBase.DelayedStake", + "members": [ + { + "astId": 7173, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7175, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "courtID", + "offset": 20, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 7177, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "stake", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 7179, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "alreadyTransferred", + "offset": 0, + "slot": "2", + "type": "t_bool" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Juror)7188_storage": { + "encoding": "inplace", + "label": "struct SortitionModuleBase.Juror", + "members": [ + { + "astId": 7183, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "courtIDs", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint96)dyn_storage" + }, + { + "astId": 7185, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "stakedPnk", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 7187, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "lockedPnk", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_struct(SortitionSumTree)7171_storage": { + "encoding": "inplace", + "label": "struct SortitionModuleBase.SortitionSumTree", + "members": [ + { + "astId": 7156, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "K", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 7159, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "stack", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 7162, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "nodes", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 7166, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "IDsToNodeIndexes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 7170, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "nodeIndexesToIDs", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_bytes32)" + } + ], + "numberOfBytes": "160" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrum/SortitionModuleNeo_Proxy.json b/contracts/deployments/arbitrum/SortitionModuleNeo_Proxy.json new file mode 100644 index 000000000..69e59cbe8 --- /dev/null +++ b/contracts/deployments/arbitrum/SortitionModuleNeo_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x614498118850184c62f82d08261109334bFB050f", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x4dad2ef2209d6c819bdbc3704034bb913fd74ca1b20e8b187c34baf634b006a0", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x614498118850184c62f82d08261109334bFB050f", + "transactionIndex": 5, + "gasUsed": "6154647", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000002000000000000000000000000000000000000000000000000", + "blockHash": "0xfec7cddde35e0d9bb2699727a0d38cdcd0c4ed98a9309943a606d02cbfb9ad96", + "transactionHash": "0x4dad2ef2209d6c819bdbc3704034bb913fd74ca1b20e8b187c34baf634b006a0", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 190274557, + "transactionHash": "0x4dad2ef2209d6c819bdbc3704034bb913fd74ca1b20e8b187c34baf634b006a0", + "address": "0x614498118850184c62f82d08261109334bFB050f", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "logIndex": 20, + "blockHash": "0xfec7cddde35e0d9bb2699727a0d38cdcd0c4ed98a9309943a606d02cbfb9ad96" + } + ], + "blockNumber": 190274557, + "cumulativeGasUsed": "17302456", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "0x498c752c000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000cd415c03dfa85b02646c7e2977f22a480c4354f100000000000000000000000000000000000000000000000000000000000007080000000000000000000000000000000000000000000000000000000000000708000000000000000000000000c3db344755b15c8edfd834db79af4f8860029fb4000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000006c6b935b8bbd40000000000000000000000000000000000000000000000001a784379d99db42000000" + ], + "numDeployments": 1, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo.json new file mode 100644 index 000000000..b3b457079 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo.json @@ -0,0 +1,1021 @@ +{ + "address": "0xd40aA608801a639E292e10C235B90488D04070b1", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x514a6dd50b1d60ca2a1176c54e682112aad04ccbf90af7b407896754232d74cb", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xd40aA608801a639E292e10C235B90488D04070b1", + "transactionIndex": 2, + "gasUsed": "235697", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000020000000000000000000000000000000000000000080000000000000000000000000000000000200000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x76e6d259eaff2af5e2fc46119bbdc64dc8d00ec8eb45607c57539777b890adff", + "transactionHash": "0x514a6dd50b1d60ca2a1176c54e682112aad04ccbf90af7b407896754232d74cb", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 21125120, + "transactionHash": "0x514a6dd50b1d60ca2a1176c54e682112aad04ccbf90af7b407896754232d74cb", + "address": "0xd40aA608801a639E292e10C235B90488D04070b1", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 1, + "blockHash": "0x76e6d259eaff2af5e2fc46119bbdc64dc8d00ec8eb45607c57539777b890adff" + } + ], + "blockNumber": 21125120, + "cumulativeGasUsed": "397284", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE636AB278fBfc8712E807c589A362dc2396d2d2F", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x0000000000000000000000000000000000000000" + ] + }, + "implementation": "0xE636AB278fBfc8712E807c589A362dc2396d2d2F", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo_Implementation.json new file mode 100644 index 000000000..3bec21096 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo_Implementation.json @@ -0,0 +1,1540 @@ +{ + "address": "0xE636AB278fBfc8712E807c589A362dc2396d2d2F", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8b7648fa0a0889d9fc7b0b4dae53ae7e30fb24cafbf21289acb7629199961820", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xE636AB278fBfc8712E807c589A362dc2396d2d2F", + "transactionIndex": 2, + "gasUsed": "4132371", + "logsBloom": "0x00000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000010000000000000000000000000040000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfb5869c62fcca3c4839f3f1f823d17337d025ba9981fb7d107b4914f40318a11", + "transactionHash": "0x8b7648fa0a0889d9fc7b0b4dae53ae7e30fb24cafbf21289acb7629199961820", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 21125112, + "transactionHash": "0x8b7648fa0a0889d9fc7b0b4dae53ae7e30fb24cafbf21289acb7629199961820", + "address": "0xE636AB278fBfc8712E807c589A362dc2396d2d2F", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 1, + "blockHash": "0xfb5869c62fcca3c4839f3f1f823d17337d025ba9981fb7d107b4914f40318a11" + } + ], + "blockNumber": 21125112, + "cumulativeGasUsed": "4293970", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"CommitCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areCommitsAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areVotesAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_nbVotes\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"jumped\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"getFundedChoices\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"fundedChoices\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"ChoiceFunded(uint256,uint256,uint256)\":{\"details\":\"To be emitted when a choice is fully funded for an appeal.\",\"params\":{\"_choice\":\"The choice that is being funded.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"CommitCast(uint256,address,uint256[],bytes32)\":{\"details\":\"To be emitted when a vote commitment is cast.\",\"params\":{\"_commit\":\"The commitment of the juror.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"The address of the juror casting the vote commitment.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Contribution(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when a funding contribution is made.\",\"params\":{\"_amount\":\"The amount contributed.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"DisputeCreation(uint256,uint256,bytes)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_extraData\":\"The extra data for the dispute.\",\"_numberOfChoices\":\"The number of choices available in the dispute.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}},\"VoteCast(uint256,address,uint256[],uint256,string)\":{\"details\":\"Emitted when casting a vote to provide the justification of juror's choice.\",\"params\":{\"_choice\":\"The choice juror voted for.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"Address of the juror.\",\"_justification\":\"Justification of the choice.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Withdrawal(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when the contributed funds are withdrawn.\",\"params\":{\"_amount\":\"The amount withdrawn.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}}},\"kind\":\"dev\",\"methods\":{\"areCommitsAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their commits for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their commits for the last round.\"}},\"areVotesAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their votes for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their votes for the last round.\"}},\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit. Note that justification string is a part of the commit.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256,string)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_justification\":\"Justification of the choice.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createDispute(uint256,uint256,bytes,uint256)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_nbVotes\":\"Number of votes for this dispute.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_nonce\":\"Nonce of the drawing iteration.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"initialize(address,address)\":{\"details\":\"Initializer.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}},\"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. Note that withdrawals are not possible if the core contract is paused.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core contract.\",\"_coreRoundID\":\"The round in the Kleros Core contract the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCoreBase.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is KlerosCoreBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _guardian The guardian's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n _initialize(\\n _governor,\\n _guardian,\\n _pinakion,\\n _jurorProsecutionModule,\\n _disputeKit,\\n _hiddenVotes,\\n _courtParameters,\\n _timesPerPeriod,\\n _sortitionExtraData,\\n _sortitionModuleAddress\\n );\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n}\\n\",\"keccak256\":\"0x347240e5b541bb5df305e4e6ec8ab324a04effa722af31db03cd1d9fdcd039ec\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title KlerosCoreBase\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\nabstract contract KlerosCoreBase is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 feePerJurorInRound; // The fee per juror in the round.\\n uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private 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 address public guardian; // The guardian able to pause asset withdrawals.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n bool public paused; // Whether asset withdrawals are paused.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event Pause();\\n event Unpause();\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n modifier onlyByGuardianOrGovernor() {\\n if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly();\\n _;\\n }\\n\\n modifier whenPaused() {\\n if (!paused) revert WhenPausedOnly();\\n _;\\n }\\n\\n modifier whenNotPaused() {\\n if (paused) revert WhenNotPausedOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) internal {\\n governor = _governor;\\n guardian = _guardian;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Pause staking and reward execution. Can only be done by guardian or governor.\\n function pause() external onlyByGuardianOrGovernor whenNotPaused {\\n paused = true;\\n emit Pause();\\n }\\n\\n /// @dev Unpause staking and reward execution. Can only be done by governor.\\n function unpause() external onlyByGovernor whenPaused {\\n paused = false;\\n emit Unpause();\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `guardian` storage variable.\\n /// @param _guardian The new value for the `guardian` storage variable.\\n function changeGuardian(address _guardian) external onlyByGovernor {\\n guardian = _guardian;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal virtual returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// Note: Reward distributions are forbidden during pause.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused {\\n Round storage round;\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n round = dispute.rounds[_round];\\n } // stack too deep workaround\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound;\\n uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror;\\n uint256 coherentCount;\\n {\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n } // stack too deep workaround\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRound = _executePenalties(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRound) {\\n round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (stakingResult != StakingResult.Successful) {\\n _stakingFailed(_onError, stakingResult);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError, StakingResult.StakingTransferFailed);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError, StakingResult.UnstakingTransferFailed);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual {\\n if (_onError == OnError.Return) return;\\n if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed();\\n if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed();\\n if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts();\\n if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt();\\n if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error GuardianOrGovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingInTooManyCourts();\\n error StakingNotPossibeInThisCourt();\\n error StakingLessThanCourtMinStake();\\n error StakingTransferFailed();\\n error UnstakingTransferFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n error WhenNotPausedOnly();\\n error WhenPausedOnly();\\n}\\n\",\"keccak256\":\"0xcc0e0ecc6a01f8c2adf8d271e8e928db2f1bcbdbcf3943b08ddf22f087d6ac92\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../KlerosCore.sol\\\";\\nimport \\\"../interfaces/IDisputeKit.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title DisputeKitClassic\\n/// Dispute kit implementation of the Kleros v1 features including:\\n/// - a drawing system: proportional to staked PNK,\\n/// - a vote aggregation system: plurality,\\n/// - an incentive system: equal split between coherent votes,\\n/// - an appeal system: fund 2 choices only, vote on any choice.\\ncontract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n bool jumped; // True if dispute jumped to a parent dispute kit and won't be handled by this DK anymore.\\n mapping(uint256 => uint256) coreRoundIDToLocal; // Maps id of the round in the core contract to the index of the round of related local dispute.\\n bytes extraData; // Extradata for the dispute.\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n uint256 nbVotes; // Maximal number of votes this dispute can get.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\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 /// @dev To be emitted when a dispute is created.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _numberOfChoices The number of choices available in the dispute.\\n /// @param _extraData The extra data for the dispute.\\n event DisputeCreation(uint256 indexed _coreDisputeID, uint256 _numberOfChoices, bytes _extraData);\\n\\n /// @dev To be emitted when a vote commitment is cast.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror The address of the juror casting the vote commitment.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _commit The commitment of the juror.\\n event CommitCast(uint256 indexed _coreDisputeID, address indexed _juror, uint256[] _voteIDs, bytes32 _commit);\\n\\n /// @dev To be emitted when a funding contribution is made.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount contributed.\\n event Contribution(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when the contributed funds are withdrawn.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount withdrawn.\\n event Withdrawal(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when a choice is fully funded for an appeal.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n event ChoiceFunded(uint256 indexed _coreDisputeID, uint256 indexed _coreRoundID, uint256 indexed _choice);\\n\\n // ************************************* //\\n // * 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 modifier notJumped(uint256 _coreDisputeID) {\\n require(!disputes[coreDisputeIDToLocal[_coreDisputeID]].jumped, \\\"Dispute jumped to a parent DK!\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n /// @param _core The KlerosCore arbitrator.\\n function initialize(address _governor, KlerosCore _core) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `core` storage variable.\\n /// @param _core The new value for the `core` storage variable.\\n function changeCore(address _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n /// @param _nbVotes Number of votes for this dispute.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n dispute.extraData = _extraData;\\n\\n // New round in the Core should be created before the dispute creation in DK.\\n dispute.coreRoundIDToLocal[core.getNumberOfRounds(_coreDisputeID) - 1] = dispute.rounds.length;\\n\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = _nbVotes;\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;\\n emit DisputeCreation(_coreDisputeID, _numberOfChoices, _extraData);\\n }\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _nonce Nonce of the drawing iteration.\\n /// @return drawnAddress The drawn address.\\n function draw(\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) external override onlyByCore notJumped(_coreDisputeID) returns (address drawnAddress) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n ISortitionModule sortitionModule = core.sortitionModule();\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n bytes32 key = bytes32(uint256(courtID)); // Get the ID of the tree.\\n\\n // TODO: Handle the situation when no one has staked yet.\\n drawnAddress = sortitionModule.draw(key, _coreDisputeID, _nonce);\\n\\n if (_postDrawCheck(_coreDisputeID, drawnAddress)) {\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n } else {\\n drawnAddress = address(0);\\n }\\n }\\n\\n /// @dev Sets the caller's commit for the specified votes. It can be called multiple times during the\\n /// commit period, each call overrides the commits of the previous one.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _commit The commit. Note that justification string is a part of the commit.\\n function castCommit(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCoreBase.Period.commit, \\\"The dispute should be in Commit period.\\\");\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n emit CommitCast(_coreDisputeID, msg.sender, _voteIDs, _commit);\\n }\\n\\n /// @dev Sets the caller's choices for the specified votes.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _choice The choice.\\n /// @param _salt The salt for the commit if the votes were hidden.\\n /// @param _justification Justification of the choice.\\n function castVote(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt,\\n string memory _justification\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCoreBase.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, bool hiddenVotes, , , , , ) = core.courts(courtID);\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _salt)),\\n \\\"The commit must match the choice in courts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n emit VoteCast(_coreDisputeID, msg.sender, _voteIDs, _choice, _justification);\\n }\\n\\n /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n /// Note that the surplus deposit will be reimbursed.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _choice A choice that receives funding.\\n function fundAppeal(uint256 _coreDisputeID, uint256 _choice) external payable notJumped(_coreDisputeID) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n (uint256 ruling, , ) = this.currentRuling(_coreDisputeID);\\n if (ruling == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n uint256 coreRoundID = core.getNumberOfRounds(_coreDisputeID) - 1;\\n\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_coreDisputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_coreDisputeID, coreRoundID, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_coreDisputeID, coreRoundID, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n if (core.isDisputeKitJumping(_coreDisputeID)) {\\n // Don't create a new round in case of a jump, and remove local dispute from the flow.\\n dispute.jumped = true;\\n } else {\\n // Don't subtract 1 from length since both round arrays haven't been updated yet.\\n dispute.coreRoundIDToLocal[coreRoundID + 1] = dispute.rounds.length;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.nbVotes = core.getNumberOfVotes(_coreDisputeID);\\n newRound.tied = true;\\n }\\n core.appeal{value: appealCost}(_coreDisputeID, dispute.numberOfChoices, dispute.extraData);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n /// Note that withdrawals are not possible if the core contract is paused.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core contract.\\n /// @param _beneficiary The address whose rewards to withdraw.\\n /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from.\\n /// @param _choice The ruling option that the caller wants to withdraw from.\\n /// @return amount The withdrawn amount.\\n function withdrawFeesAndRewards(\\n uint256 _coreDisputeID,\\n address payable _beneficiary,\\n uint256 _coreRoundID,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n (, , , bool isRuled, ) = core.disputes(_coreDisputeID);\\n require(isRuled, \\\"Dispute should be resolved.\\\");\\n require(!core.paused(), \\\"Core is paused\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 finalRuling, , ) = core.currentRuling(_coreDisputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function getFundedChoices(uint256 _coreDisputeID) public view returns (uint256[] memory fundedChoices) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n return lastRound.fundedChoices;\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(\\n uint256 _coreDisputeID\\n ) external view override returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n tied = round.tied;\\n ruling = tied ? 0 : round.winningChoice;\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n // Override the final ruling if only one side funded the appeals.\\n if (period == KlerosCoreBase.Period.execution) {\\n uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID);\\n if (fundedChoices.length == 1) {\\n ruling = fundedChoices[0];\\n tied = false;\\n overridden = true;\\n }\\n }\\n }\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 /* _feePerJuror */,\\n uint256 /* _pnkAtStakePerJuror */\\n ) external view override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (vote.voted && (vote.choice == winningChoice || tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage currentRound = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (currentRound.totalVoted == 0 || (!tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalCommitted == round.votes.length;\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalVoted == round.votes.length;\\n }\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view returns (bool) {\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n uint256 lockedAmountPerJuror = core\\n .getRoundInfo(_coreDisputeID, core.getNumberOfRounds(_coreDisputeID) - 1)\\n .pnkAtStakePerJuror;\\n (uint256 totalStaked, uint256 totalLocked, , ) = core.sortitionModule().getJurorBalance(_juror, courtID);\\n return totalStaked >= totalLocked + lockedAmountPerJuror;\\n }\\n}\\n\",\"keccak256\":\"0x18bacae1d55cb3ebc4fa88cac18b2ce7c444a97b892bfca5d0a8ae38ee50c5f5\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @param _feePerJuror The fee per juror.\\n /// @param _pnkAtStakePerJuror The PNK at stake per juror.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 _feePerJuror,\\n uint256 _pnkAtStakePerJuror\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x72cdf621c11d1d84b851edb1ef7607ac950ba7038154c85005ccc86cdd43e71b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../../libraries/Constants.sol\\\";\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x47960dd772c9dafeefa2e6b9414c7045b5dcc68df735c1fccda6af48ca089858\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// Courts\\nuint96 constant FORKING_COURT = 0; // Index of the forking court.\\nuint96 constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n// Dispute Kits\\nuint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\nuint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n// Sortition Module\\nuint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\nuint256 constant DEFAULT_K = 6; // Default number of children per node.\\n\\n// Defaults\\nuint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\nIERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\\nenum StakingResult {\\n Successful,\\n StakingTransferFailed,\\n UnstakingTransferFailed,\\n CannotStakeInMoreCourts,\\n CannotStakeInThisCourt,\\n CannotStakeLessThanMinStake,\\n CannotStakeMoreThanMaxStakePerJuror,\\n CannotStakeMoreThanMaxTotalStaked\\n}\\n\",\"keccak256\":\"0xdc648a85f2816fa323e9f7f4accac3d9384187d0123bdfb1f9b89ce25ea64679\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051613eeb6200010360003960008181611588015281816115b101526117a90152613eeb6000f3fe6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c157806352d1902d146102d4578063564a565d146102e95780635c92e2f61461031857806365540b9614610338578063675926f61461036557806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a2366004613186565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f366004613186565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a366004613186565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046131b4565b610785565b34801561029857600080fd5b506102ac6102a73660046131f1565b610c10565b005b6102ac6102bc36600461322a565b610d0d565b6102ac6102cf366004613339565b611574565b3480156102e057600080fd5b5061022161179c565b3480156102f557600080fd5b50610309610304366004613186565b6117fa565b6040516101b3939291906133d8565b34801561032457600080fd5b506102ac610333366004613444565b6118c0565b34801561034457600080fd5b50610358610353366004613186565b611bcd565b6040516101b39190613496565b34801561037157600080fd5b506102216103803660046134da565b611c91565b34801561039157600080fd5b506103a56103a0366004613515565b611dd6565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed366004613186565b611e8e565b3480156103fe57600080fd5b506102ac61040d366004613541565b611f05565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac610443366004613599565b611fd1565b34801561045457600080fd5b506102ac610463366004613631565b6126ac565b34801561047457600080fd5b50610488610483366004613515565b6126f8565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461364e565b6127be565b3480156104f657600080fd5b506101a7610505366004613515565b612993565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b36600461322a565b612a2e565b34801561054c57600080fd5b5061022161055b36600461322a565b612d37565b34801561056c57600080fd5b506102ac61057b366004613631565b612e8a565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46136d5565b600091825260208220600590910201805490925082906105e690600190613701565b815481106105f6576105f66136d5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436136d5565b6000918252602082206005909102018054909250829061066590600190613701565b81548110610675576106756136d5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613740565b5090935060049250610726915050565b816004811115610738576107386137a7565b0361077b57600061074888611bcd565b905080516001036107795780600081518110610766576107666136d5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613740565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600160009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906137bd565b156109045760405162461bcd60e51b815260206004820152600e60248201526d10dbdc99481a5cc81c185d5cd95960921b6044820152606401610846565b600086815260036020526040812054600280549091908110610928576109286136d5565b6000918252602080832088845260036005909302019182019052604082205481549193508391811061095c5761095c6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db91906137d8565b5050600087815260078401602052604090205490915060ff16610a25576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610b6a565b808603610a9a576000868152600683016020526040902054610a48576000610a93565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b8652909352922054610a899190613814565b610a93919061382b565b9450610b6a565b600081815260078301602052604090205460ff16610b6a5781600601600083600a01600181548110610ace57610ace6136d5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610b0457610b046136d5565b9060005260206000200154815260200190815260200160002054610b28919061384d565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610b5d9190613814565b610b67919061382b565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610c04576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610c59575080546001600160401b03808416911610155b15610c765760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610d3157610d316136d5565b600091825260209091206002600590920201015460ff1615610d655760405162461bcd60e51b815260040161084690613860565b600083815260036020526040812054600280549091908110610d8957610d896136d5565b906000526020600020906005020190508060010154831115610ded5760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190613897565b91509150814210158015610e7157508042105b610eb65760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b91906137d8565b50509050868103610f30576127109150610fb1565b612710611388610f408686613701565b610f4a9190613814565b610f54919061382b565b610f5e8542613701565b10610fab5760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610fc490600190613701565b81548110610fd457610fd46136d5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015611033573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105791906138bb565b6110619190613701565b60008a815260078401602052604090205490915060ff16156110c55760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561110f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113391906138bb565b905060006127106111448784613814565b61114e919061382b565b611158908361384d565b60008c8152600686016020526040812054919250908211156112095760008c815260068601602052604090205434906111919084613701565b116111b65760008c81526006860160205260409020546111b19083613701565b6111b8565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f85604051611200929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061123590849061384d565b909155505060008c81526006860160205260408120805483929061125a90849061384d565b909155505060008c8152600686016020526040902054821161132c5760008c81526006860160205260408120546009870180549192909161129c90849061384d565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611537578285600901546113499190613701565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906137bd565b156113d45760028a01805460ff191660011790556114b7565b895460038b0160006113e787600161384d565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161146291815260200190565b602060405180830381865afa15801561147f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a391906138bb565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b81526004016115049392919061390e565b6000604051808303818588803b15801561151d57600080fd5b505af1158015611531573d6000803e3d6000fd5b50505050505b8034111561156557336108fc61154d8334613701565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b61157d82612ed6565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806115fb57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115ef600080516020613e968339815191525490565b6001600160a01b031614155b156116195760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611673575060408051601f3d908101601f19168201909252611670918101906138bb565b60015b61169b57604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613e9683398151915281146116cc57604051632a87526960e21b815260048101829052602401610846565b600080516020613e968339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611797576000836001600160a01b03168360405161173391906139a8565b600060405180830381855af49150503d806000811461176e576040519150601f19603f3d011682016040523d82523d6000602084013e611773565b606091505b5050905080611795576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117e75760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613e9683398151915290565b6002818154811061180a57600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff909116929161183d906138d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611869906138d4565b80156118b65780601f1061188b576101008083540402835291602001916118b6565b820191906000526020600020905b81548152906001019060200180831161189957829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118e4576118e46136d5565b600091825260209091206002600590920201015460ff16156119185760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611962573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119869190613740565b5090935060019250611996915050565b8160048111156119a8576119a86137a7565b14611a055760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611a425760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611a6657611a666136d5565b60009182526020822060059091020180549092508290611a8890600190613701565b81548110611a9857611a986136d5565b90600052602060002090600c0201905060005b86811015611b66573382898984818110611ac757611ac76136d5565b9050602002013581548110611ade57611ade6136d5565b60009182526020909120600490910201546001600160a01b031614611b155760405162461bcd60e51b8152600401610846906139c4565b8582898984818110611b2957611b296136d5565b9050602002013581548110611b4057611b406136d5565b600091825260209091206001600490920201015580611b5e816139fb565b915050611aab565b5086869050816005016000828254611b7e919061384d565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611bbb908b908b908b90613a46565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611bf357611bf36136d5565b60009182526020822060059091020180549092508290611c1590600190613701565b81548110611c2557611c256136d5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c8357602002820191906000526020600020905b815481526020019060010190808311611c6f575b505050505092505050919050565b600085815260036020526040812054600280548392908110611cb557611cb56136d5565b60009182526020808320898452600360059093020191820190526040822054815491935083918110611ce957611ce96136d5565b90600052602060002090600c02016000018681548110611d0b57611d0b6136d5565b600091825260208220600154604051631c3db16d60e01b815260048082018e905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8d91906137d8565b506003850154919350915060ff168015611db157508183600201541480611db15750805b15611dc457612710945050505050611dcd565b60009450505050505b95945050505050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611e0757611e076136d5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611e3b57611e3b6136d5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611eb257611eb26136d5565b60009182526020822060059091020180549092508290611ed490600190613701565b81548110611ee457611ee46136d5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611f2f5760405162461bcd60e51b815260040161084690613a6a565b6000836001600160a01b03168383604051611f4a91906139a8565b60006040518083038185875af1925050503d8060008114611f87576040519150601f19603f3d011682016040523d82523d6000602084013e611f8c565b606091505b50509050806117955760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611ff557611ff56136d5565b600091825260209091206002600590920201015460ff16156120295760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120979190613740565b50909350600292506120a7915050565b8160048111156120b9576120b96137a7565b146121145760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b856121565760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b60008881526003602052604081205460028054909190811061217a5761217a6136d5565b9060005260206000209060050201905080600101548611156121d55760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b805460009082906121e890600190613701565b815481106121f8576121f86136d5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa158015612253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122779190613740565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa1580156122d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f69190613aac565b505050505091505060005b8a8110156125725733848d8d8481811061231d5761231d6136d5565b9050602002013581548110612334576123346136d5565b60009182526020909120600490910201546001600160a01b03161461236b5760405162461bcd60e51b8152600401610846906139c4565b8115806123de575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106123b3576123b36136d5565b90506020020135815481106123ca576123ca6136d5565b906000526020600020906004020160010154145b6124505760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c83818110612463576124636136d5565b905060200201358154811061247a5761247a6136d5565b600091825260209091206003600490920201015460ff16156124d35760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d848181106124e7576124e76136d5565b90506020020135815481106124fe576124fe6136d5565b60009182526020909120600260049092020101556001848d8d84818110612527576125276136d5565b905060200201358154811061253e5761253e6136d5565b60009182526020909120600490910201600301805460ff19169115159190911790558061256a816139fb565b915050612301565b508a8a905083600401600082825461258a919061384d565b90915550506000898152600284016020526040812080548c92906125af90849061384d565b9091555050600183015489036125de57600383015460ff16156125d95760038301805460ff191690555b612657565b60018301546000908152600284016020526040808220548b83529120540361262057600383015460ff166125d95760038301805460ff19166001179055612657565b60018301546000908152600284016020526040808220548b83529120541115612657576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c60405161269693929190613b16565b60405180910390a4505050505050505050505050565b6000546001600160a01b031633146126d65760405162461bcd60e51b815260040161084690613a6a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a81526020019081526020016000205481548110612726576127266136d5565b600091825260208083208a845260036005909302019182019052604082205481549193508391811061275a5761275a6136d5565b90600052602060002090600c0201600001878154811061277c5761277c6136d5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127e85760405162461bcd60e51b815260040161084690613b46565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad201612873858783613bd8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156128ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ee91906138bb565b6128f89190613701565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890612981908a908a908a90613c98565b60405180910390a25050505050505050565b6000838152600360205260408120546002805483929081106129b7576129b76136d5565b600091825260208083208784526003600590930201918201905260408220548154919350839181106129eb576129eb6136d5565b90600052602060002090600c02016000018481548110612a0d57612a0d6136d5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b03163314612a5b5760405162461bcd60e51b815260040161084690613b46565b600083815260036020526040902054600280548592908110612a7f57612a7f6136d5565b600091825260209091206002600590920201015460ff1615612ab35760405162461bcd60e51b815260040161084690613860565b600084815260036020526040812054600280549091908110612ad757612ad76136d5565b60009182526020822060059091020180549092508290612af990600190613701565b81548110612b0957612b096136d5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b929190613cce565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c059190613740565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612c69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8d9190613cce565b9650612c998988612f03565b15612d2657604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612d2b565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612d5b57612d5b6136d5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612d8f57612d8f6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1291906137d8565b5091509150826004015460001480612e41575080158015612e4157506000828152600284016020526040902054155b15612e53576000945050505050612e84565b8015612e68575050600401549150612e849050565b506000908152600290910160205260409020549150612e849050565b92915050565b6000546001600160a01b03163314612eb45760405162461bcd60e51b815260040161084690613a6a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612f005760405162461bcd60e51b815260040161084690613a6a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f759190613740565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ff891906138bb565b6130029190613701565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015613043573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261306b9190810190613d7e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130eb9190613cce565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa158015613142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131669190613e5f565b5050915091508281613178919061384d565b909110159695505050505050565b60006020828403121561319857600080fd5b5035919050565b6001600160a01b0381168114612f0057600080fd5b600080600080608085870312156131ca57600080fd5b8435935060208501356131dc8161319f565b93969395505050506040820135916060013590565b6000806040838503121561320457600080fd5b823561320f8161319f565b9150602083013561321f8161319f565b809150509250929050565b6000806040838503121561323d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156132855761328561324c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156132b3576132b361324c565b604052919050565b60006001600160401b038311156132d4576132d461324c565b6132e7601f8401601f191660200161328b565b90508281528383830111156132fb57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261332357600080fd5b613332838335602085016132bb565b9392505050565b6000806040838503121561334c57600080fd5b82356133578161319f565b915060208301356001600160401b0381111561337257600080fd5b61337e85828601613312565b9150509250929050565b60005b838110156133a357818101518382015260200161338b565b50506000910152565b600081518084526133c4816020860160208601613388565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000611dcd60608301846133ac565b60008083601f84011261340b57600080fd5b5081356001600160401b0381111561342257600080fd5b6020830191508360208260051b850101111561343d57600080fd5b9250929050565b6000806000806060858703121561345a57600080fd5b8435935060208501356001600160401b0381111561347757600080fd5b613483878288016133f9565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b818110156134ce578351835292840192918401916001016134b2565b50909695505050505050565b600080600080600060a086880312156134f257600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60008060006060848603121561352a57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561355657600080fd5b83356135618161319f565b92506020840135915060408401356001600160401b0381111561358357600080fd5b61358f86828701613312565b9150509250925092565b60008060008060008060a087890312156135b257600080fd5b8635955060208701356001600160401b03808211156135d057600080fd5b6135dc8a838b016133f9565b90975095506040890135945060608901359350608089013591508082111561360357600080fd5b508701601f8101891361361557600080fd5b613624898235602084016132bb565b9150509295509295509295565b60006020828403121561364357600080fd5b81356133328161319f565b60008060008060006080868803121561366657600080fd5b853594506020860135935060408601356001600160401b038082111561368b57600080fd5b818801915088601f83011261369f57600080fd5b8135818111156136ae57600080fd5b8960208285010111156136c057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612e8457612e846136eb565b80516001600160601b038116811461372b57600080fd5b919050565b8051801515811461372b57600080fd5b600080600080600060a0868803121561375857600080fd5b61376186613714565b945060208601516137718161319f565b60408701519094506005811061378657600080fd5b925061379460608701613730565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156137cf57600080fd5b61333282613730565b6000806000606084860312156137ed57600080fd5b835192506137fd60208501613730565b915061380b60408501613730565b90509250925092565b8082028115828204841417612e8457612e846136eb565b60008261384857634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612e8457612e846136eb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b600080604083850312156138aa57600080fd5b505080516020909101519092909150565b6000602082840312156138cd57600080fd5b5051919050565b600181811c908216806138e857607f821691505b60208210810361390857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461392e816138d4565b8060608701526080600180841660008114613950576001811461396a57613998565b60ff1985168984015283151560051b890183019550613998565b896000528660002060005b858110156139905781548b8201860152908301908801613975565b8a0184019650505b50939a9950505050505050505050565b600082516139ba818460208701613388565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b600060018201613a0d57613a0d6136eb565b5060010190565b81835260006001600160fb1b03831115613a2d57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000613a5a604083018587613a14565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a031215613ac757600080fd5b613ad088613714565b9650613ade60208901613730565b955060408801519450606088015193506080880151925060a08801519150613b0860c08901613730565b905092959891949750929550565b604081526000613b2a604083018587613a14565b8281036020840152613b3c81856133ac565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f82111561179757600081815260208120601f850160051c81016020861015613bb15750805b601f850160051c820191505b81811015613bd057828155600101613bbd565b505050505050565b6001600160401b03831115613bef57613bef61324c565b613c0383613bfd83546138d4565b83613b8a565b6000601f841160018114613c375760008515613c1f5750838201355b600019600387901b1c1916600186901b178355613c91565b600083815260209020601f19861690835b82811015613c685786850135825560209485019460019092019101613c48565b5086821015613c855760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613ce057600080fd5b81516133328161319f565b600082601f830112613cfc57600080fd5b815160206001600160401b03821115613d1757613d1761324c565b8160051b613d2682820161328b565b9283528481018201928281019087851115613d4057600080fd5b83870192505b84831015613d68578251613d598161319f565b82529183019190830190613d46565b979650505050505050565b805161372b8161319f565b600060208284031215613d9057600080fd5b81516001600160401b0380821115613da757600080fd5b908301906101608286031215613dbc57600080fd5b613dc4613262565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613e0c57600080fd5b613e1887828601613ceb565b60c08301525060e0838101519082015261010080840151908201526101209150613e43828401613d73565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613e7557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220c0a3954a9a165d1e4e7405b5d4e168cd44b7982e63ca7cd0a2c7346976035acd64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c157806352d1902d146102d4578063564a565d146102e95780635c92e2f61461031857806365540b9614610338578063675926f61461036557806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a2366004613186565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f366004613186565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a366004613186565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046131b4565b610785565b34801561029857600080fd5b506102ac6102a73660046131f1565b610c10565b005b6102ac6102bc36600461322a565b610d0d565b6102ac6102cf366004613339565b611574565b3480156102e057600080fd5b5061022161179c565b3480156102f557600080fd5b50610309610304366004613186565b6117fa565b6040516101b3939291906133d8565b34801561032457600080fd5b506102ac610333366004613444565b6118c0565b34801561034457600080fd5b50610358610353366004613186565b611bcd565b6040516101b39190613496565b34801561037157600080fd5b506102216103803660046134da565b611c91565b34801561039157600080fd5b506103a56103a0366004613515565b611dd6565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed366004613186565b611e8e565b3480156103fe57600080fd5b506102ac61040d366004613541565b611f05565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac610443366004613599565b611fd1565b34801561045457600080fd5b506102ac610463366004613631565b6126ac565b34801561047457600080fd5b50610488610483366004613515565b6126f8565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461364e565b6127be565b3480156104f657600080fd5b506101a7610505366004613515565b612993565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b36600461322a565b612a2e565b34801561054c57600080fd5b5061022161055b36600461322a565b612d37565b34801561056c57600080fd5b506102ac61057b366004613631565b612e8a565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46136d5565b600091825260208220600590910201805490925082906105e690600190613701565b815481106105f6576105f66136d5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436136d5565b6000918252602082206005909102018054909250829061066590600190613701565b81548110610675576106756136d5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613740565b5090935060049250610726915050565b816004811115610738576107386137a7565b0361077b57600061074888611bcd565b905080516001036107795780600081518110610766576107666136d5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613740565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600160009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906137bd565b156109045760405162461bcd60e51b815260206004820152600e60248201526d10dbdc99481a5cc81c185d5cd95960921b6044820152606401610846565b600086815260036020526040812054600280549091908110610928576109286136d5565b6000918252602080832088845260036005909302019182019052604082205481549193508391811061095c5761095c6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db91906137d8565b5050600087815260078401602052604090205490915060ff16610a25576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610b6a565b808603610a9a576000868152600683016020526040902054610a48576000610a93565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b8652909352922054610a899190613814565b610a93919061382b565b9450610b6a565b600081815260078301602052604090205460ff16610b6a5781600601600083600a01600181548110610ace57610ace6136d5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610b0457610b046136d5565b9060005260206000200154815260200190815260200160002054610b28919061384d565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610b5d9190613814565b610b67919061382b565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610c04576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610c59575080546001600160401b03808416911610155b15610c765760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610d3157610d316136d5565b600091825260209091206002600590920201015460ff1615610d655760405162461bcd60e51b815260040161084690613860565b600083815260036020526040812054600280549091908110610d8957610d896136d5565b906000526020600020906005020190508060010154831115610ded5760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190613897565b91509150814210158015610e7157508042105b610eb65760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b91906137d8565b50509050868103610f30576127109150610fb1565b612710611388610f408686613701565b610f4a9190613814565b610f54919061382b565b610f5e8542613701565b10610fab5760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610fc490600190613701565b81548110610fd457610fd46136d5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015611033573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105791906138bb565b6110619190613701565b60008a815260078401602052604090205490915060ff16156110c55760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561110f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113391906138bb565b905060006127106111448784613814565b61114e919061382b565b611158908361384d565b60008c8152600686016020526040812054919250908211156112095760008c815260068601602052604090205434906111919084613701565b116111b65760008c81526006860160205260409020546111b19083613701565b6111b8565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f85604051611200929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f84529091528120805483929061123590849061384d565b909155505060008c81526006860160205260408120805483929061125a90849061384d565b909155505060008c8152600686016020526040902054821161132c5760008c81526006860160205260408120546009870180549192909161129c90849061384d565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611537578285600901546113499190613701565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906137bd565b156113d45760028a01805460ff191660011790556114b7565b895460038b0160006113e787600161384d565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b815260040161146291815260200190565b602060405180830381865afa15801561147f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a391906138bb565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b81526004016115049392919061390e565b6000604051808303818588803b15801561151d57600080fd5b505af1158015611531573d6000803e3d6000fd5b50505050505b8034111561156557336108fc61154d8334613701565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b61157d82612ed6565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806115fb57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115ef600080516020613e968339815191525490565b6001600160a01b031614155b156116195760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611673575060408051601f3d908101601f19168201909252611670918101906138bb565b60015b61169b57604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613e9683398151915281146116cc57604051632a87526960e21b815260048101829052602401610846565b600080516020613e968339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611797576000836001600160a01b03168360405161173391906139a8565b600060405180830381855af49150503d806000811461176e576040519150601f19603f3d011682016040523d82523d6000602084013e611773565b606091505b5050905080611795576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117e75760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613e9683398151915290565b6002818154811061180a57600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff909116929161183d906138d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611869906138d4565b80156118b65780601f1061188b576101008083540402835291602001916118b6565b820191906000526020600020905b81548152906001019060200180831161189957829003601f168201915b5050505050905083565b6000848152600360205260409020546002805486929081106118e4576118e46136d5565b600091825260209091206002600590920201015460ff16156119185760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611962573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119869190613740565b5090935060019250611996915050565b8160048111156119a8576119a86137a7565b14611a055760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611a425760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611a6657611a666136d5565b60009182526020822060059091020180549092508290611a8890600190613701565b81548110611a9857611a986136d5565b90600052602060002090600c0201905060005b86811015611b66573382898984818110611ac757611ac76136d5565b9050602002013581548110611ade57611ade6136d5565b60009182526020909120600490910201546001600160a01b031614611b155760405162461bcd60e51b8152600401610846906139c4565b8582898984818110611b2957611b296136d5565b9050602002013581548110611b4057611b406136d5565b600091825260209091206001600490920201015580611b5e816139fb565b915050611aab565b5086869050816005016000828254611b7e919061384d565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611bbb908b908b908b90613a46565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611bf357611bf36136d5565b60009182526020822060059091020180549092508290611c1590600190613701565b81548110611c2557611c256136d5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611c8357602002820191906000526020600020905b815481526020019060010190808311611c6f575b505050505092505050919050565b600085815260036020526040812054600280548392908110611cb557611cb56136d5565b60009182526020808320898452600360059093020191820190526040822054815491935083918110611ce957611ce96136d5565b90600052602060002090600c02016000018681548110611d0b57611d0b6136d5565b600091825260208220600154604051631c3db16d60e01b815260048082018e905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015611d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8d91906137d8565b506003850154919350915060ff168015611db157508183600201541480611db15750805b15611dc457612710945050505050611dcd565b60009450505050505b95945050505050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611e0757611e076136d5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611e3b57611e3b6136d5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611eb257611eb26136d5565b60009182526020822060059091020180549092508290611ed490600190613701565b81548110611ee457611ee46136d5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611f2f5760405162461bcd60e51b815260040161084690613a6a565b6000836001600160a01b03168383604051611f4a91906139a8565b60006040518083038185875af1925050503d8060008114611f87576040519150601f19603f3d011682016040523d82523d6000602084013e611f8c565b606091505b50509050806117955760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611ff557611ff56136d5565b600091825260209091206002600590920201015460ff16156120295760405162461bcd60e51b815260040161084690613860565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120979190613740565b50909350600292506120a7915050565b8160048111156120b9576120b96137a7565b146121145760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b856121565760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b60008881526003602052604081205460028054909190811061217a5761217a6136d5565b9060005260206000209060050201905080600101548611156121d55760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b805460009082906121e890600190613701565b815481106121f8576121f86136d5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa158015612253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122779190613740565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa1580156122d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f69190613aac565b505050505091505060005b8a8110156125725733848d8d8481811061231d5761231d6136d5565b9050602002013581548110612334576123346136d5565b60009182526020909120600490910201546001600160a01b03161461236b5760405162461bcd60e51b8152600401610846906139c4565b8115806123de575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106123b3576123b36136d5565b90506020020135815481106123ca576123ca6136d5565b906000526020600020906004020160010154145b6124505760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c83818110612463576124636136d5565b905060200201358154811061247a5761247a6136d5565b600091825260209091206003600490920201015460ff16156124d35760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d848181106124e7576124e76136d5565b90506020020135815481106124fe576124fe6136d5565b60009182526020909120600260049092020101556001848d8d84818110612527576125276136d5565b905060200201358154811061253e5761253e6136d5565b60009182526020909120600490910201600301805460ff19169115159190911790558061256a816139fb565b915050612301565b508a8a905083600401600082825461258a919061384d565b90915550506000898152600284016020526040812080548c92906125af90849061384d565b9091555050600183015489036125de57600383015460ff16156125d95760038301805460ff191690555b612657565b60018301546000908152600284016020526040808220548b83529120540361262057600383015460ff166125d95760038301805460ff19166001179055612657565b60018301546000908152600284016020526040808220548b83529120541115612657576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c60405161269693929190613b16565b60405180910390a4505050505050505050505050565b6000546001600160a01b031633146126d65760405162461bcd60e51b815260040161084690613a6a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a81526020019081526020016000205481548110612726576127266136d5565b600091825260208083208a845260036005909302019182019052604082205481549193508391811061275a5761275a6136d5565b90600052602060002090600c0201600001878154811061277c5761277c6136d5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127e85760405162461bcd60e51b815260040161084690613b46565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad201612873858783613bd8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa1580156128ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ee91906138bb565b6128f89190613701565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab5810890612981908a908a908a90613c98565b60405180910390a25050505050505050565b6000838152600360205260408120546002805483929081106129b7576129b76136d5565b600091825260208083208784526003600590930201918201905260408220548154919350839181106129eb576129eb6136d5565b90600052602060002090600c02016000018481548110612a0d57612a0d6136d5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b03163314612a5b5760405162461bcd60e51b815260040161084690613b46565b600083815260036020526040902054600280548592908110612a7f57612a7f6136d5565b600091825260209091206002600590920201015460ff1615612ab35760405162461bcd60e51b815260040161084690613860565b600084815260036020526040812054600280549091908110612ad757612ad76136d5565b60009182526020822060059091020180549092508290612af990600190613701565b81548110612b0957612b096136d5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b929190613cce565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c059190613740565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612c69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8d9190613cce565b9650612c998988612f03565b15612d2657604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612d2b565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612d5b57612d5b6136d5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612d8f57612d8f6136d5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1291906137d8565b5091509150826004015460001480612e41575080158015612e4157506000828152600284016020526040902054155b15612e53576000945050505050612e84565b8015612e68575050600401549150612e849050565b506000908152600290910160205260409020549150612e849050565b92915050565b6000546001600160a01b03163314612eb45760405162461bcd60e51b815260040161084690613a6a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612f005760405162461bcd60e51b815260040161084690613a6a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f759190613740565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ff891906138bb565b6130029190613701565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015613043573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261306b9190810190613d7e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130eb9190613cce565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa158015613142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131669190613e5f565b5050915091508281613178919061384d565b909110159695505050505050565b60006020828403121561319857600080fd5b5035919050565b6001600160a01b0381168114612f0057600080fd5b600080600080608085870312156131ca57600080fd5b8435935060208501356131dc8161319f565b93969395505050506040820135916060013590565b6000806040838503121561320457600080fd5b823561320f8161319f565b9150602083013561321f8161319f565b809150509250929050565b6000806040838503121561323d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156132855761328561324c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156132b3576132b361324c565b604052919050565b60006001600160401b038311156132d4576132d461324c565b6132e7601f8401601f191660200161328b565b90508281528383830111156132fb57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261332357600080fd5b613332838335602085016132bb565b9392505050565b6000806040838503121561334c57600080fd5b82356133578161319f565b915060208301356001600160401b0381111561337257600080fd5b61337e85828601613312565b9150509250929050565b60005b838110156133a357818101518382015260200161338b565b50506000910152565b600081518084526133c4816020860160208601613388565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000611dcd60608301846133ac565b60008083601f84011261340b57600080fd5b5081356001600160401b0381111561342257600080fd5b6020830191508360208260051b850101111561343d57600080fd5b9250929050565b6000806000806060858703121561345a57600080fd5b8435935060208501356001600160401b0381111561347757600080fd5b613483878288016133f9565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b818110156134ce578351835292840192918401916001016134b2565b50909695505050505050565b600080600080600060a086880312156134f257600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60008060006060848603121561352a57600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561355657600080fd5b83356135618161319f565b92506020840135915060408401356001600160401b0381111561358357600080fd5b61358f86828701613312565b9150509250925092565b60008060008060008060a087890312156135b257600080fd5b8635955060208701356001600160401b03808211156135d057600080fd5b6135dc8a838b016133f9565b90975095506040890135945060608901359350608089013591508082111561360357600080fd5b508701601f8101891361361557600080fd5b613624898235602084016132bb565b9150509295509295509295565b60006020828403121561364357600080fd5b81356133328161319f565b60008060008060006080868803121561366657600080fd5b853594506020860135935060408601356001600160401b038082111561368b57600080fd5b818801915088601f83011261369f57600080fd5b8135818111156136ae57600080fd5b8960208285010111156136c057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612e8457612e846136eb565b80516001600160601b038116811461372b57600080fd5b919050565b8051801515811461372b57600080fd5b600080600080600060a0868803121561375857600080fd5b61376186613714565b945060208601516137718161319f565b60408701519094506005811061378657600080fd5b925061379460608701613730565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000602082840312156137cf57600080fd5b61333282613730565b6000806000606084860312156137ed57600080fd5b835192506137fd60208501613730565b915061380b60408501613730565b90509250925092565b8082028115828204841417612e8457612e846136eb565b60008261384857634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612e8457612e846136eb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b600080604083850312156138aa57600080fd5b505080516020909101519092909150565b6000602082840312156138cd57600080fd5b5051919050565b600181811c908216806138e857607f821691505b60208210810361390857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461392e816138d4565b8060608701526080600180841660008114613950576001811461396a57613998565b60ff1985168984015283151560051b890183019550613998565b896000528660002060005b858110156139905781548b8201860152908301908801613975565b8a0184019650505b50939a9950505050505050505050565b600082516139ba818460208701613388565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b600060018201613a0d57613a0d6136eb565b5060010190565b81835260006001600160fb1b03831115613a2d57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000613a5a604083018587613a14565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a031215613ac757600080fd5b613ad088613714565b9650613ade60208901613730565b955060408801519450606088015193506080880151925060a08801519150613b0860c08901613730565b905092959891949750929550565b604081526000613b2a604083018587613a14565b8281036020840152613b3c81856133ac565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f82111561179757600081815260208120601f850160051c81016020861015613bb15750805b601f850160051c820191505b81811015613bd057828155600101613bbd565b505050505050565b6001600160401b03831115613bef57613bef61324c565b613c0383613bfd83546138d4565b83613b8a565b6000601f841160018114613c375760008515613c1f5750838201355b600019600387901b1c1916600186901b178355613c91565b600083815260209020601f19861690835b82811015613c685786850135825560209485019460019092019101613c48565b5086821015613c855760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613ce057600080fd5b81516133328161319f565b600082601f830112613cfc57600080fd5b815160206001600160401b03821115613d1757613d1761324c565b8160051b613d2682820161328b565b9283528481018201928281019087851115613d4057600080fd5b83870192505b84831015613d68578251613d598161319f565b82529183019190830190613d46565b979650505050505050565b805161372b8161319f565b600060208284031215613d9057600080fd5b81516001600160401b0380821115613da757600080fd5b908301906101608286031215613dbc57600080fd5b613dc4613262565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613e0c57600080fd5b613e1887828601613ceb565b60c08301525060e0838101519082015261010080840151908201526101209150613e43828401613d73565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613e7557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220c0a3954a9a165d1e4e7405b5d4e168cd44b7982e63ca7cd0a2c7346976035acd64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "ChoiceFunded(uint256,uint256,uint256)": { + "details": "To be emitted when a choice is fully funded for an appeal.", + "params": { + "_choice": "The choice that is being funded.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "CommitCast(uint256,address,uint256[],bytes32)": { + "details": "To be emitted when a vote commitment is cast.", + "params": { + "_commit": "The commitment of the juror.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "The address of the juror casting the vote commitment.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Contribution(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when a funding contribution is made.", + "params": { + "_amount": "The amount contributed.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "DisputeCreation(uint256,uint256,bytes)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_extraData": "The extra data for the dispute.", + "_numberOfChoices": "The number of choices available in the dispute." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + }, + "VoteCast(uint256,address,uint256[],uint256,string)": { + "details": "Emitted when casting a vote to provide the justification of juror's choice.", + "params": { + "_choice": "The choice juror voted for.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "Address of the juror.", + "_justification": "Justification of the choice.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Withdrawal(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when the contributed funds are withdrawn.", + "params": { + "_amount": "The amount withdrawn.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + } + }, + "kind": "dev", + "methods": { + "areCommitsAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their commits for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their commits for the last round." + } + }, + "areVotesAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their votes for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their votes for the last round." + } + }, + "castCommit(uint256,uint256[],bytes32)": { + "details": "Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.", + "params": { + "_commit": "The commit. Note that justification string is a part of the commit.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_voteIDs": "The IDs of the votes." + } + }, + "castVote(uint256,uint256[],uint256,uint256,string)": { + "details": "Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.", + "params": { + "_choice": "The choice.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_justification": "Justification of the choice.", + "_salt": "The salt for the commit if the votes were hidden.", + "_voteIDs": "The IDs of the votes." + } + }, + "changeCore(address)": { + "details": "Changes the `core` storage variable.", + "params": { + "_core": "The new value for the `core` storage variable." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createDispute(uint256,uint256,bytes,uint256)": { + "details": "Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_extraData": "Additional info about the dispute, for possible use in future dispute kits.", + "_nbVotes": "Number of votes for this dispute.", + "_numberOfChoices": "Number of choices of the dispute" + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_nonce": "Nonce of the drawing iteration." + }, + "returns": { + "drawnAddress": "The drawn address." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "fundAppeal(uint256,uint256)": { + "details": "Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.", + "params": { + "_choice": "A choice that receives funding.", + "_coreDisputeID": "Index of the dispute in Kleros Core." + } + }, + "getCoherentCount(uint256,uint256)": { + "details": "Gets the number of jurors who are eligible to a reward in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit." + }, + "returns": { + "_0": "The number of coherent jurors." + } + }, + "getDegreeOfCoherence(uint256,uint256,uint256,uint256,uint256)": { + "details": "Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the vote." + }, + "returns": { + "_0": "The degree of coherence in basis points." + } + }, + "initialize(address,address)": { + "details": "Initializer.", + "params": { + "_core": "The KlerosCore arbitrator.", + "_governor": "The governor's address." + } + }, + "isVoteActive(uint256,uint256,uint256)": { + "details": "Returns true if the specified voter was active in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the voter." + }, + "returns": { + "_0": "Whether the voter was active or not." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + }, + "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. Note that withdrawals are not possible if the core contract is paused.", + "params": { + "_beneficiary": "The address whose rewards to withdraw.", + "_choice": "The ruling option that the caller wants to withdraw from.", + "_coreDisputeID": "Index of the dispute in Kleros Core contract.", + "_coreRoundID": "The round in the Kleros Core contract the caller wants to withdraw from." + }, + "returns": { + "amount": "The withdrawn amount." + } + } + }, + "title": "DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 13676, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 13679, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)5036" + }, + { + "astId": 13683, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(Dispute)13615_storage)dyn_storage" + }, + { + "astId": 13687, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreDisputeIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Dispute)13615_storage)dyn_storage": { + "base": "t_struct(Dispute)13615_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)13653_storage)dyn_storage": { + "base": "t_struct(Round)13653_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Vote)13662_storage)dyn_storage": { + "base": "t_struct(Vote)13662_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Vote[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)5036": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_uint256)" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(Dispute)13615_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Dispute", + "members": [ + { + "astId": 13604, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "rounds", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Round)13653_storage)dyn_storage" + }, + { + "astId": 13606, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "numberOfChoices", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 13608, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "jumped", + "offset": 0, + "slot": "2", + "type": "t_bool" + }, + { + "astId": 13612, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreRoundIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 13614, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "extraData", + "offset": 0, + "slot": "4", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(Round)13653_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Round", + "members": [ + { + "astId": 13619, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "votes", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Vote)13662_storage)dyn_storage" + }, + { + "astId": 13621, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "winningChoice", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 13625, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "counts", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 13627, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "tied", + "offset": 0, + "slot": "3", + "type": "t_bool" + }, + { + "astId": 13629, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalVoted", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 13631, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalCommitted", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 13635, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "paidFees", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 13639, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "hasPaid", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 13645, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "contributions", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 13647, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "feeRewards", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 13650, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "fundedChoices", + "offset": 0, + "slot": "10", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 13652, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "nbVotes", + "offset": 0, + "slot": "11", + "type": "t_uint256" + } + ], + "numberOfBytes": "384" + }, + "t_struct(Vote)13662_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Vote", + "members": [ + { + "astId": 13655, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 13657, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "commit", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 13659, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "choice", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 13661, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "voted", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo_Proxy.json new file mode 100644 index 000000000..2fa486534 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicNeo_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xd40aA608801a639E292e10C235B90488D04070b1", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x514a6dd50b1d60ca2a1176c54e682112aad04ccbf90af7b407896754232d74cb", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xd40aA608801a639E292e10C235B90488D04070b1", + "transactionIndex": 2, + "gasUsed": "235697", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000020000000000000000000000000000000000000000080000000000000000000000000000000000200000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x76e6d259eaff2af5e2fc46119bbdc64dc8d00ec8eb45607c57539777b890adff", + "transactionHash": "0x514a6dd50b1d60ca2a1176c54e682112aad04ccbf90af7b407896754232d74cb", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 21125120, + "transactionHash": "0x514a6dd50b1d60ca2a1176c54e682112aad04ccbf90af7b407896754232d74cb", + "address": "0xd40aA608801a639E292e10C235B90488D04070b1", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 1, + "blockHash": "0x76e6d259eaff2af5e2fc46119bbdc64dc8d00ec8eb45607c57539777b890adff" + } + ], + "blockNumber": 21125120, + "cumulativeGasUsed": "397284", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE636AB278fBfc8712E807c589A362dc2396d2d2F", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json new file mode 100644 index 000000000..e623365bd --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverNeo.json @@ -0,0 +1,522 @@ +{ + "address": "0xaBC213522c01354DC0Db2B3E89bDe0FCF44Acac6", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplate", + "type": "string" + }, + { + "internalType": "string", + "name": "_disputeTemplateDataMappings", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplateUri", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplateUri", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_arbitratorDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xcedfb2daa378289cc09f45f854ece537af54b15b83faa0687191a7e5e77c58c9", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xaBC213522c01354DC0Db2B3E89bDe0FCF44Acac6", + "transactionIndex": 6, + "gasUsed": "1328883", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7b5aefb9212214c4b3e65ab595de281009034c2b1b100b5ba8f1c08925134380", + "transactionHash": "0xcedfb2daa378289cc09f45f854ece537af54b15b83faa0687191a7e5e77c58c9", + "logs": [], + "blockNumber": 21126646, + "cumulativeGasUsed": "3887692", + "status": 1, + "byzantium": true + }, + "args": [ + "0x26bf077037550e437605F07e25EfcAd510715C3A", + "0x596D3B09E684D62217682216e9b7a0De75933391" + ], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateDataMappings\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_arbitratorDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_disputeTemplateDataMappings\":\"The data mappings.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_arbitratorDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator, IDisputeTemplateRegistry _templateRegistry) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _disputeTemplateDataMappings The data mappings.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return\\n _createDispute(\\n _arbitratorExtraData,\\n _disputeTemplate,\\n _disputeTemplateDataMappings,\\n \\\"\\\",\\n _numberOfRulingOptions\\n );\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _arbitratorDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _arbitratorDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_arbitratorDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _arbitratorDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n uint256 templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _disputeTemplate, _disputeTemplateDataMappings);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x76af575d9dcf7b5a3dad88406832569a15d1c6f21d1ff23093ef59560a5b8eeb\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610ed5380380610ed583398101604081905261002f91610083565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100bd565b6001600160a01b038116811461008057600080fd5b50565b6000806040838503121561009657600080fd5b82516100a18161006b565b60208401519092506100b28161006b565b809150509250929050565b610e09806100cc6000396000f3fe60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220a06c81e91424fe76df69c3e72cd9c749e5c9c24c2bef1c69e870ee7aa89d346f64736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220a06c81e91424fe76df69c3e72cd9c749e5c9c24c2bef1c69e870ee7aa89d346f64736f6c63430008120033", + "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor.", + "params": { + "_governor": "The address of the new governor." + } + }, + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "Target global arbitrator for any disputes." + } + }, + "createDisputeForTemplate(bytes,string,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplate": "Dispute template.", + "_disputeTemplateDataMappings": "The data mappings.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "createDisputeForTemplateUri(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_arbitratorDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 13025, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 13028, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitrator", + "offset": 0, + "slot": "1", + "type": "t_contract(IArbitratorV2)18984" + }, + { + "astId": 13031, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "templateRegistry", + "offset": 0, + "slot": "2", + "type": "t_contract(IDisputeTemplateRegistry)19155" + }, + { + "astId": 13035, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "disputes", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(DisputeStruct)13023_storage)dyn_storage" + }, + { + "astId": 13039, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorDisputeIDToLocalID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)13023_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)13023_storage", + "encoding": "dynamic_array", + "label": "struct DisputeResolver.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)18984": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)19155": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)13023_storage": { + "encoding": "inplace", + "label": "struct DisputeResolver.DisputeStruct", + "members": [ + { + "astId": 13016, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "0", + "type": "t_bytes_storage" + }, + { + "astId": 13018, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "isRuled", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 13020, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "ruling", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 13022, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo.json new file mode 100644 index 000000000..8d3fd428c --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo.json @@ -0,0 +1,2100 @@ +{ + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrableNotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "GuardianOrGovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEligibleForStaking", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingInTooManyCourts", + "type": "error" + }, + { + "inputs": [], + "name": "StakingLessThanCourtMinStake", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxStakePerJuror", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxTotalStaked", + "type": "error" + }, + { + "inputs": [], + "name": "StakingNotPossibeInThisCourt", + "type": "error" + }, + { + "inputs": [], + "name": "StakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnstakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WhenNotPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WhenPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCoreBase.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "arbitrableWhitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_arbitrable", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "changeArbitrableWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guardian", + "type": "address" + } + ], + "name": "changeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "changeJurorNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCoreBase.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "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" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCoreBase.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_guardian", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + }, + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorNft", + "outputs": [ + { + "internalType": "contract IERC721", + "name": "", + "type": "address" + } + ], + "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": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "transactionIndex": 2, + "gasUsed": "670390", + "logsBloom": "0x00000000000000000000400020000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000140000000004000000000000000000020000000000000010000800402000000008000008000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000028000000000000004000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000000001001000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711", + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000d40aa608801a639e292e10c235b90488d04070b1" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + }, + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 2, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + }, + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + }, + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + } + ], + "blockNumber": 21125156, + "cumulativeGasUsed": "831421", + "status": 1, + "byzantium": true + }, + "args": [ + "0x419B8C9b13e7Ea358D0ACBfD2214a9Ec0f8e182e", + "0x2c053739000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa2250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d40aa608801a639e292e10c235b90488d04070b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000220000000000000000000000000809533c303c10915bb5c0585f2d8d738e2a4fb640000000000000000000000007dfcf7444a81d4a92a641ee292f36458cd9eb36500000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 2, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x34B944D42cAcfC8266955D07A80181D2054aa225", + "0x0000000000000000000000000000000000000000", + "0xd40aA608801a639E292e10C235B90488D04070b1", + false, + [ + { + "type": "BigNumber", + "hex": "0x0ad78ebc5ac6200000" + }, + 10000, + { + "type": "BigNumber", + "hex": "0x016345785d8a0000" + }, + 256 + ], + [ + 0, + 0, + 0, + 10 + ], + "0x05", + "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F" + ] + }, + "implementation": "0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo_Implementation.json new file mode 100644 index 000000000..92f96ed65 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo_Implementation.json @@ -0,0 +1,2835 @@ +{ + "address": "0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrableNotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "GuardianOrGovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEligibleForStaking", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingInTooManyCourts", + "type": "error" + }, + { + "inputs": [], + "name": "StakingLessThanCourtMinStake", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxStakePerJuror", + "type": "error" + }, + { + "inputs": [], + "name": "StakingMoreThanMaxTotalStaked", + "type": "error" + }, + { + "inputs": [], + "name": "StakingNotPossibeInThisCourt", + "type": "error" + }, + { + "inputs": [], + "name": "StakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnstakingTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WhenNotPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WhenPausedOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCoreBase.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "arbitrableWhitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_arbitrable", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "changeArbitrableWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guardian", + "type": "address" + } + ], + "name": "changeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "changeJurorNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCoreBase.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "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" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCoreBase.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_guardian", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + }, + { + "internalType": "contract IERC721", + "name": "_jurorNft", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorNft", + "outputs": [ + { + "internalType": "contract IERC721", + "name": "", + "type": "address" + } + ], + "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": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x8b80bfa88c9e5e90c8e53f74d87b2739832ad888ff537a47ed2e7cb5764ac92a", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB", + "transactionIndex": 3, + "gasUsed": "6535356", + "logsBloom": "0x00000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000040000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5338b404754e20462bc7ef471b92f9fe8a3d1fdcbaf0515bded00ef41cc0662a", + "transactionHash": "0x8b80bfa88c9e5e90c8e53f74d87b2739832ad888ff537a47ed2e7cb5764ac92a", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 21554000, + "transactionHash": "0x8b80bfa88c9e5e90c8e53f74d87b2739832ad888ff537a47ed2e7cb5764ac92a", + "address": "0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 6, + "blockHash": "0x5338b404754e20462bc7ef471b92f9fe8a3d1fdcbaf0515bded00ef41cc0662a" + } + ], + "blockNumber": 21554000, + "cumulativeGasUsed": "6850085", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 2, + "solcInputHash": "04e66c05dce8c2b0405d41f363293597", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrableNotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrationFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArraysLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotDisableClassicDK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepthLevelMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitNotSupportedByCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeNotAppealable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodIsFinal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeStillDrawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EvidenceNotPassedAndNotAppeal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GuardianOrGovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDisputKitParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidForkingCourtAsParent\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinStakeLowerThanParentCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSupportDisputeKitClassic\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEligibleForStaking\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEvidencePeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotExecutionPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RulingAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SortitionModuleOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingInTooManyCourts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingLessThanCourtMinStake\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingMoreThanMaxStakePerJuror\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingMoreThanMaxTotalStaked\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingNotPossibeInThisCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotAccepted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnstakingTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsuccessfulCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedDisputeKit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VotePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WhenNotPausedOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WhenPausedOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongDisputeKitIndex\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"AcceptedFeeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"CourtCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_fromCourtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"_toCourtID\",\"type\":\"uint96\"}],\"name\":\"CourtJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"CourtModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"DisputeKitCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"DisputeKitEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_fromDisputeKitID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toDisputeKitID\",\"type\":\"uint256\"}],\"name\":\"DisputeKitJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_pnkAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"LeftoverRewardSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"NewCurrencyRate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum KlerosCoreBase.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_degreeOfCoherency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_pnkAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_feeAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"arbitrableWhitelist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"changeAcceptedFeeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_allowed\",\"type\":\"bool\"}],\"name\":\"changeArbitrableWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeCourtParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"changeCurrencyRates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_guardian\",\"type\":\"address\"}],\"name\":\"changeGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC721\",\"name\":\"_jurorNft\",\"type\":\"address\"}],\"name\":\"changeJurorNft\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"}],\"name\":\"changeJurorProsecutionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_toToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amountInEth\",\"type\":\"uint256\"}],\"name\":\"convertEthToTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"createCourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"currencyRates\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"feePaymentAccepted\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"rateDecimals\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKits\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrableV2\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCoreBase.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"enableDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"executeRuling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeKitsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"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\"}],\"name\":\"getNumberOfVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"disputeKitID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkAtStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repartitions\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkPenalties\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"drawnJurors\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"sumFeeRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumPnkRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"drawIterations\",\"type\":\"uint256\"}],\"internalType\":\"struct KlerosCoreBase.Round\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"guardian\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_guardian\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKit\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModuleAddress\",\"type\":\"address\"},{\"internalType\":\"contract IERC721\",\"name\":\"_jurorNft\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"isDisputeKitJumping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"isSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"jurorNft\",\"outputs\":[{\"internalType\":\"contract IERC721\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStakeBySortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"AcceptedFeeToken(address,bool)\":{\"details\":\"To be emitted when an ERC20 token is added or removed as a method to pay fees.\",\"params\":{\"_accepted\":\"Whether the token is accepted or not.\",\"_token\":\"The ERC20 token.\"}},\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"NewCurrencyRate(address,uint64,uint8)\":{\"details\":\"To be emitted when the fee for a particular ERC20 token is updated.\",\"params\":{\"_feeToken\":\"The ERC20 token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\"}},\"appeal(uint256,uint256,bytes)\":{\"details\":\"Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Extradata for the dispute. Can be required during court jump.\",\"_numberOfChoices\":\"Number of choices for the dispute. Can be required during court jump.\"}},\"appealCost(uint256)\":{\"details\":\"Gets the cost of appealing a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"cost\":\"The appeal cost.\"}},\"appealPeriod(uint256)\":{\"details\":\"Gets the start and the end of a specified dispute's current appeal period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"end\":\"The end of the appeal period.\",\"start\":\"The start of the appeal period.\"}},\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost in ETH.\"}},\"arbitrationCost(bytes,address)\":{\"details\":\"Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeToken\":\"The ERC20 token used to pay fees.\"},\"returns\":{\"cost\":\"The arbitration cost in `_feeToken`.\"}},\"changeAcceptedFeeTokens(address,bool)\":{\"details\":\"Changes the supported fee tokens.\",\"params\":{\"_accepted\":\"Whether the token is supported or not as a method of fee payment.\",\"_feeToken\":\"The fee token.\"}},\"changeArbitrableWhitelist(address,bool)\":{\"details\":\"Adds or removes an arbitrable from whitelist.\",\"params\":{\"_allowed\":\"Whether add or remove permission.\",\"_arbitrable\":\"Arbitrable address.\"}},\"changeCurrencyRates(address,uint64,uint8)\":{\"details\":\"Changes the currency rate of a fee token.\",\"params\":{\"_feeToken\":\"The fee token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeGuardian(address)\":{\"details\":\"Changes the `guardian` storage variable.\",\"params\":{\"_guardian\":\"The new value for the `guardian` storage variable.\"}},\"changeJurorNft(address)\":{\"details\":\"Changes the `jurorNft` storage variable.\",\"params\":{\"_jurorNft\":\"The new value for the `jurorNft` storage variable.\"}},\"changeJurorProsecutionModule(address)\":{\"details\":\"Changes the `jurorProsecutionModule` storage variable.\",\"params\":{\"_jurorProsecutionModule\":\"The new value for the `jurorProsecutionModule` storage variable.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.\",\"params\":{\"_sortitionModule\":\"The new value for the `sortitionModule` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])\":{\"details\":\"Creates a court under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the court.\",\"_feeForJuror\":\"The `feeForJuror` property value of the court.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the court.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the court.\",\"_minStake\":\"The `minStake` property value of the court.\",\"_parent\":\"The `parent` property value of the court.\",\"_sortitionExtraData\":\"Extra data for sortition module.\",\"_supportedDisputeKits\":\"Indexes of dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the court.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"createDispute(uint256,bytes,address,uint256)\":{\"details\":\"Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeAmount\":\"Amount of the ERC20 token used to pay fees.\",\"_feeToken\":\"The ERC20 token used to pay fees.\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws jurors for the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"enableDisputeKits(uint96,uint256[],bool)\":{\"details\":\"Adds/removes court's support for specified dispute kits.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_disputeKitIDs\":\"The IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the court.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts. Note: Reward distributions are forbidden during pause.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\",\"_round\":\"The appeal round.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"executeRuling(uint256)\":{\"details\":\"Executes a specified dispute's ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getNumberOfVotes(uint256)\":{\"details\":\"Gets the number of votes permitted for the specified dispute in the latest round.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_courtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"initialize(address,address,address,address,address,bool,uint256[4],uint256[4],bytes,address,address)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_courtParameters\":\"Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_governor\":\"The governor's address.\",\"_guardian\":\"The guardian's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_jurorNft\":\"NFT contract to vet the jurors.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionExtraData\":\"The extra data for sortition module.\",\"_sortitionModuleAddress\":\"The sortition module responsible for sortition of the jurors.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\"}},\"isDisputeKitJumping(uint256)\":{\"details\":\"Returns true if the dispute kit will be switched to a parent DK.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"_0\":\"Whether DK will be switched or not.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"pause()\":{\"details\":\"Pause staking and reward execution. Can only be done by guardian or governor.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a court. Note: Staking and unstaking is forbidden during pause.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake. Note that the existing delayed stake will be nullified as non-relevant.\"}},\"setStakeBySortitionModule(address,uint96,uint256,bool)\":{\"details\":\"Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\",\"params\":{\"_account\":\"The account whose stake is being set.\",\"_alreadyTransferred\":\"Whether the PNKs have already been transferred to the contract.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"}},\"unpause()\":{\"details\":\"Unpause staking and reward execution. Can only be done by governor.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"KlerosCoreNeo Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCoreNeo.sol\":\"KlerosCoreNeo\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5bce51e11f7d194b79ea59fe00c9e8de9fa2c5530124960f29a24d4c740a3266\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title KlerosCoreBase\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\nabstract contract KlerosCoreBase is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 feePerJurorInRound; // The fee per juror in the round.\\n uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private 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 address public guardian; // The guardian able to pause asset withdrawals.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n bool public paused; // Whether asset withdrawals are paused.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event Paused();\\n event Unpaused();\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n modifier onlyByGuardianOrGovernor() {\\n if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly();\\n _;\\n }\\n\\n modifier whenPaused() {\\n if (!paused) revert WhenPausedOnly();\\n _;\\n }\\n\\n modifier whenNotPaused() {\\n if (paused) revert WhenNotPausedOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) internal {\\n governor = _governor;\\n guardian = _guardian;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Pause staking and reward execution. Can only be done by guardian or governor.\\n function pause() external onlyByGuardianOrGovernor whenNotPaused {\\n paused = true;\\n emit Paused();\\n }\\n\\n /// @dev Unpause staking and reward execution. Can only be done by governor.\\n function unpause() external onlyByGovernor whenPaused {\\n paused = false;\\n emit Unpaused();\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `guardian` storage variable.\\n /// @param _guardian The new value for the `guardian` storage variable.\\n function changeGuardian(address _guardian) external onlyByGovernor {\\n guardian = _guardian;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal virtual returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// Note: Reward distributions are forbidden during pause.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused {\\n Round storage round;\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n round = dispute.rounds[_round];\\n } // stack too deep workaround\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound;\\n uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror;\\n uint256 coherentCount;\\n {\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n } // stack too deep workaround\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRound = _executePenalties(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRound) {\\n round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (stakingResult != StakingResult.Successful) {\\n _stakingFailed(_onError, stakingResult);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError, StakingResult.StakingTransferFailed);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError, StakingResult.UnstakingTransferFailed);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual {\\n if (_onError == OnError.Return) return;\\n if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed();\\n if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed();\\n if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts();\\n if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt();\\n if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error GuardianOrGovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingInTooManyCourts();\\n error StakingNotPossibeInThisCourt();\\n error StakingLessThanCourtMinStake();\\n error StakingTransferFailed();\\n error UnstakingTransferFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n error WhenNotPausedOnly();\\n error WhenPausedOnly();\\n}\\n\",\"keccak256\":\"0x53eb90e3209b47a218bd9eb25bd64bcff4edca51829cb7bfff35ed68f9cee05c\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreNeo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCoreBase.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\n/// @title KlerosCoreNeo\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCoreNeo is KlerosCoreBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n mapping(address => bool) public arbitrableWhitelist; // Arbitrable whitelist.\\n IERC721 public jurorNft; // Eligible jurors NFT.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _guardian The guardian's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n /// @param _jurorNft NFT contract to vet the jurors.\\n function initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress,\\n IERC721 _jurorNft\\n ) external reinitializer(2) {\\n // super._initialize(\\n // _governor,\\n // _guardian,\\n // _pinakion,\\n // _jurorProsecutionModule,\\n // _disputeKit,\\n // _hiddenVotes,\\n // _courtParameters,\\n // _timesPerPeriod,\\n // _sortitionExtraData,\\n // _sortitionModuleAddress\\n // );\\n // jurorNft = _jurorNft;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `jurorNft` storage variable.\\n /// @param _jurorNft The new value for the `jurorNft` storage variable.\\n function changeJurorNft(IERC721 _jurorNft) external onlyByGovernor {\\n jurorNft = _jurorNft;\\n }\\n\\n /// @dev Adds or removes an arbitrable from whitelist.\\n /// @param _arbitrable Arbitrable address.\\n /// @param _allowed Whether add or remove permission.\\n function changeArbitrableWhitelist(address _arbitrable, bool _allowed) external onlyByGovernor {\\n arbitrableWhitelist[_arbitrable] = _allowed;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// Note: Staking and unstaking is forbidden during pause.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external override whenNotPaused {\\n if (jurorNft.balanceOf(msg.sender) == 0) revert NotEligibleForStaking();\\n super._setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal override returns (uint256 disputeID) {\\n if (!arbitrableWhitelist[msg.sender]) revert ArbitrableNotWhitelisted();\\n return super._createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure override {\\n super._stakingFailed(_onError, _result);\\n if (_result == StakingResult.CannotStakeMoreThanMaxStakePerJuror) revert StakingMoreThanMaxStakePerJuror();\\n if (_result == StakingResult.CannotStakeMoreThanMaxTotalStaked) revert StakingMoreThanMaxTotalStaked();\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error NotEligibleForStaking();\\n error StakingMoreThanMaxStakePerJuror();\\n error StakingMoreThanMaxTotalStaked();\\n error ArbitrableNotWhitelisted();\\n}\\n\",\"keccak256\":\"0xea253c1c947aca1589462436980c8cd22d4f09180a38739f438967427b688830\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @param _feePerJuror The fee per juror.\\n /// @param _pnkAtStakePerJuror The PNK at stake per juror.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 _feePerJuror,\\n uint256 _pnkAtStakePerJuror\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x72cdf621c11d1d84b851edb1ef7607ac950ba7038154c85005ccc86cdd43e71b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../../libraries/Constants.sol\\\";\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x47960dd772c9dafeefa2e6b9414c7045b5dcc68df735c1fccda6af48ca089858\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// Courts\\nuint96 constant FORKING_COURT = 0; // Index of the forking court.\\nuint96 constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n// Dispute Kits\\nuint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\nuint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n// Sortition Module\\nuint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\nuint256 constant DEFAULT_K = 6; // Default number of children per node.\\n\\n// Defaults\\nuint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\nIERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\\nenum StakingResult {\\n Successful,\\n StakingTransferFailed,\\n UnstakingTransferFailed,\\n CannotStakeInMoreCourts,\\n CannotStakeInThisCourt,\\n CannotStakeLessThanMinStake,\\n CannotStakeMoreThanMaxStakePerJuror,\\n CannotStakeMoreThanMaxTotalStaked\\n}\\n\",\"keccak256\":\"0xdc648a85f2816fa323e9f7f4accac3d9384187d0123bdfb1f9b89ce25ea64679\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516158b162000103600039600081816118cc015281816118f50152611aec01526158b16000f3fe6080604052600436106102c95760003560e01c806382d022371161017b578063c71f4253116100d7578063f6506db411610085578063f6506db414610968578063f7434ea914610988578063fbb519e7146109a8578063fbf405b0146109c8578063fc6f8f16146109e8578063fe4037e614610a08578063fe524c3914610a2857600080fd5b8063c71f425314610893578063cf0c38f8146108b3578063d07368bd146108d3578063d2b8035a146108f3578063d4d1d76a14610913578063d98493f614610928578063e4c0aaf41461094857600080fd5b8063acdbf51d11610134578063acdbf51d146107a8578063afe15cfb146107c8578063b0049637146107fd578063b44d573c1461081d578063c13517e11461084d578063c258bb1914610860578063c35699021461088057600080fd5b806382d02237146106e65780638456cb591461070657806386541b241461071b5780638a9bb02a1461073b5780638bb0487514610768578063a072b86c1461078857600080fd5b80632e2e936a1161022a57806352d1902d116101e357806352d1902d14610606578063564a565d1461061b57806359ec827e1461064c5780635c975abb1461066c578063751accd0146106865780637717a6e8146106a65780637934c0be146106c657600080fd5b80632e2e936a146105515780632fcb4f04146105715780633cfd1184146105915780633f4ba83a146105be578063452a9320146105d35780634f1ef286146105f357600080fd5b806319b815291161028757806319b81529146104035780631c3db16d146104335780631d7e6892146104705780631f5a0dd2146104905780632c053739146104f15780632d29a47b146105115780632e1daf2f1461053157600080fd5b8062f5822c146102ce5780630219da79146102f05780630b7414bc146103685780630c340a2414610388578063115d5376146103b55780631860592b146103d5575b600080fd5b3480156102da57600080fd5b506102ee6102e9366004614a12565b610a48565b005b3480156102fc57600080fd5b5061033b61030b366004614a12565b60086020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561037457600080fd5b506102ee610383366004614b20565b610a95565b34801561039457600080fd5b506000546103a8906001600160a01b031681565b60405161035f9190614b81565b3480156103c157600080fd5b506102ee6103d0366004614b95565b610bd6565b3480156103e157600080fd5b506103f56103f0366004614bae565b61110d565b60405190815260200161035f565b34801561040f57600080fd5b5061042361041e366004614b95565b611167565b604051901515815260200161035f565b34801561043f57600080fd5b5061045361044e366004614b95565b611260565b60408051938452911515602084015215159082015260600161035f565b34801561047c57600080fd5b506102ee61048b366004614bda565b611361565b34801561049c57600080fd5b506104b06104ab366004614b95565b6113b7565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e00161035f565b3480156104fd57600080fd5b506102ee61050c366004614cef565b611416565b34801561051d57600080fd5b506102ee61052c366004614ddc565b6114e8565b34801561053d57600080fd5b506004546103a8906001600160a01b031681565b34801561055d57600080fd5b50600b546103a8906001600160a01b031681565b34801561057d57600080fd5b506102ee61058c366004614a12565b61177e565b34801561059d57600080fd5b506105b16105ac366004614e08565b6117cb565b60405161035f9190614e46565b3480156105ca57600080fd5b506102ee611835565b3480156105df57600080fd5b506001546103a8906001600160a01b031681565b6102ee610601366004614e54565b6118b8565b34801561061257600080fd5b506103f5611adf565b34801561062757600080fd5b5061063b610636366004614b95565b611b3d565b60405161035f959493929190614edb565b34801561065857600080fd5b506103f5610667366004614b95565b611b99565b34801561067857600080fd5b506009546104239060ff1681565b34801561069257600080fd5b506102ee6106a1366004614f1a565b611cee565b3480156106b257600080fd5b506102ee6106c1366004614f72565b611d98565b3480156106d257600080fd5b506102ee6106e1366004614bda565b611e5b565b3480156106f257600080fd5b506102ee610701366004614f8e565b611eda565b34801561071257600080fd5b506102ee611f97565b34801561072757600080fd5b506102ee610736366004614fe0565b612037565b34801561074757600080fd5b5061075b61075636600461504e565b61221e565b60405161035f91906150b4565b34801561077457600080fd5b506102ee610783366004614b95565b6123aa565b34801561079457600080fd5b506102ee6107a3366004615159565b61250e565b3480156107b457600080fd5b506103a86107c3366004614b95565b61287f565b3480156107d457600080fd5b506107e86107e3366004614b95565b6128a9565b6040805192835260208301919091520161035f565b34801561080957600080fd5b506102ee610818366004614a12565b612955565b34801561082957600080fd5b50610423610838366004614a12565b600a6020526000908152604090205460ff1681565b6103f561085b366004615219565b6129a2565b34801561086c57600080fd5b506102ee61087b366004614a12565b6129da565b6102ee61088e366004615249565b612a27565b34801561089f57600080fd5b506103f56108ae366004614b95565b612efb565b3480156108bf57600080fd5b506003546103a8906001600160a01b031681565b3480156108df57600080fd5b506102ee6108ee366004614a12565b612f63565b3480156108ff57600080fd5b506102ee61090e36600461504e565b61300c565b34801561091f57600080fd5b506006546103f5565b34801561093457600080fd5b506103f56109433660046152ca565b613321565b34801561095457600080fd5b506102ee610963366004614a12565b61336e565b34801561097457600080fd5b506103f5610983366004615315565b6133bb565b34801561099457600080fd5b506103f56109a336600461537b565b6134a1565b3480156109b457600080fd5b506102ee6109c33660046153af565b6134ed565b3480156109d457600080fd5b506002546103a8906001600160a01b031681565b3480156109f457600080fd5b506103f5610a03366004614b95565b61352d565b348015610a1457600080fd5b506102ee610a23366004614a12565b61355c565b348015610a3457600080fd5b50610423610a43366004614f72565b6135a9565b6000546001600160a01b03163314610a735760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ac05760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610bd0578115610b5f57828181518110610ae457610ae4615400565b602002602001015160001480610b1757506006548351849083908110610b0c57610b0c615400565b602002602001015110155b15610b3557604051633d58a98960e11b815260040160405180910390fd5b610b5a84848381518110610b4b57610b4b615400565b602002602001015160016135f1565b610bbe565b6001838281518110610b7357610b73615400565b602002602001015103610b99576040516356d111fd60e11b815260040160405180910390fd5b610bbe84848381518110610baf57610baf615400565b602002602001015160006135f1565b80610bc88161542c565b915050610ac3565b50505050565b600060078281548110610beb57610beb615400565b600091825260208220600490910201805460058054929450916001600160601b03909116908110610c1e57610c1e615400565b6000918252602082206003850154600c909202019250610c4090600190615445565b90506000836003018281548110610c5957610c59615400565b600091825260208220600b909102019150600185015460ff166004811115610c8357610c83614ea3565b03610d5e5781158015610cd257506001840154600684019060ff166004811115610caf57610caf614ea3565b60048110610cbf57610cbf615400565b01546002850154610cd09042615445565b105b15610cf057604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610d18576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610d2f576002610d32565b60015b60018086018054909160ff1990911690836004811115610d5457610d54614ea3565b02179055506110bf565b60018085015460ff166004811115610d7857610d78614ea3565b03610e88576001840154600684019060ff166004811115610d9b57610d9b614ea3565b60048110610dab57610dab615400565b01546002850154610dbc9042615445565b108015610e5357506006816000015481548110610ddb57610ddb615400565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e519190615458565b155b15610e7157604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610d54565b6002600185015460ff166004811115610ea357610ea3614ea3565b03610ff1576001840154600684019060ff166004811115610ec657610ec6614ea3565b60048110610ed657610ed6615400565b01546002850154610ee79042615445565b108015610f7e57506006816000015481548110610f0657610f06615400565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c9190615458565b155b15610f9c57604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a36110bf565b6003600185015460ff16600481111561100c5761100c614ea3565b03611086576001840154600684019060ff16600481111561102f5761102f614ea3565b6004811061103f5761103f615400565b015460028501546110509042615445565b101561106f57604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610d54565b6004600185015460ff1660048111156110a1576110a1614ea3565b036110bf576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916110fe9160ff1690615475565b60405180910390a25050505050565b6001600160a01b03821660009081526008602052604081205461010081046001600160401b03169061114a90600160481b900460ff16600a615567565b6111549084615576565b61115e91906155a3565b90505b92915050565b6000806007838154811061117d5761117d615400565b60009182526020822060036004909202019081018054919350906111a390600190615445565b815481106111b3576111b3615400565b600091825260208220845460058054600b909402909201945090916001600160601b039091169081106111e8576111e8615400565b90600052602060002090600c0201905080600501548260030154101561121357506000949350505050565b80546005805490916001600160601b031690811061123357611233615400565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b6000806000806007858154811061127957611279615400565b600091825260208220600360049092020190810180549193509061129f90600190615445565b815481106112af576112af615400565b90600052602060002090600b02019050600060068260000154815481106112d8576112d8615400565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa15801561132d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135191906155b7565b9199909850909650945050505050565b6000546001600160a01b0316331461138c5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600581815481106113c757600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff168061145f575080546001600160401b03808416911610155b1561147c5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b1760ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050505050565b60095460ff161561150c57604051636f1dac1d60e01b815260040160405180910390fd5b6000806007858154811061152257611522615400565b600091825260209091206004918202019150600182015460ff16600481111561154d5761154d614ea3565b1461156b57604051638794ce4b60e01b815260040160405180910390fd5b80600301848154811061158057611580615400565b6000918252602082206004600b909202019081015490935091506115a484836155ef565b60058401546006850154600286015492935090916000906115c69083906155a3565b905060008660010154905060008060068960000154815481106115eb576115eb615400565b60009182526020909120015460405163368efae360e21b8152600481018e9052602481018d90526001600160a01b039091169150819063da3beb8c90604401602060405180830381865afa158015611647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166b9190615602565b915050806000036116875783861115611682578395505b6116a7565b611692846002615576565b8611156116a7576116a4846002615576565b95505b60048801869055865b8681101561175d5784811015611709576117026040518061010001604052808e81526020018d815260200184815260200187815260200186815260200185815260200188815260200183815250613679565b955061174b565b61174b6040518061010001604052808e81526020018d815260200184815260200187815260200186815260200185815260200188815260200183815250613b4a565b806117558161542c565b9150506116b0565b508488600501541461177157600588018590555b5050505050505050505050565b6000546001600160a01b031633146117a95760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6117d3614942565b6005826001600160601b0316815481106117ef576117ef615400565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b8154815260200190600101908083116118165750505050509050919050565b6000546001600160a01b031633146118605760405163c383977560e01b815260040160405180910390fd5b60095460ff166118835760405163b4143dc760e01b815260040160405180910390fd5b6009805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b6118c182614082565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061193f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661193360008051602061585c8339815191525490565b6001600160a01b031614155b1561195d5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119b7575060408051601f3d908101601f191682019092526119b491810190615602565b60015b6119df5781604051630c76093760e01b81526004016119d69190614b81565b60405180910390fd5b60008051602061585c8339815191528114611a1057604051632a87526960e21b8152600481018290526024016119d6565b60008051602061585c8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611ad9576000836001600160a01b031683604051611a77919061563f565b600060405180830381855af49150503d8060008114611ab2576040519150601f19603f3d011682016040523d82523d6000602084013e611ab7565b606091505b5050905080610bd0576040516339b21b5d60e11b815260040160405180910390fd5b505b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611b2a5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061585c83398151915290565b60078181548110611b4d57600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b60008060078381548110611baf57611baf615400565b6000918252602082206003600490920201908101805491935090611bd590600190615445565b81548110611be557611be5615400565b600091825260208220845460058054600b909402909201945090916001600160601b03909116908110611c1a57611c1a615400565b90600052602060002090600c020190508060050154826003015410611cb95782546001600160601b031660001901611c5b576001600160ff1b039350611ce6565b6003820154611c6b906002615576565b611c769060016155ef565b81546005805490916001600160601b0316908110611c9657611c96615400565b90600052602060002090600c020160040154611cb29190615576565b9350611ce6565b6003820154611cc9906002615576565b611cd49060016155ef565b8160040154611ce39190615576565b93505b505050919050565b6000546001600160a01b03163314611d195760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611d34919061563f565b60006040518083038185875af1925050503d8060008114611d71576040519150601f19603f3d011682016040523d82523d6000602084013e611d76565b606091505b5050905080610bd0576040516322092f2f60e11b815260040160405180910390fd5b60095460ff1615611dbc57604051636f1dac1d60e01b815260040160405180910390fd5b600b546040516370a0823160e01b81526001600160a01b03909116906370a0823190611dec903390600401614b81565b602060405180830381865afa158015611e09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2d9190615602565b600003611e4d576040516326b551e560e11b815260040160405180910390fd5b611ad93383836000806140b0565b6000546001600160a01b03163314611e865760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611f055760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260086020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6001546001600160a01b03163314801590611fbd57506000546001600160a01b03163314155b15611fdb57604051636b29334f60e01b815260040160405180910390fd5b60095460ff1615611fff57604051636f1dac1d60e01b815260040160405180910390fd5b6009805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000546001600160a01b031633146120625760405163c383977560e01b815260040160405180910390fd5b60006005886001600160601b03168154811061208057612080615400565b90600052602060002090600c0201905060016001600160601b0316886001600160601b0316141580156120e2575080546005805488926001600160601b03169081106120ce576120ce615400565b90600052602060002090600c020160020154115b1561210057604051639717078960e01b815260040160405180910390fd5b60005b60018201548110156121855786600583600101838154811061212757612127615400565b90600052602060002001548154811061214257612142615400565b90600052602060002090600c020160020154101561217357604051639717078960e01b815260040160405180910390fd5b8061217d8161542c565b915050612103565b5060028101869055805460ff60601b1916600160601b88151502178155600381018590556004808201859055600582018490556121c89060068301908490614960565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a88888888888860405161220c9695949392919061565b565b60405180910390a25050505050505050565b61228460405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b6007838154811061229757612297615400565b906000526020600020906004020160030182815481106122b9576122b9615400565b90600052602060002090600b0201604051806101600160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820180548060200260200160405190810160405280929190818152602001828054801561236857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161234a575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b6000600782815481106123bf576123bf615400565b600091825260209091206004918202019150600182015460ff1660048111156123ea576123ea614ea3565b1461240857604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff16156124335760405163c977f8d360e01b815260040160405180910390fd5b600061243e83611260565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b1580156124f157600080fd5b505af1158015612505573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146125395760405163c383977560e01b815260040160405180910390fd5b8660058a6001600160601b03168154811061255657612556615400565b90600052602060002090600c020160020154111561258757604051639717078960e01b815260040160405180910390fd5b80516000036125a95760405163402585f560e01b815260040160405180910390fd5b6001600160601b0389166125d057604051631ef4f64960e01b815260040160405180910390fd5b60058054600181018255600091825290600c82027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001905b83518110156126ce5783818151811061262357612623615400565b6020026020010151600014806126565750600654845185908390811061264b5761264b615400565b602002602001015110155b1561267457604051633d58a98960e11b815260040160405180910390fd5b600182600a01600086848151811061268e5761268e615400565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806126c69061542c565b915050612608565b5060016000908152600a8201602052604090205460ff16612702576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c16178155604080516000815260208101918290525161273a91600184019161499e565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561277d9060068301908790614960565b50600480546040516311de995760e21b81526001600160a01b039091169163477a655c916127af9186918991016156ba565b600060405180830381600087803b1580156127c957600080fd5b505af11580156127dd573d6000803e3d6000fd5b5050505060058b6001600160601b0316815481106127fd576127fd615400565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d9061286a908e908e908e908e908e908e908d906156d3565b60405180910390a35050505050505050505050565b6006818154811061288f57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000806000600784815481106128c1576128c1615400565b6000918252602090912060049091020190506003600182015460ff1660048111156128ee576128ee614ea3565b03612946576002810154815460058054929550916001600160601b0390911690811061291c5761291c615400565b600091825260209091206009600c909202010154600282015461293f91906155ef565b915061294f565b60009250600091505b50915091565b6000546001600160a01b031633146129805760405163c383977560e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006129ad826134a1565b3410156129cd57604051630e3360f160e21b815260040160405180910390fd5b61115e838360003461426a565b6000546001600160a01b03163314612a055760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612a3083611b99565b341015612a5057604051633191f8f160e01b815260040160405180910390fd5b600060078481548110612a6557612a65615400565b6000918252602090912060049091020190506003600182015460ff166004811115612a9257612a92614ea3565b14612ab0576040516337cdefcb60e21b815260040160405180910390fd5b60038101805460009190612ac690600190615445565b81548110612ad657612ad6615400565b90600052602060002090600b020190506006816000015481548110612afd57612afd615400565b6000918252602090912001546001600160a01b03163314612b315760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600580546001600160601b0390951694600b9093029091019184908110612b7457612b74615400565b90600052602060002090600c020160050154846003015410612c7d576005836001600160601b031681548110612bac57612bac615400565b60009182526020909120600c9091020154600580546001600160601b0390921694509084908110612bdf57612bdf615400565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612c0b57600191505b84546001600160601b03848116911614612c7d57845460038601546001600160601b0390911690612c3e90600190615445565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560058054600092908110612cc057612cc0615400565b90600052602060002090600c02019050806004015434612ce091906155a3565b826003018190555061271081600301548260020154612cff9190615576565b612d0991906155a3565b60018084019190915534600284015583835560045460038801546001600160a01b039091169163d09f392d918c91612d4091615445565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612d7e57600080fd5b505af1158015612d92573d6000803e3d6000fd5b505086548454149150612e7890505784546003870154612db490600190615445565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46006826000015481548110612e0257612e02615400565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612e45918d918d918d9190600401615750565b600060405180830381600087803b158015612e5f57600080fd5b505af1158015612e73573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612ee89190615475565b60405180910390a2505050505050505050565b60008060078381548110612f1157612f11615400565b906000526020600020906004020190508060030160018260030180549050612f399190615445565b81548110612f4957612f49615400565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612f8e5760405163c383977560e01b815260040160405180910390fd5b6006805460018101825560009182527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b60006007838154811061302157613021615400565b906000526020600020906004020190506000600182600301805490506130479190615445565b9050600082600301828154811061306057613060615400565b600091825260208220600b909102019150600184015460ff16600481111561308a5761308a614ea3565b146130a857604051638285c4ef60e01b815260040160405180910390fd5b600060068260000154815481106130c1576130c1615400565b6000918252602082200154600a8401546001600160a01b039091169250905b86811080156130f6575060038401546006850154105b156132fe5760006001600160a01b03841663d2b8035a8a846131178161542c565b955061312390876155ef565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af1158015613166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318a9190615780565b90506001600160a01b0381166131a057506130e0565b6004805460018701546040516310f0b12f60e11b81526001600160a01b03909216926321e1625e926131d692869290910161579d565b600060405180830381600087803b1580156131f057600080fd5b505af1158015613204573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b91613251918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b03841617905560038601549054036132f85760048054604051632e96bc2360e11b81529182018b9052602482018890526001600160a01b031690635d2d784690604401600060405180830381600087803b1580156132df57600080fd5b505af11580156132f3573d6000803e3d6000fd5b505050505b506130e0565b8084600a01600082825461331291906155ef565b90915550505050505050505050565b6000613366826103f086868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134a192505050565b949350505050565b6000546001600160a01b031633146133995760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526008602052604081205460ff166133f45760405163e51cf7bf60e01b815260040160405180910390fd5b6133ff858585613321565b82101561341f57604051630e3360f160e21b815260040160405180910390fd5b6134346001600160a01b0384163330856142a6565b613451576040516312171d8360e31b815260040160405180910390fd5b6134958686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925087915061426a9050565b90505b95945050505050565b60008060006134af84614382565b5091509150806005836001600160601b0316815481106134d1576134d1615400565b90600052602060002090600c0201600401546133669190615576565b6004546001600160a01b0316331461351857604051639d6cab9960e01b815260040160405180910390fd5b6135268484848460016140b0565b5050505050565b60006007828154811061354257613542615400565b600091825260209091206003600490920201015492915050565b6000546001600160a01b031633146135875760405163c383977560e01b815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006005836001600160601b0316815481106135c7576135c7615400565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806005846001600160601b03168154811061360e5761360e615400565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b600080600783600001518154811061369357613693615400565b906000526020600020906004020190506000816003018460200151815481106136be576136be615400565b90600052602060002090600b02019050600060068260000154815481106136e7576136e7615400565b60009182526020808320919091015487519188015160e089015160808a015160a08b01516040516333ac937b60e11b8152600481019690965260248601939093526044850191909152606484015260848301526001600160a01b03169250829063675926f69060a401602060405180830381865afa15801561376d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137919190615602565b90506127108111156137a257506127105b60006127106137b18382615445565b85600101546137c09190615576565b6137ca91906155a3565b9050808760c0018181516137de91906155ef565b90525060e08701516006850180546000929081106137fe576137fe615400565b6000918252602090912001546004805460405163965af6c760e01b81526001600160a01b03938416945092169163965af6c79161383f91859187910161579d565b600060405180830381600087803b15801561385957600080fd5b505af115801561386d573d6000803e3d6000fd5b505060048054604051633c85b79360e21b81526001600160a01b03909116935063f216de4c92506138a291859187910161579d565b600060405180830381600087803b1580156138bc57600080fd5b505af11580156138d0573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e786613910876157b6565b60098b01546040516139329392916000916001600160a01b03909116906157d2565b60405180910390a48751602089015160e08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa158015613999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139bd9190615458565b613a23576004805460405163b5d69e9960e01b81526001600160a01b039091169163b5d69e99916139f091859101614b81565b600060405180830381600087803b158015613a0a57600080fd5b505af1158015613a1e573d6000803e3d6000fd5b505050505b60018860600151613a349190615445565b8860e00151148015613a4857506040880151155b15613b395760098501546001600160a01b0316613a91576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1935050505050613ab8565b60005460028601546009870154613ab6926001600160a01b0391821692911690614409565b505b60005460c0890151600254613adb926001600160a01b0391821692911690614409565b506020880151885160c08a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf493613b3093909290916001600160a01b03909116906157f6565b60405180910390a35b50505060c090940151949350505050565b60006007826000015181548110613b6357613b63615400565b90600052602060002090600402019050600081600301836020015181548110613b8e57613b8e615400565b90600052602060002090600b0201905060006006826000015481548110613bb757613bb7615400565b6000918252602080832090910154865191870151606088015160e08901516001600160a01b039093169550859363675926f693909291613bf691615815565b60808a015160a08b01516040516001600160e01b031960e088901b1681526004810195909552602485019390935260448401919091526064830152608482015260a401602060405180830381865afa158015613c56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c7a9190615602565b9050612710811115613c8b57506127105b60008360060186606001518760e00151613ca59190615815565b81548110613cb557613cb5615400565b600091825260208220015460018601546001600160a01b03909116925061271090613ce1908590615576565b613ceb91906155a3565b6004805460405163965af6c760e01b81529293506001600160a01b03169163965af6c791613d1d91869186910161579d565b600060405180830381600087803b158015613d3757600080fd5b505af1158015613d4b573d6000803e3d6000fd5b505060048054604051636624192f60e01b81526001600160a01b039091169350636624192f9250613d7e91869101614b81565b602060405180830381865afa158015613d9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dbf9190615458565b613ddc57600254613dda906001600160a01b03168383614409565b505b60006127108489604001518a60c00151613df691906155a3565b613e009190615576565b613e0a91906155a3565b905080866008016000828254613e2091906155ef565b925050819055506000612710858a604001518960020154613e4191906155a3565b613e4b9190615576565b613e5591906155a3565b905080876007016000828254613e6b91906155ef565b9091555050600254613e87906001600160a01b03168584614409565b5060098701546001600160a01b0316613ec5576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613ee0565b6009870154613ede906001600160a01b03168583614409565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613f30928c928a928a92909116906157d2565b60405180910390a4600189606001516002613f4b9190615576565b613f559190615445565b8960e001510361407757600087600801548a60c00151613f759190615445565b9050600088600701548960020154613f8d9190615445565b905081151580613f9c57508015155b15611771578115613fc657600054600254613fc4916001600160a01b03918216911684614409565b505b801561402d5760098901546001600160a01b031661400c57600080546040516001600160a01b039091169183156108fc02918491818181858888f193505050505061402d565b60005460098a015461402b916001600160a01b03918216911683614409565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161286a91879187916001600160a01b03909116906157f6565b505050505050505050565b6000546001600160a01b031633146140ad5760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b03851615806140d257506005546001600160601b038616115b156140ea576140e28260046144d6565b506000613498565b831580159061412557506005856001600160601b03168154811061411057614110615400565b90600052602060002090600c02016002015484105b15614135576140e28260056144d6565b60048054604051630a5861b960e41b81526001600160a01b03898116938201939093526001600160601b03881660248201526044810187905285151560648201526000928392839291169063a5861b90906084016060604051808303816000875af11580156141a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141cc9190615829565b9194509250905060008160078111156141e7576141e7614ea3565b14614202576141f685826144d6565b60009350505050613498565b821561422f57600254614220906001600160a01b03168a30866142a6565b61422f576141f68560016144d6565b811561425b5760025461424c906001600160a01b03168a84614409565b61425b576141f68560026144d6565b50600198975050505050505050565b336000908152600a602052604081205460ff1661429a57604051630407618360e31b815260040160405180910390fd5b61349885858585614544565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b1790525161430b919061563f565b6000604051808303816000865af19150503d8060008114614348576040519150601f19603f3d011682016040523d82523d6000602084013e61434d565b606091505b50915091508180156143775750805115806143775750808060200190518101906143779190615458565b979650505050505050565b600080600060408451106143f7575050506020810151604082015160608301516001600160601b03831615806143c357506005546001600160601b03841610155b156143cd57600192505b816000036143da57600391505b8015806143e957506006548110155b156143f2575060015b614402565b506001915060039050815b9193909250565b6000806000856001600160a01b0316858560405160240161442b92919061579d565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b17905251614460919061563f565b6000604051808303816000865af19150503d806000811461449d576040519150601f19603f3d011682016040523d82523d6000602084013e6144a2565b606091505b50915091508180156144cc5750805115806144cc5750808060200190518101906144cc9190615458565b9695505050505050565b6144e0828261482b565b60068160078111156144f4576144f4614ea3565b0361451257604051636590e91560e01b815260040160405180910390fd5b600781600781111561452657614526614ea3565b03611adb576040516358859f1d60e01b815260040160405180910390fd5b600080600061455286614382565b92505091506005826001600160601b03168154811061457357614573615400565b60009182526020808320848452600a600c90930201919091019052604090205460ff166145b35760405163b34eb75d60e01b815260040160405180910390fd5b600780546001810182556000918252600160601b33026001600160601b03851617600482027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888101918255427fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a90910155600680549296509092918490811061463e5761463e615400565b6000918252602082200154600580546001600160a01b039092169350906001600160601b03871690811061467457614674615400565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156146bf576146ba8a846004015461110d565b6146c5565b82600401545b90506146d1818a6155a3565b6003808401919091558683558301546002840154612710916146f291615576565b6146fc91906155a3565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c8116919091179091556004805460405163d09f392d60e01b81529182018b9052600060248301529091169063d09f392d90604401600060405180830381600087803b15801561476f57600080fd5b505af1158015614783573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016147bd9493929190615750565b600060405180830381600087803b1580156147d757600080fd5b505af11580156147eb573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b600182600181111561483f5761483f614ea3565b03614848575050565b600181600781111561485c5761485c614ea3565b0361487a57604051630f323ed960e11b815260040160405180910390fd5b600281600781111561488e5761488e614ea3565b036148ac5760405163e45e13a360e01b815260040160405180910390fd5b60038160078111156148c0576148c0614ea3565b036148de57604051631d91d0ed60e31b815260040160405180910390fd5b60048160078111156148f2576148f2614ea3565b03614910576040516321f1774b60e11b815260040160405180910390fd5b600581600781111561492457614924614ea3565b03611adb57604051630caac6b360e31b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b826004810192821561498e579160200282015b8281111561498e578251825591602001919060010190614973565b5061499a9291506149d8565b5090565b82805482825590600052602060002090810192821561498e579160200282018281111561498e578251825591602001919060010190614973565b5b8082111561499a57600081556001016149d9565b6001600160a01b03811681146140ad57600080fd5b8035614a0d816149ed565b919050565b600060208284031215614a2457600080fd5b8135614a2f816149ed565b9392505050565b80356001600160601b0381168114614a0d57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614a8b57614a8b614a4d565b604052919050565b600082601f830112614aa457600080fd5b813560206001600160401b03821115614abf57614abf614a4d565b8160051b614ace828201614a63565b9283528481018201928281019087851115614ae857600080fd5b83870192505b8483101561437757823582529183019190830190614aee565b80151581146140ad57600080fd5b8035614a0d81614b07565b600080600060608486031215614b3557600080fd5b614b3e84614a36565b925060208401356001600160401b03811115614b5957600080fd5b614b6586828701614a93565b9250506040840135614b7681614b07565b809150509250925092565b6001600160a01b0391909116815260200190565b600060208284031215614ba757600080fd5b5035919050565b60008060408385031215614bc157600080fd5b8235614bcc816149ed565b946020939093013593505050565b60008060408385031215614bed57600080fd5b8235614bf8816149ed565b91506020830135614c0881614b07565b809150509250929050565b600082601f830112614c2457600080fd5b604051608081018181106001600160401b0382111715614c4657614c46614a4d565b604052806080840185811115614c5b57600080fd5b845b81811015614c75578035835260209283019201614c5d565b509195945050505050565b600082601f830112614c9157600080fd5b81356001600160401b03811115614caa57614caa614a4d565b614cbd601f8201601f1916602001614a63565b818152846020838601011115614cd257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060008060006102208c8e031215614d1157600080fd5b8b35614d1c816149ed565b9a5060208c0135614d2c816149ed565b9950614d3a60408d01614a02565b9850614d4860608d01614a02565b9750614d5660808d01614a02565b9650614d6460a08d01614b15565b9550614d738d60c08e01614c13565b9450614d838d6101408e01614c13565b93506101c08c01356001600160401b03811115614d9f57600080fd5b614dab8e828f01614c80565b935050614dbb6101e08d01614a02565b9150614dca6102008d01614a02565b90509295989b509295989b9093969950565b600080600060608486031215614df157600080fd5b505081359360208301359350604090920135919050565b600060208284031215614e1a57600080fd5b61115e82614a36565b8060005b6004811015610bd0578151845260209384019390910190600101614e27565b608081016111618284614e23565b60008060408385031215614e6757600080fd5b8235614e72816149ed565b915060208301356001600160401b03811115614e8d57600080fd5b614e9985828601614c80565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b60058110614ed757634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a08101614f076040830186614eb9565b9215156060820152608001529392505050565b600080600060608486031215614f2f57600080fd5b8335614f3a816149ed565b92506020840135915060408401356001600160401b03811115614f5c57600080fd5b614f6886828701614c80565b9150509250925092565b60008060408385031215614f8557600080fd5b614bcc83614a36565b600080600060608486031215614fa357600080fd5b8335614fae816149ed565b925060208401356001600160401b0381168114614fca57600080fd5b9150604084013560ff81168114614b7657600080fd5b6000806000806000806000610140888a031215614ffc57600080fd5b61500588614a36565b9650602088013561501581614b07565b955060408801359450606088013593506080880135925060a088013591506150408960c08a01614c13565b905092959891949750929550565b6000806040838503121561506157600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156150a95781516001600160a01b031687529582019590820190600101615084565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e085015261510f610180850183615070565b60e08601516101008681019190915286015161012080870191909152860151909250610140615148818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101808a8c03121561517857600080fd5b6151818a614a36565b985060208a013561519181614b07565b975060408a0135965060608a0135955060808a0135945060a08a013593506151bc8b60c08c01614c13565b92506101408a01356001600160401b03808211156151d957600080fd5b6151e58d838e01614c80565b93506101608c01359150808211156151fc57600080fd5b506152098c828d01614a93565b9150509295985092959850929598565b6000806040838503121561522c57600080fd5b8235915060208301356001600160401b03811115614e8d57600080fd5b60008060006060848603121561525e57600080fd5b833592506020840135915060408401356001600160401b03811115614f5c57600080fd5b60008083601f84011261529457600080fd5b5081356001600160401b038111156152ab57600080fd5b6020830191508360208285010111156152c357600080fd5b9250929050565b6000806000604084860312156152df57600080fd5b83356001600160401b038111156152f557600080fd5b61530186828701615282565b9094509250506020840135614b76816149ed565b60008060008060006080868803121561532d57600080fd5b8535945060208601356001600160401b0381111561534a57600080fd5b61535688828901615282565b909550935050604086013561536a816149ed565b949793965091946060013592915050565b60006020828403121561538d57600080fd5b81356001600160401b038111156153a357600080fd5b61336684828501614c80565b600080600080608085870312156153c557600080fd5b84356153d0816149ed565b93506153de60208601614a36565b92506040850135915060608501356153f581614b07565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161543e5761543e615416565b5060010190565b8181038181111561116157611161615416565b60006020828403121561546a57600080fd5b8151614a2f81614b07565b602081016111618284614eb9565b600181815b808511156154be5781600019048211156154a4576154a4615416565b808516156154b157918102915b93841c9390800290615488565b509250929050565b6000826154d557506001611161565b816154e257506000611161565b81600181146154f857600281146155025761551e565b6001915050611161565b60ff84111561551357615513615416565b50506001821b611161565b5060208310610133831016604e8410600b8410161715615541575081810a611161565b61554b8383615483565b806000190482111561555f5761555f615416565b029392505050565b600061115e60ff8416836154c6565b808202811582820484141761116157611161615416565b634e487b7160e01b600052601260045260246000fd5b6000826155b2576155b261558d565b500490565b6000806000606084860312156155cc57600080fd5b8351925060208401516155de81614b07565b6040850151909250614b7681614b07565b8082018082111561116157611161615416565b60006020828403121561561457600080fd5b5051919050565b60005b8381101561563657818101518382015260200161561e565b50506000910152565b6000825161565181846020870161561b565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261437760a0830184614e23565b600081518084526156a681602086016020860161561b565b601f01601f19169290920160200192915050565b828152604060208201526000613366604083018461568e565b60006101408083018a1515845260208a8186015289604086015288606086015287608086015261570660a0860188614e23565b6101208501929092528451908190526101608401918086019160005b8181101561573e57835185529382019392820192600101615722565b50929c9b505050505050505050505050565b84815283602082015260806040820152600061576f608083018561568e565b905082606083015295945050505050565b60006020828403121561579257600080fd5b8151614a2f816149ed565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b82016157cb576157cb615416565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b6000826158245761582461558d565b500690565b60008060006060848603121561583e57600080fd5b8351925060208401519150604084015160088110614b7657600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ffd4b8cc0150c09d914b76d2012f161e53d22e94660667769ec86952a8f5683364736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102c95760003560e01c806382d022371161017b578063c71f4253116100d7578063f6506db411610085578063f6506db414610968578063f7434ea914610988578063fbb519e7146109a8578063fbf405b0146109c8578063fc6f8f16146109e8578063fe4037e614610a08578063fe524c3914610a2857600080fd5b8063c71f425314610893578063cf0c38f8146108b3578063d07368bd146108d3578063d2b8035a146108f3578063d4d1d76a14610913578063d98493f614610928578063e4c0aaf41461094857600080fd5b8063acdbf51d11610134578063acdbf51d146107a8578063afe15cfb146107c8578063b0049637146107fd578063b44d573c1461081d578063c13517e11461084d578063c258bb1914610860578063c35699021461088057600080fd5b806382d02237146106e65780638456cb591461070657806386541b241461071b5780638a9bb02a1461073b5780638bb0487514610768578063a072b86c1461078857600080fd5b80632e2e936a1161022a57806352d1902d116101e357806352d1902d14610606578063564a565d1461061b57806359ec827e1461064c5780635c975abb1461066c578063751accd0146106865780637717a6e8146106a65780637934c0be146106c657600080fd5b80632e2e936a146105515780632fcb4f04146105715780633cfd1184146105915780633f4ba83a146105be578063452a9320146105d35780634f1ef286146105f357600080fd5b806319b815291161028757806319b81529146104035780631c3db16d146104335780631d7e6892146104705780631f5a0dd2146104905780632c053739146104f15780632d29a47b146105115780632e1daf2f1461053157600080fd5b8062f5822c146102ce5780630219da79146102f05780630b7414bc146103685780630c340a2414610388578063115d5376146103b55780631860592b146103d5575b600080fd5b3480156102da57600080fd5b506102ee6102e9366004614a12565b610a48565b005b3480156102fc57600080fd5b5061033b61030b366004614a12565b60086020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561037457600080fd5b506102ee610383366004614b20565b610a95565b34801561039457600080fd5b506000546103a8906001600160a01b031681565b60405161035f9190614b81565b3480156103c157600080fd5b506102ee6103d0366004614b95565b610bd6565b3480156103e157600080fd5b506103f56103f0366004614bae565b61110d565b60405190815260200161035f565b34801561040f57600080fd5b5061042361041e366004614b95565b611167565b604051901515815260200161035f565b34801561043f57600080fd5b5061045361044e366004614b95565b611260565b60408051938452911515602084015215159082015260600161035f565b34801561047c57600080fd5b506102ee61048b366004614bda565b611361565b34801561049c57600080fd5b506104b06104ab366004614b95565b6113b7565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e00161035f565b3480156104fd57600080fd5b506102ee61050c366004614cef565b611416565b34801561051d57600080fd5b506102ee61052c366004614ddc565b6114e8565b34801561053d57600080fd5b506004546103a8906001600160a01b031681565b34801561055d57600080fd5b50600b546103a8906001600160a01b031681565b34801561057d57600080fd5b506102ee61058c366004614a12565b61177e565b34801561059d57600080fd5b506105b16105ac366004614e08565b6117cb565b60405161035f9190614e46565b3480156105ca57600080fd5b506102ee611835565b3480156105df57600080fd5b506001546103a8906001600160a01b031681565b6102ee610601366004614e54565b6118b8565b34801561061257600080fd5b506103f5611adf565b34801561062757600080fd5b5061063b610636366004614b95565b611b3d565b60405161035f959493929190614edb565b34801561065857600080fd5b506103f5610667366004614b95565b611b99565b34801561067857600080fd5b506009546104239060ff1681565b34801561069257600080fd5b506102ee6106a1366004614f1a565b611cee565b3480156106b257600080fd5b506102ee6106c1366004614f72565b611d98565b3480156106d257600080fd5b506102ee6106e1366004614bda565b611e5b565b3480156106f257600080fd5b506102ee610701366004614f8e565b611eda565b34801561071257600080fd5b506102ee611f97565b34801561072757600080fd5b506102ee610736366004614fe0565b612037565b34801561074757600080fd5b5061075b61075636600461504e565b61221e565b60405161035f91906150b4565b34801561077457600080fd5b506102ee610783366004614b95565b6123aa565b34801561079457600080fd5b506102ee6107a3366004615159565b61250e565b3480156107b457600080fd5b506103a86107c3366004614b95565b61287f565b3480156107d457600080fd5b506107e86107e3366004614b95565b6128a9565b6040805192835260208301919091520161035f565b34801561080957600080fd5b506102ee610818366004614a12565b612955565b34801561082957600080fd5b50610423610838366004614a12565b600a6020526000908152604090205460ff1681565b6103f561085b366004615219565b6129a2565b34801561086c57600080fd5b506102ee61087b366004614a12565b6129da565b6102ee61088e366004615249565b612a27565b34801561089f57600080fd5b506103f56108ae366004614b95565b612efb565b3480156108bf57600080fd5b506003546103a8906001600160a01b031681565b3480156108df57600080fd5b506102ee6108ee366004614a12565b612f63565b3480156108ff57600080fd5b506102ee61090e36600461504e565b61300c565b34801561091f57600080fd5b506006546103f5565b34801561093457600080fd5b506103f56109433660046152ca565b613321565b34801561095457600080fd5b506102ee610963366004614a12565b61336e565b34801561097457600080fd5b506103f5610983366004615315565b6133bb565b34801561099457600080fd5b506103f56109a336600461537b565b6134a1565b3480156109b457600080fd5b506102ee6109c33660046153af565b6134ed565b3480156109d457600080fd5b506002546103a8906001600160a01b031681565b3480156109f457600080fd5b506103f5610a03366004614b95565b61352d565b348015610a1457600080fd5b506102ee610a23366004614a12565b61355c565b348015610a3457600080fd5b50610423610a43366004614f72565b6135a9565b6000546001600160a01b03163314610a735760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ac05760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610bd0578115610b5f57828181518110610ae457610ae4615400565b602002602001015160001480610b1757506006548351849083908110610b0c57610b0c615400565b602002602001015110155b15610b3557604051633d58a98960e11b815260040160405180910390fd5b610b5a84848381518110610b4b57610b4b615400565b602002602001015160016135f1565b610bbe565b6001838281518110610b7357610b73615400565b602002602001015103610b99576040516356d111fd60e11b815260040160405180910390fd5b610bbe84848381518110610baf57610baf615400565b602002602001015160006135f1565b80610bc88161542c565b915050610ac3565b50505050565b600060078281548110610beb57610beb615400565b600091825260208220600490910201805460058054929450916001600160601b03909116908110610c1e57610c1e615400565b6000918252602082206003850154600c909202019250610c4090600190615445565b90506000836003018281548110610c5957610c59615400565b600091825260208220600b909102019150600185015460ff166004811115610c8357610c83614ea3565b03610d5e5781158015610cd257506001840154600684019060ff166004811115610caf57610caf614ea3565b60048110610cbf57610cbf615400565b01546002850154610cd09042615445565b105b15610cf057604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610d18576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610d2f576002610d32565b60015b60018086018054909160ff1990911690836004811115610d5457610d54614ea3565b02179055506110bf565b60018085015460ff166004811115610d7857610d78614ea3565b03610e88576001840154600684019060ff166004811115610d9b57610d9b614ea3565b60048110610dab57610dab615400565b01546002850154610dbc9042615445565b108015610e5357506006816000015481548110610ddb57610ddb615400565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e519190615458565b155b15610e7157604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610d54565b6002600185015460ff166004811115610ea357610ea3614ea3565b03610ff1576001840154600684019060ff166004811115610ec657610ec6614ea3565b60048110610ed657610ed6615400565b01546002850154610ee79042615445565b108015610f7e57506006816000015481548110610f0657610f06615400565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c9190615458565b155b15610f9c57604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a36110bf565b6003600185015460ff16600481111561100c5761100c614ea3565b03611086576001840154600684019060ff16600481111561102f5761102f614ea3565b6004811061103f5761103f615400565b015460028501546110509042615445565b101561106f57604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610d54565b6004600185015460ff1660048111156110a1576110a1614ea3565b036110bf576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b91916110fe9160ff1690615475565b60405180910390a25050505050565b6001600160a01b03821660009081526008602052604081205461010081046001600160401b03169061114a90600160481b900460ff16600a615567565b6111549084615576565b61115e91906155a3565b90505b92915050565b6000806007838154811061117d5761117d615400565b60009182526020822060036004909202019081018054919350906111a390600190615445565b815481106111b3576111b3615400565b600091825260208220845460058054600b909402909201945090916001600160601b039091169081106111e8576111e8615400565b90600052602060002090600c0201905080600501548260030154101561121357506000949350505050565b80546005805490916001600160601b031690811061123357611233615400565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b6000806000806007858154811061127957611279615400565b600091825260208220600360049092020190810180549193509061129f90600190615445565b815481106112af576112af615400565b90600052602060002090600b02019050600060068260000154815481106112d8576112d8615400565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa15801561132d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135191906155b7565b9199909850909650945050505050565b6000546001600160a01b0316331461138c5760405163c383977560e01b815260040160405180910390fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600581815481106113c757600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff168061145f575080546001600160401b03808416911610155b1561147c5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b1760ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050505050565b60095460ff161561150c57604051636f1dac1d60e01b815260040160405180910390fd5b6000806007858154811061152257611522615400565b600091825260209091206004918202019150600182015460ff16600481111561154d5761154d614ea3565b1461156b57604051638794ce4b60e01b815260040160405180910390fd5b80600301848154811061158057611580615400565b6000918252602082206004600b909202019081015490935091506115a484836155ef565b60058401546006850154600286015492935090916000906115c69083906155a3565b905060008660010154905060008060068960000154815481106115eb576115eb615400565b60009182526020909120015460405163368efae360e21b8152600481018e9052602481018d90526001600160a01b039091169150819063da3beb8c90604401602060405180830381865afa158015611647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166b9190615602565b915050806000036116875783861115611682578395505b6116a7565b611692846002615576565b8611156116a7576116a4846002615576565b95505b60048801869055865b8681101561175d5784811015611709576117026040518061010001604052808e81526020018d815260200184815260200187815260200186815260200185815260200188815260200183815250613679565b955061174b565b61174b6040518061010001604052808e81526020018d815260200184815260200187815260200186815260200185815260200188815260200183815250613b4a565b806117558161542c565b9150506116b0565b508488600501541461177157600588018590555b5050505050505050505050565b6000546001600160a01b031633146117a95760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6117d3614942565b6005826001600160601b0316815481106117ef576117ef615400565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b8154815260200190600101908083116118165750505050509050919050565b6000546001600160a01b031633146118605760405163c383977560e01b815260040160405180910390fd5b60095460ff166118835760405163b4143dc760e01b815260040160405180910390fd5b6009805460ff191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b6118c182614082565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061193f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661193360008051602061585c8339815191525490565b6001600160a01b031614155b1561195d5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156119b7575060408051601f3d908101601f191682019092526119b491810190615602565b60015b6119df5781604051630c76093760e01b81526004016119d69190614b81565b60405180910390fd5b60008051602061585c8339815191528114611a1057604051632a87526960e21b8152600481018290526024016119d6565b60008051602061585c8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611ad9576000836001600160a01b031683604051611a77919061563f565b600060405180830381855af49150503d8060008114611ab2576040519150601f19603f3d011682016040523d82523d6000602084013e611ab7565b606091505b5050905080610bd0576040516339b21b5d60e11b815260040160405180910390fd5b505b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611b2a5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061585c83398151915290565b60078181548110611b4d57600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b60008060078381548110611baf57611baf615400565b6000918252602082206003600490920201908101805491935090611bd590600190615445565b81548110611be557611be5615400565b600091825260208220845460058054600b909402909201945090916001600160601b03909116908110611c1a57611c1a615400565b90600052602060002090600c020190508060050154826003015410611cb95782546001600160601b031660001901611c5b576001600160ff1b039350611ce6565b6003820154611c6b906002615576565b611c769060016155ef565b81546005805490916001600160601b0316908110611c9657611c96615400565b90600052602060002090600c020160040154611cb29190615576565b9350611ce6565b6003820154611cc9906002615576565b611cd49060016155ef565b8160040154611ce39190615576565b93505b505050919050565b6000546001600160a01b03163314611d195760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611d34919061563f565b60006040518083038185875af1925050503d8060008114611d71576040519150601f19603f3d011682016040523d82523d6000602084013e611d76565b606091505b5050905080610bd0576040516322092f2f60e11b815260040160405180910390fd5b60095460ff1615611dbc57604051636f1dac1d60e01b815260040160405180910390fd5b600b546040516370a0823160e01b81526001600160a01b03909116906370a0823190611dec903390600401614b81565b602060405180830381865afa158015611e09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2d9190615602565b600003611e4d576040516326b551e560e11b815260040160405180910390fd5b611ad93383836000806140b0565b6000546001600160a01b03163314611e865760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611f055760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260086020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6001546001600160a01b03163314801590611fbd57506000546001600160a01b03163314155b15611fdb57604051636b29334f60e01b815260040160405180910390fd5b60095460ff1615611fff57604051636f1dac1d60e01b815260040160405180910390fd5b6009805460ff191660011790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000546001600160a01b031633146120625760405163c383977560e01b815260040160405180910390fd5b60006005886001600160601b03168154811061208057612080615400565b90600052602060002090600c0201905060016001600160601b0316886001600160601b0316141580156120e2575080546005805488926001600160601b03169081106120ce576120ce615400565b90600052602060002090600c020160020154115b1561210057604051639717078960e01b815260040160405180910390fd5b60005b60018201548110156121855786600583600101838154811061212757612127615400565b90600052602060002001548154811061214257612142615400565b90600052602060002090600c020160020154101561217357604051639717078960e01b815260040160405180910390fd5b8061217d8161542c565b915050612103565b5060028101869055805460ff60601b1916600160601b88151502178155600381018590556004808201859055600582018490556121c89060068301908490614960565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a88888888888860405161220c9695949392919061565b565b60405180910390a25050505050505050565b61228460405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b6007838154811061229757612297615400565b906000526020600020906004020160030182815481106122b9576122b9615400565b90600052602060002090600b0201604051806101600160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820180548060200260200160405190810160405280929190818152602001828054801561236857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161234a575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b6000600782815481106123bf576123bf615400565b600091825260209091206004918202019150600182015460ff1660048111156123ea576123ea614ea3565b1461240857604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff16156124335760405163c977f8d360e01b815260040160405180910390fd5b600061243e83611260565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b1580156124f157600080fd5b505af1158015612505573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146125395760405163c383977560e01b815260040160405180910390fd5b8660058a6001600160601b03168154811061255657612556615400565b90600052602060002090600c020160020154111561258757604051639717078960e01b815260040160405180910390fd5b80516000036125a95760405163402585f560e01b815260040160405180910390fd5b6001600160601b0389166125d057604051631ef4f64960e01b815260040160405180910390fd5b60058054600181018255600091825290600c82027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001905b83518110156126ce5783818151811061262357612623615400565b6020026020010151600014806126565750600654845185908390811061264b5761264b615400565b602002602001015110155b1561267457604051633d58a98960e11b815260040160405180910390fd5b600182600a01600086848151811061268e5761268e615400565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806126c69061542c565b915050612608565b5060016000908152600a8201602052604090205460ff16612702576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c16178155604080516000815260208101918290525161273a91600184019161499e565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561277d9060068301908790614960565b50600480546040516311de995760e21b81526001600160a01b039091169163477a655c916127af9186918991016156ba565b600060405180830381600087803b1580156127c957600080fd5b505af11580156127dd573d6000803e3d6000fd5b5050505060058b6001600160601b0316815481106127fd576127fd615400565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d9061286a908e908e908e908e908e908e908d906156d3565b60405180910390a35050505050505050505050565b6006818154811061288f57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000806000600784815481106128c1576128c1615400565b6000918252602090912060049091020190506003600182015460ff1660048111156128ee576128ee614ea3565b03612946576002810154815460058054929550916001600160601b0390911690811061291c5761291c615400565b600091825260209091206009600c909202010154600282015461293f91906155ef565b915061294f565b60009250600091505b50915091565b6000546001600160a01b031633146129805760405163c383977560e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006129ad826134a1565b3410156129cd57604051630e3360f160e21b815260040160405180910390fd5b61115e838360003461426a565b6000546001600160a01b03163314612a055760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612a3083611b99565b341015612a5057604051633191f8f160e01b815260040160405180910390fd5b600060078481548110612a6557612a65615400565b6000918252602090912060049091020190506003600182015460ff166004811115612a9257612a92614ea3565b14612ab0576040516337cdefcb60e21b815260040160405180910390fd5b60038101805460009190612ac690600190615445565b81548110612ad657612ad6615400565b90600052602060002090600b020190506006816000015481548110612afd57612afd615400565b6000918252602090912001546001600160a01b03163314612b315760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600580546001600160601b0390951694600b9093029091019184908110612b7457612b74615400565b90600052602060002090600c020160050154846003015410612c7d576005836001600160601b031681548110612bac57612bac615400565b60009182526020909120600c9091020154600580546001600160601b0390921694509084908110612bdf57612bdf615400565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612c0b57600191505b84546001600160601b03848116911614612c7d57845460038601546001600160601b0390911690612c3e90600190615445565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560058054600092908110612cc057612cc0615400565b90600052602060002090600c02019050806004015434612ce091906155a3565b826003018190555061271081600301548260020154612cff9190615576565b612d0991906155a3565b60018084019190915534600284015583835560045460038801546001600160a01b039091169163d09f392d918c91612d4091615445565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612d7e57600080fd5b505af1158015612d92573d6000803e3d6000fd5b505086548454149150612e7890505784546003870154612db490600190615445565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46006826000015481548110612e0257612e02615400565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612e45918d918d918d9190600401615750565b600060405180830381600087803b158015612e5f57600080fd5b505af1158015612e73573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612ee89190615475565b60405180910390a2505050505050505050565b60008060078381548110612f1157612f11615400565b906000526020600020906004020190508060030160018260030180549050612f399190615445565b81548110612f4957612f49615400565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612f8e5760405163c383977560e01b815260040160405180910390fd5b6006805460018101825560009182527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b60006007838154811061302157613021615400565b906000526020600020906004020190506000600182600301805490506130479190615445565b9050600082600301828154811061306057613060615400565b600091825260208220600b909102019150600184015460ff16600481111561308a5761308a614ea3565b146130a857604051638285c4ef60e01b815260040160405180910390fd5b600060068260000154815481106130c1576130c1615400565b6000918252602082200154600a8401546001600160a01b039091169250905b86811080156130f6575060038401546006850154105b156132fe5760006001600160a01b03841663d2b8035a8a846131178161542c565b955061312390876155ef565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af1158015613166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318a9190615780565b90506001600160a01b0381166131a057506130e0565b6004805460018701546040516310f0b12f60e11b81526001600160a01b03909216926321e1625e926131d692869290910161579d565b600060405180830381600087803b1580156131f057600080fd5b505af1158015613204573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b91613251918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b03841617905560038601549054036132f85760048054604051632e96bc2360e11b81529182018b9052602482018890526001600160a01b031690635d2d784690604401600060405180830381600087803b1580156132df57600080fd5b505af11580156132f3573d6000803e3d6000fd5b505050505b506130e0565b8084600a01600082825461331291906155ef565b90915550505050505050505050565b6000613366826103f086868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134a192505050565b949350505050565b6000546001600160a01b031633146133995760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526008602052604081205460ff166133f45760405163e51cf7bf60e01b815260040160405180910390fd5b6133ff858585613321565b82101561341f57604051630e3360f160e21b815260040160405180910390fd5b6134346001600160a01b0384163330856142a6565b613451576040516312171d8360e31b815260040160405180910390fd5b6134958686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925087915061426a9050565b90505b95945050505050565b60008060006134af84614382565b5091509150806005836001600160601b0316815481106134d1576134d1615400565b90600052602060002090600c0201600401546133669190615576565b6004546001600160a01b0316331461351857604051639d6cab9960e01b815260040160405180910390fd5b6135268484848460016140b0565b5050505050565b60006007828154811061354257613542615400565b600091825260209091206003600490920201015492915050565b6000546001600160a01b031633146135875760405163c383977560e01b815260040160405180910390fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60006005836001600160601b0316815481106135c7576135c7615400565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806005846001600160601b03168154811061360e5761360e615400565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b600080600783600001518154811061369357613693615400565b906000526020600020906004020190506000816003018460200151815481106136be576136be615400565b90600052602060002090600b02019050600060068260000154815481106136e7576136e7615400565b60009182526020808320919091015487519188015160e089015160808a015160a08b01516040516333ac937b60e11b8152600481019690965260248601939093526044850191909152606484015260848301526001600160a01b03169250829063675926f69060a401602060405180830381865afa15801561376d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137919190615602565b90506127108111156137a257506127105b60006127106137b18382615445565b85600101546137c09190615576565b6137ca91906155a3565b9050808760c0018181516137de91906155ef565b90525060e08701516006850180546000929081106137fe576137fe615400565b6000918252602090912001546004805460405163965af6c760e01b81526001600160a01b03938416945092169163965af6c79161383f91859187910161579d565b600060405180830381600087803b15801561385957600080fd5b505af115801561386d573d6000803e3d6000fd5b505060048054604051633c85b79360e21b81526001600160a01b03909116935063f216de4c92506138a291859187910161579d565b600060405180830381600087803b1580156138bc57600080fd5b505af11580156138d0573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e786613910876157b6565b60098b01546040516139329392916000916001600160a01b03909116906157d2565b60405180910390a48751602089015160e08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa158015613999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139bd9190615458565b613a23576004805460405163b5d69e9960e01b81526001600160a01b039091169163b5d69e99916139f091859101614b81565b600060405180830381600087803b158015613a0a57600080fd5b505af1158015613a1e573d6000803e3d6000fd5b505050505b60018860600151613a349190615445565b8860e00151148015613a4857506040880151155b15613b395760098501546001600160a01b0316613a91576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f1935050505050613ab8565b60005460028601546009870154613ab6926001600160a01b0391821692911690614409565b505b60005460c0890151600254613adb926001600160a01b0391821692911690614409565b506020880151885160c08a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf493613b3093909290916001600160a01b03909116906157f6565b60405180910390a35b50505060c090940151949350505050565b60006007826000015181548110613b6357613b63615400565b90600052602060002090600402019050600081600301836020015181548110613b8e57613b8e615400565b90600052602060002090600b0201905060006006826000015481548110613bb757613bb7615400565b6000918252602080832090910154865191870151606088015160e08901516001600160a01b039093169550859363675926f693909291613bf691615815565b60808a015160a08b01516040516001600160e01b031960e088901b1681526004810195909552602485019390935260448401919091526064830152608482015260a401602060405180830381865afa158015613c56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c7a9190615602565b9050612710811115613c8b57506127105b60008360060186606001518760e00151613ca59190615815565b81548110613cb557613cb5615400565b600091825260208220015460018601546001600160a01b03909116925061271090613ce1908590615576565b613ceb91906155a3565b6004805460405163965af6c760e01b81529293506001600160a01b03169163965af6c791613d1d91869186910161579d565b600060405180830381600087803b158015613d3757600080fd5b505af1158015613d4b573d6000803e3d6000fd5b505060048054604051636624192f60e01b81526001600160a01b039091169350636624192f9250613d7e91869101614b81565b602060405180830381865afa158015613d9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dbf9190615458565b613ddc57600254613dda906001600160a01b03168383614409565b505b60006127108489604001518a60c00151613df691906155a3565b613e009190615576565b613e0a91906155a3565b905080866008016000828254613e2091906155ef565b925050819055506000612710858a604001518960020154613e4191906155a3565b613e4b9190615576565b613e5591906155a3565b905080876007016000828254613e6b91906155ef565b9091555050600254613e87906001600160a01b03168584614409565b5060098701546001600160a01b0316613ec5576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613ee0565b6009870154613ede906001600160a01b03168583614409565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613f30928c928a928a92909116906157d2565b60405180910390a4600189606001516002613f4b9190615576565b613f559190615445565b8960e001510361407757600087600801548a60c00151613f759190615445565b9050600088600701548960020154613f8d9190615445565b905081151580613f9c57508015155b15611771578115613fc657600054600254613fc4916001600160a01b03918216911684614409565b505b801561402d5760098901546001600160a01b031661400c57600080546040516001600160a01b039091169183156108fc02918491818181858888f193505050505061402d565b60005460098a015461402b916001600160a01b03918216911683614409565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161286a91879187916001600160a01b03909116906157f6565b505050505050505050565b6000546001600160a01b031633146140ad5760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b03851615806140d257506005546001600160601b038616115b156140ea576140e28260046144d6565b506000613498565b831580159061412557506005856001600160601b03168154811061411057614110615400565b90600052602060002090600c02016002015484105b15614135576140e28260056144d6565b60048054604051630a5861b960e41b81526001600160a01b03898116938201939093526001600160601b03881660248201526044810187905285151560648201526000928392839291169063a5861b90906084016060604051808303816000875af11580156141a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141cc9190615829565b9194509250905060008160078111156141e7576141e7614ea3565b14614202576141f685826144d6565b60009350505050613498565b821561422f57600254614220906001600160a01b03168a30866142a6565b61422f576141f68560016144d6565b811561425b5760025461424c906001600160a01b03168a84614409565b61425b576141f68560026144d6565b50600198975050505050505050565b336000908152600a602052604081205460ff1661429a57604051630407618360e31b815260040160405180910390fd5b61349885858585614544565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b1790525161430b919061563f565b6000604051808303816000865af19150503d8060008114614348576040519150601f19603f3d011682016040523d82523d6000602084013e61434d565b606091505b50915091508180156143775750805115806143775750808060200190518101906143779190615458565b979650505050505050565b600080600060408451106143f7575050506020810151604082015160608301516001600160601b03831615806143c357506005546001600160601b03841610155b156143cd57600192505b816000036143da57600391505b8015806143e957506006548110155b156143f2575060015b614402565b506001915060039050815b9193909250565b6000806000856001600160a01b0316858560405160240161442b92919061579d565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b17905251614460919061563f565b6000604051808303816000865af19150503d806000811461449d576040519150601f19603f3d011682016040523d82523d6000602084013e6144a2565b606091505b50915091508180156144cc5750805115806144cc5750808060200190518101906144cc9190615458565b9695505050505050565b6144e0828261482b565b60068160078111156144f4576144f4614ea3565b0361451257604051636590e91560e01b815260040160405180910390fd5b600781600781111561452657614526614ea3565b03611adb576040516358859f1d60e01b815260040160405180910390fd5b600080600061455286614382565b92505091506005826001600160601b03168154811061457357614573615400565b60009182526020808320848452600a600c90930201919091019052604090205460ff166145b35760405163b34eb75d60e01b815260040160405180910390fd5b600780546001810182556000918252600160601b33026001600160601b03851617600482027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888101918255427fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a90910155600680549296509092918490811061463e5761463e615400565b6000918252602082200154600580546001600160a01b039092169350906001600160601b03871690811061467457614674615400565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156146bf576146ba8a846004015461110d565b6146c5565b82600401545b90506146d1818a6155a3565b6003808401919091558683558301546002840154612710916146f291615576565b6146fc91906155a3565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c8116919091179091556004805460405163d09f392d60e01b81529182018b9052600060248301529091169063d09f392d90604401600060405180830381600087803b15801561476f57600080fd5b505af1158015614783573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016147bd9493929190615750565b600060405180830381600087803b1580156147d757600080fd5b505af11580156147eb573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b600182600181111561483f5761483f614ea3565b03614848575050565b600181600781111561485c5761485c614ea3565b0361487a57604051630f323ed960e11b815260040160405180910390fd5b600281600781111561488e5761488e614ea3565b036148ac5760405163e45e13a360e01b815260040160405180910390fd5b60038160078111156148c0576148c0614ea3565b036148de57604051631d91d0ed60e31b815260040160405180910390fd5b60048160078111156148f2576148f2614ea3565b03614910576040516321f1774b60e11b815260040160405180910390fd5b600581600781111561492457614924614ea3565b03611adb57604051630caac6b360e31b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b826004810192821561498e579160200282015b8281111561498e578251825591602001919060010190614973565b5061499a9291506149d8565b5090565b82805482825590600052602060002090810192821561498e579160200282018281111561498e578251825591602001919060010190614973565b5b8082111561499a57600081556001016149d9565b6001600160a01b03811681146140ad57600080fd5b8035614a0d816149ed565b919050565b600060208284031215614a2457600080fd5b8135614a2f816149ed565b9392505050565b80356001600160601b0381168114614a0d57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614a8b57614a8b614a4d565b604052919050565b600082601f830112614aa457600080fd5b813560206001600160401b03821115614abf57614abf614a4d565b8160051b614ace828201614a63565b9283528481018201928281019087851115614ae857600080fd5b83870192505b8483101561437757823582529183019190830190614aee565b80151581146140ad57600080fd5b8035614a0d81614b07565b600080600060608486031215614b3557600080fd5b614b3e84614a36565b925060208401356001600160401b03811115614b5957600080fd5b614b6586828701614a93565b9250506040840135614b7681614b07565b809150509250925092565b6001600160a01b0391909116815260200190565b600060208284031215614ba757600080fd5b5035919050565b60008060408385031215614bc157600080fd5b8235614bcc816149ed565b946020939093013593505050565b60008060408385031215614bed57600080fd5b8235614bf8816149ed565b91506020830135614c0881614b07565b809150509250929050565b600082601f830112614c2457600080fd5b604051608081018181106001600160401b0382111715614c4657614c46614a4d565b604052806080840185811115614c5b57600080fd5b845b81811015614c75578035835260209283019201614c5d565b509195945050505050565b600082601f830112614c9157600080fd5b81356001600160401b03811115614caa57614caa614a4d565b614cbd601f8201601f1916602001614a63565b818152846020838601011115614cd257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060008060006102208c8e031215614d1157600080fd5b8b35614d1c816149ed565b9a5060208c0135614d2c816149ed565b9950614d3a60408d01614a02565b9850614d4860608d01614a02565b9750614d5660808d01614a02565b9650614d6460a08d01614b15565b9550614d738d60c08e01614c13565b9450614d838d6101408e01614c13565b93506101c08c01356001600160401b03811115614d9f57600080fd5b614dab8e828f01614c80565b935050614dbb6101e08d01614a02565b9150614dca6102008d01614a02565b90509295989b509295989b9093969950565b600080600060608486031215614df157600080fd5b505081359360208301359350604090920135919050565b600060208284031215614e1a57600080fd5b61115e82614a36565b8060005b6004811015610bd0578151845260209384019390910190600101614e27565b608081016111618284614e23565b60008060408385031215614e6757600080fd5b8235614e72816149ed565b915060208301356001600160401b03811115614e8d57600080fd5b614e9985828601614c80565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b60058110614ed757634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a08101614f076040830186614eb9565b9215156060820152608001529392505050565b600080600060608486031215614f2f57600080fd5b8335614f3a816149ed565b92506020840135915060408401356001600160401b03811115614f5c57600080fd5b614f6886828701614c80565b9150509250925092565b60008060408385031215614f8557600080fd5b614bcc83614a36565b600080600060608486031215614fa357600080fd5b8335614fae816149ed565b925060208401356001600160401b0381168114614fca57600080fd5b9150604084013560ff81168114614b7657600080fd5b6000806000806000806000610140888a031215614ffc57600080fd5b61500588614a36565b9650602088013561501581614b07565b955060408801359450606088013593506080880135925060a088013591506150408960c08a01614c13565b905092959891949750929550565b6000806040838503121561506157600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156150a95781516001600160a01b031687529582019590820190600101615084565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e085015261510f610180850183615070565b60e08601516101008681019190915286015161012080870191909152860151909250610140615148818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101808a8c03121561517857600080fd5b6151818a614a36565b985060208a013561519181614b07565b975060408a0135965060608a0135955060808a0135945060a08a013593506151bc8b60c08c01614c13565b92506101408a01356001600160401b03808211156151d957600080fd5b6151e58d838e01614c80565b93506101608c01359150808211156151fc57600080fd5b506152098c828d01614a93565b9150509295985092959850929598565b6000806040838503121561522c57600080fd5b8235915060208301356001600160401b03811115614e8d57600080fd5b60008060006060848603121561525e57600080fd5b833592506020840135915060408401356001600160401b03811115614f5c57600080fd5b60008083601f84011261529457600080fd5b5081356001600160401b038111156152ab57600080fd5b6020830191508360208285010111156152c357600080fd5b9250929050565b6000806000604084860312156152df57600080fd5b83356001600160401b038111156152f557600080fd5b61530186828701615282565b9094509250506020840135614b76816149ed565b60008060008060006080868803121561532d57600080fd5b8535945060208601356001600160401b0381111561534a57600080fd5b61535688828901615282565b909550935050604086013561536a816149ed565b949793965091946060013592915050565b60006020828403121561538d57600080fd5b81356001600160401b038111156153a357600080fd5b61336684828501614c80565b600080600080608085870312156153c557600080fd5b84356153d0816149ed565b93506153de60208601614a36565b92506040850135915060608501356153f581614b07565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161543e5761543e615416565b5060010190565b8181038181111561116157611161615416565b60006020828403121561546a57600080fd5b8151614a2f81614b07565b602081016111618284614eb9565b600181815b808511156154be5781600019048211156154a4576154a4615416565b808516156154b157918102915b93841c9390800290615488565b509250929050565b6000826154d557506001611161565b816154e257506000611161565b81600181146154f857600281146155025761551e565b6001915050611161565b60ff84111561551357615513615416565b50506001821b611161565b5060208310610133831016604e8410600b8410161715615541575081810a611161565b61554b8383615483565b806000190482111561555f5761555f615416565b029392505050565b600061115e60ff8416836154c6565b808202811582820484141761116157611161615416565b634e487b7160e01b600052601260045260246000fd5b6000826155b2576155b261558d565b500490565b6000806000606084860312156155cc57600080fd5b8351925060208401516155de81614b07565b6040850151909250614b7681614b07565b8082018082111561116157611161615416565b60006020828403121561561457600080fd5b5051919050565b60005b8381101561563657818101518382015260200161561e565b50506000910152565b6000825161565181846020870161561b565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261437760a0830184614e23565b600081518084526156a681602086016020860161561b565b601f01601f19169290920160200192915050565b828152604060208201526000613366604083018461568e565b60006101408083018a1515845260208a8186015289604086015288606086015287608086015261570660a0860188614e23565b6101208501929092528451908190526101608401918086019160005b8181101561573e57835185529382019392820192600101615722565b50929c9b505050505050505050505050565b84815283602082015260806040820152600061576f608083018561568e565b905082606083015295945050505050565b60006020828403121561579257600080fd5b8151614a2f816149ed565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b82016157cb576157cb615416565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b6000826158245761582461558d565b500690565b60008060006060848603121561583e57600080fd5b8351925060208401519150604084015160088110614b7657600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ffd4b8cc0150c09d914b76d2012f161e53d22e94660667769ec86952a8f5683364736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "AcceptedFeeToken(address,bool)": { + "details": "To be emitted when an ERC20 token is added or removed as a method to pay fees.", + "params": { + "_accepted": "Whether the token is accepted or not.", + "_token": "The ERC20 token." + } + }, + "DisputeCreation(uint256,address)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_arbitrable": "The contract which created the dispute.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "NewCurrencyRate(address,uint64,uint8)": { + "details": "To be emitted when the fee for a particular ERC20 token is updated.", + "params": { + "_feeToken": "The ERC20 token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrable": "The arbitrable receiving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "addNewDisputeKit(address)": { + "details": "Add a new supported dispute kit module to the court.", + "params": { + "_disputeKitAddress": "The address of the dispute kit contract." + } + }, + "appeal(uint256,uint256,bytes)": { + "details": "Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.", + "params": { + "_disputeID": "The ID of the dispute.", + "_extraData": "Extradata for the dispute. Can be required during court jump.", + "_numberOfChoices": "Number of choices for the dispute. Can be required during court jump." + } + }, + "appealCost(uint256)": { + "details": "Gets the cost of appealing a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "cost": "The appeal cost." + } + }, + "appealPeriod(uint256)": { + "details": "Gets the start and the end of a specified dispute's current appeal period.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "end": "The end of the appeal period.", + "start": "The start of the appeal period." + } + }, + "arbitrationCost(bytes)": { + "details": "Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes)." + }, + "returns": { + "cost": "The arbitration cost in ETH." + } + }, + "arbitrationCost(bytes,address)": { + "details": "Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeToken": "The ERC20 token used to pay fees." + }, + "returns": { + "cost": "The arbitration cost in `_feeToken`." + } + }, + "changeAcceptedFeeTokens(address,bool)": { + "details": "Changes the supported fee tokens.", + "params": { + "_accepted": "Whether the token is supported or not as a method of fee payment.", + "_feeToken": "The fee token." + } + }, + "changeArbitrableWhitelist(address,bool)": { + "details": "Adds or removes an arbitrable from whitelist.", + "params": { + "_allowed": "Whether add or remove permission.", + "_arbitrable": "Arbitrable address." + } + }, + "changeCurrencyRates(address,uint64,uint8)": { + "details": "Changes the currency rate of a fee token.", + "params": { + "_feeToken": "The fee token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "changeGuardian(address)": { + "details": "Changes the `guardian` storage variable.", + "params": { + "_guardian": "The new value for the `guardian` storage variable." + } + }, + "changeJurorNft(address)": { + "details": "Changes the `jurorNft` storage variable.", + "params": { + "_jurorNft": "The new value for the `jurorNft` storage variable." + } + }, + "changeJurorProsecutionModule(address)": { + "details": "Changes the `jurorProsecutionModule` storage variable.", + "params": { + "_jurorProsecutionModule": "The new value for the `jurorProsecutionModule` storage variable." + } + }, + "changePinakion(address)": { + "details": "Changes the `pinakion` storage variable.", + "params": { + "_pinakion": "The new value for the `pinakion` storage variable." + } + }, + "changeSortitionModule(address)": { + "details": "Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.", + "params": { + "_sortitionModule": "The new value for the `sortitionModule` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])": { + "details": "Creates a court under a specified parent court.", + "params": { + "_alpha": "The `alpha` property value of the court.", + "_feeForJuror": "The `feeForJuror` property value of the court.", + "_hiddenVotes": "The `hiddenVotes` property value of the court.", + "_jurorsForCourtJump": "The `jurorsForCourtJump` property value of the court.", + "_minStake": "The `minStake` property value of the court.", + "_parent": "The `parent` property value of the court.", + "_sortitionExtraData": "Extra data for sortition module.", + "_supportedDisputeKits": "Indexes of dispute kits that this court will support.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the court." + } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "createDispute(uint256,bytes,address,uint256)": { + "details": "Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeAmount": "Amount of the ERC20 token used to pay fees.", + "_feeToken": "The ERC20 token used to pay fees.", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws jurors for the dispute. Can be called in parts.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run." + } + }, + "enableDisputeKits(uint96,uint256[],bool)": { + "details": "Adds/removes court's support for specified dispute kits.", + "params": { + "_courtID": "The ID of the court.", + "_disputeKitIDs": "The IDs of dispute kits which support should be added/removed.", + "_enable": "Whether add or remove the dispute kits from the court." + } + }, + "execute(uint256,uint256,uint256)": { + "details": "Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts. Note: Reward distributions are forbidden during pause.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run.", + "_round": "The appeal round." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "executeRuling(uint256)": { + "details": "Executes a specified dispute's ruling.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getNumberOfVotes(uint256)": { + "details": "Gets the number of votes permitted for the specified dispute in the latest round.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getTimesPerPeriod(uint96)": { + "details": "Gets the timesPerPeriod array for a given court.", + "params": { + "_courtID": "The ID of the court to get the times from." + }, + "returns": { + "timesPerPeriod": "The timesPerPeriod array for the given court." + } + }, + "initialize(address,address,address,address,address,bool,uint256[4],uint256[4],bytes,address,address)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_courtParameters": "Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).", + "_disputeKit": "The address of the default dispute kit.", + "_governor": "The governor's address.", + "_guardian": "The guardian's address.", + "_hiddenVotes": "The `hiddenVotes` property value of the general court.", + "_jurorNft": "NFT contract to vet the jurors.", + "_jurorProsecutionModule": "The address of the juror prosecution module.", + "_pinakion": "The address of the token contract.", + "_sortitionExtraData": "The extra data for sortition module.", + "_sortitionModuleAddress": "The sortition module responsible for sortition of the jurors.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the general court." + } + }, + "isDisputeKitJumping(uint256)": { + "details": "Returns true if the dispute kit will be switched to a parent DK.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "_0": "Whether DK will be switched or not." + } + }, + "passPeriod(uint256)": { + "details": "Passes the period of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "pause()": { + "details": "Pause staking and reward execution. Can only be done by guardian or governor." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setStake(uint96,uint256)": { + "details": "Sets the caller's stake in a court. Note: Staking and unstaking is forbidden during pause.", + "params": { + "_courtID": "The ID of the court.", + "_newStake": "The new stake. Note that the existing delayed stake will be nullified as non-relevant." + } + }, + "setStakeBySortitionModule(address,uint96,uint256,bool)": { + "details": "Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.", + "params": { + "_account": "The account whose stake is being set.", + "_alreadyTransferred": "Whether the PNKs have already been transferred to the contract.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + } + }, + "unpause()": { + "details": "Unpause staking and reward execution. Can only be done by governor." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "KlerosCoreNeo Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 338, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 340, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "guardian", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 343, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "pinakion", + "offset": 0, + "slot": "2", + "type": "t_contract(IERC20)77" + }, + { + "astId": 345, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "jurorProsecutionModule", + "offset": 0, + "slot": "3", + "type": "t_address" + }, + { + "astId": 348, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "sortitionModule", + "offset": 0, + "slot": "4", + "type": "t_contract(ISortitionModule)4413" + }, + { + "astId": 352, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "courts", + "offset": 0, + "slot": "5", + "type": "t_array(t_struct(Court)257_storage)dyn_storage" + }, + { + "astId": 356, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disputeKits", + "offset": 0, + "slot": "6", + "type": "t_array(t_contract(IDisputeKit)4289)dyn_storage" + }, + { + "astId": 360, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disputes", + "offset": 0, + "slot": "7", + "type": "t_array(t_struct(Dispute)274_storage)dyn_storage" + }, + { + "astId": 366, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "currencyRates", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_contract(IERC20)77,t_struct(CurrencyRate)323_storage)" + }, + { + "astId": 368, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "paused", + "offset": 0, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 3808, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "arbitrableWhitelist", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 3811, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "jurorNft", + "offset": 0, + "slot": "11", + "type": "t_contract(IERC721)193" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "base": "t_address", + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_contract(IDisputeKit)4289)dyn_storage": { + "base": "t_contract(IDisputeKit)4289", + "encoding": "dynamic_array", + "label": "contract IDisputeKit[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Court)257_storage)dyn_storage": { + "base": "t_struct(Court)257_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCoreBase.Court[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Dispute)274_storage)dyn_storage": { + "base": "t_struct(Dispute)274_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCoreBase.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)299_storage)dyn_storage": { + "base": "t_struct(Round)299_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCoreBase.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)4_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[4]", + "numberOfBytes": "128" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IArbitrableV2)4046": { + "encoding": "inplace", + "label": "contract IArbitrableV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeKit)4289": { + "encoding": "inplace", + "label": "contract IDisputeKit", + "numberOfBytes": "20" + }, + "t_contract(IERC20)77": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IERC721)193": { + "encoding": "inplace", + "label": "contract IERC721", + "numberOfBytes": "20" + }, + "t_contract(ISortitionModule)4413": { + "encoding": "inplace", + "label": "contract ISortitionModule", + "numberOfBytes": "20" + }, + "t_enum(Period)231": { + "encoding": "inplace", + "label": "enum KlerosCoreBase.Period", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_contract(IERC20)77,t_struct(CurrencyRate)323_storage)": { + "encoding": "mapping", + "key": "t_contract(IERC20)77", + "label": "mapping(contract IERC20 => struct KlerosCoreBase.CurrencyRate)", + "numberOfBytes": "32", + "value": "t_struct(CurrencyRate)323_storage" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_struct(Court)257_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.Court", + "members": [ + { + "astId": 233, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "parent", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 235, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "hiddenVotes", + "offset": 12, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 238, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "children", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 240, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "minStake", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 242, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "alpha", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 244, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "feeForJuror", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 246, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "jurorsForCourtJump", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 250, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "timesPerPeriod", + "offset": 0, + "slot": "6", + "type": "t_array(t_uint256)4_storage" + }, + { + "astId": 254, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "supportedDisputeKits", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 256, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disabled", + "offset": 0, + "slot": "11", + "type": "t_bool" + } + ], + "numberOfBytes": "384" + }, + "t_struct(CurrencyRate)323_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.CurrencyRate", + "members": [ + { + "astId": 318, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "feePaymentAccepted", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 320, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "rateInEth", + "offset": 1, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 322, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "rateDecimals", + "offset": 9, + "slot": "0", + "type": "t_uint8" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Dispute)274_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.Dispute", + "members": [ + { + "astId": 259, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "courtID", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 262, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "arbitrated", + "offset": 12, + "slot": "0", + "type": "t_contract(IArbitrableV2)4046" + }, + { + "astId": 265, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "period", + "offset": 0, + "slot": "1", + "type": "t_enum(Period)231" + }, + { + "astId": 267, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "ruled", + "offset": 1, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 269, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "lastPeriodChange", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 273, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "rounds", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(Round)299_storage)dyn_storage" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Round)299_storage": { + "encoding": "inplace", + "label": "struct KlerosCoreBase.Round", + "members": [ + { + "astId": 276, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "disputeKitID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 278, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "pnkAtStakePerJuror", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 280, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "totalFeesForJurors", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 282, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "nbVotes", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 284, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "repartitions", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 286, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "pnkPenalties", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 289, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "drawnJurors", + "offset": 0, + "slot": "6", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 291, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "sumFeeRewardPaid", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 293, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "sumPnkRewardPaid", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 296, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "feeToken", + "offset": 0, + "slot": "9", + "type": "t_contract(IERC20)77" + }, + { + "astId": 298, + "contract": "src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo", + "label": "drawIterations", + "offset": 0, + "slot": "10", + "type": "t_uint256" + } + ], + "numberOfBytes": "352" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo_Proxy.json new file mode 100644 index 000000000..ec265acca --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreNeo_Proxy.json @@ -0,0 +1,136 @@ +{ + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "transactionIndex": 2, + "gasUsed": "670390", + "logsBloom": "0x00000000000000000000400020000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000140000000004000000000000000000020000000000000010000800402000000008000008000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000028000000000000004000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000000001001000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711", + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000d40aa608801a639e292e10c235b90488d04070b1" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + }, + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 2, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + }, + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + }, + { + "transactionIndex": 2, + "blockNumber": 21125156, + "transactionHash": "0x7478f8ad2cb95e17467c9358a98fc0c0e22976df680fc1653071bdfb81303126", + "address": "0x26bf077037550e437605F07e25EfcAd510715C3A", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0xe9bd2617efebaf3236bc6453bb375b951eebe064e3d70168838a449a7414e711" + } + ], + "blockNumber": 21125156, + "cumulativeGasUsed": "831421", + "status": 1, + "byzantium": true + }, + "args": [ + "0x419B8C9b13e7Ea358D0ACBfD2214a9Ec0f8e182e", + "0x2c053739000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa2250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d40aa608801a639e292e10c235b90488d04070b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000220000000000000000000000000809533c303c10915bb5c0585f2d8d738e2a4fb640000000000000000000000007dfcf7444a81d4a92a641ee292f36458cd9eb36500000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosV2NeoEarlyUser.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosV2NeoEarlyUser.json new file mode 100644 index 000000000..64ab1ae2f --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosV2NeoEarlyUser.json @@ -0,0 +1,594 @@ +{ + "address": "0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "changeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x2dcc10115b4aa779adb3a473c51b9ca97f18d2e7511977d400c42c484831322c", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F", + "transactionIndex": 5, + "gasUsed": "1949558", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7597d86cf77afb8f7808362cf2fb41021c4b9670d7e2ccb04220d1169774c656", + "transactionHash": "0x2dcc10115b4aa779adb3a473c51b9ca97f18d2e7511977d400c42c484831322c", + "logs": [], + "blockNumber": 21128478, + "cumulativeGasUsed": "18973249", + "status": 1, + "byzantium": true + }, + "args": [ + "Kleros V2 Neo Early User", + "KlerosV2NeoEarlyUser" + ], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"changeOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"safeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenURI(uint256)\":{\"details\":\"See {IERC721Metadata-tokenURI}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC721.sol\":\"TestERC721\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC721.sol\\\";\\nimport \\\"./IERC721Receiver.sol\\\";\\nimport \\\"./extensions/IERC721Metadata.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/Strings.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\\n using Address for address;\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n // Mapping from token ID to owner address\\n mapping(uint256 => address) private _owners;\\n\\n // Mapping owner address to token count\\n mapping(address => uint256) private _balances;\\n\\n // Mapping from token ID to approved address\\n mapping(uint256 => address) private _tokenApprovals;\\n\\n // Mapping from owner to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual override returns (uint256) {\\n require(owner != address(0), \\\"ERC721: address zero is not a valid owner\\\");\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\\n address owner = _ownerOf(tokenId);\\n require(owner != address(0), \\\"ERC721: invalid token ID\\\");\\n return owner;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireMinted(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual override {\\n address owner = ERC721.ownerOf(tokenId);\\n require(to != owner, \\\"ERC721: approval to current owner\\\");\\n\\n require(\\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\\n \\\"ERC721: approve caller is not token owner or approved for all\\\"\\n );\\n\\n _approve(to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\\n _requireMinted(tokenId);\\n\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual override {\\n //solhint-disable-next-line max-line-length\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n\\n _transfer(from, to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n _safeTransfer(from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n require(_checkOnERC721Received(from, to, tokenId, data), \\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `tokenId` exists.\\n *\\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\\n *\\n * Tokens start existing when they are minted (`_mint`),\\n * and stop existing when they are burned (`_burn`).\\n */\\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\\n return _ownerOf(tokenId) != address(0);\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\\n address owner = ERC721.ownerOf(tokenId);\\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Safely mints `tokenId` and transfers it to `to`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal virtual {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n require(\\n _checkOnERC721Received(address(0), to, tokenId, data),\\n \\\"ERC721: transfer to non ERC721Receiver implementer\\\"\\n );\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal virtual {\\n require(to != address(0), \\\"ERC721: mint to the zero address\\\");\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n _beforeTokenTransfer(address(0), to, tokenId, 1);\\n\\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n unchecked {\\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\\n // Given that tokens are minted one by one, it is impossible in practice that\\n // this ever happens. Might change if we allow batch minting.\\n // The ERC fails to describe this case.\\n _balances[to] += 1;\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(address(0), to, tokenId);\\n\\n _afterTokenTransfer(address(0), to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal virtual {\\n address owner = ERC721.ownerOf(tokenId);\\n\\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\\n\\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\\n owner = ERC721.ownerOf(tokenId);\\n\\n // Clear approvals\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // Cannot overflow, as that would require more tokens to be burned/transferred\\n // out than the owner initially received through minting and transferring in.\\n _balances[owner] -= 1;\\n }\\n delete _owners[tokenId];\\n\\n emit Transfer(owner, address(0), tokenId);\\n\\n _afterTokenTransfer(owner, address(0), tokenId, 1);\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal virtual {\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n require(to != address(0), \\\"ERC721: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, tokenId, 1);\\n\\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n\\n // Clear approvals from the previous owner\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\\n // `from`'s balance is the number of token held, which is at least one before the current\\n // transfer.\\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\\n // all 2**256 token ids to be minted, which in practice is impossible.\\n _balances[from] -= 1;\\n _balances[to] += 1;\\n }\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n _afterTokenTransfer(from, to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits an {Approval} event.\\n */\\n function _approve(address to, uint256 tokenId) internal virtual {\\n _tokenApprovals[tokenId] = to;\\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n require(owner != operator, \\\"ERC721: approve to caller\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` has not been minted yet.\\n */\\n function _requireMinted(uint256 tokenId) internal view virtual {\\n require(_exists(tokenId), \\\"ERC721: invalid token ID\\\");\\n }\\n\\n /**\\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\\n * The call is not executed if the target address is not a contract.\\n *\\n * @param from address representing the previous owner of the given token ID\\n * @param to target address that will receive the tokens\\n * @param tokenId uint256 ID of the token to be transferred\\n * @param data bytes optional data to send along with the call\\n * @return bool whether the call correctly returned the expected magic value\\n */\\n function _checkOnERC721Received(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) private returns (bool) {\\n if (to.isContract()) {\\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\\n return retval == IERC721Receiver.onERC721Received.selector;\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n revert(\\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n } else {\\n /// @solidity memory-safe-assembly\\n assembly {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n } else {\\n return true;\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\\n * - When `from` is zero, the tokens will be minted for `to`.\\n * - When `to` is zero, ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\\n * - When `from` is zero, the tokens were minted for `to`.\\n * - When `to` is zero, ``from``'s tokens were burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant\\n * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such\\n * that `ownerOf(tokenId)` is `a`.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function __unsafe_increaseBalance(address account, uint256 amount) internal {\\n _balances[account] += amount;\\n }\\n}\\n\",\"keccak256\":\"0x2c309e7df9e05e6ce15bedfe74f3c61b467fc37e0fae9eab496acf5ea0bbd7ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5bce51e11f7d194b79ea59fe00c9e8de9fa2c5530124960f29a24d4c740a3266\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x75b829ff2f26c14355d1cba20e16fe7b29ca58eb5fef665ede48bc0f9c6c74b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\nimport \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toString(int256 value) internal pure returns (string memory) {\\n return string(abi.encodePacked(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value))));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x3088eb2868e8d13d89d16670b5f8612c4ab9ff8956272837d8e90106c59c14a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1, \\\"Math: mulDiv overflow\\\");\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // must be unchecked in order to support `n = type(int256).min`\\n return uint256(n >= 0 ? n : -n);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc\",\"license\":\"MIT\"},\"src/token/TestERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\n\\ncontract TestERC721 is ERC721 {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public owner;\\n uint256 private _nextTokenId;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {\\n owner = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier ownerOnly() {\\n require(msg.sender == owner, \\\"Owner only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeOwner(address _newOwner) external ownerOnly {\\n owner = _newOwner;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function safeMint(address to) external ownerOnly {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n }\\n}\\n\",\"keccak256\":\"0x5ad5b5aef2598b16a383ffc1c6ac688321326538bccc2d047369290a2e707dcb\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506040516200168638038062001686833981016040819052620000349162000136565b818160006200004483826200022f565b5060016200005382826200022f565b5050600680546001600160a01b0319163317905550620002fb915050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200009957600080fd5b81516001600160401b0380821115620000b657620000b662000071565b604051601f8301601f19908116603f01168101908282118183101715620000e157620000e162000071565b81604052838152602092508683858801011115620000fe57600080fd5b600091505b8382101562000122578582018301518183018401529082019062000103565b600093810190920192909252949350505050565b600080604083850312156200014a57600080fd5b82516001600160401b03808211156200016257600080fd5b620001708683870162000087565b935060208501519150808211156200018757600080fd5b50620001968582860162000087565b9150509250929050565b600181811c90821680620001b557607f821691505b602082108103620001d657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200022a57600081815260208120601f850160051c81016020861015620002055750805b601f850160051c820191505b81811015620002265782815560010162000211565b5050505b505050565b81516001600160401b038111156200024b576200024b62000071565b62000263816200025c8454620001a0565b84620001dc565b602080601f8311600181146200029b5760008415620002825750858301515b600019600386901b1c1916600185901b17855562000226565b600085815260208120601f198616915b82811015620002cc57888601518255948401946001909101908401620002ab565b5085821015620002eb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61137b806200030b6000396000f3fe608060405234801561001057600080fd5b50600436106100e05760003560e01c806370a082311161008757806370a08231146101ae5780638da5cb5b146101cf57806395d89b41146101e2578063a22cb465146101ea578063a6f9dae1146101fd578063b88d4fde14610210578063c87b56dd14610223578063e985e9c51461023657600080fd5b806301ffc9a7146100e557806306fdde031461010d578063081812fc14610122578063095ea7b31461014d57806323b872dd1461016257806340d097c31461017557806342842e0e146101885780636352211e1461019b575b600080fd5b6100f86100f3366004610e53565b610249565b60405190151581526020015b60405180910390f35b61011561029b565b6040516101049190610ec0565b610135610130366004610ed3565b61032d565b6040516001600160a01b039091168152602001610104565b61016061015b366004610f08565b610354565b005b610160610170366004610f32565b61046e565b610160610183366004610f6e565b61049f565b610160610196366004610f32565b6104ee565b6101356101a9366004610ed3565b610509565b6101c16101bc366004610f6e565b61053e565b604051908152602001610104565b600654610135906001600160a01b031681565b6101156105c4565b6101606101f8366004610f89565b6105d3565b61016061020b366004610f6e565b6105de565b61016061021e366004610fdb565b61062a565b610115610231366004610ed3565b610662565b6100f86102443660046110b7565b6106d6565b60006001600160e01b031982166380ac58cd60e01b148061027a57506001600160e01b03198216635b5e139f60e01b145b8061029557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546102aa906110ea565b80601f01602080910402602001604051908101604052809291908181526020018280546102d6906110ea565b80156103235780601f106102f857610100808354040283529160200191610323565b820191906000526020600020905b81548152906001019060200180831161030657829003601f168201915b5050505050905090565b600061033882610704565b506000908152600460205260409020546001600160a01b031690565b600061035f82610509565b9050806001600160a01b0316836001600160a01b0316036103d15760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806103ed57506103ed81336106d6565b61045f5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016103c8565b610469838361072c565b505050565b610478338261079a565b6104945760405162461bcd60e51b81526004016103c890611124565b6104698383836107f9565b6006546001600160a01b031633146104c95760405162461bcd60e51b81526004016103c890611171565b60078054600091826104da83611195565b9190505590506104ea828261095d565b5050565b6104698383836040518060200160405280600081525061062a565b6000818152600260205260408120546001600160a01b0316806102955760405162461bcd60e51b81526004016103c8906111bc565b60006001600160a01b0382166105a85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103c8565b506001600160a01b031660009081526003602052604090205490565b6060600180546102aa906110ea565b6104ea338383610977565b6006546001600160a01b031633146106085760405162461bcd60e51b81526004016103c890611171565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b610634338361079a565b6106505760405162461bcd60e51b81526004016103c890611124565b61065c84848484610a41565b50505050565b606061066d82610704565b600061068460408051602081019091526000815290565b905060008151116106a457604051806020016040528060008152506106cf565b806106ae84610a74565b6040516020016106bf9291906111ee565b6040516020818303038152906040525b9392505050565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61070d81610b07565b6107295760405162461bcd60e51b81526004016103c8906111bc565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061076182610509565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806107a683610509565b9050806001600160a01b0316846001600160a01b031614806107cd57506107cd81856106d6565b806107f15750836001600160a01b03166107e68461032d565b6001600160a01b0316145b949350505050565b826001600160a01b031661080c82610509565b6001600160a01b0316146108325760405162461bcd60e51b81526004016103c89061121d565b6001600160a01b0382166108945760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103c8565b826001600160a01b03166108a782610509565b6001600160a01b0316146108cd5760405162461bcd60e51b81526004016103c89061121d565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6104ea828260405180602001604052806000815250610b24565b816001600160a01b0316836001600160a01b0316036109d45760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016103c8565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610a4c8484846107f9565b610a5884848484610b57565b61065c5760405162461bcd60e51b81526004016103c890611262565b60606000610a8183610c58565b600101905060008167ffffffffffffffff811115610aa157610aa1610fc5565b6040519080825280601f01601f191660200182016040528015610acb576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610ad557509392505050565b6000908152600260205260409020546001600160a01b0316151590565b610b2e8383610d30565b610b3b6000848484610b57565b6104695760405162461bcd60e51b81526004016103c890611262565b60006001600160a01b0384163b15610c4d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610b9b9033908990889088906004016112b4565b6020604051808303816000875af1925050508015610bd6575060408051601f3d908101601f19168201909252610bd3918101906112f1565b60015b610c33573d808015610c04576040519150601f19603f3d011682016040523d82523d6000602084013e610c09565b606091505b508051600003610c2b5760405162461bcd60e51b81526004016103c890611262565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506107f1565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610c975772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610cc3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610ce157662386f26fc10000830492506010015b6305f5e1008310610cf9576305f5e100830492506008015b6127108310610d0d57612710830492506004015b60648310610d1f576064830492506002015b600a83106102955760010192915050565b6001600160a01b038216610d865760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103c8565b610d8f81610b07565b15610dac5760405162461bcd60e51b81526004016103c89061130e565b610db581610b07565b15610dd25760405162461bcd60e51b81526004016103c89061130e565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b03198116811461072957600080fd5b600060208284031215610e6557600080fd5b81356106cf81610e3d565b60005b83811015610e8b578181015183820152602001610e73565b50506000910152565b60008151808452610eac816020860160208601610e70565b601f01601f19169290920160200192915050565b6020815260006106cf6020830184610e94565b600060208284031215610ee557600080fd5b5035919050565b80356001600160a01b0381168114610f0357600080fd5b919050565b60008060408385031215610f1b57600080fd5b610f2483610eec565b946020939093013593505050565b600080600060608486031215610f4757600080fd5b610f5084610eec565b9250610f5e60208501610eec565b9150604084013590509250925092565b600060208284031215610f8057600080fd5b6106cf82610eec565b60008060408385031215610f9c57600080fd5b610fa583610eec565b915060208301358015158114610fba57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610ff157600080fd5b610ffa85610eec565b935061100860208601610eec565b925060408501359150606085013567ffffffffffffffff8082111561102c57600080fd5b818701915087601f83011261104057600080fd5b81358181111561105257611052610fc5565b604051601f8201601f19908116603f0116810190838211818310171561107a5761107a610fc5565b816040528281528a602084870101111561109357600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080604083850312156110ca57600080fd5b6110d383610eec565b91506110e160208401610eec565b90509250929050565b600181811c908216806110fe57607f821691505b60208210810361111e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6020808252600a90820152694f776e6572206f6e6c7960b01b604082015260600190565b6000600182016111b557634e487b7160e01b600052601160045260246000fd5b5060010190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351611200818460208801610e70565b835190830190611214818360208801610e70565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906112e790830184610e94565b9695505050505050565b60006020828403121561130357600080fd5b81516106cf81610e3d565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060408201526060019056fea2646970667358221220124927ec635664d406c8f2c9da77971edac68ac87ad1da1b200f6538c3bd88a864736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100e05760003560e01c806370a082311161008757806370a08231146101ae5780638da5cb5b146101cf57806395d89b41146101e2578063a22cb465146101ea578063a6f9dae1146101fd578063b88d4fde14610210578063c87b56dd14610223578063e985e9c51461023657600080fd5b806301ffc9a7146100e557806306fdde031461010d578063081812fc14610122578063095ea7b31461014d57806323b872dd1461016257806340d097c31461017557806342842e0e146101885780636352211e1461019b575b600080fd5b6100f86100f3366004610e53565b610249565b60405190151581526020015b60405180910390f35b61011561029b565b6040516101049190610ec0565b610135610130366004610ed3565b61032d565b6040516001600160a01b039091168152602001610104565b61016061015b366004610f08565b610354565b005b610160610170366004610f32565b61046e565b610160610183366004610f6e565b61049f565b610160610196366004610f32565b6104ee565b6101356101a9366004610ed3565b610509565b6101c16101bc366004610f6e565b61053e565b604051908152602001610104565b600654610135906001600160a01b031681565b6101156105c4565b6101606101f8366004610f89565b6105d3565b61016061020b366004610f6e565b6105de565b61016061021e366004610fdb565b61062a565b610115610231366004610ed3565b610662565b6100f86102443660046110b7565b6106d6565b60006001600160e01b031982166380ac58cd60e01b148061027a57506001600160e01b03198216635b5e139f60e01b145b8061029557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546102aa906110ea565b80601f01602080910402602001604051908101604052809291908181526020018280546102d6906110ea565b80156103235780601f106102f857610100808354040283529160200191610323565b820191906000526020600020905b81548152906001019060200180831161030657829003601f168201915b5050505050905090565b600061033882610704565b506000908152600460205260409020546001600160a01b031690565b600061035f82610509565b9050806001600160a01b0316836001600160a01b0316036103d15760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806103ed57506103ed81336106d6565b61045f5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016103c8565b610469838361072c565b505050565b610478338261079a565b6104945760405162461bcd60e51b81526004016103c890611124565b6104698383836107f9565b6006546001600160a01b031633146104c95760405162461bcd60e51b81526004016103c890611171565b60078054600091826104da83611195565b9190505590506104ea828261095d565b5050565b6104698383836040518060200160405280600081525061062a565b6000818152600260205260408120546001600160a01b0316806102955760405162461bcd60e51b81526004016103c8906111bc565b60006001600160a01b0382166105a85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103c8565b506001600160a01b031660009081526003602052604090205490565b6060600180546102aa906110ea565b6104ea338383610977565b6006546001600160a01b031633146106085760405162461bcd60e51b81526004016103c890611171565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b610634338361079a565b6106505760405162461bcd60e51b81526004016103c890611124565b61065c84848484610a41565b50505050565b606061066d82610704565b600061068460408051602081019091526000815290565b905060008151116106a457604051806020016040528060008152506106cf565b806106ae84610a74565b6040516020016106bf9291906111ee565b6040516020818303038152906040525b9392505050565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61070d81610b07565b6107295760405162461bcd60e51b81526004016103c8906111bc565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061076182610509565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806107a683610509565b9050806001600160a01b0316846001600160a01b031614806107cd57506107cd81856106d6565b806107f15750836001600160a01b03166107e68461032d565b6001600160a01b0316145b949350505050565b826001600160a01b031661080c82610509565b6001600160a01b0316146108325760405162461bcd60e51b81526004016103c89061121d565b6001600160a01b0382166108945760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103c8565b826001600160a01b03166108a782610509565b6001600160a01b0316146108cd5760405162461bcd60e51b81526004016103c89061121d565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6104ea828260405180602001604052806000815250610b24565b816001600160a01b0316836001600160a01b0316036109d45760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016103c8565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610a4c8484846107f9565b610a5884848484610b57565b61065c5760405162461bcd60e51b81526004016103c890611262565b60606000610a8183610c58565b600101905060008167ffffffffffffffff811115610aa157610aa1610fc5565b6040519080825280601f01601f191660200182016040528015610acb576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610ad557509392505050565b6000908152600260205260409020546001600160a01b0316151590565b610b2e8383610d30565b610b3b6000848484610b57565b6104695760405162461bcd60e51b81526004016103c890611262565b60006001600160a01b0384163b15610c4d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610b9b9033908990889088906004016112b4565b6020604051808303816000875af1925050508015610bd6575060408051601f3d908101601f19168201909252610bd3918101906112f1565b60015b610c33573d808015610c04576040519150601f19603f3d011682016040523d82523d6000602084013e610c09565b606091505b508051600003610c2b5760405162461bcd60e51b81526004016103c890611262565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506107f1565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610c975772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310610cc3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610ce157662386f26fc10000830492506010015b6305f5e1008310610cf9576305f5e100830492506008015b6127108310610d0d57612710830492506004015b60648310610d1f576064830492506002015b600a83106102955760010192915050565b6001600160a01b038216610d865760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103c8565b610d8f81610b07565b15610dac5760405162461bcd60e51b81526004016103c89061130e565b610db581610b07565b15610dd25760405162461bcd60e51b81526004016103c89061130e565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b03198116811461072957600080fd5b600060208284031215610e6557600080fd5b81356106cf81610e3d565b60005b83811015610e8b578181015183820152602001610e73565b50506000910152565b60008151808452610eac816020860160208601610e70565b601f01601f19169290920160200192915050565b6020815260006106cf6020830184610e94565b600060208284031215610ee557600080fd5b5035919050565b80356001600160a01b0381168114610f0357600080fd5b919050565b60008060408385031215610f1b57600080fd5b610f2483610eec565b946020939093013593505050565b600080600060608486031215610f4757600080fd5b610f5084610eec565b9250610f5e60208501610eec565b9150604084013590509250925092565b600060208284031215610f8057600080fd5b6106cf82610eec565b60008060408385031215610f9c57600080fd5b610fa583610eec565b915060208301358015158114610fba57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610ff157600080fd5b610ffa85610eec565b935061100860208601610eec565b925060408501359150606085013567ffffffffffffffff8082111561102c57600080fd5b818701915087601f83011261104057600080fd5b81358181111561105257611052610fc5565b604051601f8201601f19908116603f0116810190838211818310171561107a5761107a610fc5565b816040528281528a602084870101111561109357600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080604083850312156110ca57600080fd5b6110d383610eec565b91506110e160208401610eec565b90509250929050565b600181811c908216806110fe57607f821691505b60208210810361111e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6020808252600a90820152694f776e6572206f6e6c7960b01b604082015260600190565b6000600182016111b557634e487b7160e01b600052601160045260246000fd5b5060010190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351611200818460208801610e70565b835190830190611214818360208801610e70565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906112e790830184610e94565b9695505050505050565b60006020828403121561130357600080fd5b81516106cf81610e3d565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060408201526060019056fea2646970667358221220124927ec635664d406c8f2c9da77971edac68ac87ad1da1b200f6538c3bd88a864736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when `owner` enables `approved` to manage the `tokenId` token." + }, + "ApprovalForAll(address,address,bool)": { + "details": "Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `tokenId` token is transferred from `from` to `to`." + } + }, + "kind": "dev", + "methods": { + "approve(address,uint256)": { + "details": "See {IERC721-approve}." + }, + "balanceOf(address)": { + "details": "See {IERC721-balanceOf}." + }, + "getApproved(uint256)": { + "details": "See {IERC721-getApproved}." + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC721-isApprovedForAll}." + }, + "name()": { + "details": "See {IERC721Metadata-name}." + }, + "ownerOf(uint256)": { + "details": "See {IERC721-ownerOf}." + }, + "safeTransferFrom(address,address,uint256)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "safeTransferFrom(address,address,uint256,bytes)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC721-setApprovalForAll}." + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "symbol()": { + "details": "See {IERC721Metadata-symbol}." + }, + "tokenURI(uint256)": { + "details": "See {IERC721Metadata-tokenURI}." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC721-transferFrom}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1137, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 1139, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 1143, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_owners", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1147, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_balances", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 1151, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_tokenApprovals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1157, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_operatorApprovals", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 31164, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "owner", + "offset": 0, + "slot": "6", + "type": "t_address" + }, + { + "astId": 31166, + "contract": "src/token/TestERC721.sol:TestERC721", + "label": "_nextTokenId", + "offset": 0, + "slot": "7", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo.json new file mode 100644 index 000000000..099e5a401 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo.json @@ -0,0 +1,1110 @@ +{ + "address": "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + } + ], + "name": "changeMaxStakePerJuror", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "changeMaxTotalStaked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxStakePerJuror", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "enum StakingResult", + "name": "stakingResult", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x17e9da82087a7337876173d5d1d5567253299c1225a23270cfcbd5d8a2c5b288", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "transactionIndex": 1, + "gasUsed": "441279", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000400000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xbb3cd01584873e92a524a9f825ae4f5b910ac8b27c46dd6f395a3124f982ac4d", + "transactionHash": "0x17e9da82087a7337876173d5d1d5567253299c1225a23270cfcbd5d8a2c5b288", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 21125139, + "transactionHash": "0x17e9da82087a7337876173d5d1d5567253299c1225a23270cfcbd5d8a2c5b288", + "address": "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xbb3cd01584873e92a524a9f825ae4f5b910ac8b27c46dd6f395a3124f982ac4d" + } + ], + "blockNumber": 21125139, + "cumulativeGasUsed": "441279", + "status": 1, + "byzantium": true + }, + "args": [ + "0x109E569f39945ea0843cF82E4E44553089AB779D", + "0x498c752c000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000026bf077037550e437605f07e25efcad510715c3a00000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf4836000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000006c6b935b8bbd40000000000000000000000000000000000000000000000001a784379d99db42000000" + ], + "numDeployments": 2, + "solcInputHash": "195c5418e632c38d356fdcef349d5799", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x26bf077037550e437605F07e25EfcAd510715C3A", + 180, + 600, + "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + 20, + { + "type": "BigNumber", + "hex": "0x6c6b935b8bbd400000" + }, + { + "type": "BigNumber", + "hex": "0x01a784379d99db42000000" + } + ] + }, + "implementation": "0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo_Implementation.json new file mode 100644 index 000000000..7d3c77db5 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo_Implementation.json @@ -0,0 +1,1609 @@ +{ + "address": "0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + } + ], + "name": "changeMaxStakePerJuror", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "changeMaxTotalStaked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxTotalStaked", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxStakePerJuror", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "enum StakingResult", + "name": "stakingResult", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x82fc0d4c0b2b3fb0a09be2779550c1fe51405f0c3d5009b9fb6a746b4be50c36", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0", + "transactionIndex": 2, + "gasUsed": "3576280", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000200000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000400000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7c9434f9bbed64f6e857d5099f88d370fc93e14ee36856aedf38304a2d918d20", + "transactionHash": "0x82fc0d4c0b2b3fb0a09be2779550c1fe51405f0c3d5009b9fb6a746b4be50c36", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 21492592, + "transactionHash": "0x82fc0d4c0b2b3fb0a09be2779550c1fe51405f0c3d5009b9fb6a746b4be50c36", + "address": "0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 3, + "blockHash": "0x7c9434f9bbed64f6e857d5099f88d370fc93e14ee36856aedf38304a2d918d20" + } + ], + "blockNumber": 21492592, + "cumulativeGasUsed": "4749335", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 2, + "solcInputHash": "6fd6c790736e49d63654c469638eeab5", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferredWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedNotTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_unlock\",\"type\":\"bool\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxStakePerJuror\",\"type\":\"uint256\"}],\"name\":\"changeMaxStakePerJuror\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxTotalStaked\",\"type\":\"uint256\"}],\"name\":\"changeMaxTotalStaked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"alreadyTransferred\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalLocked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakedInCourt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxTotalStaked\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"isJurorStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedPnk\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedPnk\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"latestDelayedStakeIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"lockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxStakePerJuror\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxTotalStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"penalizeStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"pnkDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkWithdrawal\",\"type\":\"uint256\"},{\"internalType\":\"enum StakingResult\",\"name\":\"stakingResult\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_ID\",\"type\":\"bytes32\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_nonce\":\"Nonce to hash with random number.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"initialize(address,address,uint256,uint256,address,uint256,uint256,uint256)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_core\":\"The KlerosCore.\",\"_governor\":\"The governor.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_maxStakePerJuror\":\"The maximum amount of PNK a juror can stake in a court.\",\"_maxTotalStaked\":\"The maximum amount of PNK that can be staked in all courts.\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256,bool)\":{\"details\":\"Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The address of the juror.\",\"_alreadyTransferred\":\"True if the tokens were already transferred from juror. Only relevant for delayed stakes.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"},\"returns\":{\"pnkDeposit\":\"The amount of PNK to be deposited.\",\"pnkWithdrawal\":\"The amount of PNK to be withdrawn.\",\"stakingResult\":\"The result of the staking operation.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_juror\":\"The address of the juror.\"},\"returns\":{\"_0\":\"value The stake of the juror in the court.\"}},\"stakeOf(bytes32,bytes32)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_ID\":\"The stake path ID, corresponding to a juror.\",\"_key\":\"The key of the tree, corresponding to a court.\"},\"returns\":{\"_0\":\"The stake of the juror in the court.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"SortitionModuleNeo\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModuleNeo.sol\":\"SortitionModuleNeo\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCoreBase.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is KlerosCoreBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _guardian The guardian's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n _initialize(\\n _governor,\\n _guardian,\\n _pinakion,\\n _jurorProsecutionModule,\\n _disputeKit,\\n _hiddenVotes,\\n _courtParameters,\\n _timesPerPeriod,\\n _sortitionExtraData,\\n _sortitionModuleAddress\\n );\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n}\\n\",\"keccak256\":\"0x347240e5b541bb5df305e4e6ec8ab324a04effa722af31db03cd1d9fdcd039ec\",\"license\":\"MIT\"},\"src/arbitration/KlerosCoreBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title KlerosCoreBase\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\nabstract contract KlerosCoreBase is IArbitratorV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 feePerJurorInRound; // The fee per juror in the round.\\n uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private 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 address public guardian; // The guardian able to pause asset withdrawals.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n bool public paused; // Whether asset withdrawals are paused.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event Pause();\\n event Unpause();\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n modifier onlyByGuardianOrGovernor() {\\n if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly();\\n _;\\n }\\n\\n modifier whenPaused() {\\n if (!paused) revert WhenPausedOnly();\\n _;\\n }\\n\\n modifier whenNotPaused() {\\n if (paused) revert WhenNotPausedOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n address _guardian,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) internal {\\n governor = _governor;\\n guardian = _guardian;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Pause staking and reward execution. Can only be done by guardian or governor.\\n function pause() external onlyByGuardianOrGovernor whenNotPaused {\\n paused = true;\\n emit Pause();\\n }\\n\\n /// @dev Unpause staking and reward execution. Can only be done by governor.\\n function unpause() external onlyByGovernor whenPaused {\\n paused = false;\\n emit Unpause();\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `guardian` storage variable.\\n /// @param _guardian The new value for the `guardian` storage variable.\\n function changeGuardian(address _guardian) external onlyByGovernor {\\n guardian = _guardian;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal virtual returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// Note: Reward distributions are forbidden during pause.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused {\\n Round storage round;\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n round = dispute.rounds[_round];\\n } // stack too deep workaround\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound;\\n uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror;\\n uint256 coherentCount;\\n {\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n } // stack too deep workaround\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRound = _executePenalties(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams({\\n disputeID: _disputeID,\\n round: _round,\\n coherentCount: coherentCount,\\n numberOfVotesInRound: numberOfVotesInRound,\\n feePerJurorInRound: feePerJurorInRound,\\n pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound,\\n pnkPenaltiesInRound: pnkPenaltiesInRound,\\n repartition: i\\n })\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRound) {\\n round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound,\\n _params.feePerJurorInRound,\\n _params.pnkAtStakePerJurorInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (stakingResult != StakingResult.Successful) {\\n _stakingFailed(_onError, stakingResult);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError, StakingResult.StakingTransferFailed);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError, StakingResult.UnstakingTransferFailed);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual {\\n if (_onError == OnError.Return) return;\\n if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed();\\n if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed();\\n if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts();\\n if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt();\\n if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == FORKING_COURT || courtID >= courts.length) {\\n courtID = GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = GENERAL_COURT;\\n minJurors = DEFAULT_NB_OF_JURORS;\\n disputeKitID = DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error GuardianOrGovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingInTooManyCourts();\\n error StakingNotPossibeInThisCourt();\\n error StakingLessThanCourtMinStake();\\n error StakingTransferFailed();\\n error UnstakingTransferFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n error WhenNotPausedOnly();\\n error WhenPausedOnly();\\n}\\n\",\"keccak256\":\"0xcc0e0ecc6a01f8c2adf8d271e8e928db2f1bcbdbcf3943b08ddf22f087d6ac92\",\"license\":\"MIT\"},\"src/arbitration/SortitionModuleBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @jaybuidl, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title SortitionModuleBase\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\nabstract contract SortitionModuleBase is ISortitionModule {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum PreStakeHookResult {\\n ok, // Correct phase. All checks are passed.\\n stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance.\\n stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update.\\n failed // Checks didn't pass. Do no changes.\\n }\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance.\\n uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(address => Juror) public jurors; // The jurors.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount);\\n event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n function _initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) internal {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n delayedStakeReadIndex = 1;\\n }\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n require(delayedStakeWriteIndex >= delayedStakeReadIndex, \\\"No delayed stake to execute.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n // Delayed stake could've been manually removed already. In this case simply move on to the next item.\\n if (delayedStake.account != address(0)) {\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.alreadyTransferred\\n );\\n delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID];\\n delete delayedStakes[i];\\n }\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes.\\n /// @return pnkDeposit The amount of PNK to be deposited.\\n /// @return pnkWithdrawal The amount of PNK to be withdrawn.\\n /// @return stakingResult The result of the staking operation.\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) {\\n (pnkDeposit, pnkWithdrawal, stakingResult) = _setStake(_account, _courtID, _newStake, _alreadyTransferred);\\n }\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// Note: no state changes should be made when returning `succeeded` = false, otherwise delayed stakes might break invariants.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) internal virtual returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) {\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = stakeOf(_account, _courtID);\\n\\n uint256 nbCourts = juror.courtIDs.length;\\n if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) {\\n return (0, 0, StakingResult.CannotStakeInMoreCourts); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n }\\n\\n if (phase != Phase.staking) {\\n pnkWithdrawal = _deleteDelayedStake(_courtID, _account);\\n\\n // Store the stake change as delayed, to be applied when the phase switches back to Staking.\\n DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex];\\n delayedStake.account = _account;\\n delayedStake.courtID = _courtID;\\n delayedStake.stake = _newStake;\\n latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex;\\n if (_newStake > currentStake) {\\n // PNK deposit: tokens are transferred now.\\n delayedStake.alreadyTransferred = true;\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake);\\n } else {\\n // PNK withdrawal: tokens are not transferred yet.\\n emit StakeDelayedNotTransferred(_account, _courtID, _newStake);\\n }\\n return (pnkDeposit, pnkWithdrawal, StakingResult.Successful);\\n }\\n\\n // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred).\\n if (_newStake >= currentStake) {\\n if (!_alreadyTransferred) {\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n } else {\\n pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n\\n // Update the sortition sum tree.\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID);\\n if (currenCourtID == GENERAL_COURT) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID); // Get the parent court.\\n }\\n }\\n emit StakeSet(_account, _courtID, _newStake);\\n return (pnkDeposit, pnkWithdrawal, StakingResult.Successful);\\n }\\n\\n /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it.\\n /// @param _courtID ID of the court.\\n /// @param _juror Juror whose stake to check.\\n function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) {\\n uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID];\\n if (latestIndex != 0) {\\n DelayedStake storage delayedStake = delayedStakes[latestIndex];\\n if (delayedStake.alreadyTransferred) {\\n // Sortition stake represents the stake value that was last updated during Staking phase.\\n uint256 sortitionStake = stakeOf(_juror, _courtID);\\n\\n // Withdraw the tokens that were added with the latest delayed stake.\\n uint256 amountToWithdraw = delayedStake.stake - sortitionStake;\\n actualAmountToWithdraw = amountToWithdraw;\\n Juror storage juror = jurors[_juror];\\n if (juror.stakedPnk <= actualAmountToWithdraw) {\\n actualAmountToWithdraw = juror.stakedPnk;\\n }\\n\\n // StakePnk can become lower because of penalty.\\n juror.stakedPnk -= actualAmountToWithdraw;\\n emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw);\\n\\n if (sortitionStake == 0) {\\n // Cleanup: delete the court otherwise it will be duplicated after staking.\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n }\\n delete delayedStakes[latestIndex];\\n delete latestDelayedStakeIndex[_juror][_courtID];\\n }\\n }\\n\\n function _increaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stake increase\\n // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror.\\n // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked.\\n uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard\\n transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard\\n ? _newStake - _currentStake - previouslyLocked\\n : 0;\\n if (_currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function _decreaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stakes can be partially delayed only when stake is increased.\\n // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution.\\n if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) {\\n // We have enough pnk staked to afford withdrawal while keeping locked tokens.\\n transferredAmount = _currentStake - _newStake;\\n } else if (juror.stakedPnk >= juror.lockedPnk) {\\n // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens.\\n transferredAmount = juror.stakedPnk - juror.lockedPnk;\\n }\\n if (_newStake == 0) {\\n // Cleanup\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk += _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, false);\\n }\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk -= _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, true);\\n }\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n Juror storage juror = jurors[_account];\\n if (juror.stakedPnk >= _relativeAmount) {\\n juror.stakedPnk -= _relativeAmount;\\n } else {\\n juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference.\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _nonce Nonce to hash with random number.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n if (tree.nodes[0] == 0) {\\n return address(0); // No jurors staked.\\n }\\n\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n uint256 treeIndex = 0;\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _juror The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @return value The stake of the juror in the court.\\n function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID);\\n return stakeOf(bytes32(uint256(_courtID)), stakePathID);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _key The key of the tree, corresponding to a court.\\n /// @param _ID The stake path ID, corresponding to a juror.\\n /// @return The stake of the juror in the court.\\n function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n if (treeIndex == 0) {\\n return 0;\\n }\\n return tree.nodes[treeIndex];\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n )\\n external\\n view\\n override\\n returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)\\n {\\n Juror storage juror = jurors[_juror];\\n totalStaked = juror.stakedPnk;\\n totalLocked = juror.lockedPnk;\\n stakedInCourt = stakeOf(_juror, _courtID);\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function isJurorStaked(address _juror) external view override returns (bool) {\\n return jurors[_juror].stakedPnk > 0;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7b525db5494a064f8d6de3ce7c1e2a7612bb5107036064222cfd796924a02dfe\",\"license\":\"MIT\"},\"src/arbitration/SortitionModuleNeo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@jaybuidl, @unknownunknown1]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./SortitionModuleBase.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title SortitionModuleNeo\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModuleNeo is SortitionModuleBase, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public maxStakePerJuror;\\n uint256 public maxTotalStaked;\\n uint256 public totalStaked;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor.\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n /// @param _maxStakePerJuror The maximum amount of PNK a juror can stake in a court.\\n /// @param _maxTotalStaked The maximum amount of PNK that can be staked in all courts.\\n function initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead,\\n uint256 _maxStakePerJuror,\\n uint256 _maxTotalStaked\\n ) external reinitializer(2) {\\n super._initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead);\\n maxStakePerJuror = _maxStakePerJuror;\\n maxTotalStaked = _maxTotalStaked;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n /// Only the governor can perform upgrades (`onlyByGovernor`)\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n function changeMaxStakePerJuror(uint256 _maxStakePerJuror) external onlyByGovernor {\\n maxStakePerJuror = _maxStakePerJuror;\\n }\\n\\n function changeMaxTotalStaked(uint256 _maxTotalStaked) external onlyByGovernor {\\n maxTotalStaked = _maxTotalStaked;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) internal override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) {\\n uint256 currentStake = stakeOf(_account, _courtID);\\n bool stakeIncrease = _newStake > currentStake;\\n uint256 stakeChange = stakeIncrease ? _newStake - currentStake : currentStake - _newStake;\\n Juror storage juror = jurors[_account];\\n if (stakeIncrease && !_alreadyTransferred) {\\n if (juror.stakedPnk + stakeChange > maxStakePerJuror) {\\n return (0, 0, StakingResult.CannotStakeMoreThanMaxStakePerJuror);\\n }\\n if (totalStaked + stakeChange > maxTotalStaked) {\\n return (0, 0, StakingResult.CannotStakeMoreThanMaxTotalStaked);\\n }\\n }\\n if (phase == Phase.staking) {\\n if (stakeIncrease) {\\n totalStaked += stakeChange;\\n } else {\\n totalStaked -= stakeChange;\\n }\\n }\\n (pnkDeposit, pnkWithdrawal, stakingResult) = super._setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n }\\n}\\n\",\"keccak256\":\"0x112a8c221aadb71c98f6422b590f190c16d489658fae71a35c90faa32fe01670\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @param _feePerJuror The fee per juror.\\n /// @param _pnkAtStakePerJuror The PNK at stake per juror.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID,\\n uint256 _feePerJuror,\\n uint256 _pnkAtStakePerJuror\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x72cdf621c11d1d84b851edb1ef7607ac950ba7038154c85005ccc86cdd43e71b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../../libraries/Constants.sol\\\";\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0x47960dd772c9dafeefa2e6b9414c7045b5dcc68df735c1fccda6af48ca089858\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// Courts\\nuint96 constant FORKING_COURT = 0; // Index of the forking court.\\nuint96 constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n// Dispute Kits\\nuint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\nuint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n// Sortition Module\\nuint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\nuint256 constant DEFAULT_K = 6; // Default number of children per node.\\n\\n// Defaults\\nuint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\nIERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\\nenum StakingResult {\\n Successful,\\n StakingTransferFailed,\\n UnstakingTransferFailed,\\n CannotStakeInMoreCourts,\\n CannotStakeInThisCourt,\\n CannotStakeLessThanMinStake,\\n CannotStakeMoreThanMaxStakePerJuror,\\n CannotStakeMoreThanMaxTotalStaked\\n}\\n\",\"keccak256\":\"0xdc648a85f2816fa323e9f7f4accac3d9384187d0123bdfb1f9b89ce25ea64679\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516131686200010360003960008181611481015281816114aa01526116a201526131686000f3fe6080604052600436106102675760003560e01c80637dc38f1411610144578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b014610731578063dd5e5cb51461077d578063e534710d1461079d578063f216de4c146107d5578063f2f4eb26146107f5578063f6b4d82d1461081557600080fd5b8063c157261814610685578063ccbac9f51461069b578063d09f392d146106b1578063d1c1df48146106d1578063d605787b1461071157600080fd5b8063a2473cc111610108578063a2473cc1146105bc578063a5861b90146105dc578063b1c9fe6e1461060b578063b5d69e9914610639578063b888adfa14610659578063c057eca71461066f57600080fd5b80637dc38f1414610530578063817b1cd214610546578063823cfd701461055c5780638d3771bb1461057c578063965af6c71461059c57600080fd5b8063498c752c116101dd578063543f8a36116101a1578063543f8a361461044c57806356acb050146104795780635a68c1541461048f5780635d2d7846146104a55780636624192f146104c557806376fa9fc51461051057600080fd5b8063498c752c146103c45780634c70a0d6146103e45780634dbbebbc146104045780634f1ef2861461042457806352d1902d1461043757600080fd5b80631b92bbbe1161022f5780631b92bbbe1461031a57806321e1625e1461033057806321ea9b3f1461035057806323f61de41461036e57806335975f4a14610384578063477a655c146103a457600080fd5b8063034327441461026c57806306dfc967146102955780630b274f2e146102b75780630c340a24146102cc5780630e083ec914610304575b600080fd5b34801561027857600080fd5b5061028260065481565b6040519081526020015b60405180910390f35b3480156102a157600080fd5b506102b56102b0366004612af8565b61087f565b005b3480156102c357600080fd5b506102b56108b7565b3480156102d857600080fd5b506000546102ec906001600160a01b031681565b6040516001600160a01b03909116815260200161028c565b34801561031057600080fd5b50610282600a5481565b34801561032657600080fd5b5061028260035481565b34801561033c57600080fd5b506102b561034b366004612b26565b610c8a565b34801561035c57600080fd5b506102b561036b366004612af8565b50565b34801561037a57600080fd5b5061028260105481565b34801561039057600080fd5b506102b561039f366004612af8565b610d2d565b3480156103b057600080fd5b506102b56103bf366004612bf5565b610f6f565b3480156103d057600080fd5b506102b56103df366004612c3c565b611066565b3480156103f057600080fd5b506102ec6103ff366004612cb4565b6111a0565b34801561041057600080fd5b506102b561041f366004612b26565b611384565b6102b5610432366004612ce0565b61146d565b34801561044357600080fd5b50610282611695565b34801561045857600080fd5b5061046c610467366004612d1a565b6116f3565b60405161028c9190612d37565b34801561048557600080fd5b50610282600b5481565b34801561049b57600080fd5b5061028260115481565b3480156104b157600080fd5b506102b56104c0366004612d84565b611791565b3480156104d157600080fd5b506105006104e0366004612d1a565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161028c565b34801561051c57600080fd5b5061028261052b366004612d84565b6117d4565b34801561053c57600080fd5b5061028260095481565b34801561055257600080fd5b5061028260125481565b34801561056857600080fd5b506102b5610577366004612af8565b61182f565b34801561058857600080fd5b506102b5610597366004612af8565b61185e565b3480156105a857600080fd5b506102b56105b7366004612b26565b61188d565b3480156105c857600080fd5b506102826105d7366004612dbb565b611928565b3480156105e857600080fd5b506105fc6105f7366004612e02565b611952565b60405161028c93929190612e6b565b34801561061757600080fd5b5060015461062c90600160a01b900460ff1681565b60405161028c9190612e97565b34801561064557600080fd5b506102b5610654366004612d1a565b61199f565b34801561066557600080fd5b5061028260045481565b34801561067b57600080fd5b5061028260025481565b34801561069157600080fd5b5061028260055481565b3480156106a757600080fd5b5061028260085481565b3480156106bd57600080fd5b506102b56106cc366004612d84565b611a81565b3480156106dd57600080fd5b506106f16106ec366004612dbb565b611abb565b60408051948552602085019390935291830152606082015260800161028c565b34801561071d57600080fd5b506007546102ec906001600160a01b031681565b34801561073d57600080fd5b5061076861074c366004612d1a565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161028c565b34801561078957600080fd5b506102b5610798366004612af8565b611afa565b3480156107a957600080fd5b506102826107b8366004612dbb565b600f60209081526000928352604080842090915290825290205481565b3480156107e157600080fd5b506102b56107f0366004612b26565b611b29565b34801561080157600080fd5b506001546102ec906001600160a01b031681565b34801561082157600080fd5b5061086f610830366004612af8565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161028c9493929190612eb1565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016108a990612ee2565b60405180910390fd5b601055565b6000600154600160a01b900460ff1660028111156108d7576108d7612e55565b03610a45576002546004546108ec9042612f3a565b101561094f5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084016108a9565b6000600654116109b15760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a9565b6007546009546001600160a01b0390911690637363ae1f906109d39043612f4d565b6040518263ffffffff1660e01b81526004016109f191815260200190565b600060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610c3f565b60018054600160a01b900460ff166002811115610a6457610a64612e55565b03610b5c576007546009546005546001600160a01b03909216916313cf905491610a8d91612f4d565b6040518263ffffffff1660e01b8152600401610aab91815260200190565b6020604051808303816000875af1158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190612f60565b6008819055600003610b425760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a9565b600180546002919060ff60a01b1916600160a01b83610a3b565b6002600154600160a01b900460ff166002811115610b7c57610b7c612e55565b03610c3f576006541580610b9e5750600354600454610b9b9042612f3a565b10155b610c315760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a9565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610c8091600160a01b90910460ff1690612e97565b60405180910390a1565b6001546001600160a01b03163314610cb45760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d602052604081206002018054839290610cdf908490612f4d565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610d4d57610d4d612e55565b14610d9a5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a9565b600b54600a541015610dee5760405162461bcd60e51b815260206004820152601c60248201527f4e6f2064656c61796564207374616b6520746f20657865637574652e0000000060448201526064016108a9565b6000600a54600183600b54610e039190612f4d565b610e0d9190612f3a565b11610e185781610e33565b600b54600a54610e289190612f3a565b610e33906001612f4d565b9050600081600b54610e459190612f4d565b600b549091505b81811015610f67576000818152600e6020526040902080546001600160a01b031615610f545760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610ec89490821693600160a01b9092046001600160601b031692909160ff1690600401612eb1565b600060405180830381600087803b158015610ee257600080fd5b505af1158015610ef6573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610f5f81612fbd565b915050610e4c565b50600b555050565b6001546001600160a01b03163314610f995760405162461bcd60e51b81526004016108a990612f79565b6000828152600c6020526040812090610fb183611ba1565b825490915015610ffa5760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a9565b6001811161104a5760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a9565b8155600201805460018101825560009182526020822001555050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff16806110b05750805467ffffffffffffffff808416911610155b156110cd5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155600080546001600160a01b038c81166001600160a01b031992831617909255600180548c841690831617815560028b905560038a90554260045560078054938a16939092169290921790556009869055600b5560108490556011839055805460ff60401b1916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050565b60006002600154600160a01b900460ff1660028111156111c2576111c2612e55565b146111fe5760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a9565b6000848152600c602052604081206002810180549192909161122257611222612fd6565b906000526020600020015460000361123e57600091505061137d565b60008160020160008154811061125657611256612fd6565b90600052602060002001546008548686604051602001611289939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6112ac9190613002565b905060005b600283015483546112c3908390613016565b6112ce906001612f4d565b101561135d5760015b83548111611357576000818386600001546112f29190613016565b6112fc9190612f4d565b9050600085600201828154811061131557611315612fd6565b9060005260206000200154905080851061133a576113338186612f3a565b9450611342565b509150611357565b5050808061134f90612fbd565b9150506112d7565b506112b1565b600081815260048401602052604090205461137790611bbc565b93505050505b9392505050565b6000546001600160a01b031633146113ae5760405162461bcd60e51b81526004016108a990612ee2565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156113ed576113ed612e55565b03611469576007546009546001600160a01b0390911690637363ae1f906114149043612f4d565b6040518263ffffffff1660e01b815260040161143291815260200190565b600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b50504360055550505b5050565b61147682611be7565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806114f457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166114e86000805160206131138339815191525490565b6001600160a01b031614155b156115125760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561156c575060408051601f3d908101601f1916820190925261156991810190612f60565b60015b61159457604051630c76093760e01b81526001600160a01b03831660048201526024016108a9565b60008051602061311383398151915281146115c557604051632a87526960e21b8152600481018290526024016108a9565b6000805160206131138339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611690576000836001600160a01b03168360405161162c919061302d565b600060405180830381855af49150503d8060008114611667576040519150601f19603f3d011682016040523d82523d6000602084013e61166c565b606091505b505090508061168e576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116e05760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061311383398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561178557602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116117425790505b50505050509050919050565b6001546001600160a01b031633146117bb5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb8361305c565b91905055505050565b6000828152600c602090815260408083208484526003810190925282205480830361180457600092505050611829565b81600201818154811061181957611819612fd6565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146118595760405162461bcd60e51b81526004016108a990612ee2565b600255565b6000546001600160a01b031633146118885760405162461bcd60e51b81526004016108a990612ee2565b601155565b6001546001600160a01b031633146118b75760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040812060020180548392906118e2908490612f3a565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610d21565b6000806119358484611c11565b905061194a6001600160601b038416826117d4565b949350505050565b600154600090819081906001600160a01b031633146119835760405162461bcd60e51b81526004016108a990612f79565b61198f87878787611c59565b9199909850909650945050505050565b6001546001600160a01b031633146119c95760405162461bcd60e51b81526004016108a990612f79565b60006119d4826116f3565b80519091505b801561169057600180546001600160a01b03169063fbb519e79085908590611a029086612f3a565b81518110611a1257611a12612fd6565b60200260200101516000806040518563ffffffff1660e01b8152600401611a3c9493929190612eb1565b600060405180830381600087803b158015611a5657600080fd5b505af1158015611a6a573d6000803e3d6000fd5b505050508080611a799061305c565b9150506119da565b6001546001600160a01b03163314611aab5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb83612fbd565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611aed8787611928565b9054949793965094505050565b6000546001600160a01b03163314611b245760405162461bcd60e51b81526004016108a990612ee2565b600355565b6001546001600160a01b03163314611b535760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040902060018101548211611b955781816001016000828254611b8a9190612f3a565b909155506116909050565b60006001820155505050565b60006020825110611bb457506020015190565b506006919050565b600060405160005b6014811015611bdf5783811a81600c84010153600101611bc4565b505192915050565b6000546001600160a01b0316331461036b5760405162461bcd60e51b81526004016108a990612ee2565b600060405160005b6014811015611c34578481600c011a81830153600101611c19565b5060145b6020811015611c505783811a81830153600101611c38565b50519392505050565b600154600090819081906001600160a01b03163314611c8a5760405162461bcd60e51b81526004016108a990612f79565b6000611c968888611928565b9050808611600081611cb157611cac8884612f3a565b611cbb565b611cbb8389612f3a565b6001600160a01b038b166000908152600d60205260409020909150828015611ce1575087155b15611d3e57601054828260010154611cf99190612f4d565b1115611d1357600080600696509650965050505050611db6565b60115482601254611d249190612f4d565b1115611d3e57600080600796509650965050505050611db6565b6000600154600160a01b900460ff166002811115611d5e57611d5e612e55565b03611d9e578215611d86578160126000828254611d7b9190612f4d565b90915550611d9e9050565b8160126000828254611d989190612f3a565b90915550505b611daa8b8b8b8b611dc0565b91985096509450505050505b9450945094915050565b6001600160a01b0384166000908152600d602052604081208190819081611de78989611928565b825490915087158015611e035750600481101580611e03575081155b15611e1b576000806003955095509550505050611db6565b6000600154600160a01b900460ff166002811115611e3b57611e3b612e55565b14611ff557611e4a898b612159565b94506000600e6000600a60008154611e6190612fbd565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611f995760028101805460ff19166001179055611f44848b8b86612410565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611fe7565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060009350611db692505050565b81881061201557866120105761200d838a8a85612410565b95505b61202e565b612021838a8a856124f0565b61202b9086612f4d565b94505b600061203a8b8b611c11565b905060008a5b816120f8576120596001600160601b0382168c856126e7565b6000196001600160601b038216016120745760019150612040565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa1580156120c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e99190613073565b50949550612040945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506000955050505050509450945094915050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b03861684529091528120548015612409576000818152600e60205260409020600281015460ff16156123bc5760006121b38587611928565b905060008183600101546121c79190612f3a565b6001600160a01b0387166000908152600d6020526040902060018101549196508692509082106121f957806001015495505b8581600101600082825461220d9190612f3a565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036123b85780545b80156123b6576001600160601b03891682612282600184612f3a565b8154811061229257612292612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123a457815482906122ce90600190612f3a565b815481106122de576122de612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906123129084612f3a565b8154811061232257612322612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b031602179055508160000180548061236e5761236e6130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123b6565b806123ae8161305c565b915050612266565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561242a57600061243e565b8560010154866002015461243e9190612f3a565b905061244a8184612f4d565b84101561245857600061246d565b806124638486612f3a565b61246d9190612f3a565b9150826000036124b2578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156124c457836124df565b838387600101546124d59190612f3a565b6124df9190612f4d565b866001018190555050949350505050565b60028401546000906125028484612f3a565b61250c9190612f4d565b856001015410612527576125208383612f3a565b905061254d565b846002015485600101541061254d578460020154856001015461254a9190612f3a565b90505b826000036126aa5784545b80156126a8576001600160601b03851686612574600184612f3a565b8154811061258457612584612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03160361269657855486906125c090600190612f3a565b815481106125d0576125d0612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906126049084612f3a565b8154811061261457612614612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b0316021790555085600001805480612660576126606130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556126a8565b806126a08161305c565b915050612558565b505b81856001015410156126bc57826126d7565b828286600101546126cd9190612f3a565b6126d79190612f4d565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036128b45783156128af57600182015460000361280257506002810180546001808201835560009283526020909220810185905590811480159061276157508154612755600183612f3a565b61275f9190613002565b155b156127fd57815460009061277590836130fe565b6000818152600485016020526040812054919250612794846001612f4d565b9050846002018560020184815481106127af576127af612fd6565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b61287d565b60018083018054909161281491612f3a565b8154811061282457612824612fd6565b9060005260206000200154905081600101805480612844576128446130e8565b600190038181906000526020600020016000905590558382600201828154811061287057612870612fd6565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556128af8582600187612a3b565b612a34565b836000036129525760008260020182815481106128d3576128d3612fd6565b9060005260206000200154905060008360020183815481106128f7576128f7612fd6565b600091825260208083209091019290925560018086018054918201815582528282200184905585815260038501825260408082208290558482526004860190925290812081905561294c908790849084612a3b565b50612a34565b81600201818154811061296757612967612fd6565b90600052602060002001548414612a345760008483600201838154811061299057612990612fd6565b9060005260206000200154111590506000816129d657858460020184815481106129bc576129bc612fd6565b90600052602060002001546129d19190612f3a565b612a01565b8360020183815481106129eb576129eb612fd6565b906000526020600020015486612a019190612f3a565b905085846002018481548110612a1957612a19612fd6565b600091825260209091200155612a3187848484612a3b565b50505b5050505050565b6000848152600c60205260409020835b8015612af0578154612a5e600183612f3a565b612a6891906130fe565b905083612a9f5782826002018281548110612a8557612a85612fd6565b9060005260206000200154612a9a9190612f3a565b612aca565b82826002018281548110612ab557612ab5612fd6565b9060005260206000200154612aca9190612f4d565b826002018281548110612adf57612adf612fd6565b600091825260209091200155612a4b565b505050505050565b600060208284031215612b0a57600080fd5b5035919050565b6001600160a01b038116811461036b57600080fd5b60008060408385031215612b3957600080fd5b8235612b4481612b11565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612b7957600080fd5b813567ffffffffffffffff80821115612b9457612b94612b52565b604051601f8301601f19908116603f01168101908282118183101715612bbc57612bbc612b52565b81604052838152866020858801011115612bd557600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612c0857600080fd5b82359150602083013567ffffffffffffffff811115612c2657600080fd5b612c3285828601612b68565b9150509250929050565b600080600080600080600080610100898b031215612c5957600080fd5b8835612c6481612b11565b97506020890135612c7481612b11565b965060408901359550606089013594506080890135612c9281612b11565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600080600060608486031215612cc957600080fd5b505081359360208301359350604090920135919050565b60008060408385031215612cf357600080fd5b8235612cfe81612b11565b9150602083013567ffffffffffffffff811115612c2657600080fd5b600060208284031215612d2c57600080fd5b813561137d81612b11565b6020808252825182820181905260009190848201906040850190845b81811015612d785783516001600160601b031683529284019291840191600101612d53565b50909695505050505050565b60008060408385031215612d9757600080fd5b50508035926020909101359150565b6001600160601b038116811461036b57600080fd5b60008060408385031215612dce57600080fd5b8235612dd981612b11565b91506020830135612de981612da6565b809150509250929050565b801515811461036b57600080fd5b60008060008060808587031215612e1857600080fd5b8435612e2381612b11565b93506020850135612e3381612da6565b9250604085013591506060850135612e4a81612df4565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b838152602081018390526060810160088310612e8957612e89612e55565b826040830152949350505050565b6020810160038310612eab57612eab612e55565b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561182957611829612f24565b8082018082111561182957611829612f24565b600060208284031215612f7257600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612fcf57612fcf612f24565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261301157613011612fec565b500690565b808202811582820484141761182957611829612f24565b6000825160005b8181101561304e5760208186018101518583015201613034565b506000920191825250919050565b60008161306b5761306b612f24565b506000190190565b600080600080600080600060e0888a03121561308e57600080fd5b875161309981612da6565b60208901519097506130aa81612df4565b8096505060408801519450606088015193506080880151925060a0880151915060c08801516130d881612df4565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b60008261310d5761310d612fec565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ca9ebf934573cb6e3d68c3b324f84f8a1c4a85e6662f664de2b642bff6efbc7264736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102675760003560e01c80637dc38f1411610144578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b014610731578063dd5e5cb51461077d578063e534710d1461079d578063f216de4c146107d5578063f2f4eb26146107f5578063f6b4d82d1461081557600080fd5b8063c157261814610685578063ccbac9f51461069b578063d09f392d146106b1578063d1c1df48146106d1578063d605787b1461071157600080fd5b8063a2473cc111610108578063a2473cc1146105bc578063a5861b90146105dc578063b1c9fe6e1461060b578063b5d69e9914610639578063b888adfa14610659578063c057eca71461066f57600080fd5b80637dc38f1414610530578063817b1cd214610546578063823cfd701461055c5780638d3771bb1461057c578063965af6c71461059c57600080fd5b8063498c752c116101dd578063543f8a36116101a1578063543f8a361461044c57806356acb050146104795780635a68c1541461048f5780635d2d7846146104a55780636624192f146104c557806376fa9fc51461051057600080fd5b8063498c752c146103c45780634c70a0d6146103e45780634dbbebbc146104045780634f1ef2861461042457806352d1902d1461043757600080fd5b80631b92bbbe1161022f5780631b92bbbe1461031a57806321e1625e1461033057806321ea9b3f1461035057806323f61de41461036e57806335975f4a14610384578063477a655c146103a457600080fd5b8063034327441461026c57806306dfc967146102955780630b274f2e146102b75780630c340a24146102cc5780630e083ec914610304575b600080fd5b34801561027857600080fd5b5061028260065481565b6040519081526020015b60405180910390f35b3480156102a157600080fd5b506102b56102b0366004612af8565b61087f565b005b3480156102c357600080fd5b506102b56108b7565b3480156102d857600080fd5b506000546102ec906001600160a01b031681565b6040516001600160a01b03909116815260200161028c565b34801561031057600080fd5b50610282600a5481565b34801561032657600080fd5b5061028260035481565b34801561033c57600080fd5b506102b561034b366004612b26565b610c8a565b34801561035c57600080fd5b506102b561036b366004612af8565b50565b34801561037a57600080fd5b5061028260105481565b34801561039057600080fd5b506102b561039f366004612af8565b610d2d565b3480156103b057600080fd5b506102b56103bf366004612bf5565b610f6f565b3480156103d057600080fd5b506102b56103df366004612c3c565b611066565b3480156103f057600080fd5b506102ec6103ff366004612cb4565b6111a0565b34801561041057600080fd5b506102b561041f366004612b26565b611384565b6102b5610432366004612ce0565b61146d565b34801561044357600080fd5b50610282611695565b34801561045857600080fd5b5061046c610467366004612d1a565b6116f3565b60405161028c9190612d37565b34801561048557600080fd5b50610282600b5481565b34801561049b57600080fd5b5061028260115481565b3480156104b157600080fd5b506102b56104c0366004612d84565b611791565b3480156104d157600080fd5b506105006104e0366004612d1a565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161028c565b34801561051c57600080fd5b5061028261052b366004612d84565b6117d4565b34801561053c57600080fd5b5061028260095481565b34801561055257600080fd5b5061028260125481565b34801561056857600080fd5b506102b5610577366004612af8565b61182f565b34801561058857600080fd5b506102b5610597366004612af8565b61185e565b3480156105a857600080fd5b506102b56105b7366004612b26565b61188d565b3480156105c857600080fd5b506102826105d7366004612dbb565b611928565b3480156105e857600080fd5b506105fc6105f7366004612e02565b611952565b60405161028c93929190612e6b565b34801561061757600080fd5b5060015461062c90600160a01b900460ff1681565b60405161028c9190612e97565b34801561064557600080fd5b506102b5610654366004612d1a565b61199f565b34801561066557600080fd5b5061028260045481565b34801561067b57600080fd5b5061028260025481565b34801561069157600080fd5b5061028260055481565b3480156106a757600080fd5b5061028260085481565b3480156106bd57600080fd5b506102b56106cc366004612d84565b611a81565b3480156106dd57600080fd5b506106f16106ec366004612dbb565b611abb565b60408051948552602085019390935291830152606082015260800161028c565b34801561071d57600080fd5b506007546102ec906001600160a01b031681565b34801561073d57600080fd5b5061076861074c366004612d1a565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161028c565b34801561078957600080fd5b506102b5610798366004612af8565b611afa565b3480156107a957600080fd5b506102826107b8366004612dbb565b600f60209081526000928352604080842090915290825290205481565b3480156107e157600080fd5b506102b56107f0366004612b26565b611b29565b34801561080157600080fd5b506001546102ec906001600160a01b031681565b34801561082157600080fd5b5061086f610830366004612af8565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161028c9493929190612eb1565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016108a990612ee2565b60405180910390fd5b601055565b6000600154600160a01b900460ff1660028111156108d7576108d7612e55565b03610a45576002546004546108ec9042612f3a565b101561094f5760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084016108a9565b6000600654116109b15760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a9565b6007546009546001600160a01b0390911690637363ae1f906109d39043612f4d565b6040518263ffffffff1660e01b81526004016109f191815260200190565b600060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610c3f565b60018054600160a01b900460ff166002811115610a6457610a64612e55565b03610b5c576007546009546005546001600160a01b03909216916313cf905491610a8d91612f4d565b6040518263ffffffff1660e01b8152600401610aab91815260200190565b6020604051808303816000875af1158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190612f60565b6008819055600003610b425760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a9565b600180546002919060ff60a01b1916600160a01b83610a3b565b6002600154600160a01b900460ff166002811115610b7c57610b7c612e55565b03610c3f576006541580610b9e5750600354600454610b9b9042612f3a565b10155b610c315760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a9565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610c8091600160a01b90910460ff1690612e97565b60405180910390a1565b6001546001600160a01b03163314610cb45760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d602052604081206002018054839290610cdf908490612f4d565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610d4d57610d4d612e55565b14610d9a5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a9565b600b54600a541015610dee5760405162461bcd60e51b815260206004820152601c60248201527f4e6f2064656c61796564207374616b6520746f20657865637574652e0000000060448201526064016108a9565b6000600a54600183600b54610e039190612f4d565b610e0d9190612f3a565b11610e185781610e33565b600b54600a54610e289190612f3a565b610e33906001612f4d565b9050600081600b54610e459190612f4d565b600b549091505b81811015610f67576000818152600e6020526040902080546001600160a01b031615610f545760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610ec89490821693600160a01b9092046001600160601b031692909160ff1690600401612eb1565b600060405180830381600087803b158015610ee257600080fd5b505af1158015610ef6573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610f5f81612fbd565b915050610e4c565b50600b555050565b6001546001600160a01b03163314610f995760405162461bcd60e51b81526004016108a990612f79565b6000828152600c6020526040812090610fb183611ba1565b825490915015610ffa5760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a9565b6001811161104a5760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a9565b8155600201805460018101825560009182526020822001555050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460029190600160401b900460ff16806110b05750805467ffffffffffffffff808416911610155b156110cd5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155600080546001600160a01b038c81166001600160a01b031992831617909255600180548c841690831617815560028b905560038a90554260045560078054938a16939092169290921790556009869055600b5560108490556011839055805460ff60401b1916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050505050565b60006002600154600160a01b900460ff1660028111156111c2576111c2612e55565b146111fe5760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a9565b6000848152600c602052604081206002810180549192909161122257611222612fd6565b906000526020600020015460000361123e57600091505061137d565b60008160020160008154811061125657611256612fd6565b90600052602060002001546008548686604051602001611289939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6112ac9190613002565b905060005b600283015483546112c3908390613016565b6112ce906001612f4d565b101561135d5760015b83548111611357576000818386600001546112f29190613016565b6112fc9190612f4d565b9050600085600201828154811061131557611315612fd6565b9060005260206000200154905080851061133a576113338186612f3a565b9450611342565b509150611357565b5050808061134f90612fbd565b9150506112d7565b506112b1565b600081815260048401602052604090205461137790611bbc565b93505050505b9392505050565b6000546001600160a01b031633146113ae5760405162461bcd60e51b81526004016108a990612ee2565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156113ed576113ed612e55565b03611469576007546009546001600160a01b0390911690637363ae1f906114149043612f4d565b6040518263ffffffff1660e01b815260040161143291815260200190565b600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b50504360055550505b5050565b61147682611be7565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806114f457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166114e86000805160206131138339815191525490565b6001600160a01b031614155b156115125760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561156c575060408051601f3d908101601f1916820190925261156991810190612f60565b60015b61159457604051630c76093760e01b81526001600160a01b03831660048201526024016108a9565b60008051602061311383398151915281146115c557604051632a87526960e21b8152600481018290526024016108a9565b6000805160206131138339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611690576000836001600160a01b03168360405161162c919061302d565b600060405180830381855af49150503d8060008114611667576040519150601f19603f3d011682016040523d82523d6000602084013e61166c565b606091505b505090508061168e576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116e05760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061311383398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561178557602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116117425790505b50505050509050919050565b6001546001600160a01b031633146117bb5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb8361305c565b91905055505050565b6000828152600c602090815260408083208484526003810190925282205480830361180457600092505050611829565b81600201818154811061181957611819612fd6565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146118595760405162461bcd60e51b81526004016108a990612ee2565b600255565b6000546001600160a01b031633146118885760405162461bcd60e51b81526004016108a990612ee2565b601155565b6001546001600160a01b031633146118b75760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040812060020180548392906118e2908490612f3a565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610d21565b6000806119358484611c11565b905061194a6001600160601b038416826117d4565b949350505050565b600154600090819081906001600160a01b031633146119835760405162461bcd60e51b81526004016108a990612f79565b61198f87878787611c59565b9199909850909650945050505050565b6001546001600160a01b031633146119c95760405162461bcd60e51b81526004016108a990612f79565b60006119d4826116f3565b80519091505b801561169057600180546001600160a01b03169063fbb519e79085908590611a029086612f3a565b81518110611a1257611a12612fd6565b60200260200101516000806040518563ffffffff1660e01b8152600401611a3c9493929190612eb1565b600060405180830381600087803b158015611a5657600080fd5b505af1158015611a6a573d6000803e3d6000fd5b505050508080611a799061305c565b9150506119da565b6001546001600160a01b03163314611aab5760405162461bcd60e51b81526004016108a990612f79565b600680549060006117cb83612fbd565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611aed8787611928565b9054949793965094505050565b6000546001600160a01b03163314611b245760405162461bcd60e51b81526004016108a990612ee2565b600355565b6001546001600160a01b03163314611b535760405162461bcd60e51b81526004016108a990612f79565b6001600160a01b0382166000908152600d6020526040902060018101548211611b955781816001016000828254611b8a9190612f3a565b909155506116909050565b60006001820155505050565b60006020825110611bb457506020015190565b506006919050565b600060405160005b6014811015611bdf5783811a81600c84010153600101611bc4565b505192915050565b6000546001600160a01b0316331461036b5760405162461bcd60e51b81526004016108a990612ee2565b600060405160005b6014811015611c34578481600c011a81830153600101611c19565b5060145b6020811015611c505783811a81830153600101611c38565b50519392505050565b600154600090819081906001600160a01b03163314611c8a5760405162461bcd60e51b81526004016108a990612f79565b6000611c968888611928565b9050808611600081611cb157611cac8884612f3a565b611cbb565b611cbb8389612f3a565b6001600160a01b038b166000908152600d60205260409020909150828015611ce1575087155b15611d3e57601054828260010154611cf99190612f4d565b1115611d1357600080600696509650965050505050611db6565b60115482601254611d249190612f4d565b1115611d3e57600080600796509650965050505050611db6565b6000600154600160a01b900460ff166002811115611d5e57611d5e612e55565b03611d9e578215611d86578160126000828254611d7b9190612f4d565b90915550611d9e9050565b8160126000828254611d989190612f3a565b90915550505b611daa8b8b8b8b611dc0565b91985096509450505050505b9450945094915050565b6001600160a01b0384166000908152600d602052604081208190819081611de78989611928565b825490915087158015611e035750600481101580611e03575081155b15611e1b576000806003955095509550505050611db6565b6000600154600160a01b900460ff166002811115611e3b57611e3b612e55565b14611ff557611e4a898b612159565b94506000600e6000600a60008154611e6190612fbd565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611f995760028101805460ff19166001179055611f44848b8b86612410565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611fe7565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060009350611db692505050565b81881061201557866120105761200d838a8a85612410565b95505b61202e565b612021838a8a856124f0565b61202b9086612f4d565b94505b600061203a8b8b611c11565b905060008a5b816120f8576120596001600160601b0382168c856126e7565b6000196001600160601b038216016120745760019150612040565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa1580156120c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e99190613073565b50949550612040945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506000955050505050509450945094915050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b03861684529091528120548015612409576000818152600e60205260409020600281015460ff16156123bc5760006121b38587611928565b905060008183600101546121c79190612f3a565b6001600160a01b0387166000908152600d6020526040902060018101549196508692509082106121f957806001015495505b8581600101600082825461220d9190612f3a565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036123b85780545b80156123b6576001600160601b03891682612282600184612f3a565b8154811061229257612292612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123a457815482906122ce90600190612f3a565b815481106122de576122de612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906123129084612f3a565b8154811061232257612322612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b031602179055508160000180548061236e5761236e6130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123b6565b806123ae8161305c565b915050612266565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561242a57600061243e565b8560010154866002015461243e9190612f3a565b905061244a8184612f4d565b84101561245857600061246d565b806124638486612f3a565b61246d9190612f3a565b9150826000036124b2578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156124c457836124df565b838387600101546124d59190612f3a565b6124df9190612f4d565b866001018190555050949350505050565b60028401546000906125028484612f3a565b61250c9190612f4d565b856001015410612527576125208383612f3a565b905061254d565b846002015485600101541061254d578460020154856001015461254a9190612f3a565b90505b826000036126aa5784545b80156126a8576001600160601b03851686612574600184612f3a565b8154811061258457612584612fd6565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03160361269657855486906125c090600190612f3a565b815481106125d0576125d0612fd6565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906126049084612f3a565b8154811061261457612614612fd6565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b0316021790555085600001805480612660576126606130e8565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556126a8565b806126a08161305c565b915050612558565b505b81856001015410156126bc57826126d7565b828286600101546126cd9190612f3a565b6126d79190612f4d565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036128b45783156128af57600182015460000361280257506002810180546001808201835560009283526020909220810185905590811480159061276157508154612755600183612f3a565b61275f9190613002565b155b156127fd57815460009061277590836130fe565b6000818152600485016020526040812054919250612794846001612f4d565b9050846002018560020184815481106127af576127af612fd6565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b61287d565b60018083018054909161281491612f3a565b8154811061282457612824612fd6565b9060005260206000200154905081600101805480612844576128446130e8565b600190038181906000526020600020016000905590558382600201828154811061287057612870612fd6565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556128af8582600187612a3b565b612a34565b836000036129525760008260020182815481106128d3576128d3612fd6565b9060005260206000200154905060008360020183815481106128f7576128f7612fd6565b600091825260208083209091019290925560018086018054918201815582528282200184905585815260038501825260408082208290558482526004860190925290812081905561294c908790849084612a3b565b50612a34565b81600201818154811061296757612967612fd6565b90600052602060002001548414612a345760008483600201838154811061299057612990612fd6565b9060005260206000200154111590506000816129d657858460020184815481106129bc576129bc612fd6565b90600052602060002001546129d19190612f3a565b612a01565b8360020183815481106129eb576129eb612fd6565b906000526020600020015486612a019190612f3a565b905085846002018481548110612a1957612a19612fd6565b600091825260209091200155612a3187848484612a3b565b50505b5050505050565b6000848152600c60205260409020835b8015612af0578154612a5e600183612f3a565b612a6891906130fe565b905083612a9f5782826002018281548110612a8557612a85612fd6565b9060005260206000200154612a9a9190612f3a565b612aca565b82826002018281548110612ab557612ab5612fd6565b9060005260206000200154612aca9190612f4d565b826002018281548110612adf57612adf612fd6565b600091825260209091200155612a4b565b505050505050565b600060208284031215612b0a57600080fd5b5035919050565b6001600160a01b038116811461036b57600080fd5b60008060408385031215612b3957600080fd5b8235612b4481612b11565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612b7957600080fd5b813567ffffffffffffffff80821115612b9457612b94612b52565b604051601f8301601f19908116603f01168101908282118183101715612bbc57612bbc612b52565b81604052838152866020858801011115612bd557600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612c0857600080fd5b82359150602083013567ffffffffffffffff811115612c2657600080fd5b612c3285828601612b68565b9150509250929050565b600080600080600080600080610100898b031215612c5957600080fd5b8835612c6481612b11565b97506020890135612c7481612b11565b965060408901359550606089013594506080890135612c9281612b11565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600080600060608486031215612cc957600080fd5b505081359360208301359350604090920135919050565b60008060408385031215612cf357600080fd5b8235612cfe81612b11565b9150602083013567ffffffffffffffff811115612c2657600080fd5b600060208284031215612d2c57600080fd5b813561137d81612b11565b6020808252825182820181905260009190848201906040850190845b81811015612d785783516001600160601b031683529284019291840191600101612d53565b50909695505050505050565b60008060408385031215612d9757600080fd5b50508035926020909101359150565b6001600160601b038116811461036b57600080fd5b60008060408385031215612dce57600080fd5b8235612dd981612b11565b91506020830135612de981612da6565b809150509250929050565b801515811461036b57600080fd5b60008060008060808587031215612e1857600080fd5b8435612e2381612b11565b93506020850135612e3381612da6565b9250604085013591506060850135612e4a81612df4565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b838152602081018390526060810160088310612e8957612e89612e55565b826040830152949350505050565b6020810160038310612eab57612eab612e55565b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561182957611829612f24565b8082018082111561182957611829612f24565b600060208284031215612f7257600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612fcf57612fcf612f24565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261301157613011612fec565b500690565b808202811582820484141761182957611829612f24565b6000825160005b8181101561304e5760208186018101518583015201613034565b506000920191825250919050565b60008161306b5761306b612f24565b506000190190565b600080600080600080600060e0888a03121561308e57600080fd5b875161309981612da6565b60208901519097506130aa81612df4565b8096505060408801519450606088015193506080880151925060a0880151915060c08801516130d881612df4565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b60008261310d5761310d612fec565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ca9ebf934573cb6e3d68c3b324f84f8a1c4a85e6662f664de2b642bff6efbc7264736f6c63430008120033", + "devdoc": { + "details": "A factory of trees that keeps track of staked values for sortition.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeMaxDrawingTime(uint256)": { + "details": "Changes the `maxDrawingTime` storage variable.", + "params": { + "_maxDrawingTime": "The new value for the `maxDrawingTime` storage variable." + } + }, + "changeMinStakingTime(uint256)": { + "details": "Changes the `minStakingTime` storage variable.", + "params": { + "_minStakingTime": "The new value for the `minStakingTime` storage variable." + } + }, + "changeRandomNumberGenerator(address,uint256)": { + "details": "Changes the `_rng` and `_rngLookahead` storage variables.", + "params": { + "_rng": "The new value for the `RNGenerator` storage variable.", + "_rngLookahead": "The new value for the `rngLookahead` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createTree(bytes32,bytes)": { + "details": "Create a sortition sum tree at the specified key.", + "params": { + "_extraData": "Extra data that contains the number of children each node in the tree should have.", + "_key": "The key of the new tree." + } + }, + "draw(bytes32,uint256,uint256)": { + "details": "Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.", + "params": { + "_coreDisputeID": "Index of the dispute in Kleros Core.", + "_key": "The key of the tree.", + "_nonce": "Nonce to hash with random number." + }, + "returns": { + "drawnAddress": "The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended." + } + }, + "executeDelayedStakes(uint256)": { + "details": "Executes the next delayed stakes.", + "params": { + "_iterations": "The number of delayed stakes to execute." + } + }, + "getJurorCourtIDs(address)": { + "details": "Gets the court identifiers where a specific `_juror` has staked.", + "params": { + "_juror": "The address of the juror." + } + }, + "initialize(address,address,uint256,uint256,address,uint256,uint256,uint256)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_core": "The KlerosCore.", + "_governor": "The governor.", + "_maxDrawingTime": "Time after which the drawing phase can be switched", + "_maxStakePerJuror": "The maximum amount of PNK a juror can stake in a court.", + "_maxTotalStaked": "The maximum amount of PNK that can be staked in all courts.", + "_minStakingTime": "Minimal time to stake", + "_rng": "The random number generator.", + "_rngLookahead": "Lookahead value for rng." + } + }, + "notifyRandomNumber(uint256)": { + "details": "Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().", + "params": { + "_randomNumber": "Random number returned by RNG contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setJurorInactive(address)": { + "details": "Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The juror to unstake." + } + }, + "setStake(address,uint96,uint256,bool)": { + "details": "Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The address of the juror.", + "_alreadyTransferred": "True if the tokens were already transferred from juror. Only relevant for delayed stakes.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + }, + "returns": { + "pnkDeposit": "The amount of PNK to be deposited.", + "pnkWithdrawal": "The amount of PNK to be withdrawn.", + "stakingResult": "The result of the staking operation." + } + }, + "stakeOf(address,uint96)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_courtID": "The ID of the court.", + "_juror": "The address of the juror." + }, + "returns": { + "_0": "value The stake of the juror in the court." + } + }, + "stakeOf(bytes32,bytes32)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_ID": "The stake path ID, corresponding to a juror.", + "_key": "The key of the tree, corresponding to a court." + }, + "returns": { + "_0": "The stake of the juror in the court." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "SortitionModuleNeo", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3793, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3796, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)158" + }, + { + "astId": 3799, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "phase", + "offset": 20, + "slot": "1", + "type": "t_enum(Phase)6238" + }, + { + "astId": 3801, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "minStakingTime", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 3803, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "maxDrawingTime", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 3805, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "lastPhaseChange", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 3807, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "randomNumberRequestBlock", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 3809, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "disputesWithoutJurors", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 3812, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "rng", + "offset": 0, + "slot": "7", + "type": "t_contract(RNG)6953" + }, + { + "astId": 3814, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "randomNumber", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 3816, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "rngLookahead", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 3818, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "delayedStakeWriteIndex", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 3820, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "delayedStakeReadIndex", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 3825, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "sortitionSumTrees", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)3774_storage)" + }, + { + "astId": 3830, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "jurors", + "offset": 0, + "slot": "13", + "type": "t_mapping(t_address,t_struct(Juror)3791_storage)" + }, + { + "astId": 3835, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "delayedStakes", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_uint256,t_struct(DelayedStake)3783_storage)" + }, + { + "astId": 3841, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "latestDelayedStakeIndex", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_mapping(t_uint96,t_uint256))" + }, + { + "astId": 5742, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "maxStakePerJuror", + "offset": 0, + "slot": "16", + "type": "t_uint256" + }, + { + "astId": 5744, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "maxTotalStaked", + "offset": 0, + "slot": "17", + "type": "t_uint256" + }, + { + "astId": 5746, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "totalStaked", + "offset": 0, + "slot": "18", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_array(t_uint96)dyn_storage": { + "base": "t_uint96", + "encoding": "dynamic_array", + "label": "uint96[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)158": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_contract(RNG)6953": { + "encoding": "inplace", + "label": "contract RNG", + "numberOfBytes": "20" + }, + "t_enum(Phase)6238": { + "encoding": "inplace", + "label": "enum ISortitionModule.Phase", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint96,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint96 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint96,t_uint256)" + }, + "t_mapping(t_address,t_struct(Juror)3791_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SortitionModuleBase.Juror)", + "numberOfBytes": "32", + "value": "t_struct(Juror)3791_storage" + }, + "t_mapping(t_bytes32,t_struct(SortitionSumTree)3774_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct SortitionModuleBase.SortitionSumTree)", + "numberOfBytes": "32", + "value": "t_struct(SortitionSumTree)3774_storage" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(DelayedStake)3783_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct SortitionModuleBase.DelayedStake)", + "numberOfBytes": "32", + "value": "t_struct(DelayedStake)3783_storage" + }, + "t_mapping(t_uint96,t_uint256)": { + "encoding": "mapping", + "key": "t_uint96", + "label": "mapping(uint96 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DelayedStake)3783_storage": { + "encoding": "inplace", + "label": "struct SortitionModuleBase.DelayedStake", + "members": [ + { + "astId": 3776, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3778, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "courtID", + "offset": 20, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 3780, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "stake", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 3782, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "alreadyTransferred", + "offset": 0, + "slot": "2", + "type": "t_bool" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Juror)3791_storage": { + "encoding": "inplace", + "label": "struct SortitionModuleBase.Juror", + "members": [ + { + "astId": 3786, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "courtIDs", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint96)dyn_storage" + }, + { + "astId": 3788, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "stakedPnk", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 3790, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "lockedPnk", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_struct(SortitionSumTree)3774_storage": { + "encoding": "inplace", + "label": "struct SortitionModuleBase.SortitionSumTree", + "members": [ + { + "astId": 3759, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "K", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 3762, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "stack", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 3765, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "nodes", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 3769, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "IDsToNodeIndexes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 3773, + "contract": "src/arbitration/SortitionModuleNeo.sol:SortitionModuleNeo", + "label": "nodeIndexesToIDs", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_bytes32)" + } + ], + "numberOfBytes": "160" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo_Proxy.json new file mode 100644 index 000000000..69a238790 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleNeo_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x17e9da82087a7337876173d5d1d5567253299c1225a23270cfcbd5d8a2c5b288", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "transactionIndex": 1, + "gasUsed": "441279", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000400000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xbb3cd01584873e92a524a9f825ae4f5b910ac8b27c46dd6f395a3124f982ac4d", + "transactionHash": "0x17e9da82087a7337876173d5d1d5567253299c1225a23270cfcbd5d8a2c5b288", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 21125139, + "transactionHash": "0x17e9da82087a7337876173d5d1d5567253299c1225a23270cfcbd5d8a2c5b288", + "address": "0x809533c303c10915BB5c0585f2d8D738e2a4fB64", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xbb3cd01584873e92a524a9f825ae4f5b910ac8b27c46dd6f395a3124f982ac4d" + } + ], + "blockNumber": 21125139, + "cumulativeGasUsed": "441279", + "status": 1, + "byzantium": true + }, + "args": [ + "0x109E569f39945ea0843cF82E4E44553089AB779D", + "0x498c752c000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000026bf077037550e437605f07e25efcad510715c3a00000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf4836000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000006c6b935b8bbd40000000000000000000000000000000000000000000000001a784379d99db42000000" + ], + "numDeployments": 1, + "solcInputHash": "db363a789eea4155c2105a5d4adf4ddb", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 12b098756..5b237aacb 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -14,6 +14,8 @@ import "hardhat-docgen"; import "hardhat-contract-sizer"; import "hardhat-tracer"; require("./scripts/simulations/tasks"); +require("./scripts/populatePolicyRegistry"); +require("./scripts/populateCourts"); dotenv.config(); @@ -146,7 +148,7 @@ const config: HardhatUserConfig = { arbitrum: { chainId: 42161, url: "https://arb1.arbitrum.io/rpc", - accounts: process.env.MAINNET_PRIVATE_KEY !== undefined ? [process.env.MAINNET_PRIVATE_KEY] : [], + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], live: true, saveDeployments: true, tags: ["production", "home", "layer2"], diff --git a/contracts/scripts/changeRng.ts b/contracts/scripts/changeRng.ts deleted file mode 100644 index e0b363720..000000000 --- a/contracts/scripts/changeRng.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { deployments, getNamedAccounts, getChainId, ethers } from "hardhat"; -const { deploy, execute } = deployments; - -enum HomeChains { - ARBITRUM_ONE = 42161, - ARBITRUM_SEPOLIA = 421614, - HARDHAT = 31337, -} - -async function main() { - // fallback to hardhat node signers on local network - const deployer = (await getNamedAccounts()).deployer ?? (await ethers.getSigners())[0].address; - - const chainId = Number(await getChainId()); - if (!HomeChains[chainId]) { - console.error(`Aborting: script is not compatible with ${chainId}`); - return; - } else { - console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); - } - - const rng = await deploy("IncrementalNG", { - from: deployer, - args: [ethers.utils.keccak256(ethers.utils.toUtf8Bytes("Hello World!"))], - log: true, - skipIfAlreadyDeployed: false, // BUG: this parameter does nothing - }); - - const disputeKitDeployment = await deployments.get("DisputeKitClassic"); - const disputeKit = await ethers.getContractAt("DisputeKitClassic", disputeKitDeployment.address); - const currentRng = await disputeKit.rng(); - if (currentRng !== rng.address) { - console.log(`New RNG deployed at ${rng.address}. Updating dispute kit...`); - await execute("DisputeKitClassic", { from: deployer, log: true }, "changeRandomNumberGenerator", rng.address); - } else { - console.log(`Same RNG as before, nothing to do.`); - } -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/contracts/scripts/dotenv.sh b/contracts/scripts/dotenv.sh new file mode 100755 index 000000000..7953bfc91 --- /dev/null +++ b/contracts/scripts/dotenv.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +varKey=$1 + +if [ -z "$varKey" ]; then + echo "Env variable name not provided. Exiting..." >&2 + exit 1 +fi + +node -e " + require('dotenv').config({ path: '"$SCRIPT_DIR"/../.env' }) + console.log(process.env.$varKey) +" | sed 1d diff --git a/contracts/scripts/generateDeploymentsMarkdown.sh b/contracts/scripts/generateDeploymentsMarkdown.sh index 1b6220e37..280505f9c 100755 --- a/contracts/scripts/generateDeploymentsMarkdown.sh +++ b/contracts/scripts/generateDeploymentsMarkdown.sh @@ -18,7 +18,7 @@ function generate() { #deploymentDir #explorerUrl contractName=$(basename $f .json) address=$(cat $f | jq -r .address) implementation=$(cat $f | jq -r .implementation) - + if [ "$implementation" != "null" ]; then echo "- [$contractName: proxy]($explorerUrl$address), [implementation]($explorerUrl$implementation)" else @@ -27,6 +27,11 @@ function generate() { #deploymentDir #explorerUrl done } +echo "### V2 Neo (prelaunch)" +echo "#### Arbitrum One" +echo +generate "$SCRIPT_DIR/../deployments/arbitrum" "https://arbiscan.io/address/" | grep -v 'DAI\|WETH\|PNKFaucet' +echo echo "### Official Testnet" echo "#### Arbitrum Sepolia" echo diff --git a/contracts/scripts/populateCourts.ts b/contracts/scripts/populateCourts.ts index 5096194a8..a786fc305 100644 --- a/contracts/scripts/populateCourts.ts +++ b/contracts/scripts/populateCourts.ts @@ -1,5 +1,5 @@ -import { getNamedAccounts, getChainId, ethers, network } from "hardhat"; -import { KlerosCore, KlerosCoreUniversity } from "../typechain-types"; +import { task, types } from "hardhat/config"; +import { KlerosCore, KlerosCoreNeo, KlerosCoreUniversity } from "../typechain-types"; import { BigNumber, BigNumberish } from "ethers"; import courtsV1Mainnet from "../config/courts.v1.mainnet.json"; import courtsV1GnosisChain from "../config/courts.v1.gnosischain.json"; @@ -20,6 +20,12 @@ enum Sources { V2_TESTNET, } +enum Cores { + BASE, + NEO, + UNIVERSITY, +} + type Court = { id: number; parent: number; @@ -32,188 +38,234 @@ type Court = { supportedDisputeKits?: BigNumberish[]; }; -const from = isDevnet(network) ? Sources.V2_DEVNET : Sources.V2_TESTNET; -const UNIVERSITY = false; -const V1_DEV_PARAMETERS = false; // rename to V1_DEV_PARAMETERS -const ETH_USD = BigNumber.from(1800); +const ETH_USD = BigNumber.from(4000); const DISPUTE_KIT_CLASSIC = BigNumber.from(1); const TEN_THOUSAND_GWEI = BigNumber.from(10).pow(13); -async function main() { - // fallback to hardhat node signers on local network - const deployer = (await getNamedAccounts()).deployer ?? (await ethers.getSigners())[0].address; +task("populate:courts", "Populates the courts and their parameters") + .addOptionalParam( + "from", + "The source of the policies between v1_mainnet, v1_gnosis, v2_devnet, v2_testnet (default: auto depending on the network)", + undefined + ) + .addOptionalParam( + "maxNumberOfCourts", + "The maximum number of courts to populate (default: all)", + undefined, + types.int + ) + .addOptionalParam( + "coreType", + "The type of core to use between base, neo, university (default: base)", + Cores.BASE.toString() + ) + .addFlag("forceV1ParametersToDev", "Use development values for the v1 courts parameters") + .setAction(async (taskArgs, hre) => { + const { getNamedAccounts, getChainId, ethers, network } = hre; - const chainId = Number(await getChainId()); - if (!HomeChains[chainId]) { - console.error(`Aborting: script is not compatible with ${chainId}`); - return; - } else { - console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); - } + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await ethers.getSigners())[0].address; - const truncateWei = (x: BigNumber) => x.div(TEN_THOUSAND_GWEI).mul(TEN_THOUSAND_GWEI); + const chainId = Number(await getChainId()); + if (!HomeChains[chainId]) { + console.error(`Aborting: script is not compatible with ${chainId}`); + return; + } else { + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); + } - const parametersUsdToEth = (court: Court): Court => ({ - ...court, - minStake: truncateWei(BigNumber.from(court.minStake).div(ETH_USD)), - feeForJuror: truncateWei(BigNumber.from(court.feeForJuror).div(ETH_USD)), - }); + let from: Sources | undefined; + if (taskArgs.from) { + from = Sources[taskArgs.from.toUpperCase() as keyof typeof Sources]; + if (from === undefined) { + console.error("Invalid source, must be one of v1_mainnet, v1_gnosis, v2_devnet, v2_testnet"); + return; + } + } else { + from = isDevnet(network) ? Sources.V2_DEVNET : Sources.V2_TESTNET; + } + console.log("Populating from source %s", Sources[from]); - const parametersProductionToDev = (court: Court): Court => ({ - ...court, - minStake: truncateWei(BigNumber.from(court.minStake).div(10000)), - feeForJuror: truncateWei(ethers.utils.parseEther("0.00001")), - timesPerPeriod: [120, 120, 120, 240], - }); + let coreType = Cores.BASE; + coreType = Cores[taskArgs.coreType.toUpperCase() as keyof typeof Cores]; + if (coreType === undefined) { + console.error("Invalid core type, must be one of base, neo, university"); + return; + } + console.log("Using core type %s", Cores[coreType]); - // WARNING: skip the Forking court at id 0, so the v1 courts are shifted by 1 - const parametersV1ToV2 = (court: Court): Court => ({ - ...court, - id: court.id++, - parent: court.parent++, - }); + const truncateWei = (x: BigNumber) => x.div(TEN_THOUSAND_GWEI).mul(TEN_THOUSAND_GWEI); - let courtsV2; - switch (+from) { - case Sources.V1_MAINNET: { - let courtsV1: Court[] = courtsV1Mainnet; - courtsV1 = V1_DEV_PARAMETERS ? courtsV1.map(parametersProductionToDev) : courtsV1; - courtsV2 = courtsV1.map(parametersV1ToV2); - break; - } - case Sources.V1_GNOSIS: { - let courtsV1: Court[] = courtsV1GnosisChain.map(parametersUsdToEth); - courtsV1 = V1_DEV_PARAMETERS ? courtsV1.map(parametersProductionToDev) : courtsV1; - courtsV2 = courtsV1.map(parametersV1ToV2); - break; - } - case Sources.V2_DEVNET: { - courtsV2 = courtsV2ArbitrumDevnet.map(parametersProductionToDev); - break; - } - case Sources.V2_TESTNET: { - courtsV2 = courtsV2ArbitrumTestnet; - break; + const parametersUsdToEth = (court: Court): Court => ({ + ...court, + minStake: truncateWei(BigNumber.from(court.minStake).div(ETH_USD)), + feeForJuror: truncateWei(BigNumber.from(court.feeForJuror).div(ETH_USD)), + }); + + const parametersProductionToDev = (court: Court): Court => ({ + ...court, + minStake: truncateWei(BigNumber.from(court.minStake).div(10000)), + feeForJuror: truncateWei(ethers.utils.parseEther("0.00001")), + timesPerPeriod: [120, 120, 120, 240], + }); + + // WARNING: skip the Forking court at id 0, so the v1 courts are shifted by 1 + const parametersV1ToV2 = (court: Court): Court => ({ + ...court, + id: court.id++, + parent: court.parent++, + }); + + let courtsV2; + switch (+from) { + case Sources.V1_MAINNET: { + let courtsV1: Court[] = courtsV1Mainnet; + courtsV1 = taskArgs.forceV1ParametersToDev ? courtsV1.map(parametersProductionToDev) : courtsV1; + courtsV2 = courtsV1.map(parametersV1ToV2); + break; + } + case Sources.V1_GNOSIS: { + let courtsV1: Court[] = courtsV1GnosisChain.map(parametersUsdToEth); + courtsV1 = taskArgs.forceV1ParametersToDev ? courtsV1.map(parametersProductionToDev) : courtsV1; + courtsV2 = courtsV1.map(parametersV1ToV2); + break; + } + case Sources.V2_DEVNET: { + courtsV2 = courtsV2ArbitrumDevnet.map(parametersProductionToDev); + break; + } + case Sources.V2_TESTNET: { + courtsV2 = courtsV2ArbitrumTestnet; + break; + } + default: + throw new Error("Unknown source"); } - default: - throw new Error("Unknown source"); - } - console.log("courtsV2 = %O", courtsV2); + const maxNumberOfCourts = taskArgs.maxNumberOfCourts; // set to undefined for all the courts + console.log("Keeping only the first %d courts", maxNumberOfCourts ?? courtsV2.length); + courtsV2 = courtsV2.slice(0, maxNumberOfCourts); - const core = UNIVERSITY - ? ((await ethers.getContract("KlerosCoreUniversity")) as KlerosCoreUniversity) - : ((await ethers.getContract("KlerosCore")) as KlerosCore); + console.log("courtsV2 = %O", courtsV2); - for (const court of courtsV2) { - const courtPresent = await core.courts(court.id).catch(() => {}); - if (courtPresent) { - console.log("Court %d found: %O", court.id, courtPresent); + let core: KlerosCore | KlerosCoreNeo | KlerosCoreUniversity; + switch (coreType) { + case Cores.UNIVERSITY: + console.log("Using KlerosCoreUniversity"); + core = (await ethers.getContract("KlerosCoreUniversity")) as KlerosCoreUniversity; + break; + case Cores.NEO: + console.log("Using KlerosCoreNeo"); + core = (await ethers.getContract("KlerosCoreNeo")) as KlerosCoreNeo; + break; + default: + console.log("Using KlerosCore"); + core = (await ethers.getContract("KlerosCore")) as KlerosCore; + break; + } - // Court.parent and sortitionSumTreeK cannot be changed. + for (const court of courtsV2) { + const courtPresent = await core.courts(court.id).catch(() => {}); + if (courtPresent) { + console.log("Court %d found: %O", court.id, courtPresent); - let change = false; + // Court.parent and sortitionSumTreeK cannot be changed. - if (courtPresent.hiddenVotes !== court.hiddenVotes) { - change = true; - console.log( - "Court %d: changing hiddenVotes from %d to %d", - court.id, - courtPresent.hiddenVotes, - court.hiddenVotes - ); - } + let change = false; - if (!courtPresent.minStake.eq(court.minStake)) { - change = true; - console.log("Court %d: changing minStake from %d to %d", court.id, courtPresent.minStake, court.minStake); - } + if (courtPresent.hiddenVotes !== court.hiddenVotes) { + change = true; + console.log( + "Court %d: changing hiddenVotes from %d to %d", + court.id, + courtPresent.hiddenVotes, + court.hiddenVotes + ); + } - if (!courtPresent.alpha.eq(court.alpha)) { - change = true; - console.log("Court %d: changing alpha from %d to %d", court.id, courtPresent.alpha, court.alpha); - } + if (!courtPresent.minStake.eq(court.minStake)) { + change = true; + console.log("Court %d: changing minStake from %d to %d", court.id, courtPresent.minStake, court.minStake); + } - if (!courtPresent.feeForJuror.eq(court.feeForJuror)) { - change = true; - console.log( - "Court %d: changing feeForJuror from %d to %d", - court.id, - courtPresent.feeForJuror, - court.feeForJuror - ); - } + if (!courtPresent.alpha.eq(court.alpha)) { + change = true; + console.log("Court %d: changing alpha from %d to %d", court.id, courtPresent.alpha, court.alpha); + } - if (!courtPresent.jurorsForCourtJump.eq(court.jurorsForCourtJump)) { - change = true; - console.log( - "Court %d: changing jurorsForCourtJump from %d to %d", - court.id, - courtPresent.jurorsForCourtJump, - court.jurorsForCourtJump - ); - } + if (!courtPresent.feeForJuror.eq(court.feeForJuror)) { + change = true; + console.log( + "Court %d: changing feeForJuror from %d to %d", + court.id, + courtPresent.feeForJuror, + court.feeForJuror + ); + } - const timesPerPeriodPresent = (await core.getTimesPerPeriod(court.id)).map((bn) => bn.toNumber()); - if (!timesPerPeriodPresent.every((val, index) => val === court.timesPerPeriod[index])) { - change = true; - console.log( - "Court %d: changing timesPerPeriod from %O to %O", - court.id, - timesPerPeriodPresent, - court.timesPerPeriod - ); - } + if (!courtPresent.jurorsForCourtJump.eq(court.jurorsForCourtJump)) { + change = true; + console.log( + "Court %d: changing jurorsForCourtJump from %d to %d", + court.id, + courtPresent.jurorsForCourtJump, + court.jurorsForCourtJump + ); + } - if (!change) { - console.log("Court %d: no parameter change", court.id); - continue; - } + const timesPerPeriodPresent = (await core.getTimesPerPeriod(court.id)).map((bn) => bn.toNumber()); + if (!timesPerPeriodPresent.every((val, index) => val === court.timesPerPeriod[index])) { + change = true; + console.log( + "Court %d: changing timesPerPeriod from %O to %O", + court.id, + timesPerPeriodPresent, + court.timesPerPeriod + ); + } - await core.changeCourtParameters( - court.id, - court.hiddenVotes, - court.minStake, - court.alpha, - court.feeForJuror, - court.jurorsForCourtJump, - court.timesPerPeriod - ); - } else { - console.log("Court %d not found, creating it with", court.id, court); - if (UNIVERSITY) { - await (core as KlerosCoreUniversity).createCourt( - court.parent, + if (!change) { + console.log("Court %d: no parameter change", court.id); + continue; + } + + await core.changeCourtParameters( + court.id, court.hiddenVotes, court.minStake, court.alpha, court.feeForJuror, court.jurorsForCourtJump, - [court.timesPerPeriod[0], court.timesPerPeriod[1], court.timesPerPeriod[2], court.timesPerPeriod[3]], - [DISPUTE_KIT_CLASSIC] + court.timesPerPeriod ); } else { - await (core as KlerosCore).createCourt( - court.parent, - court.hiddenVotes, - court.minStake, - court.alpha, - court.feeForJuror, - court.jurorsForCourtJump, - [court.timesPerPeriod[0], court.timesPerPeriod[1], court.timesPerPeriod[2], court.timesPerPeriod[3]], - ethers.utils.hexlify(5), // Not accessible on-chain, but has always been set to the same value so far. - [DISPUTE_KIT_CLASSIC] - ); + console.log("Court %d not found, creating it with", court.id, court); + if (coreType === Cores.UNIVERSITY) { + await (core as KlerosCoreUniversity).createCourt( + court.parent, + court.hiddenVotes, + court.minStake, + court.alpha, + court.feeForJuror, + court.jurorsForCourtJump, + [court.timesPerPeriod[0], court.timesPerPeriod[1], court.timesPerPeriod[2], court.timesPerPeriod[3]], + [DISPUTE_KIT_CLASSIC] + ); + } else { + await (core as KlerosCore).createCourt( + court.parent, + court.hiddenVotes, + court.minStake, + court.alpha, + court.feeForJuror, + court.jurorsForCourtJump, + [court.timesPerPeriod[0], court.timesPerPeriod[1], court.timesPerPeriod[2], court.timesPerPeriod[3]], + ethers.utils.hexlify(5), // Not accessible on-chain, but has always been set to the same value so far. + [DISPUTE_KIT_CLASSIC] + ); + } } - } - await new Promise((resolve) => setTimeout(resolve, 100)); - } -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); + await new Promise((resolve) => setTimeout(resolve, 100)); + } }); diff --git a/contracts/scripts/populatePolicyRegistry.ts b/contracts/scripts/populatePolicyRegistry.ts index 75d1570a3..de574295b 100644 --- a/contracts/scripts/populatePolicyRegistry.ts +++ b/contracts/scripts/populatePolicyRegistry.ts @@ -1,4 +1,4 @@ -import { deployments, getNamedAccounts, getChainId, ethers, network } from "hardhat"; +import { task, types } from "hardhat/config"; import { PolicyRegistry } from "../typechain-types"; import policiesV1Mainnet from "../config/policies.v1.mainnet.json"; import policiesV1GnosisChain from "../config/policies.v1.gnosischain.json"; @@ -18,66 +18,88 @@ enum Sources { V2_DEVNET, V2_TESTNET, } -const from = isDevnet(network) ? Sources.V2_DEVNET : Sources.V2_TESTNET; -async function main() { - // fallback to hardhat node signers on local network - const deployer = (await getNamedAccounts()).deployer ?? (await ethers.getSigners())[0].address; +task("populate:policy-registry", "Populates the policy registry for each court") + .addOptionalParam( + "from", + "The source of the policies between v1_mainnet, v1_gnosis, v2_devnet, v2_testnet (default: auto depending on the network)", + undefined + ) + .addOptionalParam( + "maxNumberOfCourts", + "The maximum number of courts to populate (default: all)", + undefined, + types.int + ) + .setAction(async (taskArgs, hre) => { + const { deployments, getNamedAccounts, getChainId, ethers, network } = hre; - const chainId = Number(await getChainId()); - if (!HomeChains[chainId]) { - console.error(`Aborting: script is not compatible with ${chainId}`); - return; - } else { - console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); - } + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await ethers.getSigners())[0].address; - let policiesV2; - switch (+from) { - case Sources.V1_MAINNET: { - const policiesV1 = policiesV1Mainnet; - - // WARNING: skip the Forking court at id 0, so the v1 courts are shifted by 1 - policiesV2 = policiesV1.map((policy) => ({ ...policy, court: policy.court + 1 })); - break; + const chainId = Number(await getChainId()); + if (!HomeChains[chainId]) { + console.error(`Aborting: script is not compatible with ${chainId}`); + return; + } else { + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); } - case Sources.V1_GNOSIS: { - const policiesV1 = policiesV1GnosisChain.map((policy) => ({ - ...policy, - name: policy.name.replace("xDai ", ""), - })); - // WARNING: skip the Forking court at id 0, so the v1 courts are shifted by 1 - policiesV2 = policiesV1.map((policy) => ({ ...policy, court: policy.court + 1 })); - break; - } - case Sources.V2_DEVNET: { - policiesV2 = policiesV2ArbitrumDevnet; - break; + let from: Sources | undefined; + if (taskArgs.from) { + from = Sources[taskArgs.from.toUpperCase() as keyof typeof Sources]; + if (from === undefined) { + console.error("Invalid source, must be one of v1_mainnet, v1_gnosis, v2_devnet, v2_testnet"); + return; + } + } else { + from = isDevnet(network) ? Sources.V2_DEVNET : Sources.V2_TESTNET; } - case Sources.V2_TESTNET: { - policiesV2 = policiesV2ArbitrumTestnet; - break; + console.log("Populating from source %s", Sources[from]); + + let policiesV2; + switch (+from) { + case Sources.V1_MAINNET: { + const policiesV1 = policiesV1Mainnet; + + // WARNING: skip the Forking court at id 0, so the v1 courts are shifted by 1 + policiesV2 = policiesV1.map((policy) => ({ ...policy, court: policy.court + 1 })); + break; + } + case Sources.V1_GNOSIS: { + const policiesV1 = policiesV1GnosisChain.map((policy) => ({ + ...policy, + name: policy.name.replace("xDai ", ""), + })); + + // WARNING: skip the Forking court at id 0, so the v1 courts are shifted by 1 + policiesV2 = policiesV1.map((policy) => ({ ...policy, court: policy.court + 1 })); + break; + } + case Sources.V2_DEVNET: { + policiesV2 = policiesV2ArbitrumDevnet; + break; + } + case Sources.V2_TESTNET: { + policiesV2 = policiesV2ArbitrumTestnet; + break; + } + default: + return; } - default: - return; - } - const policyRegistryDeployment = await deployments.get("PolicyRegistry"); - const policyRegistry = (await ethers.getContractAt( - "PolicyRegistry", - policyRegistryDeployment.address - )) as PolicyRegistry; + const maxNumberOfCourts = taskArgs.maxNumberOfCourts; // set to undefined for all the courts + console.log("Keeping only the first %d courts", maxNumberOfCourts ?? policiesV2.length); + policiesV2 = policiesV2.slice(0, maxNumberOfCourts); - for await (const policy of policiesV2) { - console.log("Populating policy for %s Court (%d): %s", policy.name, policy.court, policy.uri); - await policyRegistry.setPolicy(policy.court, policy.name, policy.uri); - } -} + const policyRegistryDeployment = await deployments.get("PolicyRegistry"); + const policyRegistry = (await ethers.getContractAt( + "PolicyRegistry", + policyRegistryDeployment.address + )) as PolicyRegistry; -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); + for await (const policy of policiesV2) { + console.log("Populating policy for %s Court (%d): %s", policy.name, policy.court, policy.uri); + await policyRegistry.setPolicy(policy.court, policy.name, policy.uri); + } }); diff --git a/contracts/src/arbitration/DisputeTemplateRegistry.sol b/contracts/src/arbitration/DisputeTemplateRegistry.sol index 2413affba..276e51ce1 100644 --- a/contracts/src/arbitration/DisputeTemplateRegistry.sol +++ b/contracts/src/arbitration/DisputeTemplateRegistry.sol @@ -46,10 +46,8 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini // * Governance * // // ************************ // - /** - * @dev Access Control to perform implementation upgrades (UUPS Proxiable) - * @dev Only the governor can perform upgrades (`onlyByGovernor`) - */ + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) function _authorizeUpgrade(address) internal view override onlyByGovernor { // NOP } diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index e4929e92a..e93d5ce6e 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -8,171 +8,14 @@ pragma solidity 0.8.18; -import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol"; -import {IDisputeKit} from "./interfaces/IDisputeKit.sol"; -import {ISortitionModule} from "./interfaces/ISortitionModule.sol"; -import {SafeERC20, IERC20} from "../libraries/SafeERC20.sol"; -import {Constants} from "../libraries/Constants.sol"; -import {OnError} from "../libraries/Types.sol"; +import "./KlerosCoreBase.sol"; import {UUPSProxiable} from "../proxy/UUPSProxiable.sol"; import {Initializable} from "../proxy/Initializable.sol"; /// @title KlerosCore /// Core arbitrator contract for Kleros v2. /// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts. -contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { - using SafeERC20 for IERC20; - - // ************************************* // - // * Enums / Structs * // - // ************************************* // - - enum Period { - evidence, // Evidence can be submitted. This is also when drawing has to take place. - commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes. - vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not. - appeal, // The dispute can be appealed. - execution // Tokens are redistributed and the ruling is executed. - } - - struct Court { - uint96 parent; // The parent court. - bool hiddenVotes; // Whether to use commit and reveal or not. - uint256[] children; // List of child courts. - uint256 minStake; // Minimum PNKs needed to stake in the court. - uint256 alpha; // Basis point of PNKs that are lost when incoherent. - uint256 feeForJuror; // Arbitration fee paid per juror. - uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any. - uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`. - mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit. - bool disabled; // True if the court is disabled. Unused for now, will be implemented later. - } - - struct Dispute { - uint96 courtID; // The ID of the court the dispute is in. - IArbitrableV2 arbitrated; // The arbitrable contract. - Period period; // The current period of the dispute. - bool ruled; // True if the ruling has been executed, false otherwise. - uint256 lastPeriodChange; // The last time the period was changed. - Round[] rounds; - } - - struct Round { - uint256 disputeKitID; // Index of the dispute kit in the array. - uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round. - uint256 totalFeesForJurors; // The total juror fees paid in this round. - uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length. - uint256 repartitions; // A counter of reward repartitions made in this round. - uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round. - address[] drawnJurors; // Addresses of the jurors that were drawn in this round. - uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round. - uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round. - IERC20 feeToken; // The token used for paying fees in this round. - uint256 drawIterations; // The number of iterations passed drawing the jurors for this round. - } - - // Workaround "stack too deep" errors - struct ExecuteParams { - uint256 disputeID; // The ID of the dispute to execute. - uint256 round; // The round to execute. - uint256 coherentCount; // The number of coherent votes in the round. - uint256 numberOfVotesInRound; // The number of votes in the round. - uint256 feePerJurorInRound; // The fee per juror in the round. - uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round. - uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round. - uint256 repartition; // The index of the repartition to execute. - } - - struct CurrencyRate { - bool feePaymentAccepted; - uint64 rateInEth; - uint8 rateDecimals; - } - - // ************************************* // - // * Storage * // - // ************************************* // - - uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by. - uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH. - - address public governor; // The governor of the contract. - IERC20 public pinakion; // The Pinakion token contract. - address public jurorProsecutionModule; // The module for juror's prosecution. - ISortitionModule public sortitionModule; // Sortition module for drawing. - Court[] public courts; // The courts. - IDisputeKit[] public disputeKits; // Array of dispute kits. - Dispute[] public disputes; // The disputes. - mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH. - - // ************************************* // - // * Events * // - // ************************************* // - - event NewPeriod(uint256 indexed _disputeID, Period _period); - event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); - event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); - event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID); - event CourtCreated( - uint256 indexed _courtID, - uint96 indexed _parent, - bool _hiddenVotes, - uint256 _minStake, - uint256 _alpha, - uint256 _feeForJuror, - uint256 _jurorsForCourtJump, - uint256[4] _timesPerPeriod, - uint256[] _supportedDisputeKits - ); - event CourtModified( - uint96 indexed _courtID, - bool _hiddenVotes, - uint256 _minStake, - uint256 _alpha, - uint256 _feeForJuror, - uint256 _jurorsForCourtJump, - uint256[4] _timesPerPeriod - ); - event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress); - event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable); - event CourtJump( - uint256 indexed _disputeID, - uint256 indexed _roundID, - uint96 indexed _fromCourtID, - uint96 _toCourtID - ); - event DisputeKitJump( - uint256 indexed _disputeID, - uint256 indexed _roundID, - uint256 indexed _fromDisputeKitID, - uint256 _toDisputeKitID - ); - event TokenAndETHShift( - address indexed _account, - uint256 indexed _disputeID, - uint256 indexed _roundID, - uint256 _degreeOfCoherency, - int256 _pnkAmount, - int256 _feeAmount, - IERC20 _feeToken - ); - event LeftoverRewardSent( - uint256 indexed _disputeID, - uint256 indexed _roundID, - uint256 _pnkAmount, - uint256 _feeAmount, - IERC20 _feeToken - ); - - // ************************************* // - // * Function Modifiers * // - // ************************************* // - - modifier onlyByGovernor() { - if (governor != msg.sender) revert GovernorOnly(); - _; - } - +contract KlerosCore is KlerosCoreBase, UUPSProxiable, Initializable { // ************************************* // // * Constructor * // // ************************************* // @@ -184,6 +27,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @dev Initializer (constructor equivalent for upgradable contracts). /// @param _governor The governor's address. + /// @param _guardian The guardian's address. /// @param _pinakion The address of the token contract. /// @param _jurorProsecutionModule The address of the juror prosecution module. /// @param _disputeKit The address of the default dispute kit. @@ -194,6 +38,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors. function initialize( address _governor, + address _guardian, IERC20 _pinakion, address _jurorProsecutionModule, IDisputeKit _disputeKit, @@ -203,952 +48,27 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { bytes memory _sortitionExtraData, ISortitionModule _sortitionModuleAddress ) external reinitializer(1) { - governor = _governor; - pinakion = _pinakion; - jurorProsecutionModule = _jurorProsecutionModule; - sortitionModule = _sortitionModuleAddress; - - // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported. - disputeKits.push(); - - // DISPUTE_KIT_CLASSIC - disputeKits.push(_disputeKit); - - emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit); - - // FORKING_COURT - // TODO: Fill the properties for the Forking court, emit CourtCreated. - courts.push(); - sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData); - - // GENERAL_COURT - Court storage court = courts.push(); - court.parent = Constants.FORKING_COURT; - court.children = new uint256[](0); - court.hiddenVotes = _hiddenVotes; - court.minStake = _courtParameters[0]; - court.alpha = _courtParameters[1]; - court.feeForJuror = _courtParameters[2]; - court.jurorsForCourtJump = _courtParameters[3]; - court.timesPerPeriod = _timesPerPeriod; - - sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData); - - emit CourtCreated( - 1, - court.parent, + _initialize( + _governor, + _guardian, + _pinakion, + _jurorProsecutionModule, + _disputeKit, _hiddenVotes, - _courtParameters[0], - _courtParameters[1], - _courtParameters[2], - _courtParameters[3], + _courtParameters, _timesPerPeriod, - new uint256[](0) + _sortitionExtraData, + _sortitionModuleAddress ); - _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true); } // ************************************* // // * Governance * // // ************************************* // - /* @dev Access Control to perform implementation upgrades (UUPS Proxiable) - * @dev Only the governor can perform upgrades (`onlyByGovernor`) - */ + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) function _authorizeUpgrade(address) internal view override onlyByGovernor { // NOP } - - /// @dev Allows the governor to call anything on behalf of the contract. - /// @param _destination The destination of the call. - /// @param _amount The value sent with the call. - /// @param _data The data sent with the call. - function executeGovernorProposal( - address _destination, - uint256 _amount, - bytes memory _data - ) external onlyByGovernor { - (bool success, ) = _destination.call{value: _amount}(_data); - if (!success) revert UnsuccessfulCall(); - } - - /// @dev Changes the `governor` storage variable. - /// @param _governor The new value for the `governor` storage variable. - function changeGovernor(address payable _governor) external onlyByGovernor { - governor = _governor; - } - - /// @dev Changes the `pinakion` storage variable. - /// @param _pinakion The new value for the `pinakion` storage variable. - function changePinakion(IERC20 _pinakion) external onlyByGovernor { - pinakion = _pinakion; - } - - /// @dev Changes the `jurorProsecutionModule` storage variable. - /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable. - function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor { - jurorProsecutionModule = _jurorProsecutionModule; - } - - /// @dev Changes the `_sortitionModule` storage variable. - /// Note that the new module should be initialized for all courts. - /// @param _sortitionModule The new value for the `sortitionModule` storage variable. - function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor { - sortitionModule = _sortitionModule; - } - - /// @dev Add a new supported dispute kit module to the court. - /// @param _disputeKitAddress The address of the dispute kit contract. - function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor { - uint256 disputeKitID = disputeKits.length; - disputeKits.push(_disputeKitAddress); - emit DisputeKitCreated(disputeKitID, _disputeKitAddress); - } - - /// @dev Creates a court under a specified parent court. - /// @param _parent The `parent` property value of the court. - /// @param _hiddenVotes The `hiddenVotes` property value of the court. - /// @param _minStake The `minStake` property value of the court. - /// @param _alpha The `alpha` property value of the court. - /// @param _feeForJuror The `feeForJuror` property value of the court. - /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court. - /// @param _timesPerPeriod The `timesPerPeriod` property value of the court. - /// @param _sortitionExtraData Extra data for sortition module. - /// @param _supportedDisputeKits Indexes of dispute kits that this court will support. - function createCourt( - uint96 _parent, - bool _hiddenVotes, - uint256 _minStake, - uint256 _alpha, - uint256 _feeForJuror, - uint256 _jurorsForCourtJump, - uint256[4] memory _timesPerPeriod, - bytes memory _sortitionExtraData, - uint256[] memory _supportedDisputeKits - ) external onlyByGovernor { - if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt(); - if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit(); - if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent(); - - uint256 courtID = courts.length; - Court storage court = courts.push(); - - for (uint256 i = 0; i < _supportedDisputeKits.length; i++) { - if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) { - revert WrongDisputeKitIndex(); - } - court.supportedDisputeKits[_supportedDisputeKits[i]] = true; - } - // Check that Classic DK support was added. - if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic(); - - court.parent = _parent; - court.children = new uint256[](0); - court.hiddenVotes = _hiddenVotes; - court.minStake = _minStake; - court.alpha = _alpha; - court.feeForJuror = _feeForJuror; - court.jurorsForCourtJump = _jurorsForCourtJump; - court.timesPerPeriod = _timesPerPeriod; - - sortitionModule.createTree(bytes32(courtID), _sortitionExtraData); - - // Update the parent. - courts[_parent].children.push(courtID); - emit CourtCreated( - courtID, - _parent, - _hiddenVotes, - _minStake, - _alpha, - _feeForJuror, - _jurorsForCourtJump, - _timesPerPeriod, - _supportedDisputeKits - ); - } - - function changeCourtParameters( - uint96 _courtID, - bool _hiddenVotes, - uint256 _minStake, - uint256 _alpha, - uint256 _feeForJuror, - uint256 _jurorsForCourtJump, - uint256[4] memory _timesPerPeriod - ) external onlyByGovernor { - Court storage court = courts[_courtID]; - if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) { - revert MinStakeLowerThanParentCourt(); - } - for (uint256 i = 0; i < court.children.length; i++) { - if (courts[court.children[i]].minStake < _minStake) { - revert MinStakeLowerThanParentCourt(); - } - } - court.minStake = _minStake; - court.hiddenVotes = _hiddenVotes; - court.alpha = _alpha; - court.feeForJuror = _feeForJuror; - court.jurorsForCourtJump = _jurorsForCourtJump; - court.timesPerPeriod = _timesPerPeriod; - emit CourtModified( - _courtID, - _hiddenVotes, - _minStake, - _alpha, - _feeForJuror, - _jurorsForCourtJump, - _timesPerPeriod - ); - } - - /// @dev Adds/removes court's support for specified dispute kits. - /// @param _courtID The ID of the court. - /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed. - /// @param _enable Whether add or remove the dispute kits from the court. - function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor { - for (uint256 i = 0; i < _disputeKitIDs.length; i++) { - if (_enable) { - if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) { - revert WrongDisputeKitIndex(); - } - _enableDisputeKit(_courtID, _disputeKitIDs[i], true); - } else { - // Classic dispute kit must be supported by all courts. - if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) { - revert CannotDisableClassicDK(); - } - _enableDisputeKit(_courtID, _disputeKitIDs[i], false); - } - } - } - - /// @dev Changes the supported fee tokens. - /// @param _feeToken The fee token. - /// @param _accepted Whether the token is supported or not as a method of fee payment. - function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor { - currencyRates[_feeToken].feePaymentAccepted = _accepted; - emit AcceptedFeeToken(_feeToken, _accepted); - } - - /// @dev Changes the currency rate of a fee token. - /// @param _feeToken The fee token. - /// @param _rateInEth The new rate of the fee token in ETH. - /// @param _rateDecimals The new decimals of the fee token rate. - function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor { - currencyRates[_feeToken].rateInEth = _rateInEth; - currencyRates[_feeToken].rateDecimals = _rateDecimals; - emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals); - } - - // ************************************* // - // * State Modifiers * // - // ************************************* // - - /// @dev Sets the caller's stake in a court. - /// @param _courtID The ID of the court. - /// @param _newStake The new stake. - /// Note that the existing delayed stake will be nullified as non-relevant. - function setStake(uint96 _courtID, uint256 _newStake) external { - _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert); - } - - /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors. - /// @param _account The account whose stake is being set. - /// @param _courtID The ID of the court. - /// @param _newStake The new stake. - /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract. - function setStakeBySortitionModule( - address _account, - uint96 _courtID, - uint256 _newStake, - bool _alreadyTransferred - ) external { - if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); - _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return); - } - - /// @inheritdoc IArbitratorV2 - function createDispute( - uint256 _numberOfChoices, - bytes memory _extraData - ) external payable override returns (uint256 disputeID) { - if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough(); - - return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value); - } - - /// @inheritdoc IArbitratorV2 - function createDispute( - uint256 _numberOfChoices, - bytes calldata _extraData, - IERC20 _feeToken, - uint256 _feeAmount - ) external override returns (uint256 disputeID) { - if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted(); - if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough(); - - if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed(); - return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount); - } - - function _createDispute( - uint256 _numberOfChoices, - bytes memory _extraData, - IERC20 _feeToken, - uint256 _feeAmount - ) internal returns (uint256 disputeID) { - (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData); - if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt(); - - disputeID = disputes.length; - Dispute storage dispute = disputes.push(); - dispute.courtID = courtID; - dispute.arbitrated = IArbitrableV2(msg.sender); - dispute.lastPeriodChange = block.timestamp; - - IDisputeKit disputeKit = disputeKits[disputeKitID]; - Court storage court = courts[courtID]; - Round storage round = dispute.rounds.push(); - - // Obtain the feeForJuror in the same currency as the _feeAmount - uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY) - ? court.feeForJuror - : convertEthToTokenAmount(_feeToken, court.feeForJuror); - round.nbVotes = _feeAmount / feeForJuror; - round.disputeKitID = disputeKitID; - round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR; - round.totalFeesForJurors = _feeAmount; - round.feeToken = IERC20(_feeToken); - - sortitionModule.createDisputeHook(disputeID, 0); // Default round ID. - - disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes); - emit DisputeCreation(disputeID, IArbitrableV2(msg.sender)); - } - - /// @dev Passes the period of a specified dispute. - /// @param _disputeID The ID of the dispute. - function passPeriod(uint256 _disputeID) external { - Dispute storage dispute = disputes[_disputeID]; - Court storage court = courts[dispute.courtID]; - - uint256 currentRound = dispute.rounds.length - 1; - Round storage round = dispute.rounds[currentRound]; - if (dispute.period == Period.evidence) { - if ( - currentRound == 0 && - block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] - ) { - revert EvidenceNotPassedAndNotAppeal(); - } - if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing(); - dispute.period = court.hiddenVotes ? Period.commit : Period.vote; - } else if (dispute.period == Period.commit) { - if ( - block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] && - !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID) - ) { - revert CommitPeriodNotPassed(); - } - dispute.period = Period.vote; - } else if (dispute.period == Period.vote) { - if ( - block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] && - !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID) - ) { - revert VotePeriodNotPassed(); - } - dispute.period = Period.appeal; - emit AppealPossible(_disputeID, dispute.arbitrated); - } else if (dispute.period == Period.appeal) { - if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) { - revert AppealPeriodNotPassed(); - } - dispute.period = Period.execution; - } else if (dispute.period == Period.execution) { - revert DisputePeriodIsFinal(); - } - - dispute.lastPeriodChange = block.timestamp; - emit NewPeriod(_disputeID, dispute.period); - } - - /// @dev Draws jurors for the dispute. Can be called in parts. - /// @param _disputeID The ID of the dispute. - /// @param _iterations The number of iterations to run. - function draw(uint256 _disputeID, uint256 _iterations) external { - Dispute storage dispute = disputes[_disputeID]; - uint256 currentRound = dispute.rounds.length - 1; - Round storage round = dispute.rounds[currentRound]; - if (dispute.period != Period.evidence) revert NotEvidencePeriod(); - - IDisputeKit disputeKit = disputeKits[round.disputeKitID]; - - uint256 startIndex = round.drawIterations; // for gas: less storage reads - uint256 i; - while (i < _iterations && round.drawnJurors.length < round.nbVotes) { - address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++); - if (drawnAddress == address(0)) { - continue; - } - sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror); - emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length); - round.drawnJurors.push(drawnAddress); - if (round.drawnJurors.length == round.nbVotes) { - sortitionModule.postDrawHook(_disputeID, currentRound); - } - } - round.drawIterations += i; - } - - /// @dev Appeals the ruling of a specified dispute. - /// Note: Access restricted to the Dispute Kit for this `disputeID`. - /// @param _disputeID The ID of the dispute. - /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump. - /// @param _extraData Extradata for the dispute. Can be required during court jump. - function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable { - if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough(); - - Dispute storage dispute = disputes[_disputeID]; - if (dispute.period != Period.appeal) revert DisputeNotAppealable(); - - Round storage round = dispute.rounds[dispute.rounds.length - 1]; - if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly(); - - uint96 newCourtID = dispute.courtID; - uint256 newDisputeKitID = round.disputeKitID; - - // Warning: the extra round must be created before calling disputeKit.createDispute() - Round storage extraRound = dispute.rounds.push(); - - if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) { - // Jump to parent court. - newCourtID = courts[newCourtID].parent; - - if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) { - // Switch to classic dispute kit if parent court doesn't support the current one. - newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC; - } - - if (newCourtID != dispute.courtID) { - emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID); - } - } - - dispute.courtID = newCourtID; - dispute.period = Period.evidence; - dispute.lastPeriodChange = block.timestamp; - - Court storage court = courts[newCourtID]; - extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds. - extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR; - extraRound.totalFeesForJurors = msg.value; - extraRound.disputeKitID = newDisputeKitID; - - sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1); - - // Dispute kit was changed, so create a dispute in the new DK contract. - if (extraRound.disputeKitID != round.disputeKitID) { - emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID); - disputeKits[extraRound.disputeKitID].createDispute( - _disputeID, - _numberOfChoices, - _extraData, - extraRound.nbVotes - ); - } - - emit AppealDecision(_disputeID, dispute.arbitrated); - emit NewPeriod(_disputeID, Period.evidence); - } - - /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts. - /// @param _disputeID The ID of the dispute. - /// @param _round The appeal round. - /// @param _iterations The number of iterations to run. - function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external { - Round storage round; - { - Dispute storage dispute = disputes[_disputeID]; - if (dispute.period != Period.execution) revert NotExecutionPeriod(); - - round = dispute.rounds[_round]; - } // stack too deep workaround - - uint256 start = round.repartitions; - uint256 end = round.repartitions + _iterations; - - uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas. - uint256 numberOfVotesInRound = round.drawnJurors.length; - uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound; - uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror; - uint256 coherentCount; - { - IDisputeKit disputeKit = disputeKits[round.disputeKitID]; - coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round. - } // stack too deep workaround - - if (coherentCount == 0) { - // 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. - if (end > numberOfVotesInRound) end = numberOfVotesInRound; - } else { - // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees. - if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2; - } - round.repartitions = end; - - for (uint256 i = start; i < end; i++) { - if (i < numberOfVotesInRound) { - pnkPenaltiesInRound = _executePenalties( - ExecuteParams({ - disputeID: _disputeID, - round: _round, - coherentCount: coherentCount, - numberOfVotesInRound: numberOfVotesInRound, - feePerJurorInRound: feePerJurorInRound, - pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound, - pnkPenaltiesInRound: pnkPenaltiesInRound, - repartition: i - }) - ); - } else { - _executeRewards( - ExecuteParams({ - disputeID: _disputeID, - round: _round, - coherentCount: coherentCount, - numberOfVotesInRound: numberOfVotesInRound, - feePerJurorInRound: feePerJurorInRound, - pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound, - pnkPenaltiesInRound: pnkPenaltiesInRound, - repartition: i - }) - ); - } - } - if (round.pnkPenalties != pnkPenaltiesInRound) { - round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact - } - } - - /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only. - /// @param _params The parameters for the execution, see `ExecuteParams`. - /// @return pnkPenaltiesInRoundCache The updated penalties in round cache. - function _executePenalties(ExecuteParams memory _params) internal returns (uint256) { - Dispute storage dispute = disputes[_params.disputeID]; - Round storage round = dispute.rounds[_params.round]; - IDisputeKit disputeKit = disputeKits[round.disputeKitID]; - - // [0, 1] value that determines how coherent the juror was in this round, in basis points. - uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence( - _params.disputeID, - _params.round, - _params.repartition, - _params.feePerJurorInRound, - _params.pnkAtStakePerJurorInRound - ); - if (degreeOfCoherence > ALPHA_DIVISOR) { - // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit. - degreeOfCoherence = ALPHA_DIVISOR; - } - - // Fully coherent jurors won't be penalized. - uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR; - _params.pnkPenaltiesInRound += penalty; - - // Unlock the PNKs affected by the penalty - address account = round.drawnJurors[_params.repartition]; - sortitionModule.unlockStake(account, penalty); - - // Apply the penalty to the staked PNKs. - sortitionModule.penalizeStake(account, penalty); - emit TokenAndETHShift( - account, - _params.disputeID, - _params.round, - degreeOfCoherence, - -int256(penalty), - 0, - round.feeToken - ); - - if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) { - // The juror is inactive, unstake them. - sortitionModule.setJurorInactive(account); - } - if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) { - // No one was coherent, send the rewards to the governor. - if (round.feeToken == Constants.NATIVE_CURRENCY) { - // The dispute fees were paid in ETH - payable(governor).send(round.totalFeesForJurors); - } else { - // The dispute fees were paid in ERC20 - round.feeToken.safeTransfer(governor, round.totalFeesForJurors); - } - pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound); - emit LeftoverRewardSent( - _params.disputeID, - _params.round, - _params.pnkPenaltiesInRound, - round.totalFeesForJurors, - round.feeToken - ); - } - return _params.pnkPenaltiesInRound; - } - - /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only. - /// @param _params The parameters for the execution, see `ExecuteParams`. - function _executeRewards(ExecuteParams memory _params) internal { - Dispute storage dispute = disputes[_params.disputeID]; - Round storage round = dispute.rounds[_params.round]; - IDisputeKit disputeKit = disputeKits[round.disputeKitID]; - - // [0, 1] value that determines how coherent the juror was in this round, in basis points. - uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence( - _params.disputeID, - _params.round, - _params.repartition % _params.numberOfVotesInRound, - _params.feePerJurorInRound, - _params.pnkAtStakePerJurorInRound - ); - - // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit. - if (degreeOfCoherence > ALPHA_DIVISOR) { - degreeOfCoherence = ALPHA_DIVISOR; - } - - address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound]; - uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR; - - // Release the rest of the PNKs of the juror for this round. - sortitionModule.unlockStake(account, pnkLocked); - - // Give back the locked PNKs in case the juror fully unstaked earlier. - if (!sortitionModule.isJurorStaked(account)) { - pinakion.safeTransfer(account, pnkLocked); - } - - // Transfer the rewards - uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR; - round.sumPnkRewardPaid += pnkReward; - uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR; - round.sumFeeRewardPaid += feeReward; - pinakion.safeTransfer(account, pnkReward); - if (round.feeToken == Constants.NATIVE_CURRENCY) { - // The dispute fees were paid in ETH - payable(account).send(feeReward); - } else { - // The dispute fees were paid in ERC20 - round.feeToken.safeTransfer(account, feeReward); - } - emit TokenAndETHShift( - account, - _params.disputeID, - _params.round, - degreeOfCoherence, - int256(pnkReward), - int256(feeReward), - round.feeToken - ); - - // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors. - if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) { - uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid; - uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid; - if (leftoverPnkReward != 0 || leftoverFeeReward != 0) { - if (leftoverPnkReward != 0) { - pinakion.safeTransfer(governor, leftoverPnkReward); - } - if (leftoverFeeReward != 0) { - if (round.feeToken == Constants.NATIVE_CURRENCY) { - // The dispute fees were paid in ETH - payable(governor).send(leftoverFeeReward); - } else { - // The dispute fees were paid in ERC20 - round.feeToken.safeTransfer(governor, leftoverFeeReward); - } - } - emit LeftoverRewardSent( - _params.disputeID, - _params.round, - leftoverPnkReward, - leftoverFeeReward, - round.feeToken - ); - } - } - } - - /// @dev Executes a specified dispute's ruling. - /// @param _disputeID The ID of the dispute. - function executeRuling(uint256 _disputeID) external { - Dispute storage dispute = disputes[_disputeID]; - if (dispute.period != Period.execution) revert NotExecutionPeriod(); - if (dispute.ruled) revert RulingAlreadyExecuted(); - - (uint256 winningChoice, , ) = currentRuling(_disputeID); - dispute.ruled = true; - emit Ruling(dispute.arbitrated, _disputeID, winningChoice); - dispute.arbitrated.rule(_disputeID, winningChoice); - } - - // ************************************* // - // * Public Views * // - // ************************************* // - - /// @dev Compute the cost of arbitration denominated in ETH. - /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. - /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). - /// @return cost The arbitration cost in ETH. - function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) { - (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData); - cost = courts[courtID].feeForJuror * minJurors; - } - - /// @dev Compute the cost of arbitration denominated in `_feeToken`. - /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. - /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). - /// @param _feeToken The ERC20 token used to pay fees. - /// @return cost The arbitration cost in `_feeToken`. - function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) { - cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData)); - } - - /// @dev Gets the cost of appealing a specified dispute. - /// @param _disputeID The ID of the dispute. - /// @return cost The appeal cost. - function appealCost(uint256 _disputeID) public view returns (uint256 cost) { - Dispute storage dispute = disputes[_disputeID]; - Round storage round = dispute.rounds[dispute.rounds.length - 1]; - Court storage court = courts[dispute.courtID]; - if (round.nbVotes >= court.jurorsForCourtJump) { - // Jump to parent court. - if (dispute.courtID == Constants.GENERAL_COURT) { - // TODO: Handle the forking when appealed in General court. - cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court. - } else { - cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1); - } - } else { - // Stay in current court. - cost = court.feeForJuror * ((round.nbVotes * 2) + 1); - } - } - - /// @dev Gets the start and the end of a specified dispute's current appeal period. - /// @param _disputeID The ID of the dispute. - /// @return start The start of the appeal period. - /// @return end The end of the appeal period. - function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) { - Dispute storage dispute = disputes[_disputeID]; - if (dispute.period == Period.appeal) { - start = dispute.lastPeriodChange; - end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)]; - } else { - start = 0; - end = 0; - } - } - - /// @dev Gets the current ruling of a specified dispute. - /// @param _disputeID The ID of the dispute. - /// @return ruling The current ruling. - /// @return tied Whether it's a tie or not. - /// @return overridden Whether the ruling was overridden by appeal funding or not. - function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) { - Dispute storage dispute = disputes[_disputeID]; - Round storage round = dispute.rounds[dispute.rounds.length - 1]; - IDisputeKit disputeKit = disputeKits[round.disputeKitID]; - (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID); - } - - function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) { - return disputes[_disputeID].rounds[_round]; - } - - function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) { - return disputes[_disputeID].rounds.length; - } - - function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) { - return courts[_courtID].supportedDisputeKits[_disputeKitID]; - } - - /// @dev Gets the timesPerPeriod array for a given court. - /// @param _courtID The ID of the court to get the times from. - /// @return timesPerPeriod The timesPerPeriod array for the given court. - function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) { - timesPerPeriod = courts[_courtID].timesPerPeriod; - } - - // ************************************* // - // * Public Views for Dispute Kits * // - // ************************************* // - - /// @dev Gets the number of votes permitted for the specified dispute in the latest round. - /// @param _disputeID The ID of the dispute. - function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) { - Dispute storage dispute = disputes[_disputeID]; - return dispute.rounds[dispute.rounds.length - 1].nbVotes; - } - - /// @dev Returns true if the dispute kit will be switched to a parent DK. - /// @param _disputeID The ID of the dispute. - /// @return Whether DK will be switched or not. - function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) { - Dispute storage dispute = disputes[_disputeID]; - Round storage round = dispute.rounds[dispute.rounds.length - 1]; - Court storage court = courts[dispute.courtID]; - - if (round.nbVotes < court.jurorsForCourtJump) { - return false; - } - - // Jump if the parent court doesn't support the current DK. - return !courts[court.parent].supportedDisputeKits[round.disputeKitID]; - } - - function getDisputeKitsLength() external view returns (uint256) { - return disputeKits.length; - } - - function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) { - return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth; - } - - // ************************************* // - // * Internal * // - // ************************************* // - - /// @dev Toggles the dispute kit support for a given court. - /// @param _courtID The ID of the court to toggle the support for. - /// @param _disputeKitID The ID of the dispute kit to toggle the support for. - /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled. - function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal { - courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable; - emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); - } - - /// @dev If called only once then set _onError to Revert, otherwise set it to Return - /// @param _account The account to set the stake for. - /// @param _courtID The ID of the court to set the stake for. - /// @param _newStake The new stake. - /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract. - /// @param _onError Whether to revert or return false on error. - /// @return Whether the stake was successfully set or not. - function _setStake( - address _account, - uint96 _courtID, - uint256 _newStake, - bool _alreadyTransferred, - OnError _onError - ) internal returns (bool) { - if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) { - _stakingFailed(_onError); // Staking directly into the forking court is not allowed. - return false; - } - if (_newStake != 0 && _newStake < courts[_courtID].minStake) { - _stakingFailed(_onError); // Staking less than the minimum stake is not allowed. - return false; - } - (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake( - _account, - _courtID, - _newStake, - _alreadyTransferred - ); - if (!sortitionSuccess) { - _stakingFailed(_onError); - return false; - } - if (pnkDeposit > 0) { - if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) { - _stakingFailed(_onError); - return false; - } - } - if (pnkWithdrawal > 0) { - if (!pinakion.safeTransfer(_account, pnkWithdrawal)) { - _stakingFailed(_onError); - return false; - } - } - return true; - } - - /// @dev It may revert depending on the _onError parameter. - function _stakingFailed(OnError _onError) internal pure { - if (_onError == OnError.Return) return; - revert StakingFailed(); - } - - /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array. - /// Note that if extradata contains an incorrect value then this value will be switched to default. - /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID. - /// @return courtID The court ID. - /// @return minJurors The minimum number of jurors required. - /// @return disputeKitID The ID of the dispute kit. - function _extraDataToCourtIDMinJurorsDisputeKit( - bytes memory _extraData - ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) { - // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index. - if (_extraData.length >= 64) { - assembly { - // solium-disable-line security/no-inline-assembly - courtID := mload(add(_extraData, 0x20)) - minJurors := mload(add(_extraData, 0x40)) - disputeKitID := mload(add(_extraData, 0x60)) - } - if (courtID == Constants.FORKING_COURT || courtID >= courts.length) { - courtID = Constants.GENERAL_COURT; - } - if (minJurors == 0) { - minJurors = Constants.DEFAULT_NB_OF_JURORS; - } - if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) { - disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used. - } - } else { - courtID = Constants.GENERAL_COURT; - minJurors = Constants.DEFAULT_NB_OF_JURORS; - disputeKitID = Constants.DISPUTE_KIT_CLASSIC; - } - } - - // ************************************* // - // * Errors * // - // ************************************* // - - error GovernorOnly(); - error DisputeKitOnly(); - error SortitionModuleOnly(); - error UnsuccessfulCall(); - error InvalidDisputKitParent(); - error DepthLevelMax(); - error MinStakeLowerThanParentCourt(); - error UnsupportedDisputeKit(); - error InvalidForkingCourtAsParent(); - error WrongDisputeKitIndex(); - error CannotDisableClassicDK(); - error ArraysLengthMismatch(); - error StakingFailed(); - error ArbitrationFeesNotEnough(); - error DisputeKitNotSupportedByCourt(); - error MustSupportDisputeKitClassic(); - error TokenNotAccepted(); - error EvidenceNotPassedAndNotAppeal(); - error DisputeStillDrawing(); - error CommitPeriodNotPassed(); - error VotePeriodNotPassed(); - error AppealPeriodNotPassed(); - error NotEvidencePeriod(); - error AppealFeesNotEnough(); - error DisputeNotAppealable(); - error NotExecutionPeriod(); - error RulingAlreadyExecuted(); - error DisputePeriodIsFinal(); - error TransferFailed(); } diff --git a/contracts/src/arbitration/KlerosCoreBase.sol b/contracts/src/arbitration/KlerosCoreBase.sol new file mode 100644 index 000000000..33a09965c --- /dev/null +++ b/contracts/src/arbitration/KlerosCoreBase.sol @@ -0,0 +1,1180 @@ +// SPDX-License-Identifier: MIT + +/// @custom:authors: [@unknownunknown1, @jaybuidl] +/// @custom:reviewers: [] +/// @custom:auditors: [] +/// @custom:bounties: [] +/// @custom:deployments: [] + +pragma solidity 0.8.18; + +import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol"; +import {IDisputeKit} from "./interfaces/IDisputeKit.sol"; +import {ISortitionModule} from "./interfaces/ISortitionModule.sol"; +import {SafeERC20, IERC20} from "../libraries/SafeERC20.sol"; +import "../libraries/Constants.sol"; + +/// @title KlerosCoreBase +/// Core arbitrator contract for Kleros v2. +/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts. +abstract contract KlerosCoreBase is IArbitratorV2 { + using SafeERC20 for IERC20; + + // ************************************* // + // * Enums / Structs * // + // ************************************* // + + enum Period { + evidence, // Evidence can be submitted. This is also when drawing has to take place. + commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes. + vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not. + appeal, // The dispute can be appealed. + execution // Tokens are redistributed and the ruling is executed. + } + + struct Court { + uint96 parent; // The parent court. + bool hiddenVotes; // Whether to use commit and reveal or not. + uint256[] children; // List of child courts. + uint256 minStake; // Minimum PNKs needed to stake in the court. + uint256 alpha; // Basis point of PNKs that are lost when incoherent. + uint256 feeForJuror; // Arbitration fee paid per juror. + uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any. + uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`. + mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit. + bool disabled; // True if the court is disabled. Unused for now, will be implemented later. + } + + struct Dispute { + uint96 courtID; // The ID of the court the dispute is in. + IArbitrableV2 arbitrated; // The arbitrable contract. + Period period; // The current period of the dispute. + bool ruled; // True if the ruling has been executed, false otherwise. + uint256 lastPeriodChange; // The last time the period was changed. + Round[] rounds; + } + + struct Round { + uint256 disputeKitID; // Index of the dispute kit in the array. + uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round. + uint256 totalFeesForJurors; // The total juror fees paid in this round. + uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length. + uint256 repartitions; // A counter of reward repartitions made in this round. + uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round. + address[] drawnJurors; // Addresses of the jurors that were drawn in this round. + uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round. + uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round. + IERC20 feeToken; // The token used for paying fees in this round. + uint256 drawIterations; // The number of iterations passed drawing the jurors for this round. + } + + // Workaround "stack too deep" errors + struct ExecuteParams { + uint256 disputeID; // The ID of the dispute to execute. + uint256 round; // The round to execute. + uint256 coherentCount; // The number of coherent votes in the round. + uint256 numberOfVotesInRound; // The number of votes in the round. + uint256 feePerJurorInRound; // The fee per juror in the round. + uint256 pnkAtStakePerJurorInRound; // The amount of PNKs at stake for each juror in the round. + uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round. + uint256 repartition; // The index of the repartition to execute. + } + + struct CurrencyRate { + bool feePaymentAccepted; + uint64 rateInEth; + uint8 rateDecimals; + } + + // ************************************* // + // * Storage * // + // ************************************* // + + uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by. + uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH. + + address public governor; // The governor of the contract. + address public guardian; // The guardian able to pause asset withdrawals. + IERC20 public pinakion; // The Pinakion token contract. + address public jurorProsecutionModule; // The module for juror's prosecution. + ISortitionModule public sortitionModule; // Sortition module for drawing. + Court[] public courts; // The courts. + IDisputeKit[] public disputeKits; // Array of dispute kits. + Dispute[] public disputes; // The disputes. + mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH. + bool public paused; // Whether asset withdrawals are paused. + + // ************************************* // + // * Events * // + // ************************************* // + + event NewPeriod(uint256 indexed _disputeID, Period _period); + event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); + event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); + event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID); + event CourtCreated( + uint256 indexed _courtID, + uint96 indexed _parent, + bool _hiddenVotes, + uint256 _minStake, + uint256 _alpha, + uint256 _feeForJuror, + uint256 _jurorsForCourtJump, + uint256[4] _timesPerPeriod, + uint256[] _supportedDisputeKits + ); + event CourtModified( + uint96 indexed _courtID, + bool _hiddenVotes, + uint256 _minStake, + uint256 _alpha, + uint256 _feeForJuror, + uint256 _jurorsForCourtJump, + uint256[4] _timesPerPeriod + ); + event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress); + event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable); + event CourtJump( + uint256 indexed _disputeID, + uint256 indexed _roundID, + uint96 indexed _fromCourtID, + uint96 _toCourtID + ); + event DisputeKitJump( + uint256 indexed _disputeID, + uint256 indexed _roundID, + uint256 indexed _fromDisputeKitID, + uint256 _toDisputeKitID + ); + event TokenAndETHShift( + address indexed _account, + uint256 indexed _disputeID, + uint256 indexed _roundID, + uint256 _degreeOfCoherency, + int256 _pnkAmount, + int256 _feeAmount, + IERC20 _feeToken + ); + event LeftoverRewardSent( + uint256 indexed _disputeID, + uint256 indexed _roundID, + uint256 _pnkAmount, + uint256 _feeAmount, + IERC20 _feeToken + ); + event Paused(); + event Unpaused(); + + // ************************************* // + // * Function Modifiers * // + // ************************************* // + + modifier onlyByGovernor() { + if (governor != msg.sender) revert GovernorOnly(); + _; + } + + modifier onlyByGuardianOrGovernor() { + if (guardian != msg.sender && governor != msg.sender) revert GuardianOrGovernorOnly(); + _; + } + + modifier whenPaused() { + if (!paused) revert WhenPausedOnly(); + _; + } + + modifier whenNotPaused() { + if (paused) revert WhenNotPausedOnly(); + _; + } + + // ************************************* // + // * Constructor * // + // ************************************* // + + function _initialize( + address _governor, + address _guardian, + IERC20 _pinakion, + address _jurorProsecutionModule, + IDisputeKit _disputeKit, + bool _hiddenVotes, + uint256[4] memory _courtParameters, + uint256[4] memory _timesPerPeriod, + bytes memory _sortitionExtraData, + ISortitionModule _sortitionModuleAddress + ) internal { + governor = _governor; + guardian = _guardian; + pinakion = _pinakion; + jurorProsecutionModule = _jurorProsecutionModule; + sortitionModule = _sortitionModuleAddress; + + // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported. + disputeKits.push(); + + // DISPUTE_KIT_CLASSIC + disputeKits.push(_disputeKit); + + emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit); + + // FORKING_COURT + // TODO: Fill the properties for the Forking court, emit CourtCreated. + courts.push(); + sortitionModule.createTree(bytes32(uint256(FORKING_COURT)), _sortitionExtraData); + + // GENERAL_COURT + Court storage court = courts.push(); + court.parent = FORKING_COURT; + court.children = new uint256[](0); + court.hiddenVotes = _hiddenVotes; + court.minStake = _courtParameters[0]; + court.alpha = _courtParameters[1]; + court.feeForJuror = _courtParameters[2]; + court.jurorsForCourtJump = _courtParameters[3]; + court.timesPerPeriod = _timesPerPeriod; + + sortitionModule.createTree(bytes32(uint256(GENERAL_COURT)), _sortitionExtraData); + + emit CourtCreated( + 1, + court.parent, + _hiddenVotes, + _courtParameters[0], + _courtParameters[1], + _courtParameters[2], + _courtParameters[3], + _timesPerPeriod, + new uint256[](0) + ); + _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true); + } + + // ************************************* // + // * Governance * // + // ************************************* // + + /// @dev Pause staking and reward execution. Can only be done by guardian or governor. + function pause() external onlyByGuardianOrGovernor whenNotPaused { + paused = true; + emit Paused(); + } + + /// @dev Unpause staking and reward execution. Can only be done by governor. + function unpause() external onlyByGovernor whenPaused { + paused = false; + emit Unpaused(); + } + + /// @dev Allows the governor to call anything on behalf of the contract. + /// @param _destination The destination of the call. + /// @param _amount The value sent with the call. + /// @param _data The data sent with the call. + function executeGovernorProposal( + address _destination, + uint256 _amount, + bytes memory _data + ) external onlyByGovernor { + (bool success, ) = _destination.call{value: _amount}(_data); + if (!success) revert UnsuccessfulCall(); + } + + /// @dev Changes the `governor` storage variable. + /// @param _governor The new value for the `governor` storage variable. + function changeGovernor(address payable _governor) external onlyByGovernor { + governor = _governor; + } + + /// @dev Changes the `guardian` storage variable. + /// @param _guardian The new value for the `guardian` storage variable. + function changeGuardian(address _guardian) external onlyByGovernor { + guardian = _guardian; + } + + /// @dev Changes the `pinakion` storage variable. + /// @param _pinakion The new value for the `pinakion` storage variable. + function changePinakion(IERC20 _pinakion) external onlyByGovernor { + pinakion = _pinakion; + } + + /// @dev Changes the `jurorProsecutionModule` storage variable. + /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable. + function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor { + jurorProsecutionModule = _jurorProsecutionModule; + } + + /// @dev Changes the `_sortitionModule` storage variable. + /// Note that the new module should be initialized for all courts. + /// @param _sortitionModule The new value for the `sortitionModule` storage variable. + function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor { + sortitionModule = _sortitionModule; + } + + /// @dev Add a new supported dispute kit module to the court. + /// @param _disputeKitAddress The address of the dispute kit contract. + function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor { + uint256 disputeKitID = disputeKits.length; + disputeKits.push(_disputeKitAddress); + emit DisputeKitCreated(disputeKitID, _disputeKitAddress); + } + + /// @dev Creates a court under a specified parent court. + /// @param _parent The `parent` property value of the court. + /// @param _hiddenVotes The `hiddenVotes` property value of the court. + /// @param _minStake The `minStake` property value of the court. + /// @param _alpha The `alpha` property value of the court. + /// @param _feeForJuror The `feeForJuror` property value of the court. + /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court. + /// @param _timesPerPeriod The `timesPerPeriod` property value of the court. + /// @param _sortitionExtraData Extra data for sortition module. + /// @param _supportedDisputeKits Indexes of dispute kits that this court will support. + function createCourt( + uint96 _parent, + bool _hiddenVotes, + uint256 _minStake, + uint256 _alpha, + uint256 _feeForJuror, + uint256 _jurorsForCourtJump, + uint256[4] memory _timesPerPeriod, + bytes memory _sortitionExtraData, + uint256[] memory _supportedDisputeKits + ) external onlyByGovernor { + if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt(); + if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit(); + if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent(); + + uint256 courtID = courts.length; + Court storage court = courts.push(); + + for (uint256 i = 0; i < _supportedDisputeKits.length; i++) { + if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) { + revert WrongDisputeKitIndex(); + } + court.supportedDisputeKits[_supportedDisputeKits[i]] = true; + } + // Check that Classic DK support was added. + if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic(); + + court.parent = _parent; + court.children = new uint256[](0); + court.hiddenVotes = _hiddenVotes; + court.minStake = _minStake; + court.alpha = _alpha; + court.feeForJuror = _feeForJuror; + court.jurorsForCourtJump = _jurorsForCourtJump; + court.timesPerPeriod = _timesPerPeriod; + + sortitionModule.createTree(bytes32(courtID), _sortitionExtraData); + + // Update the parent. + courts[_parent].children.push(courtID); + emit CourtCreated( + courtID, + _parent, + _hiddenVotes, + _minStake, + _alpha, + _feeForJuror, + _jurorsForCourtJump, + _timesPerPeriod, + _supportedDisputeKits + ); + } + + function changeCourtParameters( + uint96 _courtID, + bool _hiddenVotes, + uint256 _minStake, + uint256 _alpha, + uint256 _feeForJuror, + uint256 _jurorsForCourtJump, + uint256[4] memory _timesPerPeriod + ) external onlyByGovernor { + Court storage court = courts[_courtID]; + if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) { + revert MinStakeLowerThanParentCourt(); + } + for (uint256 i = 0; i < court.children.length; i++) { + if (courts[court.children[i]].minStake < _minStake) { + revert MinStakeLowerThanParentCourt(); + } + } + court.minStake = _minStake; + court.hiddenVotes = _hiddenVotes; + court.alpha = _alpha; + court.feeForJuror = _feeForJuror; + court.jurorsForCourtJump = _jurorsForCourtJump; + court.timesPerPeriod = _timesPerPeriod; + emit CourtModified( + _courtID, + _hiddenVotes, + _minStake, + _alpha, + _feeForJuror, + _jurorsForCourtJump, + _timesPerPeriod + ); + } + + /// @dev Adds/removes court's support for specified dispute kits. + /// @param _courtID The ID of the court. + /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed. + /// @param _enable Whether add or remove the dispute kits from the court. + function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor { + for (uint256 i = 0; i < _disputeKitIDs.length; i++) { + if (_enable) { + if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) { + revert WrongDisputeKitIndex(); + } + _enableDisputeKit(_courtID, _disputeKitIDs[i], true); + } else { + // Classic dispute kit must be supported by all courts. + if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) { + revert CannotDisableClassicDK(); + } + _enableDisputeKit(_courtID, _disputeKitIDs[i], false); + } + } + } + + /// @dev Changes the supported fee tokens. + /// @param _feeToken The fee token. + /// @param _accepted Whether the token is supported or not as a method of fee payment. + function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor { + currencyRates[_feeToken].feePaymentAccepted = _accepted; + emit AcceptedFeeToken(_feeToken, _accepted); + } + + /// @dev Changes the currency rate of a fee token. + /// @param _feeToken The fee token. + /// @param _rateInEth The new rate of the fee token in ETH. + /// @param _rateDecimals The new decimals of the fee token rate. + function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor { + currencyRates[_feeToken].rateInEth = _rateInEth; + currencyRates[_feeToken].rateDecimals = _rateDecimals; + emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals); + } + + // ************************************* // + // * State Modifiers * // + // ************************************* // + + /// @dev Sets the caller's stake in a court. + /// @param _courtID The ID of the court. + /// @param _newStake The new stake. + /// Note that the existing delayed stake will be nullified as non-relevant. + function setStake(uint96 _courtID, uint256 _newStake) external virtual whenNotPaused { + _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert); + } + + /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors. + /// @param _account The account whose stake is being set. + /// @param _courtID The ID of the court. + /// @param _newStake The new stake. + /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract. + function setStakeBySortitionModule( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred + ) external { + if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); + _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return); + } + + /// @inheritdoc IArbitratorV2 + function createDispute( + uint256 _numberOfChoices, + bytes memory _extraData + ) external payable override returns (uint256 disputeID) { + if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough(); + + return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value); + } + + /// @inheritdoc IArbitratorV2 + function createDispute( + uint256 _numberOfChoices, + bytes calldata _extraData, + IERC20 _feeToken, + uint256 _feeAmount + ) external override returns (uint256 disputeID) { + if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted(); + if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough(); + + if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed(); + return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount); + } + + function _createDispute( + uint256 _numberOfChoices, + bytes memory _extraData, + IERC20 _feeToken, + uint256 _feeAmount + ) internal virtual returns (uint256 disputeID) { + (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData); + if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt(); + + disputeID = disputes.length; + Dispute storage dispute = disputes.push(); + dispute.courtID = courtID; + dispute.arbitrated = IArbitrableV2(msg.sender); + dispute.lastPeriodChange = block.timestamp; + + IDisputeKit disputeKit = disputeKits[disputeKitID]; + Court storage court = courts[courtID]; + Round storage round = dispute.rounds.push(); + + // Obtain the feeForJuror in the same currency as the _feeAmount + uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY) + ? court.feeForJuror + : convertEthToTokenAmount(_feeToken, court.feeForJuror); + round.nbVotes = _feeAmount / feeForJuror; + round.disputeKitID = disputeKitID; + round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR; + round.totalFeesForJurors = _feeAmount; + round.feeToken = IERC20(_feeToken); + + sortitionModule.createDisputeHook(disputeID, 0); // Default round ID. + + disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes); + emit DisputeCreation(disputeID, IArbitrableV2(msg.sender)); + } + + /// @dev Passes the period of a specified dispute. + /// @param _disputeID The ID of the dispute. + function passPeriod(uint256 _disputeID) external { + Dispute storage dispute = disputes[_disputeID]; + Court storage court = courts[dispute.courtID]; + + uint256 currentRound = dispute.rounds.length - 1; + Round storage round = dispute.rounds[currentRound]; + if (dispute.period == Period.evidence) { + if ( + currentRound == 0 && + block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] + ) { + revert EvidenceNotPassedAndNotAppeal(); + } + if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing(); + dispute.period = court.hiddenVotes ? Period.commit : Period.vote; + } else if (dispute.period == Period.commit) { + if ( + block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] && + !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID) + ) { + revert CommitPeriodNotPassed(); + } + dispute.period = Period.vote; + } else if (dispute.period == Period.vote) { + if ( + block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] && + !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID) + ) { + revert VotePeriodNotPassed(); + } + dispute.period = Period.appeal; + emit AppealPossible(_disputeID, dispute.arbitrated); + } else if (dispute.period == Period.appeal) { + if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) { + revert AppealPeriodNotPassed(); + } + dispute.period = Period.execution; + } else if (dispute.period == Period.execution) { + revert DisputePeriodIsFinal(); + } + + dispute.lastPeriodChange = block.timestamp; + emit NewPeriod(_disputeID, dispute.period); + } + + /// @dev Draws jurors for the dispute. Can be called in parts. + /// @param _disputeID The ID of the dispute. + /// @param _iterations The number of iterations to run. + function draw(uint256 _disputeID, uint256 _iterations) external { + Dispute storage dispute = disputes[_disputeID]; + uint256 currentRound = dispute.rounds.length - 1; + Round storage round = dispute.rounds[currentRound]; + if (dispute.period != Period.evidence) revert NotEvidencePeriod(); + + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; + + uint256 startIndex = round.drawIterations; // for gas: less storage reads + uint256 i; + while (i < _iterations && round.drawnJurors.length < round.nbVotes) { + address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++); + if (drawnAddress == address(0)) { + continue; + } + sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror); + emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length); + round.drawnJurors.push(drawnAddress); + if (round.drawnJurors.length == round.nbVotes) { + sortitionModule.postDrawHook(_disputeID, currentRound); + } + } + round.drawIterations += i; + } + + /// @dev Appeals the ruling of a specified dispute. + /// Note: Access restricted to the Dispute Kit for this `disputeID`. + /// @param _disputeID The ID of the dispute. + /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump. + /// @param _extraData Extradata for the dispute. Can be required during court jump. + function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable { + if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough(); + + Dispute storage dispute = disputes[_disputeID]; + if (dispute.period != Period.appeal) revert DisputeNotAppealable(); + + Round storage round = dispute.rounds[dispute.rounds.length - 1]; + if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly(); + + uint96 newCourtID = dispute.courtID; + uint256 newDisputeKitID = round.disputeKitID; + + // Warning: the extra round must be created before calling disputeKit.createDispute() + Round storage extraRound = dispute.rounds.push(); + + if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) { + // Jump to parent court. + newCourtID = courts[newCourtID].parent; + + if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) { + // Switch to classic dispute kit if parent court doesn't support the current one. + newDisputeKitID = DISPUTE_KIT_CLASSIC; + } + + if (newCourtID != dispute.courtID) { + emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID); + } + } + + dispute.courtID = newCourtID; + dispute.period = Period.evidence; + dispute.lastPeriodChange = block.timestamp; + + Court storage court = courts[newCourtID]; + extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds. + extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR; + extraRound.totalFeesForJurors = msg.value; + extraRound.disputeKitID = newDisputeKitID; + + sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1); + + // Dispute kit was changed, so create a dispute in the new DK contract. + if (extraRound.disputeKitID != round.disputeKitID) { + emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID); + disputeKits[extraRound.disputeKitID].createDispute( + _disputeID, + _numberOfChoices, + _extraData, + extraRound.nbVotes + ); + } + + emit AppealDecision(_disputeID, dispute.arbitrated); + emit NewPeriod(_disputeID, Period.evidence); + } + + /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts. + /// Note: Reward distributions are forbidden during pause. + /// @param _disputeID The ID of the dispute. + /// @param _round The appeal round. + /// @param _iterations The number of iterations to run. + function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external whenNotPaused { + Round storage round; + { + Dispute storage dispute = disputes[_disputeID]; + if (dispute.period != Period.execution) revert NotExecutionPeriod(); + + round = dispute.rounds[_round]; + } // stack too deep workaround + + uint256 start = round.repartitions; + uint256 end = round.repartitions + _iterations; + + uint256 pnkPenaltiesInRound = round.pnkPenalties; // Keep in memory to save gas. + uint256 numberOfVotesInRound = round.drawnJurors.length; + uint256 feePerJurorInRound = round.totalFeesForJurors / numberOfVotesInRound; + uint256 pnkAtStakePerJurorInRound = round.pnkAtStakePerJuror; + uint256 coherentCount; + { + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; + coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round. + } // stack too deep workaround + + if (coherentCount == 0) { + // 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. + if (end > numberOfVotesInRound) end = numberOfVotesInRound; + } else { + // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees. + if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2; + } + round.repartitions = end; + + for (uint256 i = start; i < end; i++) { + if (i < numberOfVotesInRound) { + pnkPenaltiesInRound = _executePenalties( + ExecuteParams({ + disputeID: _disputeID, + round: _round, + coherentCount: coherentCount, + numberOfVotesInRound: numberOfVotesInRound, + feePerJurorInRound: feePerJurorInRound, + pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound, + pnkPenaltiesInRound: pnkPenaltiesInRound, + repartition: i + }) + ); + } else { + _executeRewards( + ExecuteParams({ + disputeID: _disputeID, + round: _round, + coherentCount: coherentCount, + numberOfVotesInRound: numberOfVotesInRound, + feePerJurorInRound: feePerJurorInRound, + pnkAtStakePerJurorInRound: pnkAtStakePerJurorInRound, + pnkPenaltiesInRound: pnkPenaltiesInRound, + repartition: i + }) + ); + } + } + if (round.pnkPenalties != pnkPenaltiesInRound) { + round.pnkPenalties = pnkPenaltiesInRound; // Reentrancy risk: breaks Check-Effect-Interact + } + } + + /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only. + /// @param _params The parameters for the execution, see `ExecuteParams`. + /// @return pnkPenaltiesInRoundCache The updated penalties in round cache. + function _executePenalties(ExecuteParams memory _params) internal returns (uint256) { + Dispute storage dispute = disputes[_params.disputeID]; + Round storage round = dispute.rounds[_params.round]; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; + + // [0, 1] value that determines how coherent the juror was in this round, in basis points. + uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence( + _params.disputeID, + _params.round, + _params.repartition, + _params.feePerJurorInRound, + _params.pnkAtStakePerJurorInRound + ); + if (degreeOfCoherence > ALPHA_DIVISOR) { + // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit. + degreeOfCoherence = ALPHA_DIVISOR; + } + + // Fully coherent jurors won't be penalized. + uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR; + _params.pnkPenaltiesInRound += penalty; + + // Unlock the PNKs affected by the penalty + address account = round.drawnJurors[_params.repartition]; + sortitionModule.unlockStake(account, penalty); + + // Apply the penalty to the staked PNKs. + sortitionModule.penalizeStake(account, penalty); + emit TokenAndETHShift( + account, + _params.disputeID, + _params.round, + degreeOfCoherence, + -int256(penalty), + 0, + round.feeToken + ); + + if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) { + // The juror is inactive, unstake them. + sortitionModule.setJurorInactive(account); + } + if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) { + // No one was coherent, send the rewards to the governor. + if (round.feeToken == NATIVE_CURRENCY) { + // The dispute fees were paid in ETH + payable(governor).send(round.totalFeesForJurors); + } else { + // The dispute fees were paid in ERC20 + round.feeToken.safeTransfer(governor, round.totalFeesForJurors); + } + pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound); + emit LeftoverRewardSent( + _params.disputeID, + _params.round, + _params.pnkPenaltiesInRound, + round.totalFeesForJurors, + round.feeToken + ); + } + return _params.pnkPenaltiesInRound; + } + + /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only. + /// @param _params The parameters for the execution, see `ExecuteParams`. + function _executeRewards(ExecuteParams memory _params) internal { + Dispute storage dispute = disputes[_params.disputeID]; + Round storage round = dispute.rounds[_params.round]; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; + + // [0, 1] value that determines how coherent the juror was in this round, in basis points. + uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence( + _params.disputeID, + _params.round, + _params.repartition % _params.numberOfVotesInRound, + _params.feePerJurorInRound, + _params.pnkAtStakePerJurorInRound + ); + + // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit. + if (degreeOfCoherence > ALPHA_DIVISOR) { + degreeOfCoherence = ALPHA_DIVISOR; + } + + address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound]; + uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR; + + // Release the rest of the PNKs of the juror for this round. + sortitionModule.unlockStake(account, pnkLocked); + + // Give back the locked PNKs in case the juror fully unstaked earlier. + if (!sortitionModule.isJurorStaked(account)) { + pinakion.safeTransfer(account, pnkLocked); + } + + // Transfer the rewards + uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR; + round.sumPnkRewardPaid += pnkReward; + uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR; + round.sumFeeRewardPaid += feeReward; + pinakion.safeTransfer(account, pnkReward); + if (round.feeToken == NATIVE_CURRENCY) { + // The dispute fees were paid in ETH + payable(account).send(feeReward); + } else { + // The dispute fees were paid in ERC20 + round.feeToken.safeTransfer(account, feeReward); + } + emit TokenAndETHShift( + account, + _params.disputeID, + _params.round, + degreeOfCoherence, + int256(pnkReward), + int256(feeReward), + round.feeToken + ); + + // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors. + if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) { + uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid; + uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid; + if (leftoverPnkReward != 0 || leftoverFeeReward != 0) { + if (leftoverPnkReward != 0) { + pinakion.safeTransfer(governor, leftoverPnkReward); + } + if (leftoverFeeReward != 0) { + if (round.feeToken == NATIVE_CURRENCY) { + // The dispute fees were paid in ETH + payable(governor).send(leftoverFeeReward); + } else { + // The dispute fees were paid in ERC20 + round.feeToken.safeTransfer(governor, leftoverFeeReward); + } + } + emit LeftoverRewardSent( + _params.disputeID, + _params.round, + leftoverPnkReward, + leftoverFeeReward, + round.feeToken + ); + } + } + } + + /// @dev Executes a specified dispute's ruling. + /// @param _disputeID The ID of the dispute. + function executeRuling(uint256 _disputeID) external { + Dispute storage dispute = disputes[_disputeID]; + if (dispute.period != Period.execution) revert NotExecutionPeriod(); + if (dispute.ruled) revert RulingAlreadyExecuted(); + + (uint256 winningChoice, , ) = currentRuling(_disputeID); + dispute.ruled = true; + emit Ruling(dispute.arbitrated, _disputeID, winningChoice); + dispute.arbitrated.rule(_disputeID, winningChoice); + } + + // ************************************* // + // * Public Views * // + // ************************************* // + + /// @dev Compute the cost of arbitration denominated in ETH. + /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. + /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). + /// @return cost The arbitration cost in ETH. + function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) { + (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData); + cost = courts[courtID].feeForJuror * minJurors; + } + + /// @dev Compute the cost of arbitration denominated in `_feeToken`. + /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. + /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). + /// @param _feeToken The ERC20 token used to pay fees. + /// @return cost The arbitration cost in `_feeToken`. + function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) { + cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData)); + } + + /// @dev Gets the cost of appealing a specified dispute. + /// @param _disputeID The ID of the dispute. + /// @return cost The appeal cost. + function appealCost(uint256 _disputeID) public view returns (uint256 cost) { + Dispute storage dispute = disputes[_disputeID]; + Round storage round = dispute.rounds[dispute.rounds.length - 1]; + Court storage court = courts[dispute.courtID]; + if (round.nbVotes >= court.jurorsForCourtJump) { + // Jump to parent court. + if (dispute.courtID == GENERAL_COURT) { + // TODO: Handle the forking when appealed in General court. + cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court. + } else { + cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1); + } + } else { + // Stay in current court. + cost = court.feeForJuror * ((round.nbVotes * 2) + 1); + } + } + + /// @dev Gets the start and the end of a specified dispute's current appeal period. + /// @param _disputeID The ID of the dispute. + /// @return start The start of the appeal period. + /// @return end The end of the appeal period. + function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) { + Dispute storage dispute = disputes[_disputeID]; + if (dispute.period == Period.appeal) { + start = dispute.lastPeriodChange; + end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)]; + } else { + start = 0; + end = 0; + } + } + + /// @dev Gets the current ruling of a specified dispute. + /// @param _disputeID The ID of the dispute. + /// @return ruling The current ruling. + /// @return tied Whether it's a tie or not. + /// @return overridden Whether the ruling was overridden by appeal funding or not. + function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) { + Dispute storage dispute = disputes[_disputeID]; + Round storage round = dispute.rounds[dispute.rounds.length - 1]; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; + (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID); + } + + function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) { + return disputes[_disputeID].rounds[_round]; + } + + function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) { + return disputes[_disputeID].rounds.length; + } + + function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) { + return courts[_courtID].supportedDisputeKits[_disputeKitID]; + } + + /// @dev Gets the timesPerPeriod array for a given court. + /// @param _courtID The ID of the court to get the times from. + /// @return timesPerPeriod The timesPerPeriod array for the given court. + function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) { + timesPerPeriod = courts[_courtID].timesPerPeriod; + } + + // ************************************* // + // * Public Views for Dispute Kits * // + // ************************************* // + + /// @dev Gets the number of votes permitted for the specified dispute in the latest round. + /// @param _disputeID The ID of the dispute. + function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) { + Dispute storage dispute = disputes[_disputeID]; + return dispute.rounds[dispute.rounds.length - 1].nbVotes; + } + + /// @dev Returns true if the dispute kit will be switched to a parent DK. + /// @param _disputeID The ID of the dispute. + /// @return Whether DK will be switched or not. + function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) { + Dispute storage dispute = disputes[_disputeID]; + Round storage round = dispute.rounds[dispute.rounds.length - 1]; + Court storage court = courts[dispute.courtID]; + + if (round.nbVotes < court.jurorsForCourtJump) { + return false; + } + + // Jump if the parent court doesn't support the current DK. + return !courts[court.parent].supportedDisputeKits[round.disputeKitID]; + } + + function getDisputeKitsLength() external view returns (uint256) { + return disputeKits.length; + } + + function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) { + return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth; + } + + // ************************************* // + // * Internal * // + // ************************************* // + + /// @dev Toggles the dispute kit support for a given court. + /// @param _courtID The ID of the court to toggle the support for. + /// @param _disputeKitID The ID of the dispute kit to toggle the support for. + /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled. + function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal { + courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable; + emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); + } + + /// @dev If called only once then set _onError to Revert, otherwise set it to Return + /// @param _account The account to set the stake for. + /// @param _courtID The ID of the court to set the stake for. + /// @param _newStake The new stake. + /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract. + /// @param _onError Whether to revert or return false on error. + /// @return Whether the stake was successfully set or not. + function _setStake( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred, + OnError _onError + ) internal returns (bool) { + if (_courtID == FORKING_COURT || _courtID > courts.length) { + _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed. + return false; + } + if (_newStake != 0 && _newStake < courts[_courtID].minStake) { + _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed. + return false; + } + (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake( + _account, + _courtID, + _newStake, + _alreadyTransferred + ); + if (stakingResult != StakingResult.Successful) { + _stakingFailed(_onError, stakingResult); + return false; + } + if (pnkDeposit > 0) { + if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) { + _stakingFailed(_onError, StakingResult.StakingTransferFailed); + return false; + } + } + if (pnkWithdrawal > 0) { + if (!pinakion.safeTransfer(_account, pnkWithdrawal)) { + _stakingFailed(_onError, StakingResult.UnstakingTransferFailed); + return false; + } + } + return true; + } + + /// @dev It may revert depending on the _onError parameter. + function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual { + if (_onError == OnError.Return) return; + if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed(); + if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed(); + if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts(); + if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt(); + if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake(); + } + + /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array. + /// Note that if extradata contains an incorrect value then this value will be switched to default. + /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID. + /// @return courtID The court ID. + /// @return minJurors The minimum number of jurors required. + /// @return disputeKitID The ID of the dispute kit. + function _extraDataToCourtIDMinJurorsDisputeKit( + bytes memory _extraData + ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) { + // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index. + if (_extraData.length >= 64) { + assembly { + // solium-disable-line security/no-inline-assembly + courtID := mload(add(_extraData, 0x20)) + minJurors := mload(add(_extraData, 0x40)) + disputeKitID := mload(add(_extraData, 0x60)) + } + if (courtID == FORKING_COURT || courtID >= courts.length) { + courtID = GENERAL_COURT; + } + if (minJurors == 0) { + minJurors = DEFAULT_NB_OF_JURORS; + } + if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) { + disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used. + } + } else { + courtID = GENERAL_COURT; + minJurors = DEFAULT_NB_OF_JURORS; + disputeKitID = DISPUTE_KIT_CLASSIC; + } + } + + // ************************************* // + // * Errors * // + // ************************************* // + + error GovernorOnly(); + error GuardianOrGovernorOnly(); + error DisputeKitOnly(); + error SortitionModuleOnly(); + error UnsuccessfulCall(); + error InvalidDisputKitParent(); + error DepthLevelMax(); + error MinStakeLowerThanParentCourt(); + error UnsupportedDisputeKit(); + error InvalidForkingCourtAsParent(); + error WrongDisputeKitIndex(); + error CannotDisableClassicDK(); + error ArraysLengthMismatch(); + error StakingInTooManyCourts(); + error StakingNotPossibeInThisCourt(); + error StakingLessThanCourtMinStake(); + error StakingTransferFailed(); + error UnstakingTransferFailed(); + error ArbitrationFeesNotEnough(); + error DisputeKitNotSupportedByCourt(); + error MustSupportDisputeKitClassic(); + error TokenNotAccepted(); + error EvidenceNotPassedAndNotAppeal(); + error DisputeStillDrawing(); + error CommitPeriodNotPassed(); + error VotePeriodNotPassed(); + error AppealPeriodNotPassed(); + error NotEvidencePeriod(); + error AppealFeesNotEnough(); + error DisputeNotAppealable(); + error NotExecutionPeriod(); + error RulingAlreadyExecuted(); + error DisputePeriodIsFinal(); + error TransferFailed(); + error WhenNotPausedOnly(); + error WhenPausedOnly(); +} diff --git a/contracts/src/arbitration/KlerosCoreNeo.sol b/contracts/src/arbitration/KlerosCoreNeo.sol new file mode 100644 index 000000000..90e7cfd3e --- /dev/null +++ b/contracts/src/arbitration/KlerosCoreNeo.sol @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: MIT + +/// @custom:authors: [@unknownunknown1, @jaybuidl] +/// @custom:reviewers: [] +/// @custom:auditors: [] +/// @custom:bounties: [] +/// @custom:deployments: [] + +pragma solidity 0.8.18; + +import "./KlerosCoreBase.sol"; +import {UUPSProxiable} from "../proxy/UUPSProxiable.sol"; +import {Initializable} from "../proxy/Initializable.sol"; +import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; + +/// @title KlerosCoreNeo +/// Core arbitrator contract for Kleros v2. +/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts. +contract KlerosCoreNeo is KlerosCoreBase, UUPSProxiable, Initializable { + // ************************************* // + // * Storage * // + // ************************************* // + + mapping(address => bool) public arbitrableWhitelist; // Arbitrable whitelist. + IERC721 public jurorNft; // Eligible jurors NFT. + + // ************************************* // + // * Constructor * // + // ************************************* // + + /// @dev Constructor, initializing the implementation to reduce attack surface. + constructor() { + _disableInitializers(); + } + + /// @dev Initializer (constructor equivalent for upgradable contracts). + /// @param _governor The governor's address. + /// @param _guardian The guardian's address. + /// @param _pinakion The address of the token contract. + /// @param _jurorProsecutionModule The address of the juror prosecution module. + /// @param _disputeKit The address of the default dispute kit. + /// @param _hiddenVotes The `hiddenVotes` property value of the general court. + /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively). + /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court. + /// @param _sortitionExtraData The extra data for sortition module. + /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors. + /// @param _jurorNft NFT contract to vet the jurors. + function initialize( + address _governor, + address _guardian, + IERC20 _pinakion, + address _jurorProsecutionModule, + IDisputeKit _disputeKit, + bool _hiddenVotes, + uint256[4] memory _courtParameters, + uint256[4] memory _timesPerPeriod, + bytes memory _sortitionExtraData, + ISortitionModule _sortitionModuleAddress, + IERC721 _jurorNft + ) external reinitializer(2) { + super._initialize( + _governor, + _guardian, + _pinakion, + _jurorProsecutionModule, + _disputeKit, + _hiddenVotes, + _courtParameters, + _timesPerPeriod, + _sortitionExtraData, + _sortitionModuleAddress + ); + jurorNft = _jurorNft; + } + + // ************************************* // + // * Governance * // + // ************************************* // + + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) + function _authorizeUpgrade(address) internal view override onlyByGovernor { + // NOP + } + + /// @dev Changes the `jurorNft` storage variable. + /// @param _jurorNft The new value for the `jurorNft` storage variable. + function changeJurorNft(IERC721 _jurorNft) external onlyByGovernor { + jurorNft = _jurorNft; + } + + /// @dev Adds or removes an arbitrable from whitelist. + /// @param _arbitrable Arbitrable address. + /// @param _allowed Whether add or remove permission. + function changeArbitrableWhitelist(address _arbitrable, bool _allowed) external onlyByGovernor { + arbitrableWhitelist[_arbitrable] = _allowed; + } + + // ************************************* // + // * State Modifiers * // + // ************************************* // + + /// @dev Sets the caller's stake in a court. + /// Note: Staking and unstaking is forbidden during pause. + /// @param _courtID The ID of the court. + /// @param _newStake The new stake. + /// Note that the existing delayed stake will be nullified as non-relevant. + function setStake(uint96 _courtID, uint256 _newStake) external override whenNotPaused { + if (jurorNft.balanceOf(msg.sender) == 0) revert NotEligibleForStaking(); + super._setStake(msg.sender, _courtID, _newStake, false, OnError.Revert); + } + + // ************************************* // + // * Internal * // + // ************************************* // + + function _createDispute( + uint256 _numberOfChoices, + bytes memory _extraData, + IERC20 _feeToken, + uint256 _feeAmount + ) internal override returns (uint256 disputeID) { + if (!arbitrableWhitelist[msg.sender]) revert ArbitrableNotWhitelisted(); + return super._createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount); + } + + function _stakingFailed(OnError _onError, StakingResult _result) internal pure override { + super._stakingFailed(_onError, _result); + if (_result == StakingResult.CannotStakeMoreThanMaxStakePerJuror) revert StakingMoreThanMaxStakePerJuror(); + if (_result == StakingResult.CannotStakeMoreThanMaxTotalStaked) revert StakingMoreThanMaxTotalStaked(); + } + + // ************************************* // + // * Errors * // + // ************************************* // + + error NotEligibleForStaking(); + error StakingMoreThanMaxStakePerJuror(); + error StakingMoreThanMaxTotalStaked(); + error ArbitrableNotWhitelisted(); +} diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 2e6575705..bb6a61722 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -10,100 +10,13 @@ pragma solidity 0.8.18; -import "./KlerosCore.sol"; -import "./interfaces/ISortitionModule.sol"; -import "./interfaces/IDisputeKit.sol"; -import "../rng/RNG.sol"; +import "./SortitionModuleBase.sol"; import "../proxy/UUPSProxiable.sol"; import "../proxy/Initializable.sol"; -import "../libraries/Constants.sol"; /// @title SortitionModule /// @dev A factory of trees that keeps track of staked values for sortition. -contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { - // ************************************* // - // * Enums / Structs * // - // ************************************* // - - enum PreStakeHookResult { - ok, // Correct phase. All checks are passed. - stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. - stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. - failed // Checks didn't pass. Do no changes. - } - - struct SortitionSumTree { - uint256 K; // The maximum number of children per node. - // 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. - uint256[] stack; - uint256[] nodes; - // 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. - mapping(bytes32 => uint256) IDsToNodeIndexes; - mapping(uint256 => bytes32) nodeIndexesToIDs; - } - - struct DelayedStake { - address account; // The address of the juror. - uint96 courtID; // The ID of the court. - uint256 stake; // The new stake. - bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution. - } - - struct Juror { - uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`. - uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance. - uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn. - } - - // ************************************* // - // * Storage * // - // ************************************* // - - uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have. - uint256 public constant DEFAULT_K = 6; // Default number of children per node. - - address public governor; // The governor of the contract. - KlerosCore public core; // The core arbitrator contract. - Phase public phase; // The current phase. - uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes. - uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking. - uint256 public lastPhaseChange; // The last time the phase was changed. - uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made. - uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors. - RNG public rng; // The random number generator. - uint256 public randomNumber; // Random number returned by RNG. - uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number. - uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped. - uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped. - mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys. - mapping(address => Juror) public jurors; // The jurors. - mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking. - mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID]. - - // ************************************* // - // * Events * // - // ************************************* // - - event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount); - event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock); - - // ************************************* // - // * Function Modifiers * // - // ************************************* // - - modifier onlyByGovernor() { - require(address(governor) == msg.sender, "Access not allowed: Governor only."); - _; - } - - modifier onlyByCore() { - require(address(core) == msg.sender, "Access not allowed: KlerosCore only."); - _; - } - +contract SortitionModule is SortitionModuleBase, UUPSProxiable, Initializable { // ************************************* // // * Constructor * // // ************************************* // @@ -114,6 +27,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { } /// @dev Initializer (constructor equivalent for upgradable contracts). + /// @param _governor The governor. /// @param _core The KlerosCore. /// @param _minStakingTime Minimal time to stake /// @param _maxDrawingTime Time after which the drawing phase can be switched @@ -127,581 +41,16 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { RNG _rng, uint256 _rngLookahead ) external reinitializer(1) { - governor = _governor; - core = _core; - minStakingTime = _minStakingTime; - maxDrawingTime = _maxDrawingTime; - lastPhaseChange = block.timestamp; - rng = _rng; - rngLookahead = _rngLookahead; - delayedStakeReadIndex = 1; + super._initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead); } // ************************************* // // * Governance * // // ************************************* // - /** - * @dev Access Control to perform implementation upgrades (UUPS Proxiable) - * @dev Only the governor can perform upgrades (`onlyByGovernor`) - */ - function _authorizeUpgrade(address) internal view override onlyByGovernor { + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) + function _authorizeUpgrade(address) internal view virtual override onlyByGovernor { // NOP } - - /// @dev Changes the `minStakingTime` storage variable. - /// @param _minStakingTime The new value for the `minStakingTime` storage variable. - function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor { - minStakingTime = _minStakingTime; - } - - /// @dev Changes the `maxDrawingTime` storage variable. - /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable. - function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor { - maxDrawingTime = _maxDrawingTime; - } - - /// @dev Changes the `_rng` and `_rngLookahead` storage variables. - /// @param _rng The new value for the `RNGenerator` storage variable. - /// @param _rngLookahead The new value for the `rngLookahead` storage variable. - function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor { - rng = _rng; - rngLookahead = _rngLookahead; - if (phase == Phase.generating) { - rng.requestRandomness(block.number + rngLookahead); - randomNumberRequestBlock = block.number; - } - } - - // ************************************* // - // * State Modifiers * // - // ************************************* // - - function passPhase() external { - if (phase == Phase.staking) { - require( - block.timestamp - lastPhaseChange >= minStakingTime, - "The minimum staking time has not passed yet." - ); - require(disputesWithoutJurors > 0, "There are no disputes that need jurors."); - rng.requestRandomness(block.number + rngLookahead); - randomNumberRequestBlock = block.number; - phase = Phase.generating; - } else if (phase == Phase.generating) { - randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead); - require(randomNumber != 0, "Random number is not ready yet"); - phase = Phase.drawing; - } else if (phase == Phase.drawing) { - require( - disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime, - "There are still disputes without jurors and the maximum drawing time has not passed yet." - ); - phase = Phase.staking; - } - - lastPhaseChange = block.timestamp; - emit NewPhase(phase); - } - - /// @dev Create a sortition sum tree at the specified key. - /// @param _key The key of the new tree. - /// @param _extraData Extra data that contains the number of children each node in the tree should have. - function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore { - SortitionSumTree storage tree = sortitionSumTrees[_key]; - uint256 K = _extraDataToTreeK(_extraData); - require(tree.K == 0, "Tree already exists."); - require(K > 1, "K must be greater than one."); - tree.K = K; - tree.nodes.push(0); - } - - /// @dev Executes the next delayed stakes. - /// @param _iterations The number of delayed stakes to execute. - function executeDelayedStakes(uint256 _iterations) external { - require(phase == Phase.staking, "Should be in Staking phase."); - - uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex - ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1 - : _iterations; - uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations; - - for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) { - DelayedStake storage delayedStake = delayedStakes[i]; - // Delayed stake could've been manually removed already. In this case simply move on to the next item. - if (delayedStake.account != address(0)) { - core.setStakeBySortitionModule( - delayedStake.account, - delayedStake.courtID, - delayedStake.stake, - delayedStake.alreadyTransferred - ); - delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID]; - delete delayedStakes[i]; - } - } - delayedStakeReadIndex = newDelayedStakeReadIndex; - } - - function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { - disputesWithoutJurors++; - } - - function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { - disputesWithoutJurors--; - } - - /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase(). - /// @param _randomNumber Random number returned by RNG contract. - function notifyRandomNumber(uint256 _randomNumber) public override {} - - /// @dev Sets the specified juror's stake in a court. - /// `O(n + p * log_k(j))` where - /// `n` is the number of courts the juror has staked in, - /// `p` is the depth of the court tree, - /// `k` is the minimum number of children per node of one of these courts' sortition sum tree, - /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. - /// @param _account The address of the juror. - /// @param _courtID The ID of the court. - /// @param _newStake The new stake. - /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. - /// @return pnkDeposit The amount of PNK to be deposited. - /// @return pnkWithdrawal The amount of PNK to be withdrawn. - /// @return succeeded True if the call succeeded, false otherwise. - function setStake( - address _account, - uint96 _courtID, - uint256 _newStake, - bool _alreadyTransferred - ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) { - Juror storage juror = jurors[_account]; - uint256 currentStake = stakeOf(_account, _courtID); - - uint256 nbCourts = juror.courtIDs.length; - if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) { - return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. - } - - if (phase != Phase.staking) { - pnkWithdrawal = _deleteDelayedStake(_courtID, _account); - - // Store the stake change as delayed, to be applied when the phase switches back to Staking. - DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; - delayedStake.account = _account; - delayedStake.courtID = _courtID; - delayedStake.stake = _newStake; - latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex; - if (_newStake > currentStake) { - // PNK deposit: tokens are transferred now. - delayedStake.alreadyTransferred = true; - pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); - emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake); - } else { - // PNK withdrawal: tokens are not transferred yet. - emit StakeDelayedNotTransferred(_account, _courtID, _newStake); - } - return (pnkDeposit, pnkWithdrawal, true); - } - - // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred). - if (_newStake >= currentStake) { - if (!_alreadyTransferred) { - pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); - } - } else { - pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake); - } - - bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID); - bool finished = false; - uint96 currenCourtID = _courtID; - while (!finished) { - // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn. - _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID); - if (currenCourtID == Constants.GENERAL_COURT) { - finished = true; - } else { - (currenCourtID, , , , , , ) = core.courts(currenCourtID); // Get the parent court. - } - } - emit StakeSet(_account, _courtID, _newStake); - return (pnkDeposit, pnkWithdrawal, true); - } - - /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. - /// @param _courtID ID of the court. - /// @param _juror Juror whose stake to check. - function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) { - uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; - if (latestIndex != 0) { - DelayedStake storage delayedStake = delayedStakes[latestIndex]; - if (delayedStake.alreadyTransferred) { - // Sortition stake represents the stake value that was last updated during Staking phase. - uint256 sortitionStake = stakeOf(_juror, _courtID); - - // Withdraw the tokens that were added with the latest delayed stake. - uint256 amountToWithdraw = delayedStake.stake - sortitionStake; - actualAmountToWithdraw = amountToWithdraw; - Juror storage juror = jurors[_juror]; - if (juror.stakedPnk <= actualAmountToWithdraw) { - actualAmountToWithdraw = juror.stakedPnk; - } - - // StakePnk can become lower because of penalty. - juror.stakedPnk -= actualAmountToWithdraw; - emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw); - - if (sortitionStake == 0) { - // Delete the court otherwise it will be duplicated after staking. - for (uint256 i = juror.courtIDs.length; i > 0; i--) { - if (juror.courtIDs[i - 1] == _courtID) { - juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; - juror.courtIDs.pop(); - break; - } - } - } - } - delete delayedStakes[latestIndex]; - delete latestDelayedStakeIndex[_juror][_courtID]; - } - } - - function _increaseStake( - Juror storage juror, - uint96 _courtID, - uint256 _newStake, - uint256 _currentStake - ) internal returns (uint256 transferredAmount) { - // Stake increase - // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. - // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. - uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard - transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard - ? _newStake - _currentStake - previouslyLocked - : 0; - if (_currentStake == 0) { - juror.courtIDs.push(_courtID); - } - // stakedPnk can become async with _currentStake (e.g. after penalty). - juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; - } - - function _decreaseStake( - Juror storage juror, - uint96 _courtID, - uint256 _newStake, - uint256 _currentStake - ) internal returns (uint256 transferredAmount) { - // Stakes can be partially delayed only when stake is increased. - // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution. - if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) { - // We have enough pnk staked to afford withdrawal while keeping locked tokens. - transferredAmount = _currentStake - _newStake; - } else if (juror.stakedPnk >= juror.lockedPnk) { - // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens. - transferredAmount = juror.stakedPnk - juror.lockedPnk; - } - if (_newStake == 0) { - for (uint256 i = juror.courtIDs.length; i > 0; i--) { - if (juror.courtIDs[i - 1] == _courtID) { - juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; - juror.courtIDs.pop(); - break; - } - } - } - // stakedPnk can become async with _currentStake (e.g. after penalty). - juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; - } - - function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore { - jurors[_account].lockedPnk += _relativeAmount; - emit StakeLocked(_account, _relativeAmount, false); - } - - function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore { - jurors[_account].lockedPnk -= _relativeAmount; - emit StakeLocked(_account, _relativeAmount, true); - } - - function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore { - Juror storage juror = jurors[_account]; - if (juror.stakedPnk >= _relativeAmount) { - juror.stakedPnk -= _relativeAmount; - } else { - juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference. - } - } - - /// @dev Unstakes the inactive juror from all courts. - /// `O(n * (p * log_k(j)) )` where - /// `n` is the number of courts the juror has staked in, - /// `p` is the depth of the court tree, - /// `k` is the minimum number of children per node of one of these courts' sortition sum tree, - /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. - /// @param _account The juror to unstake. - function setJurorInactive(address _account) external override onlyByCore { - uint96[] memory courtIDs = getJurorCourtIDs(_account); - for (uint256 j = courtIDs.length; j > 0; j--) { - core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false); - } - } - - // ************************************* // - // * Public Views * // - // ************************************* // - - /// @dev Draw an ID from a tree using a number. - /// Note that this function reverts if the sum of all values in the tree is 0. - /// @param _key The key of the tree. - /// @param _coreDisputeID Index of the dispute in Kleros Core. - /// @param _nonce Nonce to hash with random number. - /// @return drawnAddress The drawn address. - /// `O(k * log_k(n))` where - /// `k` is the maximum number of children per node in the tree, - /// and `n` is the maximum number of nodes ever appended. - function draw( - bytes32 _key, - uint256 _coreDisputeID, - uint256 _nonce - ) public view override returns (address drawnAddress) { - require(phase == Phase.drawing, "Wrong phase."); - SortitionSumTree storage tree = sortitionSumTrees[_key]; - - if (tree.nodes[0] == 0) { - return address(0); // No jurors staked. - } - - uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) % - tree.nodes[0]; - - // While it still has children - uint256 treeIndex = 0; - while ((tree.K * treeIndex) + 1 < tree.nodes.length) { - for (uint256 i = 1; i <= tree.K; i++) { - // Loop over children. - uint256 nodeIndex = (tree.K * treeIndex) + i; - uint256 nodeValue = tree.nodes[nodeIndex]; - - if (currentDrawnNumber >= nodeValue) { - // Go to the next child. - currentDrawnNumber -= nodeValue; - } else { - // Pick this child. - treeIndex = nodeIndex; - break; - } - } - } - drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]); - } - - /// @dev Get the stake of a juror in a court. - /// @param _juror The address of the juror. - /// @param _courtID The ID of the court. - /// @return value The stake of the juror in the court. - function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) { - bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); - return stakeOf(bytes32(uint256(_courtID)), stakePathID); - } - - /// @dev Get the stake of a juror in a court. - /// @param _key The key of the tree, corresponding to a court. - /// @param _ID The stake path ID, corresponding to a juror. - /// @return The stake of the juror in the court. - function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) { - SortitionSumTree storage tree = sortitionSumTrees[_key]; - uint treeIndex = tree.IDsToNodeIndexes[_ID]; - if (treeIndex == 0) { - return 0; - } - return tree.nodes[treeIndex]; - } - - function getJurorBalance( - address _juror, - uint96 _courtID - ) - external - view - override - returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts) - { - Juror storage juror = jurors[_juror]; - totalStaked = juror.stakedPnk; - totalLocked = juror.lockedPnk; - stakedInCourt = stakeOf(_juror, _courtID); - nbCourts = juror.courtIDs.length; - } - - /// @dev Gets the court identifiers where a specific `_juror` has staked. - /// @param _juror The address of the juror. - function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) { - return jurors[_juror].courtIDs; - } - - function isJurorStaked(address _juror) external view override returns (bool) { - return jurors[_juror].stakedPnk > 0; - } - - // ************************************* // - // * Internal * // - // ************************************* // - - /// @dev Update all the parents of a node. - /// @param _key The key of the tree to update. - /// @param _treeIndex The index of the node to start from. - /// @param _plusOrMinus Whether to add (true) or substract (false). - /// @param _value The value to add or substract. - /// `O(log_k(n))` where - /// `k` is the maximum number of children per node in the tree, - /// and `n` is the maximum number of nodes ever appended. - function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private { - SortitionSumTree storage tree = sortitionSumTrees[_key]; - - uint256 parentIndex = _treeIndex; - while (parentIndex != 0) { - parentIndex = (parentIndex - 1) / tree.K; - tree.nodes[parentIndex] = _plusOrMinus - ? tree.nodes[parentIndex] + _value - : tree.nodes[parentIndex] - _value; - } - } - - /// @dev Retrieves a juror's address from the stake path ID. - /// @param _stakePathID The stake path ID to unpack. - /// @return account The account. - function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) { - assembly { - // solium-disable-line security/no-inline-assembly - let ptr := mload(0x40) - for { - let i := 0x00 - } lt(i, 0x14) { - i := add(i, 0x01) - } { - mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID)) - } - account := mload(ptr) - } - } - - function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) { - if (_extraData.length >= 32) { - assembly { - // solium-disable-line security/no-inline-assembly - K := mload(add(_extraData, 0x20)) - } - } else { - K = DEFAULT_K; - } - } - - /// @dev Set a value in a tree. - /// @param _key The key of the tree. - /// @param _value The new value. - /// @param _ID The ID of the value. - /// `O(log_k(n))` where - /// `k` is the maximum number of children per node in the tree, - /// and `n` is the maximum number of nodes ever appended. - function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal { - SortitionSumTree storage tree = sortitionSumTrees[_key]; - uint256 treeIndex = tree.IDsToNodeIndexes[_ID]; - - if (treeIndex == 0) { - // No existing node. - if (_value != 0) { - // Non zero value. - // Append. - // Add node. - if (tree.stack.length == 0) { - // No vacant spots. - // Get the index and append the value. - treeIndex = tree.nodes.length; - tree.nodes.push(_value); - - // Potentially append a new node and make the parent a sum node. - if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) { - // Is first child. - uint256 parentIndex = treeIndex / tree.K; - bytes32 parentID = tree.nodeIndexesToIDs[parentIndex]; - uint256 newIndex = treeIndex + 1; - tree.nodes.push(tree.nodes[parentIndex]); - delete tree.nodeIndexesToIDs[parentIndex]; - tree.IDsToNodeIndexes[parentID] = newIndex; - tree.nodeIndexesToIDs[newIndex] = parentID; - } - } else { - // Some vacant spot. - // Pop the stack and append the value. - treeIndex = tree.stack[tree.stack.length - 1]; - tree.stack.pop(); - tree.nodes[treeIndex] = _value; - } - - // Add label. - tree.IDsToNodeIndexes[_ID] = treeIndex; - tree.nodeIndexesToIDs[treeIndex] = _ID; - - _updateParents(_key, treeIndex, true, _value); - } - } else { - // Existing node. - if (_value == 0) { - // Zero value. - // Remove. - // Remember value and set to 0. - uint256 value = tree.nodes[treeIndex]; - tree.nodes[treeIndex] = 0; - - // Push to stack. - tree.stack.push(treeIndex); - - // Clear label. - delete tree.IDsToNodeIndexes[_ID]; - delete tree.nodeIndexesToIDs[treeIndex]; - - _updateParents(_key, treeIndex, false, value); - } else if (_value != tree.nodes[treeIndex]) { - // New, non zero value. - // Set. - bool plusOrMinus = tree.nodes[treeIndex] <= _value; - uint256 plusOrMinusValue = plusOrMinus - ? _value - tree.nodes[treeIndex] - : tree.nodes[treeIndex] - _value; - tree.nodes[treeIndex] = _value; - - _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue); - } - } - } - - /// @dev Packs an account and a court ID into a stake path ID. - /// @param _account The address of the juror to pack. - /// @param _courtID The court ID to pack. - /// @return stakePathID The stake path ID. - function _accountAndCourtIDToStakePathID( - address _account, - uint96 _courtID - ) internal pure returns (bytes32 stakePathID) { - assembly { - // solium-disable-line security/no-inline-assembly - let ptr := mload(0x40) - for { - let i := 0x00 - } lt(i, 0x14) { - i := add(i, 0x01) - } { - mstore8(add(ptr, i), byte(add(0x0c, i), _account)) - } - for { - let i := 0x14 - } lt(i, 0x20) { - i := add(i, 0x01) - } { - mstore8(add(ptr, i), byte(i, _courtID)) - } - stakePathID := mload(ptr) - } - } } diff --git a/contracts/src/arbitration/SortitionModuleBase.sol b/contracts/src/arbitration/SortitionModuleBase.sol new file mode 100644 index 000000000..973f4beeb --- /dev/null +++ b/contracts/src/arbitration/SortitionModuleBase.sol @@ -0,0 +1,697 @@ +// SPDX-License-Identifier: MIT + +/** + * @custom:authors: [@epiqueras, @unknownunknown1, @jaybuidl, @shotaronowhere] + * @custom:reviewers: [] + * @custom:auditors: [] + * @custom:bounties: [] + * @custom:deployments: [] + */ + +pragma solidity 0.8.18; + +import "./KlerosCore.sol"; +import "./interfaces/ISortitionModule.sol"; +import "./interfaces/IDisputeKit.sol"; +import "../rng/RNG.sol"; +import "../libraries/Constants.sol"; + +/// @title SortitionModuleBase +/// @dev A factory of trees that keeps track of staked values for sortition. +abstract contract SortitionModuleBase is ISortitionModule { + // ************************************* // + // * Enums / Structs * // + // ************************************* // + + enum PreStakeHookResult { + ok, // Correct phase. All checks are passed. + stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. + stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. + failed // Checks didn't pass. Do no changes. + } + + struct SortitionSumTree { + uint256 K; // The maximum number of children per node. + // 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. + uint256[] stack; + uint256[] nodes; + // 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. + mapping(bytes32 => uint256) IDsToNodeIndexes; + mapping(uint256 => bytes32) nodeIndexesToIDs; + } + + struct DelayedStake { + address account; // The address of the juror. + uint96 courtID; // The ID of the court. + uint256 stake; // The new stake. + bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution. + } + + struct Juror { + uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`. + uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance. + uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn. + } + + // ************************************* // + // * Storage * // + // ************************************* // + + address public governor; // The governor of the contract. + KlerosCore public core; // The core arbitrator contract. + Phase public phase; // The current phase. + uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes. + uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking. + uint256 public lastPhaseChange; // The last time the phase was changed. + uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made. + uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors. + RNG public rng; // The random number generator. + uint256 public randomNumber; // Random number returned by RNG. + uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number. + uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped. + uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped. + mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys. + mapping(address => Juror) public jurors; // The jurors. + mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking. + mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID]. + + // ************************************* // + // * Events * // + // ************************************* // + + event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount); + event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock); + + // ************************************* // + // * Constructor * // + // ************************************* // + + function _initialize( + address _governor, + KlerosCore _core, + uint256 _minStakingTime, + uint256 _maxDrawingTime, + RNG _rng, + uint256 _rngLookahead + ) internal { + governor = _governor; + core = _core; + minStakingTime = _minStakingTime; + maxDrawingTime = _maxDrawingTime; + lastPhaseChange = block.timestamp; + rng = _rng; + rngLookahead = _rngLookahead; + delayedStakeReadIndex = 1; + } + + // ************************************* // + // * Function Modifiers * // + // ************************************* // + + modifier onlyByGovernor() { + require(address(governor) == msg.sender, "Access not allowed: Governor only."); + _; + } + + modifier onlyByCore() { + require(address(core) == msg.sender, "Access not allowed: KlerosCore only."); + _; + } + + // ************************************* // + // * Governance * // + // ************************************* // + + /// @dev Changes the `minStakingTime` storage variable. + /// @param _minStakingTime The new value for the `minStakingTime` storage variable. + function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor { + minStakingTime = _minStakingTime; + } + + /// @dev Changes the `maxDrawingTime` storage variable. + /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable. + function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor { + maxDrawingTime = _maxDrawingTime; + } + + /// @dev Changes the `_rng` and `_rngLookahead` storage variables. + /// @param _rng The new value for the `RNGenerator` storage variable. + /// @param _rngLookahead The new value for the `rngLookahead` storage variable. + function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor { + rng = _rng; + rngLookahead = _rngLookahead; + if (phase == Phase.generating) { + rng.requestRandomness(block.number + rngLookahead); + randomNumberRequestBlock = block.number; + } + } + + // ************************************* // + // * State Modifiers * // + // ************************************* // + + function passPhase() external { + if (phase == Phase.staking) { + require( + block.timestamp - lastPhaseChange >= minStakingTime, + "The minimum staking time has not passed yet." + ); + require(disputesWithoutJurors > 0, "There are no disputes that need jurors."); + rng.requestRandomness(block.number + rngLookahead); + randomNumberRequestBlock = block.number; + phase = Phase.generating; + } else if (phase == Phase.generating) { + randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead); + require(randomNumber != 0, "Random number is not ready yet"); + phase = Phase.drawing; + } else if (phase == Phase.drawing) { + require( + disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime, + "There are still disputes without jurors and the maximum drawing time has not passed yet." + ); + phase = Phase.staking; + } + + lastPhaseChange = block.timestamp; + emit NewPhase(phase); + } + + /// @dev Create a sortition sum tree at the specified key. + /// @param _key The key of the new tree. + /// @param _extraData Extra data that contains the number of children each node in the tree should have. + function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore { + SortitionSumTree storage tree = sortitionSumTrees[_key]; + uint256 K = _extraDataToTreeK(_extraData); + require(tree.K == 0, "Tree already exists."); + require(K > 1, "K must be greater than one."); + tree.K = K; + tree.nodes.push(0); + } + + /// @dev Executes the next delayed stakes. + /// @param _iterations The number of delayed stakes to execute. + function executeDelayedStakes(uint256 _iterations) external { + require(phase == Phase.staking, "Should be in Staking phase."); + require(delayedStakeWriteIndex >= delayedStakeReadIndex, "No delayed stake to execute."); + + uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex + ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1 + : _iterations; + uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations; + + for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) { + DelayedStake storage delayedStake = delayedStakes[i]; + // Delayed stake could've been manually removed already. In this case simply move on to the next item. + if (delayedStake.account != address(0)) { + core.setStakeBySortitionModule( + delayedStake.account, + delayedStake.courtID, + delayedStake.stake, + delayedStake.alreadyTransferred + ); + delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID]; + delete delayedStakes[i]; + } + } + delayedStakeReadIndex = newDelayedStakeReadIndex; + } + + function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { + disputesWithoutJurors++; + } + + function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { + disputesWithoutJurors--; + } + + /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase(). + /// @param _randomNumber Random number returned by RNG contract. + function notifyRandomNumber(uint256 _randomNumber) public override {} + + /// @dev Sets the specified juror's stake in a court. + /// `O(n + p * log_k(j))` where + /// `n` is the number of courts the juror has staked in, + /// `p` is the depth of the court tree, + /// `k` is the minimum number of children per node of one of these courts' sortition sum tree, + /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. + /// @param _account The address of the juror. + /// @param _courtID The ID of the court. + /// @param _newStake The new stake. + /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. + /// @return pnkDeposit The amount of PNK to be deposited. + /// @return pnkWithdrawal The amount of PNK to be withdrawn. + /// @return stakingResult The result of the staking operation. + function setStake( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred + ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) { + (pnkDeposit, pnkWithdrawal, stakingResult) = _setStake(_account, _courtID, _newStake, _alreadyTransferred); + } + + /// @dev Sets the specified juror's stake in a court. + /// Note: no state changes should be made when returning `succeeded` = false, otherwise delayed stakes might break invariants. + function _setStake( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred + ) internal virtual returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) { + Juror storage juror = jurors[_account]; + uint256 currentStake = stakeOf(_account, _courtID); + + uint256 nbCourts = juror.courtIDs.length; + if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) { + return (0, 0, StakingResult.CannotStakeInMoreCourts); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. + } + + if (phase != Phase.staking) { + pnkWithdrawal = _deleteDelayedStake(_courtID, _account); + + // Store the stake change as delayed, to be applied when the phase switches back to Staking. + DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; + delayedStake.account = _account; + delayedStake.courtID = _courtID; + delayedStake.stake = _newStake; + latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex; + if (_newStake > currentStake) { + // PNK deposit: tokens are transferred now. + delayedStake.alreadyTransferred = true; + pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); + emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake); + } else { + // PNK withdrawal: tokens are not transferred yet. + emit StakeDelayedNotTransferred(_account, _courtID, _newStake); + } + return (pnkDeposit, pnkWithdrawal, StakingResult.Successful); + } + + // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred). + if (_newStake >= currentStake) { + if (!_alreadyTransferred) { + pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); + } + } else { + pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake); + } + + // Update the sortition sum tree. + bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID); + bool finished = false; + uint96 currenCourtID = _courtID; + while (!finished) { + // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn. + _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID); + if (currenCourtID == GENERAL_COURT) { + finished = true; + } else { + (currenCourtID, , , , , , ) = core.courts(currenCourtID); // Get the parent court. + } + } + emit StakeSet(_account, _courtID, _newStake); + return (pnkDeposit, pnkWithdrawal, StakingResult.Successful); + } + + /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. + /// @param _courtID ID of the court. + /// @param _juror Juror whose stake to check. + function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) { + uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; + if (latestIndex != 0) { + DelayedStake storage delayedStake = delayedStakes[latestIndex]; + if (delayedStake.alreadyTransferred) { + // Sortition stake represents the stake value that was last updated during Staking phase. + uint256 sortitionStake = stakeOf(_juror, _courtID); + + // Withdraw the tokens that were added with the latest delayed stake. + uint256 amountToWithdraw = delayedStake.stake - sortitionStake; + actualAmountToWithdraw = amountToWithdraw; + Juror storage juror = jurors[_juror]; + if (juror.stakedPnk <= actualAmountToWithdraw) { + actualAmountToWithdraw = juror.stakedPnk; + } + + // StakePnk can become lower because of penalty. + juror.stakedPnk -= actualAmountToWithdraw; + emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw); + + if (sortitionStake == 0) { + // Cleanup: delete the court otherwise it will be duplicated after staking. + for (uint256 i = juror.courtIDs.length; i > 0; i--) { + if (juror.courtIDs[i - 1] == _courtID) { + juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; + juror.courtIDs.pop(); + break; + } + } + } + } + delete delayedStakes[latestIndex]; + delete latestDelayedStakeIndex[_juror][_courtID]; + } + } + + function _increaseStake( + Juror storage juror, + uint96 _courtID, + uint256 _newStake, + uint256 _currentStake + ) internal returns (uint256 transferredAmount) { + // Stake increase + // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. + // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. + uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard + transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard + ? _newStake - _currentStake - previouslyLocked + : 0; + if (_currentStake == 0) { + juror.courtIDs.push(_courtID); + } + // stakedPnk can become async with _currentStake (e.g. after penalty). + juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; + } + + function _decreaseStake( + Juror storage juror, + uint96 _courtID, + uint256 _newStake, + uint256 _currentStake + ) internal returns (uint256 transferredAmount) { + // Stakes can be partially delayed only when stake is increased. + // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution. + if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) { + // We have enough pnk staked to afford withdrawal while keeping locked tokens. + transferredAmount = _currentStake - _newStake; + } else if (juror.stakedPnk >= juror.lockedPnk) { + // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens. + transferredAmount = juror.stakedPnk - juror.lockedPnk; + } + if (_newStake == 0) { + // Cleanup + for (uint256 i = juror.courtIDs.length; i > 0; i--) { + if (juror.courtIDs[i - 1] == _courtID) { + juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; + juror.courtIDs.pop(); + break; + } + } + } + // stakedPnk can become async with _currentStake (e.g. after penalty). + juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; + } + + function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore { + jurors[_account].lockedPnk += _relativeAmount; + emit StakeLocked(_account, _relativeAmount, false); + } + + function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore { + jurors[_account].lockedPnk -= _relativeAmount; + emit StakeLocked(_account, _relativeAmount, true); + } + + function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore { + Juror storage juror = jurors[_account]; + if (juror.stakedPnk >= _relativeAmount) { + juror.stakedPnk -= _relativeAmount; + } else { + juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference. + } + } + + /// @dev Unstakes the inactive juror from all courts. + /// `O(n * (p * log_k(j)) )` where + /// `n` is the number of courts the juror has staked in, + /// `p` is the depth of the court tree, + /// `k` is the minimum number of children per node of one of these courts' sortition sum tree, + /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. + /// @param _account The juror to unstake. + function setJurorInactive(address _account) external override onlyByCore { + uint96[] memory courtIDs = getJurorCourtIDs(_account); + for (uint256 j = courtIDs.length; j > 0; j--) { + core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false); + } + } + + // ************************************* // + // * Public Views * // + // ************************************* // + + /// @dev Draw an ID from a tree using a number. + /// Note that this function reverts if the sum of all values in the tree is 0. + /// @param _key The key of the tree. + /// @param _coreDisputeID Index of the dispute in Kleros Core. + /// @param _nonce Nonce to hash with random number. + /// @return drawnAddress The drawn address. + /// `O(k * log_k(n))` where + /// `k` is the maximum number of children per node in the tree, + /// and `n` is the maximum number of nodes ever appended. + function draw( + bytes32 _key, + uint256 _coreDisputeID, + uint256 _nonce + ) public view override returns (address drawnAddress) { + require(phase == Phase.drawing, "Wrong phase."); + SortitionSumTree storage tree = sortitionSumTrees[_key]; + + if (tree.nodes[0] == 0) { + return address(0); // No jurors staked. + } + + uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) % + tree.nodes[0]; + + // While it still has children + uint256 treeIndex = 0; + while ((tree.K * treeIndex) + 1 < tree.nodes.length) { + for (uint256 i = 1; i <= tree.K; i++) { + // Loop over children. + uint256 nodeIndex = (tree.K * treeIndex) + i; + uint256 nodeValue = tree.nodes[nodeIndex]; + + if (currentDrawnNumber >= nodeValue) { + // Go to the next child. + currentDrawnNumber -= nodeValue; + } else { + // Pick this child. + treeIndex = nodeIndex; + break; + } + } + } + drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]); + } + + /// @dev Get the stake of a juror in a court. + /// @param _juror The address of the juror. + /// @param _courtID The ID of the court. + /// @return value The stake of the juror in the court. + function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) { + bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); + return stakeOf(bytes32(uint256(_courtID)), stakePathID); + } + + /// @dev Get the stake of a juror in a court. + /// @param _key The key of the tree, corresponding to a court. + /// @param _ID The stake path ID, corresponding to a juror. + /// @return The stake of the juror in the court. + function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) { + SortitionSumTree storage tree = sortitionSumTrees[_key]; + uint treeIndex = tree.IDsToNodeIndexes[_ID]; + if (treeIndex == 0) { + return 0; + } + return tree.nodes[treeIndex]; + } + + function getJurorBalance( + address _juror, + uint96 _courtID + ) + external + view + override + returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts) + { + Juror storage juror = jurors[_juror]; + totalStaked = juror.stakedPnk; + totalLocked = juror.lockedPnk; + stakedInCourt = stakeOf(_juror, _courtID); + nbCourts = juror.courtIDs.length; + } + + /// @dev Gets the court identifiers where a specific `_juror` has staked. + /// @param _juror The address of the juror. + function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) { + return jurors[_juror].courtIDs; + } + + function isJurorStaked(address _juror) external view override returns (bool) { + return jurors[_juror].stakedPnk > 0; + } + + // ************************************* // + // * Internal * // + // ************************************* // + + /// @dev Update all the parents of a node. + /// @param _key The key of the tree to update. + /// @param _treeIndex The index of the node to start from. + /// @param _plusOrMinus Whether to add (true) or substract (false). + /// @param _value The value to add or substract. + /// `O(log_k(n))` where + /// `k` is the maximum number of children per node in the tree, + /// and `n` is the maximum number of nodes ever appended. + function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private { + SortitionSumTree storage tree = sortitionSumTrees[_key]; + + uint256 parentIndex = _treeIndex; + while (parentIndex != 0) { + parentIndex = (parentIndex - 1) / tree.K; + tree.nodes[parentIndex] = _plusOrMinus + ? tree.nodes[parentIndex] + _value + : tree.nodes[parentIndex] - _value; + } + } + + /// @dev Retrieves a juror's address from the stake path ID. + /// @param _stakePathID The stake path ID to unpack. + /// @return account The account. + function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) { + assembly { + // solium-disable-line security/no-inline-assembly + let ptr := mload(0x40) + for { + let i := 0x00 + } lt(i, 0x14) { + i := add(i, 0x01) + } { + mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID)) + } + account := mload(ptr) + } + } + + function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) { + if (_extraData.length >= 32) { + assembly { + // solium-disable-line security/no-inline-assembly + K := mload(add(_extraData, 0x20)) + } + } else { + K = DEFAULT_K; + } + } + + /// @dev Set a value in a tree. + /// @param _key The key of the tree. + /// @param _value The new value. + /// @param _ID The ID of the value. + /// `O(log_k(n))` where + /// `k` is the maximum number of children per node in the tree, + /// and `n` is the maximum number of nodes ever appended. + function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal { + SortitionSumTree storage tree = sortitionSumTrees[_key]; + uint256 treeIndex = tree.IDsToNodeIndexes[_ID]; + + if (treeIndex == 0) { + // No existing node. + if (_value != 0) { + // Non zero value. + // Append. + // Add node. + if (tree.stack.length == 0) { + // No vacant spots. + // Get the index and append the value. + treeIndex = tree.nodes.length; + tree.nodes.push(_value); + + // Potentially append a new node and make the parent a sum node. + if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) { + // Is first child. + uint256 parentIndex = treeIndex / tree.K; + bytes32 parentID = tree.nodeIndexesToIDs[parentIndex]; + uint256 newIndex = treeIndex + 1; + tree.nodes.push(tree.nodes[parentIndex]); + delete tree.nodeIndexesToIDs[parentIndex]; + tree.IDsToNodeIndexes[parentID] = newIndex; + tree.nodeIndexesToIDs[newIndex] = parentID; + } + } else { + // Some vacant spot. + // Pop the stack and append the value. + treeIndex = tree.stack[tree.stack.length - 1]; + tree.stack.pop(); + tree.nodes[treeIndex] = _value; + } + + // Add label. + tree.IDsToNodeIndexes[_ID] = treeIndex; + tree.nodeIndexesToIDs[treeIndex] = _ID; + + _updateParents(_key, treeIndex, true, _value); + } + } else { + // Existing node. + if (_value == 0) { + // Zero value. + // Remove. + // Remember value and set to 0. + uint256 value = tree.nodes[treeIndex]; + tree.nodes[treeIndex] = 0; + + // Push to stack. + tree.stack.push(treeIndex); + + // Clear label. + delete tree.IDsToNodeIndexes[_ID]; + delete tree.nodeIndexesToIDs[treeIndex]; + + _updateParents(_key, treeIndex, false, value); + } else if (_value != tree.nodes[treeIndex]) { + // New, non zero value. + // Set. + bool plusOrMinus = tree.nodes[treeIndex] <= _value; + uint256 plusOrMinusValue = plusOrMinus + ? _value - tree.nodes[treeIndex] + : tree.nodes[treeIndex] - _value; + tree.nodes[treeIndex] = _value; + + _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue); + } + } + } + + /// @dev Packs an account and a court ID into a stake path ID. + /// @param _account The address of the juror to pack. + /// @param _courtID The court ID to pack. + /// @return stakePathID The stake path ID. + function _accountAndCourtIDToStakePathID( + address _account, + uint96 _courtID + ) internal pure returns (bytes32 stakePathID) { + assembly { + // solium-disable-line security/no-inline-assembly + let ptr := mload(0x40) + for { + let i := 0x00 + } lt(i, 0x14) { + i := add(i, 0x01) + } { + mstore8(add(ptr, i), byte(add(0x0c, i), _account)) + } + for { + let i := 0x14 + } lt(i, 0x20) { + i := add(i, 0x01) + } { + mstore8(add(ptr, i), byte(i, _courtID)) + } + stakePathID := mload(ptr) + } + } +} diff --git a/contracts/src/arbitration/SortitionModuleNeo.sol b/contracts/src/arbitration/SortitionModuleNeo.sol new file mode 100644 index 000000000..e7e8bed7c --- /dev/null +++ b/contracts/src/arbitration/SortitionModuleNeo.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT + +/** + * @custom:authors: [@jaybuidl, @unknownunknown1] + * @custom:reviewers: [] + * @custom:auditors: [] + * @custom:bounties: [] + * @custom:deployments: [] + */ + +pragma solidity 0.8.18; + +import "./SortitionModuleBase.sol"; +import "../proxy/UUPSProxiable.sol"; +import "../proxy/Initializable.sol"; + +/// @title SortitionModuleNeo +/// @dev A factory of trees that keeps track of staked values for sortition. +contract SortitionModuleNeo is SortitionModuleBase, UUPSProxiable, Initializable { + // ************************************* // + // * Storage * // + // ************************************* // + + uint256 public maxStakePerJuror; + uint256 public maxTotalStaked; + uint256 public totalStaked; + + // ************************************* // + // * Constructor * // + // ************************************* // + + /// @dev Constructor, initializing the implementation to reduce attack surface. + constructor() { + _disableInitializers(); + } + + /// @dev Initializer (constructor equivalent for upgradable contracts). + /// @param _governor The governor. + /// @param _core The KlerosCore. + /// @param _minStakingTime Minimal time to stake + /// @param _maxDrawingTime Time after which the drawing phase can be switched + /// @param _rng The random number generator. + /// @param _rngLookahead Lookahead value for rng. + /// @param _maxStakePerJuror The maximum amount of PNK a juror can stake in a court. + /// @param _maxTotalStaked The maximum amount of PNK that can be staked in all courts. + function initialize( + address _governor, + KlerosCore _core, + uint256 _minStakingTime, + uint256 _maxDrawingTime, + RNG _rng, + uint256 _rngLookahead, + uint256 _maxStakePerJuror, + uint256 _maxTotalStaked + ) external reinitializer(2) { + super._initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead); + maxStakePerJuror = _maxStakePerJuror; + maxTotalStaked = _maxTotalStaked; + } + + // ************************************* // + // * Governance * // + // ************************************* // + + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) + function _authorizeUpgrade(address) internal view override onlyByGovernor { + // NOP + } + + function changeMaxStakePerJuror(uint256 _maxStakePerJuror) external onlyByGovernor { + maxStakePerJuror = _maxStakePerJuror; + } + + function changeMaxTotalStaked(uint256 _maxTotalStaked) external onlyByGovernor { + maxTotalStaked = _maxTotalStaked; + } + + // ************************************* // + // * State Modifiers * // + // ************************************* // + + function _setStake( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred + ) internal override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) { + uint256 currentStake = stakeOf(_account, _courtID); + bool stakeIncrease = _newStake > currentStake; + uint256 stakeChange = stakeIncrease ? _newStake - currentStake : currentStake - _newStake; + Juror storage juror = jurors[_account]; + if (stakeIncrease && !_alreadyTransferred) { + if (juror.stakedPnk + stakeChange > maxStakePerJuror) { + return (0, 0, StakingResult.CannotStakeMoreThanMaxStakePerJuror); + } + if (totalStaked + stakeChange > maxTotalStaked) { + return (0, 0, StakingResult.CannotStakeMoreThanMaxTotalStaked); + } + } + if (phase == Phase.staking) { + if (stakeIncrease) { + totalStaked += stakeChange; + } else { + totalStaked -= stakeChange; + } + } + (pnkDeposit, pnkWithdrawal, stakingResult) = super._setStake( + _account, + _courtID, + _newStake, + _alreadyTransferred + ); + } +} diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol index ad71e91a9..fcb924300 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol @@ -159,10 +159,8 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { // * Governance * // // ************************ // - /** - * @dev Access Control to perform implementation upgrades (UUPS Proxiable) - * @dev Only the governor can perform upgrades (`onlyByGovernor`) - */ + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) function _authorizeUpgrade(address) internal view override onlyByGovernor { // NOP } @@ -263,7 +261,7 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { bytes32 _commit ) external notJumped(_coreDisputeID) { (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); - require(period == KlerosCore.Period.commit, "The dispute should be in Commit period."); + require(period == KlerosCoreBase.Period.commit, "The dispute should be in Commit period."); require(_commit != bytes32(0), "Empty commit."); Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]]; @@ -292,7 +290,7 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { string memory _justification ) external notJumped(_coreDisputeID) { (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); - require(period == KlerosCore.Period.vote, "The dispute should be in Vote period."); + require(period == KlerosCoreBase.Period.vote, "The dispute should be in Vote period."); require(_voteIDs.length > 0, "No voteID provided"); Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]]; @@ -404,6 +402,7 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { } /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved. + /// Note that withdrawals are not possible if the core contract is paused. /// @param _coreDisputeID Index of the dispute in Kleros Core contract. /// @param _beneficiary The address whose rewards to withdraw. /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from. @@ -417,6 +416,7 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { ) external returns (uint256 amount) { (, , , bool isRuled, ) = core.disputes(_coreDisputeID); require(isRuled, "Dispute should be resolved."); + require(!core.paused(), "Core is paused"); Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]]; Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]]; @@ -471,7 +471,7 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { ruling = tied ? 0 : round.winningChoice; (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); // Override the final ruling if only one side funded the appeals. - if (period == KlerosCore.Period.execution) { + if (period == KlerosCoreBase.Period.execution) { uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID); if (fundedChoices.length == 1) { ruling = fundedChoices[0]; diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol index 8767cc8a9..2d65aca07 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol @@ -170,10 +170,8 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { // * Governance * // // ************************ // - /** - * @dev Access Control to perform implementation upgrades (UUPS Proxiable) - * @dev Only the governor can perform upgrades (`onlyByGovernor`) - */ + /// @dev Access Control to perform implementation upgrades (UUPS Proxiable) + /// Only the governor can perform upgrades (`onlyByGovernor`) function _authorizeUpgrade(address) internal view override onlyByGovernor { // NOP } @@ -281,7 +279,7 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { bytes32 _commit ) external notJumped(_coreDisputeID) { (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); - require(period == KlerosCore.Period.commit, "The dispute should be in Commit period."); + require(period == KlerosCoreBase.Period.commit, "The dispute should be in Commit period."); require(_commit != bytes32(0), "Empty commit."); Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]]; @@ -310,7 +308,7 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { string memory _justification ) external notJumped(_coreDisputeID) { (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); - require(period == KlerosCore.Period.vote, "The dispute should be in Vote period."); + require(period == KlerosCoreBase.Period.vote, "The dispute should be in Vote period."); require(_voteIDs.length > 0, "No voteID provided"); Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]]; @@ -422,6 +420,7 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { } /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved. + /// Note that withdrawals are not possible if the core contract is paused. /// @param _coreDisputeID Index of the dispute in Kleros Core contract. /// @param _beneficiary The address whose rewards to withdraw. /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from. @@ -435,6 +434,7 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { ) external returns (uint256 amount) { (, , , bool isRuled, ) = core.disputes(_coreDisputeID); require(isRuled, "Dispute should be resolved."); + require(!core.paused(), "Core is paused"); Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]]; Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]]; @@ -489,7 +489,7 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { ruling = tied ? 0 : round.winningChoice; (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); // Override the final ruling if only one side funded the appeals. - if (period == KlerosCore.Period.execution) { + if (period == KlerosCoreBase.Period.execution) { uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID); if (fundedChoices.length == 1) { ruling = fundedChoices[0]; diff --git a/contracts/src/arbitration/interfaces/IArbitrableV2.sol b/contracts/src/arbitration/interfaces/IArbitrableV2.sol index e17603a3e..cc8554efa 100644 --- a/contracts/src/arbitration/interfaces/IArbitrableV2.sol +++ b/contracts/src/arbitration/interfaces/IArbitrableV2.sol @@ -6,7 +6,7 @@ import "./IArbitratorV2.sol"; /// @title IArbitrableV2 /// @notice Arbitrable interface. -/// When developing arbitrable contracts, we need to: +/// @dev When developing arbitrable contracts, we need to: /// - Define the action taken when a ruling is received by the contract. /// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData); interface IArbitrableV2 { diff --git a/contracts/src/arbitration/interfaces/ISortitionModule.sol b/contracts/src/arbitration/interfaces/ISortitionModule.sol index 4474f646e..2a3c34df8 100644 --- a/contracts/src/arbitration/interfaces/ISortitionModule.sol +++ b/contracts/src/arbitration/interfaces/ISortitionModule.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.18; +import "../../libraries/Constants.sol"; + interface ISortitionModule { enum Phase { staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors. @@ -17,7 +19,7 @@ interface ISortitionModule { uint96 _courtID, uint256 _newStake, bool _alreadyTransferred - ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded); + ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult); function setJurorInactive(address _account) external; diff --git a/contracts/src/arbitration/university/KlerosCoreUniversity.sol b/contracts/src/arbitration/university/KlerosCoreUniversity.sol index 401dff6bc..ddbf93775 100644 --- a/contracts/src/arbitration/university/KlerosCoreUniversity.sol +++ b/contracts/src/arbitration/university/KlerosCoreUniversity.sol @@ -6,8 +6,7 @@ import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitratorV2.sol"; import {IDisputeKit} from "../interfaces/IDisputeKit.sol"; import {ISortitionModuleUniversity} from "./ISortitionModuleUniversity.sol"; import {SafeERC20, IERC20} from "../../libraries/SafeERC20.sol"; -import {Constants} from "../../libraries/Constants.sol"; -import {OnError} from "../../libraries/Types.sol"; +import "../../libraries/Constants.sol"; import {UUPSProxiable} from "../../proxy/UUPSProxiable.sol"; import {Initializable} from "../../proxy/Initializable.sol"; @@ -219,7 +218,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { // DISPUTE_KIT_CLASSIC disputeKits.push(_disputeKit); - emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit); + emit DisputeKitCreated(DISPUTE_KIT_CLASSIC, _disputeKit); // FORKING_COURT // TODO: Fill the properties for the Forking court, emit CourtCreated. @@ -227,7 +226,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { // GENERAL_COURT Court storage court = courts.push(); - court.parent = Constants.FORKING_COURT; + court.parent = FORKING_COURT; court.children = new uint256[](0); court.hiddenVotes = _hiddenVotes; court.minStake = _courtParameters[0]; @@ -247,7 +246,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { _timesPerPeriod, new uint256[](0) ); - _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true); + _enableDisputeKit(GENERAL_COURT, DISPUTE_KIT_CLASSIC, true); } // ************************************* // @@ -334,7 +333,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { ) external onlyByGovernor { if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt(); if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit(); - if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent(); + if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent(); uint256 courtID = courts.length; Court storage court = courts.push(); @@ -346,7 +345,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { court.supportedDisputeKits[_supportedDisputeKits[i]] = true; } // Check that Classic DK support was added. - if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic(); + if (!court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic(); court.parent = _parent; court.children = new uint256[](0); @@ -382,7 +381,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { uint256[4] memory _timesPerPeriod ) external onlyByGovernor { Court storage court = courts[_courtID]; - if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) { + if (_courtID != GENERAL_COURT && courts[court.parent].minStake > _minStake) { revert MinStakeLowerThanParentCourt(); } for (uint256 i = 0; i < court.children.length; i++) { @@ -420,7 +419,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { _enableDisputeKit(_courtID, _disputeKitIDs[i], true); } else { // Classic dispute kit must be supported by all courts. - if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) { + if (_disputeKitIDs[i] == DISPUTE_KIT_CLASSIC) { revert CannotDisableClassicDK(); } _enableDisputeKit(_courtID, _disputeKitIDs[i], false); @@ -480,7 +479,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { ) external payable override returns (uint256 disputeID) { if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough(); - return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value); + return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value); } /// @inheritdoc IArbitratorV2 @@ -517,7 +516,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { Round storage round = dispute.rounds.push(); // Obtain the feeForJuror in the same currency as the _feeAmount - uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY) + uint256 feeForJuror = (_feeToken == NATIVE_CURRENCY) ? court.feeForJuror : convertEthToTokenAmount(_feeToken, court.feeForJuror); round.nbVotes = _feeAmount / feeForJuror; @@ -634,7 +633,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) { // Switch to classic dispute kit if parent court doesn't support the current one. - newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC; + newDisputeKitID = DISPUTE_KIT_CLASSIC; } if (newCourtID != dispute.courtID) { @@ -785,7 +784,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { } if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) { // No one was coherent, send the rewards to the governor. - if (round.feeToken == Constants.NATIVE_CURRENCY) { + if (round.feeToken == NATIVE_CURRENCY) { // The dispute fees were paid in ETH payable(governor).send(round.totalFeesForJurors); } else { @@ -842,7 +841,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR; round.sumFeeRewardPaid += feeReward; pinakion.safeTransfer(account, pnkReward); - if (round.feeToken == Constants.NATIVE_CURRENCY) { + if (round.feeToken == NATIVE_CURRENCY) { // The dispute fees were paid in ETH payable(account).send(feeReward); } else { @@ -868,7 +867,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { pinakion.safeTransfer(governor, leftoverPnkReward); } if (leftoverFeeReward != 0) { - if (round.feeToken == Constants.NATIVE_CURRENCY) { + if (round.feeToken == NATIVE_CURRENCY) { // The dispute fees were paid in ETH payable(governor).send(leftoverFeeReward); } else { @@ -931,7 +930,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { Court storage court = courts[dispute.courtID]; if (round.nbVotes >= court.jurorsForCourtJump) { // Jump to parent court. - if (dispute.courtID == Constants.GENERAL_COURT) { + if (dispute.courtID == GENERAL_COURT) { // TODO: Handle the forking when appealed in General court. cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court. } else { @@ -1051,33 +1050,33 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { bool _alreadyTransferred, OnError _onError ) internal returns (bool) { - if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) { - _stakingFailed(_onError); // Staking directly into the forking court is not allowed. + if (_courtID == FORKING_COURT || _courtID > courts.length) { + _stakingFailed(_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed. return false; } if (_newStake != 0 && _newStake < courts[_courtID].minStake) { - _stakingFailed(_onError); // Staking less than the minimum stake is not allowed. + _stakingFailed(_onError, StakingResult.CannotStakeLessThanMinStake); // Staking less than the minimum stake is not allowed. return false; } - (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake( + (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) = sortitionModule.setStake( _account, _courtID, _newStake, _alreadyTransferred ); - if (!sortitionSuccess) { - _stakingFailed(_onError); + if (stakingResult != StakingResult.Successful) { + _stakingFailed(_onError, stakingResult); return false; } if (pnkDeposit > 0) { if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) { - _stakingFailed(_onError); + _stakingFailed(_onError, StakingResult.StakingTransferFailed); return false; } } if (pnkWithdrawal > 0) { if (!pinakion.safeTransfer(_account, pnkWithdrawal)) { - _stakingFailed(_onError); + _stakingFailed(_onError, StakingResult.UnstakingTransferFailed); return false; } } @@ -1085,9 +1084,13 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { } /// @dev It may revert depending on the _onError parameter. - function _stakingFailed(OnError _onError) internal pure { + function _stakingFailed(OnError _onError, StakingResult _result) internal pure virtual { if (_onError == OnError.Return) return; - revert StakingFailed(); + if (_result == StakingResult.StakingTransferFailed) revert StakingTransferFailed(); + if (_result == StakingResult.UnstakingTransferFailed) revert UnstakingTransferFailed(); + if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts(); + if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt(); + if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake(); } /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array. @@ -1107,19 +1110,19 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { minJurors := mload(add(_extraData, 0x40)) disputeKitID := mload(add(_extraData, 0x60)) } - if (courtID == Constants.FORKING_COURT || courtID >= courts.length) { - courtID = Constants.GENERAL_COURT; + if (courtID == FORKING_COURT || courtID >= courts.length) { + courtID = GENERAL_COURT; } if (minJurors == 0) { - minJurors = Constants.DEFAULT_NB_OF_JURORS; + minJurors = DEFAULT_NB_OF_JURORS; } - if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) { - disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used. + if (disputeKitID == NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) { + disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used. } } else { - courtID = Constants.GENERAL_COURT; - minJurors = Constants.DEFAULT_NB_OF_JURORS; - disputeKitID = Constants.DISPUTE_KIT_CLASSIC; + courtID = GENERAL_COURT; + minJurors = DEFAULT_NB_OF_JURORS; + disputeKitID = DISPUTE_KIT_CLASSIC; } } @@ -1141,7 +1144,11 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable { error WrongDisputeKitIndex(); error CannotDisableClassicDK(); error ArraysLengthMismatch(); - error StakingFailed(); + error StakingInTooManyCourts(); + error StakingNotPossibeInThisCourt(); + error StakingLessThanCourtMinStake(); + error StakingTransferFailed(); + error UnstakingTransferFailed(); error ArbitrationFeesNotEnough(); error DisputeKitNotSupportedByCourt(); error MustSupportDisputeKitClassic(); diff --git a/contracts/src/arbitration/university/SortitionModuleUniversity.sol b/contracts/src/arbitration/university/SortitionModuleUniversity.sol index 379231f5d..c21d0b230 100644 --- a/contracts/src/arbitration/university/SortitionModuleUniversity.sol +++ b/contracts/src/arbitration/university/SortitionModuleUniversity.sol @@ -126,18 +126,19 @@ contract SortitionModuleUniversity is ISortitionModuleUniversity, UUPSProxiable, /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. /// @return pnkDeposit The amount of PNK to be deposited. /// @return pnkWithdrawal The amount of PNK to be withdrawn. - /// @return succeeded True if the call succeeded, false otherwise. + /// @return stakingResult The result of the staking operation. function setStake( address _account, uint96 _courtID, uint256 _newStake, bool _alreadyTransferred - ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) { + ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, StakingResult stakingResult) { Juror storage juror = jurors[_account]; uint256 currentStake = _stakeOf(_account, _courtID); - if (_newStake == 0 && currentStake == 0) { - return (0, 0, false); + uint256 nbCourts = juror.courtIDs.length; + if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) { + return (0, 0, StakingResult.CannotStakeInMoreCourts); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. } if (_newStake >= currentStake) { @@ -154,14 +155,14 @@ contract SortitionModuleUniversity is ISortitionModuleUniversity, UUPSProxiable, // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn. juror.stakesByCourtID[currentCourtID] += _newStake; juror.stakesByCourtID[currentCourtID] -= currentStake; - if (currentCourtID == Constants.GENERAL_COURT) { + if (currentCourtID == GENERAL_COURT) { finished = true; } else { (currentCourtID, , , , , , ) = core.courts(currentCourtID); } } emit StakeSet(_account, _courtID, _newStake); - return (pnkDeposit, pnkWithdrawal, true); + return (pnkDeposit, pnkWithdrawal, StakingResult.Successful); } function _increaseStake( diff --git a/contracts/src/gateway/ForeignGateway.sol b/contracts/src/gateway/ForeignGateway.sol index acce881b1..4bf43bf68 100644 --- a/contracts/src/gateway/ForeignGateway.sol +++ b/contracts/src/gateway/ForeignGateway.sol @@ -266,10 +266,10 @@ contract ForeignGateway is IForeignGateway, UUPSProxiable, Initializable { minJurors := mload(add(_extraData, 0x40)) } if (feeForJuror[courtID] == 0) courtID = 0; - if (minJurors == 0) minJurors = Constants.DEFAULT_NB_OF_JURORS; + if (minJurors == 0) minJurors = DEFAULT_NB_OF_JURORS; } else { courtID = 0; - minJurors = Constants.DEFAULT_NB_OF_JURORS; + minJurors = DEFAULT_NB_OF_JURORS; } } } diff --git a/contracts/src/gateway/HomeGateway.sol b/contracts/src/gateway/HomeGateway.sol index 5c232cd29..93eff40fb 100644 --- a/contracts/src/gateway/HomeGateway.sol +++ b/contracts/src/gateway/HomeGateway.sol @@ -133,7 +133,7 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable { /// @inheritdoc IHomeGateway function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable override { - require(feeToken == Constants.NATIVE_CURRENCY, "Fees paid in ERC20 only"); + require(feeToken == NATIVE_CURRENCY, "Fees paid in ERC20 only"); require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); bytes32 disputeHash = keccak256( @@ -171,7 +171,7 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable { /// @inheritdoc IHomeGateway function relayCreateDispute(RelayCreateDisputeParams memory _params, uint256 _feeAmount) external { - require(feeToken != Constants.NATIVE_CURRENCY, "Fees paid in native currency only"); + require(feeToken != NATIVE_CURRENCY, "Fees paid in native currency only"); require(_params.foreignChainID == foreignChainID, "Foreign chain ID not supported"); bytes32 disputeHash = keccak256( diff --git a/contracts/src/libraries/Constants.sol b/contracts/src/libraries/Constants.sol index ddf0adcb5..e6a9d8554 100644 --- a/contracts/src/libraries/Constants.sol +++ b/contracts/src/libraries/Constants.sol @@ -4,17 +4,34 @@ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -/// @title Constants -library Constants { - // Courts - uint96 internal constant FORKING_COURT = 0; // Index of the forking court. - uint96 internal constant GENERAL_COURT = 1; // Index of the default (general) court. - - // Dispute Kits - uint256 internal constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent. - uint256 internal constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped. - - // Defaults - uint256 internal constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute. - IERC20 internal constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1. +// Courts +uint96 constant FORKING_COURT = 0; // Index of the forking court. +uint96 constant GENERAL_COURT = 1; // Index of the default (general) court. + +// Dispute Kits +uint256 constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent. +uint256 constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped. + +// Sortition Module +uint256 constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have. +uint256 constant DEFAULT_K = 6; // Default number of children per node. + +// Defaults +uint256 constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute. +IERC20 constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1. + +enum OnError { + Revert, + Return +} + +enum StakingResult { + Successful, + StakingTransferFailed, + UnstakingTransferFailed, + CannotStakeInMoreCourts, + CannotStakeInThisCourt, + CannotStakeLessThanMinStake, + CannotStakeMoreThanMaxStakePerJuror, + CannotStakeMoreThanMaxTotalStaked } diff --git a/contracts/src/libraries/Types.sol b/contracts/src/libraries/Types.sol deleted file mode 100644 index f575ca129..000000000 --- a/contracts/src/libraries/Types.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -enum OnError { - Revert, - Return -} diff --git a/contracts/src/token/TestERC721.sol b/contracts/src/token/TestERC721.sol new file mode 100644 index 000000000..e81341ebc --- /dev/null +++ b/contracts/src/token/TestERC721.sol @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.18; + +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; + +contract TestERC721 is ERC721, ERC721Enumerable { + // ************************************* // + // * Storage * // + // ************************************* // + + address public owner; + uint256 private _nextTokenId; + + // ************************************* // + // * Constructor * // + // ************************************* // + + constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) { + owner = msg.sender; + } + + // ************************************* // + // * Function Modifiers * // + // ************************************* // + + modifier ownerOnly() { + require(msg.sender == owner, "Owner only"); + _; + } + + // ************************************* // + // * Governance * // + // ************************************* // + + function changeOwner(address _newOwner) external ownerOnly { + owner = _newOwner; + } + + // ************************************* // + // * State Modifiers * // + // ************************************* // + + function safeMint(address to) external ownerOnly { + uint256 tokenId = _nextTokenId++; + _safeMint(to, tokenId); + } + + // ************************************* // + // * Public Views * // + // ************************************* // + + function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { + return super.supportsInterface(interfaceId); + } + + // ************************************* // + // * Internal * // + // ************************************* // + + function _beforeTokenTransfer( + address from, + address to, + uint256 firstTokenId, + uint256 batchSize + ) internal virtual override(ERC721, ERC721Enumerable) { + super._beforeTokenTransfer(from, to, firstTokenId, batchSize); + } +} diff --git a/contracts/test/arbitration/staking-neo.ts b/contracts/test/arbitration/staking-neo.ts new file mode 100644 index 000000000..68f870125 --- /dev/null +++ b/contracts/test/arbitration/staking-neo.ts @@ -0,0 +1,753 @@ +import { ethers, getNamedAccounts, network, deployments } from "hardhat"; +const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs"); +import { BigNumber } from "ethers"; +import { + PNK, + RandomizerRNG, + RandomizerMock, + SortitionModuleNeo, + KlerosCoreNeo, + TestERC721, + DisputeResolver, +} from "../../typechain-types"; +import { expect } from "chai"; + +/* eslint-disable no-unused-vars */ +/* eslint-disable no-unused-expressions */ + +/************************************************************************************************ +Neo should behave like an arbitrator when all the following conditions are met: +- maxStake is high enough, +- totalMaxStaked is high enough, +- the juror has a NFT +- the arbitrable is whitelisted + +Otherwise it should behave like a Neo arbitrator. +************************************************************************************************/ + +// TODO: assert on sortition.totalStaked in happy case + +describe("Staking", async () => { + const ETH = (amount: number) => ethers.utils.parseUnits(amount.toString()); + const PNK = ETH; + + // 2nd court, 3 jurors, 1 dispute kit + const extraData = + "0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001"; + + let deployer; + let juror; + let guardian; + let pnk; + let core; + let sortition; + let rng; + let randomizer; + let nft; + let resolver; + let balanceBefore; + + const deployUnhappy = async () => { + ({ deployer } = await getNamedAccounts()); + await deployments.fixture(["ArbitrationNeo"], { + fallbackToGlobal: true, + keepExistingDeployments: false, + }); + pnk = (await ethers.getContract("PNK")) as PNK; + core = (await ethers.getContract("KlerosCoreNeo")) as KlerosCoreNeo; + sortition = (await ethers.getContract("SortitionModuleNeo")) as SortitionModuleNeo; + rng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG; + randomizer = (await ethers.getContract("RandomizerOracle")) as RandomizerMock; + resolver = (await ethers.getContract("DisputeResolverNeo")) as DisputeResolver; + nft = (await ethers.getContract("KlerosV2NeoEarlyUser")) as TestERC721; + + // Juror signer setup and funding + const { firstWallet } = await getNamedAccounts(); + juror = await ethers.getSigner(firstWallet); + await pnk.transfer(juror.address, PNK(100_000)); + await ethers.getSigner(deployer).then((signer) => signer.sendTransaction({ to: juror.address, value: ETH(1) })); + + // Set new guardian + const { secondWallet } = await getNamedAccounts(); + guardian = await ethers.getSigner(secondWallet); + await ethers.getSigner(deployer).then((signer) => signer.sendTransaction({ to: guardian.address, value: ETH(1) })); + await core.changeGuardian(guardian.address); + }; + + const deploy = async () => { + await deployUnhappy(); + + // Sets up the happy path for Neo + await nft.safeMint(deployer); + await nft.safeMint(juror.address); + await sortition.changeMaxStakePerJuror(PNK(10_000)); + await sortition.changeMaxTotalStaked(PNK(20_000)); + }; + + const createDisputeAndReachGeneratingPhaseFromStaking = async () => { + const arbitrationCost = ETH(0.5); + await resolver.createDisputeForTemplate(extraData, "", "", 2, { value: arbitrationCost }); + await reachGeneratingPhaseFromStaking(); + }; + + const reachGeneratingPhaseFromStaking = async () => { + await network.provider.send("evm_increaseTime", [3600]); // Wait for minStakingTime + await network.provider.send("evm_mine"); + + expect(await sortition.phase()).to.be.equal(0); // Staking + await sortition.passPhase(); // Staking -> Generating + expect(await sortition.phase()).to.be.equal(1); // Generating + }; + + const drawFromGeneratingPhase = async () => { + expect(await sortition.phase()).to.be.equal(1); // Generating + + const lookahead = await sortition.rngLookahead(); + for (let index = 0; index < lookahead; index++) { + await network.provider.send("evm_mine"); + } + + await randomizer.relay(rng.address, 0, ethers.utils.randomBytes(32)); + await sortition.passPhase(); // Generating -> Drawing + expect(await sortition.phase()).to.be.equal(2); // Drawing + + await core.draw(0, 10); + }; + + const drawAndReachStakingPhaseFromGenerating = async () => { + await drawFromGeneratingPhase(); + + await network.provider.send("evm_increaseTime", [3600]); // Ensures that maxDrawingTime has passed + await network.provider.send("evm_mine"); + + await sortition.passPhase(); // Drawing -> Staking + expect(await sortition.phase()).to.be.equal(0); // Staking + }; + + /************************************************************************************************ + SHOULD BEHAVE LIKE A NEO ARBITRATOR + ************************************************************************************************/ + + describe("When arbitrable is not whitelisted", () => { + before("Setup", async () => { + await deployUnhappy(); + await core.changeArbitrableWhitelist(resolver.address, false); + }); + + it("Should fail to create a dispute", async () => { + const arbitrationCost = ETH(0.5); + await expect( + resolver.createDisputeForTemplate(extraData, "", "", 2, { value: arbitrationCost }) + ).to.be.revertedWithCustomError(core, "ArbitrableNotWhitelisted"); + }); + }); + + describe("When arbitrable is whitelisted", () => { + before("Setup", async () => { + await deployUnhappy(); + await core.changeArbitrableWhitelist(resolver.address, true); + }); + + it("Should create a dispute", async () => { + const arbitrationCost = ETH(0.5); + expect(await resolver.createDisputeForTemplate(extraData, "", "", 2, { value: arbitrationCost })) + .to.emit(core, "DisputeCreation") + .withArgs(1, resolver.address); + }); + }); + + describe("When juror has no NFT", async () => { + before("Setup", async () => { + await deployUnhappy(); + }); + + it("Should not be able to stake", async () => { + await pnk.connect(juror).approve(core.address, PNK(1000)); + await expect(core.connect(juror).setStake(1, PNK(1000))).to.be.revertedWithCustomError( + core, + "NotEligibleForStaking" + ); + }); + }); + + describe("When juror does have a NFT", async () => { + before("Setup", async () => { + await deployUnhappy(); + await nft.safeMint(juror.address); + }); + + it("Should be able to stake", async () => { + await pnk.connect(juror).approve(core.address, PNK(1000)); + await expect(await core.connect(juror).setStake(1, PNK(1000))) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(1000)); + expect(await sortition.totalStaked()).to.be.equal(PNK(1000)); + }); + }); + + describe("When juror stakes less", async () => { + beforeEach("Setup", async () => { + await deployUnhappy(); + await nft.safeMint(juror.address); + + await pnk.connect(juror).approve(core.address, PNK(10_000)); + await core.connect(juror).setStake(1, PNK(1000)); + }); + + describe("When stakes are NOT delayed", () => { + it("Should be able to unstake", async () => { + expect(await core.connect(juror).setStake(1, PNK(500))) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(500)); + expect(await sortition.totalStaked()).to.be.equal(PNK(500)); + + expect(await core.connect(juror).setStake(1, PNK(1001))) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(1001)); + expect(await sortition.totalStaked()).to.be.equal(PNK(1001)); + + expect(await core.connect(juror).setStake(1, PNK(0))) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(0)); + expect(await sortition.totalStaked()).to.be.equal(PNK(0)); + }); + }); + + describe("When stakes are delayed", () => { + beforeEach("Setup", async () => { + await createDisputeAndReachGeneratingPhaseFromStaking(); + }); + + it("Should be able to unstake", async () => { + expect(await core.connect(juror).setStake(1, PNK(0))) + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(juror.address, 1, PNK(0)) + .to.not.emit(sortition, "StakeSet"); + expect(await sortition.totalStaked()).to.be.equal(PNK(1000)); + await drawAndReachStakingPhaseFromGenerating(); + expect(await sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(0)); + }); + }); + }); + + describe("When juror stakes more", async () => { + beforeEach("Setup", async () => { + await deployUnhappy(); + await nft.safeMint(juror.address); + }); + + describe("When totalStaked is low", async () => { + describe("When stakes are NOT delayed", () => { + it("Should not be able to stake more than maxStakePerJuror", async () => { + await pnk.connect(juror).approve(core.address, PNK(5000)); + await expect(core.connect(juror).setStake(1, PNK(5000))).to.be.revertedWithCustomError( + core, + "StakingMoreThanMaxStakePerJuror" + ); + expect(await sortition.totalStaked()).to.be.equal(PNK(0)); + }); + }); + + describe("When stakes are delayed", () => { + it("Should not be able to stake more than maxStakePerJuror", async () => { + await createDisputeAndReachGeneratingPhaseFromStaking(); + await pnk.connect(juror).approve(core.address, PNK(5000)); + await expect(core.connect(juror).setStake(1, PNK(5000))).to.be.revertedWithCustomError( + core, + "StakingMoreThanMaxStakePerJuror" + ); + expect(await sortition.totalStaked()).to.be.equal(PNK(0)); + await drawAndReachStakingPhaseFromGenerating(); + await expect(sortition.executeDelayedStakes(10)).to.revertedWith("No delayed stake to execute."); + expect(await sortition.totalStaked()).to.be.equal(PNK(0)); + }); + + it("Should be able to stake exactly maxStakePerJuror", async () => { + await pnk.connect(juror).approve(core.address, PNK(5000)); + await core.connect(juror).setStake(1, PNK(1000)); + await createDisputeAndReachGeneratingPhaseFromStaking(); + expect(await core.connect(juror).setStake(1, PNK(2000))) + .to.emit(sortition, "StakeDelayedAlreadyTransferred") + .withArgs(juror.address, 1, PNK(2000)) + .to.not.emit(sortition, "StakeSet"); + expect(await sortition.totalStaked()).to.be.equal(PNK(1000)); + await drawAndReachStakingPhaseFromGenerating(); + expect(await sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(2000)); + expect(await sortition.totalStaked()).to.be.equal(PNK(2000)); + }); + }); + }); + + describe("When totalStaked is close to maxTotalStaked", async () => { + beforeEach("Setup", async () => { + await sortition.changeMaxTotalStaked(PNK(3000)); + + // deployer increases totalStaked to 2000 + await nft.safeMint(deployer); + await pnk.approve(core.address, PNK(2000)); + await core.setStake(1, PNK(2000)); + }); + + describe("When stakes are NOT delayed", () => { + it("Should not be able to stake more than maxTotalStaked", async () => { + await pnk.connect(juror).approve(core.address, PNK(2000)); + await expect(core.connect(juror).setStake(1, PNK(2000))).to.be.revertedWithCustomError( + core, + "StakingMoreThanMaxTotalStaked" + ); + expect(await sortition.totalStaked()).to.be.equal(PNK(2000)); + }); + + it("Should be able to stake exactly maxTotalStaked", async () => { + await pnk.connect(juror).approve(core.address, PNK(1000)); + await expect(await core.connect(juror).setStake(1, PNK(1000))) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(1000)); + expect(await sortition.totalStaked()).to.be.equal(PNK(3000)); + }); + }); + + describe("When stakes are delayed", () => { + beforeEach("Setup", async () => { + await createDisputeAndReachGeneratingPhaseFromStaking(); + }); + + it("Should not be able to stake more than maxTotalStaked", async () => { + await pnk.connect(juror).approve(core.address, PNK(2000)); + await expect(core.connect(juror).setStake(1, PNK(2000))).to.be.revertedWithCustomError( + core, + "StakingMoreThanMaxTotalStaked" + ); + expect(await sortition.totalStaked()).to.be.equal(PNK(2000)); + await drawAndReachStakingPhaseFromGenerating(); + await expect(sortition.executeDelayedStakes(10)).to.revertedWith("No delayed stake to execute."); + expect(await sortition.totalStaked()).to.be.equal(PNK(2000)); + }); + + it("Should be able to stake exactly maxTotalStaked", async () => { + await pnk.connect(juror).approve(core.address, PNK(1000)); + await expect(await core.connect(juror).setStake(1, PNK(1000))) + .to.emit(sortition, "StakeDelayedAlreadyTransferred") + .withArgs(juror.address, 1, PNK(1000)); + expect(await sortition.totalStaked()).to.be.equal(PNK(2000)); // Not updated until the delayed stake is executed + await drawAndReachStakingPhaseFromGenerating(); + await expect(await sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(juror.address, 1, PNK(1000)); + expect(await sortition.totalStaked()).to.be.equal(PNK(3000)); + }); + }); + }); + }); + + /************************************************************************************************ + SHOULD BEHAVE LIKE A REGULAR ARBITRATOR + ************************************************************************************************/ + + describe("When not paused", () => { + beforeEach("Setup", async () => { + await deploy(); + }); + + it("Should not allow anyone except the guardian or the governor to pause", async () => { + await expect(core.connect(juror).pause()).to.be.revertedWithCustomError(core, "GuardianOrGovernorOnly"); + }); + + it("Should allow the guardian to pause", async () => { + expect(await core.connect(guardian).pause()).to.emit(core, "Paused"); + expect(await core.paused()).to.equal(true); + }); + + it("Should allow the governor to pause", async () => { + expect(await core.pause()).to.emit(core, "Paused"); + expect(await core.paused()).to.equal(true); + }); + }); + + describe("When paused", () => { + beforeEach("Setup", async () => { + await deploy(); + + await pnk.approve(core.address, PNK(2000)); + await core.setStake(1, PNK(500)); + + await core.connect(guardian).pause(); + }); + + it("Should allow only the governor to unpause", async () => { + await expect(core.connect(guardian).unpause()).to.be.revertedWithCustomError(core, "GovernorOnly"); + expect(await core.unpause()).to.emit(core, "Unpaused"); + expect(await core.paused()).to.equal(false); + }); + + it("Should prevent stake increases", async () => { + await expect(core.setStake(1, PNK(1000))).to.be.revertedWithCustomError(core, "WhenNotPausedOnly"); + }); + + it("Should prevent stake decreases", async () => { + await expect(core.setStake(1, PNK(0))).to.be.revertedWithCustomError(core, "WhenNotPausedOnly"); + }); + }); + + describe("When outside the Staking phase", async () => { + const createSubcourtStakeAndCreateDispute = async () => { + expect(await sortition.phase()).to.be.equal(0); // Staking + await core.createCourt(1, false, PNK(1000), 1000, ETH(0.1), 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit + + await pnk.approve(core.address, PNK(4000)); + await core.setStake(1, PNK(2000)); + await core.setStake(2, PNK(2000)); + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + + const arbitrationCost = ETH(0.1).mul(3); + await resolver.createDisputeForTemplate(extraData, "", "", 2, { value: arbitrationCost }); + }; + + describe("When stake is increased once", async () => { + before("Setup", async () => { + await deploy(); + await createSubcourtStakeAndCreateDispute(); + await reachGeneratingPhaseFromStaking(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Generating + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + }); + + describe("When stake is increased", () => { + it("Should transfer PNK but delay the stake increase", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + await pnk.approve(core.address, PNK(1000)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(3000))) + .to.emit(sortition, "StakeDelayedAlreadyTransferred") + .withArgs(deployer, 2, PNK(3000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(2000), 2]); // stake does not change + }); + + it("Should transfer some PNK out of the juror's account", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(PNK(1000))); // PNK is transferred out of the juror's account + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(3000), true]); + }); + }); + + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await drawAndReachStakingPhaseFromGenerating(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes", async () => { + await expect(await sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(3000)) + .to.not.emit(sortition, "StakeDelayedNotTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(5000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(3000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(2); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 1)).to.be.equal(0); // no delayed stakes left + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer + }); + }); + }); + + describe("When stake is decreased once", async () => { + before("Setup", async () => { + await deploy(); + await createSubcourtStakeAndCreateDispute(); + await reachGeneratingPhaseFromStaking(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Generating + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + }); + + describe("When stake is decreased", async () => { + it("Should delay the stake decrease", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(1000))) + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(1000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(1000), false]); + }); + }); + + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await drawAndReachStakingPhaseFromGenerating(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes by withdrawing PNK and reducing the stakes", async () => { + await expect(await sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(1000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(3000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(1000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(2); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 1)).to.be.equal(0); // no delayed stakes left + }); + + it("Should withdraw some PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(PNK(1000))); // No PNK transfer yet + }); + }); + }); + + describe("When stake is decreased then increased back", async () => { + before("Setup", async () => { + await deploy(); + await createSubcourtStakeAndCreateDispute(); + await reachGeneratingPhaseFromStaking(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Generating + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + }); + + describe("When stake is decreased", async () => { + it("Should delay the stake decrease", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(1000))) + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(1000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(1000), false]); + }); + }); + + describe("When stake is increased back to the previous amount", () => { + it("Should delay the stake increase", async () => { + balanceBefore = await pnk.balanceOf(deployer); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + await expect(core.setStake(2, PNK(2000))) + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(2000)) + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + }); + }); + + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await drawAndReachStakingPhaseFromGenerating(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes but the stakes should remain the same", async () => { + await expect(await sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(2000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(4000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(2000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + }); + }); + + describe("When stake is increased then decreased back", async () => { + before("Setup", async () => { + await deploy(); + await createSubcourtStakeAndCreateDispute(); + await reachGeneratingPhaseFromStaking(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Generating + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + }); + + describe("When stake is increased", () => { + it("Should transfer PNK but delay the stake increase", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + await pnk.approve(core.address, PNK(1000)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(3000))) + .to.emit(sortition, "StakeDelayedAlreadyTransferred") + .withArgs(deployer, 2, PNK(3000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(2000), 2]); // stake does not change + }); + + it("Should transfer some PNK out of the juror's account", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(PNK(1000))); // PNK is transferred out of the juror's account + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(3000), true]); + }); + }); + + describe("When stake is decreased back to the previous amount", () => { + it("Should cancel out the stake decrease back", async () => { + balanceBefore = await pnk.balanceOf(deployer); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + await expect(core.setStake(2, PNK(2000))) + .to.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn") + .withArgs(deployer, 2, PNK(1000)) + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(2000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake has changed immediately + }); + + it("Should transfer back some PNK to the juror", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(PNK(1000))); // PNK is sent back to the juror + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + }); + }); + + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await drawAndReachStakingPhaseFromGenerating(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes but the stakes should remain the same", async () => { + await expect(sortition.executeDelayedStakes(10)) + .to.emit(await sortition, "StakeSet") + .withArgs(deployer, 2, PNK(2000)) + .to.not.emit(sortition, "StakeDelayedNotTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(4000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(2000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + }); + }); + }); + + describe("When a juror is inactive", async () => { + before("Setup", async () => { + await deploy(); + }); + + it("Should unstake from all courts", async () => { + await core.createCourt(1, false, PNK(1000), 1000, ETH(0.1), 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit + + await pnk.approve(core.address, PNK(4000)); + await core.setStake(1, PNK(2000)); + await core.setStake(2, PNK(2000)); + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); + + await createDisputeAndReachGeneratingPhaseFromStaking(); + await drawAndReachStakingPhaseFromGenerating(); + + await core.passPeriod(0); // Evidence -> Voting + await core.passPeriod(0); // Voting -> Appeal + await core.passPeriod(0); // Appeal -> Execution + + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); + await core.execute(0, 0, 1); // 1 iteration should unstake from both courts + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([]); + }); + }); +}); diff --git a/cspell.json b/cspell.json index e0347b486..3c3c7b792 100644 --- a/cspell.json +++ b/cspell.json @@ -10,7 +10,10 @@ ], "words": [ "arbitrum", + "ARBMAINNET", + "ARBSEPOLIA", "autorestart", + "CHAINID", "codegen", "commify", "commitlint", diff --git a/subgraph/README.md b/subgraph/README.md index 843c3ce21..e061dfec3 100644 --- a/subgraph/README.md +++ b/subgraph/README.md @@ -2,6 +2,11 @@ ## Deployments +### V2 Neo + +- [Core](https://thegraph.com/studio/subgraph/kleros-v2-coreneo/) +- [Dispute Registry Template - Arbitrum One](https://thegraph.com/studio/subgraph/kleros-v2-drt/) + ### Testnet - [Core](https://thegraph.com/studio/subgraph/kleros-v2-core-testnet/) diff --git a/subgraph/core-neo/schema.graphql b/subgraph/core-neo/schema.graphql new file mode 120000 index 000000000..cfec42dfe --- /dev/null +++ b/subgraph/core-neo/schema.graphql @@ -0,0 +1 @@ +../core/schema.graphql \ No newline at end of file diff --git a/subgraph/core-neo/src b/subgraph/core-neo/src new file mode 120000 index 000000000..5bc79fa78 --- /dev/null +++ b/subgraph/core-neo/src @@ -0,0 +1 @@ +../core/src \ No newline at end of file diff --git a/subgraph/core-neo/subgraph.yaml b/subgraph/core-neo/subgraph.yaml new file mode 100644 index 000000000..0b07fb708 --- /dev/null +++ b/subgraph/core-neo/subgraph.yaml @@ -0,0 +1,163 @@ +specVersion: 0.0.4 +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum + name: KlerosCore + network: arbitrum-one + source: + address: "0xCd415C03dfa85B02646C7e2977F22a480c4354F1" + abi: KlerosCore + startBlock: 190274596 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - User + - Arbitrable + - TokenAndETHShift + - JurorTokensPerCourt + - Court + - Dispute + - Round + - Draw + - DisputeKit + - Counter + abis: + - name: SortitionModule + file: ../../contracts/deployments/arbitrum/SortitionModuleNeo.json + - name: DisputeKitClassic + file: ../../contracts/deployments/arbitrum/DisputeKitClassicNeo.json + - name: KlerosCore + file: ../../contracts/deployments/arbitrum/KlerosCoreNeo.json + eventHandlers: + - event: AppealDecision(indexed uint256,indexed address) + handler: handleAppealDecision + - event: DisputeCreation(indexed uint256,indexed address) + handler: handleDisputeCreation + - event: Draw(indexed address,indexed uint256,uint256,uint256) + handler: handleDraw + - event: NewPeriod(indexed uint256,uint8) + handler: handleNewPeriod + - event: CourtCreated(indexed uint256,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[]) + handler: handleCourtCreated + - event: CourtModified(indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4]) + handler: handleCourtModified + - event: DisputeKitCreated(indexed uint256,indexed address) + handler: handleDisputeKitCreated + - event: DisputeKitEnabled(indexed uint96,indexed uint256,indexed bool) + handler: handleDisputeKitEnabled + - event: TokenAndETHShift(indexed address,indexed uint256,indexed uint256,uint256,int256,int256,address) + handler: handleTokenAndETHShift + - event: Ruling(indexed address,indexed uint256,uint256) + handler: handleRuling + - event: AcceptedFeeToken(indexed address,indexed bool) + handler: handleAcceptedFeeToken + - event: CourtJump(indexed uint256,indexed uint256,indexed uint96,uint96) + handler: handleCourtJump + file: ./src/KlerosCore.ts + - kind: ethereum + name: PolicyRegistry + network: arbitrum-one + source: + address: "0x26c1980120F1C82cF611D666CE81D2b54d018547" + abi: PolicyRegistry + startBlock: 190274403 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - Court + abis: + - name: PolicyRegistry + file: ../../contracts/deployments/arbitrum/PolicyRegistry.json + eventHandlers: + - event: PolicyUpdate(indexed uint256,string,string) + handler: handlePolicyUpdate + file: ./src/PolicyRegistry.ts + - kind: ethereum + name: DisputeKitClassic + network: arbitrum-one + source: + address: "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9" + abi: DisputeKitClassic + startBlock: 190274518 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - ClassicDispute + - ClassicRound + - ClassicVote + - ClassicContribution + abis: + - name: DisputeKitClassic + file: ../../contracts/deployments/arbitrum/DisputeKitClassicNeo.json + - name: KlerosCore + file: ../../contracts/deployments/arbitrum/KlerosCoreNeo.json + eventHandlers: + - event: DisputeCreation(indexed uint256,uint256,bytes) + handler: handleDisputeCreation + - event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256) + handler: handleContributionEvent + - event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256) + handler: handleWithdrawal + - event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256) + handler: handleChoiceFunded + - event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string) + handler: handleVoteCast + - event: CommitCast(indexed uint256,indexed address,uint256[],bytes32) + handler: handleCommitCast + file: ./src/DisputeKitClassic.ts + - kind: ethereum + name: EvidenceModule + network: arbitrum-one + source: + address: "0xe62B776498F48061ef9425fCEf30F3d1370DB005" + abi: EvidenceModule + startBlock: 190274441 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - ClassicEvidenceGroup + - ClassicEvidence + abis: + - name: EvidenceModule + file: ../../contracts/deployments/arbitrum/EvidenceModule.json + eventHandlers: + - event: Evidence(indexed uint256,indexed address,string) + handler: handleEvidenceEvent + file: ./src/EvidenceModule.ts + - kind: ethereum + name: SortitionModule + network: arbitrum-one + source: + address: "0x614498118850184c62f82d08261109334bFB050f" + abi: SortitionModule + startBlock: 190274557 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - JurorTokensPerCourt + abis: + - name: SortitionModule + file: ../../contracts/deployments/arbitrum/SortitionModuleNeo.json + eventHandlers: + - event: StakeDelayedAlreadyTransferred(indexed address,uint256,uint256) + handler: handleStakeDelayedAlreadyTransferred + - event: StakeDelayedAlreadyTransferredWithdrawn(indexed address,indexed uint96,uint256) + handler: handleStakeDelayedAlreadyTransferredWithdrawn + - event: StakeDelayedNotTransferred(indexed address,uint256,uint256) + handler: handleStakeDelayedNotTransferred + - event: StakeLocked(indexed address,uint256,bool) + handler: handleStakeLocked + - event: StakeSet(indexed address,uint256,uint256) + handler: handleStakeSet + file: ./src/SortitionModule.ts diff --git a/subgraph/core-neo/tests b/subgraph/core-neo/tests new file mode 120000 index 000000000..88b04eec1 --- /dev/null +++ b/subgraph/core-neo/tests @@ -0,0 +1 @@ +../core/tests \ No newline at end of file diff --git a/subgraph/dispute-template-registry/subgraph.yaml b/subgraph/dispute-template-registry/subgraph.yaml index 3c35d7ca2..9d7ead2ae 100644 --- a/subgraph/dispute-template-registry/subgraph.yaml +++ b/subgraph/dispute-template-registry/subgraph.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: DisputeTemplateRegistry - network: arbitrum-sepolia + network: arbitrum-one source: - address: "0x596D3B09E684D62217682216e9b7a0De75933391" + address: "0x52c9f5634361eD3641016e5d9783310f9EFf9e25" abi: DisputeTemplateRegistry - startBlock: 3639191 + startBlock: 190274710 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -17,7 +17,7 @@ dataSources: - DisputeTemplate abis: - name: DisputeTemplateRegistry - file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json + file: ../../contracts/deployments/arbitrum/DisputeTemplateRegistry.json eventHandlers: - event: DisputeTemplate(indexed uint256,indexed string,string,string) handler: handleDisputeTemplate diff --git a/subgraph/package.json b/subgraph/package.json index 2d8774db8..dc8db49a5 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -5,7 +5,7 @@ "scripts": { "update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core/subgraph.yaml", "update:core:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia core/subgraph.yaml", - "update:core:arbitrum": "./scripts/update.sh arbitrum arbitrum core/subgraph.yaml", + "update:core:arbitrum": "./scripts/update.sh arbitrum arbitrum-one core/subgraph.yaml", "update:core:local": "./scripts/update.sh localhost mainnet core/subgraph.yaml", "codegen:core": "graph codegen --output-dir core/generated/ core/subgraph.yaml", "build:core": "graph build --output-dir core/build/ core/subgraph.yaml", @@ -17,19 +17,31 @@ "deploy:core:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-core-local --version-label v$(date +%s) core/subgraph.yaml", "rebuild-deploy:core:local": "yarn update:core:local && yarn codegen:core && yarn build:core && yarn create:local kleros/kleros-v2-core-local && yarn deploy:core:local", "": "------------------------------------------------------------------------------------------", + "update:core-neo:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core-neo/subgraph.yaml", + "update:core-neo:arbitrum": "./scripts/update.sh arbitrum arbitrum-one core-neo/subgraph.yaml", + "update:core-neo:local": "./scripts/update.sh localhost mainnet core-neo/subgraph.yaml", + "codegen:core-neo": "yarn codegen:core && graph codegen --output-dir core-neo/generated/ core-neo/subgraph.yaml", + "build:core-neo": "graph build --output-dir core-neo/build/ core-neo/subgraph.yaml", + "test:core-neo": "cd core-neo && graph test", + "clean:core-neo": "graph clean --codegen-dir core-neo/generated/ --build-dir core-neo/build/ && rm core-neo/subgraph.yaml.bak.*", + "deploy:core-neo:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-coreneo-devnet -l v$npm_package_version core-neo/subgraph.yaml", + "deploy:core-neo:arbitrum": "graph deploy --product subgraph-studio kleros-v2-coreneo -l v$npm_package_version core-neo/subgraph.yaml", + "deploy:core-neo:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-coreneo-local --version-label v$(date +%s) core-neo/subgraph.yaml", + "rebuild-deploy:core-neo:local": "yarn update:core-neo:local && yarn codegen:core-neo && yarn build:core-neo && yarn create:local kleros/kleros-v2-coreneo-local && yarn deploy:core-neo:local", + "-": "------------------------------------------------------------------------------------------", "update:core-university:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core-university/subgraph.yaml", "update:core-university:local": "./scripts/update.sh localhost mainnet core-university/subgraph.yaml", - "codegen:core-university": "graph codegen --output-dir core-university/generated/ core-university/subgraph.yaml", + "codegen:core-university": "yarn codegen:core && graph codegen --output-dir core-university/generated/ core-university/subgraph.yaml", "build:core-university": "graph build --output-dir core-university/build/ core-university/subgraph.yaml", "test:core-university": "cd core-university && graph test", "clean:core-university": "graph clean --codegen-dir core-university/generated/ --build-dir core-university/build/ && rm core-university/subgraph.yaml.bak.*", - "deploy:core-university:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-coreuni-devnet -l v$npm_package_version core/subgraph.yaml", + "deploy:core-university:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-coreuni-devnet -l v$npm_package_version core-university/subgraph.yaml", "deploy:core-university:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-coreuni-local --version-label v$(date +%s) core-university/subgraph.yaml", "rebuild-deploy:core-university:local": "yarn update:core-university:local && yarn codegen:core-university && yarn build:core-university && yarn create:local kleros/kleros-v2-coreuni-local && yarn deploy:core-university:local", - " ": "------------------------------------------------------------------------------------------", + "--": "-----------------------------------------------------------------------------------------", "update:drt:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia dispute-template-registry/subgraph.yaml", "update:drt:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia dispute-template-registry/subgraph.yaml", - "update:drt:arbitrum": "./scripts/update.sh arbitrum arbitrum dispute-template-registry/subgraph.yaml", + "update:drt:arbitrum": "./scripts/update.sh arbitrum arbitrum-one dispute-template-registry/subgraph.yaml", "update:drt:local": "./scripts/update.sh localhost mainnet dispute-template-registry/subgraph.yaml", "codegen:drt": "graph codegen --output-dir dispute-template-registry/generated/ dispute-template-registry/subgraph.yaml", "build:drt": "graph build --output-dir dispute-template-registry/generated/ dispute-template-registry/subgraph.yaml", @@ -37,19 +49,19 @@ "clean:drt": "graph clean --codegen-dir dispute-template-registry/generated/ --build-dir dispute-template-registry/build/ && rm dispute-template-registry/subgraph.yaml.bak.*", "deploy:drt:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-devnet -l v$npm_package_version dispute-template-registry/subgraph.yaml", "deploy:drt:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-testnet -l v$npm_package_version dispute-template-registry/subgraph.yaml", - "deploy:drt:arbitrum": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-mainnet -l v$npm_package_version dispute-template-registry/subgraph.yaml", + "deploy:drt:arbitrum": "graph deploy --product subgraph-studio kleros-v2-drt -l v$npm_package_version dispute-template-registry/subgraph.yaml", "deploy:drt:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-drt-local --version-label v$(date +%s) dispute-template-registry/subgraph.yaml", "rebuild-deploy:drt:local": "yarn update:drt:local && yarn codegen:drt && yarn build:drt && yarn create:local kleros/kleros-v2-drt-local && yarn deploy:drt:local", - " ": "-----------------------------------------------------------------------------------------", + "---": "----------------------------------------------------------------------------------------", "update:arbitrum-sepolia-devnet": "./scripts/all.sh update arbitrum-sepolia-devnet", "update:arbitrum-sepolia": "./scripts/all.sh update arbitrum-sepolia", - "update:arbitrum": "./scripts/all.sh update arbitrum", + "update:arbitrum": "./scripts/all.sh update arbitrum arbitrum-one", "update:local": "./scripts/all.sh update local", "clean": "./scripts/all.sh clean", "codegen": "./scripts/all.sh codegen", "build": "./scripts/all.sh build", "rebuild-deploy:local": "./scripts/all.sh rebuild-deploy local", - " ": "----------------------------------------------------------------------------------------", + "----": "--------------------------------------------------------------------------------------", "create:local": "graph create --node http://localhost:8020/", "remove:local": "graph remove --node http://localhost:8020/", "start-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml up -d && docker compose -f ../services/graph-node/docker-compose.yml logs -f", diff --git a/web/.env.devnet-neo.public b/web/.env.devnet-neo.public new file mode 100644 index 000000000..d60e1e408 --- /dev/null +++ b/web/.env.devnet-neo.public @@ -0,0 +1,7 @@ +# Do not enter sensitive information here. +export REACT_APP_DEPLOYMENT=devnet +export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-coreneo-devnet/version/latest +export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/version/latest +export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge +export REACT_APP_GENESIS_BLOCK_ARBSEPOLIA=3084598 +export REACT_APP_ARBITRATOR_TYPE=neo \ No newline at end of file diff --git a/web/.env.devnet-university.public b/web/.env.devnet-university.public index 5efc88b8e..c0ca09186 100644 --- a/web/.env.devnet-university.public +++ b/web/.env.devnet-university.public @@ -4,4 +4,4 @@ export REACT_APP_CORE_SUBGRAPH=https://api.thegraph.com/subgraphs/name/alcercu/k export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/version/latest export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge export REACT_APP_GENESIS_BLOCK_ARBSEPOLIA=3084598 -export REACT_APP_UNIVERSITY_COURT=true \ No newline at end of file +export REACT_APP_ARBITRATOR_TYPE=university \ No newline at end of file diff --git a/web/.env.mainnet-neo.public b/web/.env.mainnet-neo.public new file mode 100644 index 000000000..89633ce00 --- /dev/null +++ b/web/.env.mainnet-neo.public @@ -0,0 +1,7 @@ +# Do not enter sensitive information here. +export REACT_APP_DEPLOYMENT=mainnet +export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-coreneo/version/latest +export REACT_APP_DRT_ARBMAINNET_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt/version/latest +export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge +export REACT_APP_GENESIS_BLOCK_ARBMAINNET=190274403 +export REACT_APP_ARBITRATOR_TYPE=neo \ No newline at end of file diff --git a/web/package.json b/web/package.json index 99c164117..f70eda700 100644 --- a/web/package.json +++ b/web/package.json @@ -30,12 +30,16 @@ "start": "yarn start-devnet", "start-local": "scripts/runEnv.sh local 'yarn generate && parcel'", "start-devnet": "scripts/runEnv.sh devnet 'yarn generate && parcel'", + "start-devnet-neo": "scripts/runEnv.sh devnet-neo 'yarn generate && parcel'", "start-devnet-university": "scripts/runEnv.sh devnet-university 'yarn generate && parcel'", "start-testnet": "scripts/runEnv.sh testnet 'yarn generate && parcel'", + "start-mainnet-neo": "scripts/runEnv.sh mainnet-neo 'yarn generate && parcel'", "build": "yarn build-devnet", "build-local": "scripts/runEnv.sh local 'yarn generate && parcel build'", "build-devnet": "scripts/runEnv.sh devnet 'yarn generate && parcel build'", + "build-devnet-neo": "scripts/runEnv.sh devnet-neo 'yarn generate && parcel build'", "build-testnet": "scripts/runEnv.sh testnet 'yarn generate && parcel build'", + "build-mainnet-neo": "scripts/runEnv.sh mainnet-neo 'yarn generate && parcel build'", "build-netlify": "node scripts/gitInfo.js && yarn generate && parcel build", "check-style": "eslint 'src/**/*.{js,jsx,ts,tsx}'", "check-types": "tsc --noEmit", diff --git a/web/scripts/runEnv.sh b/web/scripts/runEnv.sh index e4cb16423..0e4bf5e0f 100755 --- a/web/scripts/runEnv.sh +++ b/web/scripts/runEnv.sh @@ -7,11 +7,11 @@ shift commands="$@" if [[ -z "$deployment" ]]; then - echo "usage: $(basename $0) " + echo "usage: $(basename $0) " exit 1 fi -valid_deployments=("local" "devnet" "devnet-university" "testnet" "mainnet") +valid_deployments=("local" "devnet" "devnet-neo" "devnet-university" "testnet" "mainnet-neo") if [[ ! " ${valid_deployments[@]} " =~ " ${deployment} " ]]; then echo "Invalid deployment option. Please choose either: ${valid_deployments[@]}." exit 1 diff --git a/web/src/components/NumberInputField.tsx b/web/src/components/NumberInputField.tsx index f6ecddb92..64460ea13 100644 --- a/web/src/components/NumberInputField.tsx +++ b/web/src/components/NumberInputField.tsx @@ -28,7 +28,7 @@ const StyledField = styled(Field)` } `; -interface INumberInputField { +interface INumberInputField extends Omit, "onChange"> { placeholder?: string; message?: string; value?: string; @@ -44,6 +44,7 @@ export const NumberInputField: React.FC = ({ onChange, formatter, className, + variant = "info", }) => { const [isEditing, setIsEditing] = useState(false); @@ -56,23 +57,18 @@ export const NumberInputField: React.FC = ({ {isEditing ? ( ) => { onChange?.(event.target.value); }} - placeholder={placeholder} - message={message} - variant="info" onBlur={toggleEditing} + {...{ value, placeholder, message, variant }} /> ) : ( )} diff --git a/web/src/components/Popup/Description/StakeWithdraw.tsx b/web/src/components/Popup/Description/StakeWithdraw.tsx index 24b796469..cc4dfa98a 100644 --- a/web/src/components/Popup/Description/StakeWithdraw.tsx +++ b/web/src/components/Popup/Description/StakeWithdraw.tsx @@ -5,7 +5,7 @@ import KlerosLogo from "tsx:svgs/icons/kleros.svg"; import { formatUnits } from "viem"; import { useAccount } from "wagmi"; -import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generatedProvider"; +import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated"; import { isUndefined } from "utils/index"; import { responsiveSize } from "styles/responsiveSize"; diff --git a/web/src/components/Verdict/FinalDecision.tsx b/web/src/components/Verdict/FinalDecision.tsx index 02c8f6769..3febdd597 100644 --- a/web/src/components/Verdict/FinalDecision.tsx +++ b/web/src/components/Verdict/FinalDecision.tsx @@ -8,7 +8,7 @@ import { useAccount } from "wagmi"; import ArrowIcon from "assets/svgs/icons/arrow.svg"; import { Periods } from "consts/periods"; -import { useKlerosCoreCurrentRuling } from "hooks/contracts/generatedProvider"; +import { useKlerosCoreCurrentRuling } from "hooks/contracts/generated"; import { usePopulatedDisputeData } from "hooks/queries/usePopulatedDisputeData"; import { useVotingHistory } from "hooks/queries/useVotingHistory"; import { useVotingContext } from "hooks/useVotingContext"; diff --git a/web/src/consts/chains.ts b/web/src/consts/chains.ts index 549feee31..d6c2efbbd 100644 --- a/web/src/consts/chains.ts +++ b/web/src/consts/chains.ts @@ -1,9 +1,11 @@ -import { Chain, arbitrumSepolia, gnosisChiado } from "wagmi/chains"; +import { Chain, arbitrum, arbitrumSepolia, gnosisChiado } from "wagmi/chains"; +import { isProductionDeployment } from "."; -export const DEFAULT_CHAIN = arbitrumSepolia.id; +export const DEFAULT_CHAIN = isProductionDeployment() ? arbitrum.id : arbitrumSepolia.id; export const SUPPORTED_CHAINS: Record = { [arbitrumSepolia.id]: arbitrumSepolia, + [arbitrum.id]: arbitrum, }; export const SUPPORTED_CHAIN_IDS = Object.keys(SUPPORTED_CHAINS); diff --git a/web/src/consts/eip712-messages.ts b/web/src/consts/eip712-messages.ts index 4e5f05f50..ae3fc52c0 100644 --- a/web/src/consts/eip712-messages.ts +++ b/web/src/consts/eip712-messages.ts @@ -1,13 +1,8 @@ import { arbitrumSepolia } from "viem/chains"; +import { DEFAULT_CHAIN } from "./chains"; export default { - contactDetails: ( - address: `0x${string}`, - nonce: string, - telegram = "", - email = "", - chainId: number = arbitrumSepolia.id - ) => + contactDetails: (address: `0x${string}`, nonce: string, telegram = "", email = "", chainId: number = DEFAULT_CHAIN) => ({ address: address.toLowerCase() as `0x${string}`, domain: { @@ -29,7 +24,7 @@ export default { nonce, }, } as const), - signingAccount: (address: `0x${string}`, chainId: number = arbitrumSepolia.id) => + signingAccount: (address: `0x${string}`, chainId: number = DEFAULT_CHAIN) => ({ account: address.toLowerCase() as `0x${string}`, domain: { diff --git a/web/src/consts/index.ts b/web/src/consts/index.ts index 20942a31a..2b6cad7cb 100644 --- a/web/src/consts/index.ts +++ b/web/src/consts/index.ts @@ -1,5 +1,11 @@ import { version, gitCommitHash, gitCommitShortHash, gitBranch, gitTags, clean } from "../generatedGitInfo.json"; +export enum ArbitratorTypes { + vanilla, + university, + neo, +} + export const ONE_BASIS_POINT = 10000n; export const IPFS_GATEWAY = process.env.REACT_APP_IPFS_GATEWAY || "https://cdn.kleros.link"; @@ -20,10 +26,16 @@ export const TELEGRAM_REGEX = /^@\w{5,32}$/; export const ETH_ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/; export const ETH_SIGNATURE_REGEX = /^0x[a-fA-F0-9]{130}$/; -export const GENESIS_BLOCK_ARBSEPOLIA = BigInt(process.env.REACT_APP_GENESIS_BLOCK_ARBSEPOLIA ?? 0); - export const isProductionDeployment = () => process.env.REACT_APP_DEPLOYMENT === "mainnet"; -export const isUniversityCourt = () => process.env.REACT_APP_UNIVERSITY_COURT?.toLowerCase() === "true"; + +export const isKlerosUniversity = () => arbitratorType() === ArbitratorTypes.university; +export const isKlerosNeo = () => arbitratorType() === ArbitratorTypes.neo; +export const arbitratorType = (): ArbitratorTypes => + ArbitratorTypes[process.env.REACT_APP_ARBITRATOR_TYPE?.toLowerCase() ?? "vanilla"]; + +export const GENESIS_BLOCK_ARBSEPOLIA = BigInt(process.env.REACT_APP_GENESIS_BLOCK_ARBSEPOLIA ?? 0); +export const GENESIS_BLOCK_ARBMAINNET = BigInt(process.env.REACT_APP_GENESIS_BLOCK_ARBMAINNET ?? 0); +export const genesisBlock = () => (isProductionDeployment() ? GENESIS_BLOCK_ARBMAINNET : GENESIS_BLOCK_ARBSEPOLIA); export const INVALID_DISPUTE_DATA_ERROR = `The dispute data is not valid, please vote "Refuse to arbitrate"`; export const RPC_ERROR = `RPC Error: Unable to fetch dispute data. Please avoid voting.`; diff --git a/web/src/context/GraphqlBatcher.tsx b/web/src/context/GraphqlBatcher.tsx index 8ae400f45..bd7b1572a 100644 --- a/web/src/context/GraphqlBatcher.tsx +++ b/web/src/context/GraphqlBatcher.tsx @@ -3,7 +3,6 @@ import React, { useMemo, createContext, useContext } from "react"; import { TypedDocumentNode } from "@graphql-typed-document-node/core"; import { create, windowedFiniteBatchScheduler, Batcher } from "@yornaath/batshit"; import { request } from "graphql-request"; -import { arbitrumSepolia } from "wagmi/chains"; import { debounceErrorToast } from "utils/debounceErrorToast"; import { getGraphqlUrl } from "utils/getGraphqlUrl"; @@ -24,7 +23,7 @@ const Context = createContext(undefined); const fetcher = async (queries: IQuery[]) => { const promises = queries.map(async ({ id, document, variables, isDisputeTemplate, chainId }) => { - const url = getGraphqlUrl(isDisputeTemplate ?? false, chainId ?? arbitrumSepolia.id); + const url = getGraphqlUrl(isDisputeTemplate ?? false, chainId); try { return request(url, document, variables).then((result) => ({ id, result })); } catch (error) { diff --git a/web/src/hooks/contracts/generatedProvider.ts b/web/src/hooks/contracts/generatedProvider.ts deleted file mode 100644 index 80c430073..000000000 --- a/web/src/hooks/contracts/generatedProvider.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { isUniversityCourt } from "consts/index"; -import { - klerosCoreABI as klerosCoreVanillaABI, - klerosCoreUniversityABI, - getKlerosCore as getKlerosCoreVanilla, - getKlerosCoreUniversity, - getDisputeKitClassic as getDisputeKitClassicVanilla, - getDisputeKitClassicUniversity, - usePrepareKlerosCoreSetStake as usePrepareKlerosCoreVanillaSetStake, - usePrepareKlerosCoreUniversitySetStake, - useKlerosCoreSetStake as useKlerosCoreVanillaSetStake, - useKlerosCoreUniversitySetStake, - useKlerosCoreArbitrationCost as useKlerosCoreVanillaArbitrationCost, - useKlerosCoreUniversityArbitrationCost, - useSortitionModulePhase as useSortitionModuleVanillaPhase, - useSortitionModuleGetJurorBalance as useSortitionModuleVanillaGetJurorBalance, - useSortitionModuleUniversityGetJurorBalance, - useKlerosCoreCurrentRuling as useKlerosCoreVanillaCurrentRuling, - useKlerosCoreUniversityCurrentRuling, - useDisputeKitClassicIsVoteActive as useDisputeKitClassicVanillaIsVoteActive, - useDisputeKitClassicUniversityIsVoteActive, - usePrepareDisputeKitClassicFundAppeal as usePrepareDisputeKitClassicVanillaFundAppeal, - usePrepareDisputeKitClassicUniversityFundAppeal, - useDisputeKitClassicFundAppeal as useDisputeKitClassicVanillaFundAppeal, - useDisputeKitClassicUniversityFundAppeal, - prepareWriteDisputeKitClassic as prepareWriteDisputeKitClassicVanilla, - prepareWriteDisputeKitClassicUniversity, - usePrepareDisputeResolverCreateDisputeForTemplate as usePrepareDisputeResolverVanillaCreateDisputeForTemplate, - usePrepareDisputeResolverUniversityCreateDisputeForTemplate, - useDisputeResolverCreateDisputeForTemplate as useDisputeResolverVanillaCreateDisputeForTemplate, - useDisputeResolverUniversityCreateDisputeForTemplate, -} from "hooks/contracts/generated"; - -const provide = (vanillaVersion, universityVersion) => (isUniversityCourt() ? universityVersion : vanillaVersion); - -export const klerosCoreABI = provide(klerosCoreVanillaABI, klerosCoreUniversityABI); - -export const getKlerosCore = provide(getKlerosCoreVanilla, getKlerosCoreUniversity); - -export const getDisputeKitClassic = provide(getDisputeKitClassicVanilla, getDisputeKitClassicUniversity); - -export const usePrepareKlerosCoreSetStake = provide( - usePrepareKlerosCoreVanillaSetStake, - usePrepareKlerosCoreUniversitySetStake -); - -export const useKlerosCoreSetStake = provide(useKlerosCoreVanillaSetStake, useKlerosCoreUniversitySetStake); - -export const useKlerosCoreArbitrationCost = provide( - useKlerosCoreVanillaArbitrationCost, - useKlerosCoreUniversityArbitrationCost -); - -export const useSortitionModulePhase = provide(useSortitionModuleVanillaPhase, undefined); - -export const useSortitionModuleGetJurorBalance = provide( - useSortitionModuleVanillaGetJurorBalance, - useSortitionModuleUniversityGetJurorBalance -); - -export const useKlerosCoreCurrentRuling = provide( - useKlerosCoreVanillaCurrentRuling, - useKlerosCoreUniversityCurrentRuling -); - -export const useDisputeKitClassicIsVoteActive = provide( - useDisputeKitClassicVanillaIsVoteActive, - useDisputeKitClassicUniversityIsVoteActive -); - -export const usePrepareDisputeKitClassicFundAppeal = provide( - usePrepareDisputeKitClassicVanillaFundAppeal, - usePrepareDisputeKitClassicUniversityFundAppeal -); - -export const useDisputeKitClassicFundAppeal = provide( - useDisputeKitClassicVanillaFundAppeal, - useDisputeKitClassicUniversityFundAppeal -); - -export const prepareWriteDisputeKitClassic = provide( - prepareWriteDisputeKitClassicVanilla, - prepareWriteDisputeKitClassicUniversity -); - -export const usePrepareDisputeResolverCreateDisputeForTemplate = provide( - usePrepareDisputeResolverVanillaCreateDisputeForTemplate, - usePrepareDisputeResolverUniversityCreateDisputeForTemplate -); - -export const useDisputeResolverCreateDisputeForTemplate = provide( - useDisputeResolverVanillaCreateDisputeForTemplate, - useDisputeResolverUniversityCreateDisputeForTemplate -); diff --git a/web/src/hooks/queries/useAppealCost.ts b/web/src/hooks/queries/useAppealCost.ts index 78995542d..9f57c1a83 100644 --- a/web/src/hooks/queries/useAppealCost.ts +++ b/web/src/hooks/queries/useAppealCost.ts @@ -1,6 +1,6 @@ import { useQuery } from "@tanstack/react-query"; -import { getKlerosCore } from "hooks/contracts/generatedProvider"; +import { getKlerosCore } from "hooks/contracts/generated"; import { isUndefined } from "utils/index"; export const useAppealCost = (disputeID?: string) => { diff --git a/web/src/hooks/queries/useDisputeKitClassicMultipliers.ts b/web/src/hooks/queries/useDisputeKitClassicMultipliers.ts index 0a5e6361f..e517bc4c5 100644 --- a/web/src/hooks/queries/useDisputeKitClassicMultipliers.ts +++ b/web/src/hooks/queries/useDisputeKitClassicMultipliers.ts @@ -1,6 +1,6 @@ import { useQuery } from "@tanstack/react-query"; -import { getDisputeKitClassic } from "hooks/contracts/generatedProvider"; +import { getDisputeKitClassic } from "hooks/contracts/generated"; import { isUndefined } from "utils/index"; export const useDisputeKitClassicMultipliers = () => { diff --git a/web/src/hooks/useContractAddress.tsx b/web/src/hooks/useContractAddress.tsx index 3b9f7a786..938521816 100644 --- a/web/src/hooks/useContractAddress.tsx +++ b/web/src/hooks/useContractAddress.tsx @@ -2,8 +2,16 @@ import { Abi, PublicClient } from "viem"; import { usePublicClient } from "wagmi"; import { GetContractArgs, GetContractResult } from "wagmi/actions"; -import { getPinakionV2, pinakionV2ABI, getWeth, getPnkFaucet, wethABI, pnkFaucetABI } from "./contracts/generated"; -import { klerosCoreABI, getKlerosCore } from "./contracts/generatedProvider"; +import { + getPnk, + pnkABI, + getWeth, + getPnkFaucet, + wethABI, + pnkFaucetABI, + getKlerosCore, + klerosCoreABI, +} from "./contracts/generated"; type Config = Omit, "abi" | "address"> & { chainId?: any; @@ -17,7 +25,7 @@ export const useContractAddress = ( }; export const usePNKAddress = () => { - return useContractAddress(getPinakionV2)?.address; + return useContractAddress(getPnk)?.address; }; export const useWETHAddress = () => { diff --git a/web/src/hooks/useSortitionModulePhase.ts b/web/src/hooks/useSortitionModulePhase.ts new file mode 100644 index 000000000..1f098cc7e --- /dev/null +++ b/web/src/hooks/useSortitionModulePhase.ts @@ -0,0 +1,7 @@ +import { useSortitionModuleRead } from "hooks/contracts/generated"; + +export const useSortitionModulePhase = () => { + // eslint-disable-next-line + // @ts-ignore + return useSortitionModuleRead({ functionName: "phase", watch: true }); +}; diff --git a/web/src/hooks/useVotingContext.tsx b/web/src/hooks/useVotingContext.tsx index b35cbfb02..6ed4f300d 100644 --- a/web/src/hooks/useVotingContext.tsx +++ b/web/src/hooks/useVotingContext.tsx @@ -5,7 +5,7 @@ import { useAccount } from "wagmi"; import { isUndefined } from "utils/index"; -import { useDisputeKitClassicIsVoteActive } from "./contracts/generatedProvider"; +import { useDisputeKitClassicIsVoteActive } from "./contracts/generated"; import { useDisputeDetailsQuery } from "./queries/useDisputeDetailsQuery"; import { useDrawQuery } from "./queries/useDrawQuery"; diff --git a/web/src/layout/Header/DesktopHeader.tsx b/web/src/layout/Header/DesktopHeader.tsx index 67263fbd9..30b97acfd 100644 --- a/web/src/layout/Header/DesktopHeader.tsx +++ b/web/src/layout/Header/DesktopHeader.tsx @@ -10,6 +10,8 @@ import KlerosSolutionsIcon from "svgs/menu-icons/kleros-solutions.svg"; import { useLockOverlayScroll } from "hooks/useLockOverlayScroll"; +import { isKlerosUniversity } from "src/consts"; + import { landscapeStyle } from "styles/landscapeStyle"; import { responsiveSize } from "styles/responsiveSize"; @@ -25,8 +27,6 @@ import Settings from "./navbar/Menu/Settings"; import { PopupContainer } from "."; -const IS_UNIVERSITY = process.env.REACT_APP_UNIVERSITY_COURT === "true"; - const Container = styled.div` display: none; position: absolute; @@ -106,7 +106,7 @@ const DesktopHeader = () => { Icon={StyledKlerosSolutionsIcon} /> - {IS_UNIVERSITY ? : } + {isKlerosUniversity() ? : } diff --git a/web/src/layout/Header/MobileHeader.tsx b/web/src/layout/Header/MobileHeader.tsx index 30a172235..53846ae11 100644 --- a/web/src/layout/Header/MobileHeader.tsx +++ b/web/src/layout/Header/MobileHeader.tsx @@ -8,14 +8,14 @@ import HamburgerIcon from "svgs/header/hamburger.svg"; import KlerosCourtUniversityLogo from "svgs/header/kleros-court-university.svg"; import KlerosCourtLogo from "svgs/header/kleros-court.svg"; +import { isKlerosUniversity } from "src/consts"; + import { landscapeStyle } from "styles/landscapeStyle"; import LightButton from "components/LightButton"; import NavBar from "./navbar"; -const IS_UNIVERSITY = process.env.REACT_APP_UNIVERSITY_COURT === "true"; - const Container = styled.div` display: flex; align-items: center; @@ -64,7 +64,7 @@ const MobileHeader = () => { return ( - {IS_UNIVERSITY ? : } + {isKlerosUniversity() ? : } diff --git a/web/src/layout/Header/navbar/Debug.tsx b/web/src/layout/Header/navbar/Debug.tsx index 7f59cb02c..5b37f84ec 100644 --- a/web/src/layout/Header/navbar/Debug.tsx +++ b/web/src/layout/Header/navbar/Debug.tsx @@ -2,7 +2,7 @@ import React, { useMemo } from "react"; import styled from "styled-components"; import { GIT_BRANCH, GIT_DIRTY, GIT_HASH, GIT_TAGS, GIT_URL, RELEASE_VERSION } from "consts/index"; -import { useSortitionModulePhase } from "hooks/contracts/generatedProvider"; +import { useSortitionModulePhase } from "hooks/useSortitionModulePhase"; import { useToggleTheme } from "hooks/useToggleThemeContext"; import { isUndefined } from "utils/index"; @@ -58,11 +58,8 @@ enum Phases { } const Phase = () => { - if (isUndefined(useSortitionModulePhase)) return <>; - const { data: phase } = useSortitionModulePhase({ - watch: true, - }); - return <>{isUndefined(phase) ? null : Phase: {Phases[phase]}}; + const { data: phase } = useSortitionModulePhase(); + return <>{isUndefined(phase) ? null : Phase: {Phases[phase as number]}}; }; const Debug: React.FC = () => { diff --git a/web/src/pages/Cases/CaseDetails/Appeal/Classic/Fund.tsx b/web/src/pages/Cases/CaseDetails/Appeal/Classic/Fund.tsx index f984a02e4..788e2f287 100644 --- a/web/src/pages/Cases/CaseDetails/Appeal/Classic/Fund.tsx +++ b/web/src/pages/Cases/CaseDetails/Appeal/Classic/Fund.tsx @@ -7,10 +7,7 @@ import { useAccount, useBalance, usePublicClient } from "wagmi"; import { Field, Button } from "@kleros/ui-components-library"; -import { - usePrepareDisputeKitClassicFundAppeal, - useDisputeKitClassicFundAppeal, -} from "hooks/contracts/generatedProvider"; +import { usePrepareDisputeKitClassicFundAppeal, useDisputeKitClassicFundAppeal } from "hooks/contracts/generated"; import { useSelectedOptionContext, useFundingContext, useCountdownContext } from "hooks/useClassicAppealContext"; import { useParsedAmount } from "hooks/useParsedAmount"; import { isUndefined } from "utils/index"; diff --git a/web/src/pages/Cases/CaseDetails/Voting/Classic/Commit.tsx b/web/src/pages/Cases/CaseDetails/Voting/Classic/Commit.tsx index 91f231e39..2f4fcc39a 100644 --- a/web/src/pages/Cases/CaseDetails/Voting/Classic/Commit.tsx +++ b/web/src/pages/Cases/CaseDetails/Voting/Classic/Commit.tsx @@ -6,7 +6,7 @@ import { useLocalStorage } from "react-use"; import { keccak256, encodePacked } from "viem"; import { useWalletClient, usePublicClient } from "wagmi"; -import { prepareWriteDisputeKitClassic } from "hooks/contracts/generatedProvider"; +import { prepareWriteDisputeKitClassic } from "hooks/contracts/generated"; import useSigningAccount from "hooks/useSigningAccount"; import { isUndefined } from "utils/index"; import { wrapWithToast } from "utils/wrapWithToast"; diff --git a/web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx b/web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx index 6e02ed67c..dea13ba17 100644 --- a/web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx +++ b/web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx @@ -9,7 +9,7 @@ import { useWalletClient, usePublicClient } from "wagmi"; import { Button } from "@kleros/ui-components-library"; -import { prepareWriteDisputeKitClassic } from "hooks/contracts/generatedProvider"; +import { prepareWriteDisputeKitClassic } from "hooks/contracts/generated"; import { usePopulatedDisputeData } from "hooks/queries/usePopulatedDisputeData"; import useSigningAccount from "hooks/useSigningAccount"; import { isUndefined } from "utils/index"; diff --git a/web/src/pages/Cases/CaseDetails/Voting/Classic/Vote.tsx b/web/src/pages/Cases/CaseDetails/Voting/Classic/Vote.tsx index fe3ba6792..b814a6ad0 100644 --- a/web/src/pages/Cases/CaseDetails/Voting/Classic/Vote.tsx +++ b/web/src/pages/Cases/CaseDetails/Voting/Classic/Vote.tsx @@ -4,7 +4,7 @@ import styled from "styled-components"; import { useParams } from "react-router-dom"; import { useWalletClient, usePublicClient } from "wagmi"; -import { prepareWriteDisputeKitClassic } from "hooks/contracts/generatedProvider"; +import { prepareWriteDisputeKitClassic } from "hooks/contracts/generated"; import { wrapWithToast } from "utils/wrapWithToast"; import { useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery"; diff --git a/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx b/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx index a00f1d06b..4f70b3930 100644 --- a/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx +++ b/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx @@ -1,13 +1,11 @@ -import React, { useState } from "react"; +import React, { useState, useMemo } from "react"; import styled from "styled-components"; import { useParams } from "react-router-dom"; import { useDebounce } from "react-use"; import { useAccount } from "wagmi"; -import { usePnkBalanceOf } from "hooks/contracts/generated"; -import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generatedProvider"; -import { useCourtDetails } from "hooks/queries/useCourtDetails"; +import { useSortitionModuleGetJurorBalance, usePnkBalanceOf } from "hooks/contracts/generated"; import { useParsedAmount } from "hooks/useParsedAmount"; import { commify, uncommify } from "utils/commify"; import { formatPNK, roundNumberDown } from "utils/format"; @@ -71,10 +69,11 @@ const InputDisplay: React.FC = ({ }) => { const [debouncedAmount, setDebouncedAmount] = useState(""); useDebounce(() => setDebouncedAmount(amount), 500, [amount]); - const parsedAmount = useParsedAmount(uncommify(debouncedAmount)); + const parsedAmount = useParsedAmount(uncommify(debouncedAmount) as `${number}`); + + const [errorMsg, setErrorMsg] = useState(); const { id } = useParams(); - const { data: courtDetails } = useCourtDetails(id); const { address } = useAccount(); const { data: balance } = usePnkBalanceOf({ enabled: !isUndefined(address), @@ -84,11 +83,11 @@ const InputDisplay: React.FC = ({ const parsedBalance = formatPNK(balance ?? 0n, 0, true); const { data: jurorBalance } = useSortitionModuleGetJurorBalance({ enabled: !isUndefined(address), - args: [address, id], + args: [address!, BigInt(id!)], watch: true, }); const parsedStake = formatPNK(jurorBalance?.[2] || 0n, 0, true); - const isStaking = action === ActionType.stake; + const isStaking = useMemo(() => action === ActionType.stake, [action]); return ( <> @@ -111,15 +110,8 @@ const InputDisplay: React.FC = ({ setAmount(e); }} placeholder={isStaking ? "Amount to stake" : "Amount to withdraw"} - // message={ - // isStaking - // ? `You need to stake at least ${formatPNK(courtDetails?.court.minStake ?? 0n, 3)} PNK. ` + - // "You may need two transactions, one to increase allowance, the other to stake." - // : `You need to either withdraw all or keep at least ${formatPNK( - // courtDetails?.court.minStake ?? 0n, - // 3 - // )} PNK.` - // } + message={errorMsg ?? undefined} + variant={!isUndefined(errorMsg) ? "error" : "info"} formatter={(number: string) => commify(roundNumberDown(Number(number)))} /> @@ -131,6 +123,7 @@ const InputDisplay: React.FC = ({ isSending, setIsSending, setIsPopupOpen, + setErrorMsg, }} /> diff --git a/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx b/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx index de34dbaab..7edf307c1 100644 --- a/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx +++ b/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx @@ -8,7 +8,7 @@ import { useAccount } from "wagmi"; import DiceIcon from "svgs/icons/dice.svg"; import PNKIcon from "svgs/icons/pnk.svg"; -import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generatedProvider"; +import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated"; import { isUndefined } from "utils/index"; import { useCourtDetails } from "queries/useCourtDetails"; diff --git a/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx b/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx index c51358936..da7352ef1 100644 --- a/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx +++ b/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from "react"; +import React, { useMemo, useEffect } from "react"; import { useParams } from "react-router-dom"; import { useAccount, usePublicClient } from "wagmi"; @@ -10,13 +10,11 @@ import { usePnkIncreaseAllowance, usePreparePnkIncreaseAllowance, usePnkAllowance, -} from "hooks/contracts/generated"; -import { getKlerosCore, useKlerosCoreSetStake, usePrepareKlerosCoreSetStake, useSortitionModuleGetJurorBalance, -} from "hooks/contracts/generatedProvider"; +} from "hooks/contracts/generated"; import { useCourtDetails } from "hooks/queries/useCourtDetails"; import { isUndefined } from "utils/index"; import { wrapWithToast } from "utils/wrapWithToast"; @@ -36,6 +34,7 @@ interface IActionButton { setIsSending: (arg0: boolean) => void; setAmount: (arg0: string) => void; setIsPopupOpen: (arg0: boolean) => void; + setErrorMsg: (arg0: string | undefined) => void; } const StakeWithdrawButton: React.FC = ({ @@ -44,6 +43,7 @@ const StakeWithdrawButton: React.FC = ({ isSending, setIsSending, setIsPopupOpen, + setErrorMsg, }) => { const { id } = useParams(); const { address } = useAccount(); @@ -82,7 +82,7 @@ const StakeWithdrawButton: React.FC = ({ return 0n; }, [jurorBalance, parsedAmount, isAllowance, isStaking]); - const { config: increaseAllowanceConfig } = usePreparePnkIncreaseAllowance({ + const { config: increaseAllowanceConfig, error: allowanceError } = usePreparePnkIncreaseAllowance({ enabled: isAllowance && !isUndefined(klerosCore) && !isUndefined(targetStake) && !isUndefined(allowance), args: [klerosCore?.address, BigInt(targetStake ?? 0) - BigInt(allowance ?? 0)], }); @@ -98,7 +98,7 @@ const StakeWithdrawButton: React.FC = ({ } }; - const { config: setStakeConfig } = usePrepareKlerosCoreSetStake({ + const { config: setStakeConfig, error: setStakeError } = usePrepareKlerosCoreSetStake({ enabled: !isUndefined(targetStake) && !isUndefined(id) && !isAllowance, args: [BigInt(id ?? 0), targetStake], }); @@ -107,13 +107,21 @@ const StakeWithdrawButton: React.FC = ({ if (typeof setStake !== "undefined") { setIsSending(true); wrapWithToast(async () => await setStake().then((response) => response.hash), publicClient) - .then(() => setIsPopupOpen(true)) + .then((res) => res.status && setIsPopupOpen(true)) .finally(() => { setIsSending(false); }); } }; + useEffect(() => { + if (isAllowance) { + setErrorMsg(allowanceError?.shortMessage); + } else { + setErrorMsg(setStakeError?.shortMessage); + } + }, [allowanceError, setStakeError, isAllowance, isStaking, setErrorMsg]); + const buttonProps = { [ActionType.allowance]: { text: "Allow PNK", @@ -122,7 +130,7 @@ const StakeWithdrawButton: React.FC = ({ }, [ActionType.stake]: { text: "Stake", - checkDisabled: () => false, + checkDisabled: () => !isUndefined(setStakeError), onClick: handleStake, }, [ActionType.withdraw]: { diff --git a/web/src/pages/Courts/CourtDetails/index.tsx b/web/src/pages/Courts/CourtDetails/index.tsx index b790bf6c7..5fb548061 100644 --- a/web/src/pages/Courts/CourtDetails/index.tsx +++ b/web/src/pages/Courts/CourtDetails/index.tsx @@ -6,6 +6,7 @@ import { useToggle } from "react-use"; import { Card, Breadcrumb } from "@kleros/ui-components-library"; +import { isProductionDeployment } from "consts/index"; import { isUndefined } from "utils/index"; import { useCourtPolicy } from "queries/useCourtPolicy"; @@ -115,7 +116,7 @@ const CourtDetails: React.FC = () => { toggleMiniGuide={toggleStakingMiniGuide} MiniGuideComponent={Staking} /> - + {!isProductionDeployment() && }
diff --git a/web/src/pages/Dashboard/Courts/index.tsx b/web/src/pages/Dashboard/Courts/index.tsx index 0c769ea41..9e0ad5475 100644 --- a/web/src/pages/Dashboard/Courts/index.tsx +++ b/web/src/pages/Dashboard/Courts/index.tsx @@ -4,7 +4,7 @@ import styled, { css } from "styled-components"; import Skeleton from "react-loading-skeleton"; import { useAccount } from "wagmi"; -import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generatedProvider"; +import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated"; import { useJurorStakeDetailsQuery } from "queries/useJurorStakeDetailsQuery"; diff --git a/web/src/pages/GetPnk/index.tsx b/web/src/pages/GetPnk/index.tsx index 8b00cb848..904a20d3f 100644 --- a/web/src/pages/GetPnk/index.tsx +++ b/web/src/pages/GetPnk/index.tsx @@ -5,6 +5,8 @@ import { useToggle } from "react-use"; import { Card } from "@kleros/ui-components-library"; +import { isProductionDeployment } from "consts/index"; + import { responsiveSize } from "styles/responsiveSize"; import ClaimPnkButton from "components/ClaimPnkButton"; @@ -38,7 +40,7 @@ const GetPnk: React.FC = () => { <> - + {!isProductionDeployment() && }
{settingsOpen ? : } diff --git a/web/src/pages/Resolver/NavigationButtons/SubmitDisputeButton.tsx b/web/src/pages/Resolver/NavigationButtons/SubmitDisputeButton.tsx index 82f49b43d..18afc056c 100644 --- a/web/src/pages/Resolver/NavigationButtons/SubmitDisputeButton.tsx +++ b/web/src/pages/Resolver/NavigationButtons/SubmitDisputeButton.tsx @@ -12,7 +12,7 @@ import { IDisputeTemplate, useNewDisputeContext } from "context/NewDisputeContex import { useDisputeResolverCreateDisputeForTemplate, usePrepareDisputeResolverCreateDisputeForTemplate, -} from "hooks/contracts/generatedProvider"; +} from "hooks/contracts/generated"; import { isUndefined } from "utils/index"; import { prepareArbitratorExtradata } from "utils/prepareArbitratorExtradata"; import { wrapWithToast } from "utils/wrapWithToast"; diff --git a/web/src/pages/Resolver/Parameters/Jurors.tsx b/web/src/pages/Resolver/Parameters/Jurors.tsx index c24107492..8c7ab8613 100644 --- a/web/src/pages/Resolver/Parameters/Jurors.tsx +++ b/web/src/pages/Resolver/Parameters/Jurors.tsx @@ -6,7 +6,7 @@ import { DisplaySmall, Field } from "@kleros/ui-components-library"; import ETH from "svgs/icons/eth.svg"; import { useNewDisputeContext } from "context/NewDisputeContext"; -import { useKlerosCoreArbitrationCost } from "hooks/contracts/generatedProvider"; +import { useKlerosCoreArbitrationCost } from "hooks/contracts/generated"; import { formatETH } from "utils/format"; import { isUndefined } from "utils/index"; import { prepareArbitratorExtradata } from "utils/prepareArbitratorExtradata"; diff --git a/web/src/utils/getGraphqlUrl.ts b/web/src/utils/getGraphqlUrl.ts index 9495056aa..7f3dcb148 100644 --- a/web/src/utils/getGraphqlUrl.ts +++ b/web/src/utils/getGraphqlUrl.ts @@ -1,11 +1,14 @@ -import { arbitrumSepolia } from "wagmi/chains"; +import { arbitrumSepolia, arbitrum } from "wagmi/chains"; +import { DEFAULT_CHAIN } from "src/consts/chains"; const CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH = { [arbitrumSepolia.id]: - process.env.REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH ?? "Wrong Subgraph URL. Please check the environment variables.", + process.env.REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH ?? "Environment variables REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH not set.", + [arbitrum.id]: + process.env.REACT_APP_DRT_ARBMAINNET_SUBGRAPH ?? "Environment variables REACT_APP_DRT_ARBMAINNET_SUBGRAPH not set.", }; -export const getGraphqlUrl = (isDisputeTemplate = false, chainId: number = arbitrumSepolia.id) => { - const coreUrl = process.env.REACT_APP_CORE_SUBGRAPH ?? "Wrong Subgraph URL. Please check the environment variables."; +export const getGraphqlUrl = (isDisputeTemplate = false, chainId: number = DEFAULT_CHAIN) => { + const coreUrl = process.env.REACT_APP_CORE_SUBGRAPH ?? "Environment variables REACT_APP_CORE_SUBGRAPH not set."; return isDisputeTemplate ? CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH[chainId] : coreUrl; }; diff --git a/web/wagmi.config.ts b/web/wagmi.config.ts index 36cde0272..bc481a0bb 100644 --- a/web/wagmi.config.ts +++ b/web/wagmi.config.ts @@ -10,6 +10,8 @@ import { Abi } from "viem"; import IArbitrableV2 from "@kleros/kleros-v2-contracts/artifacts/src/arbitration/interfaces/IArbitrableV2.sol/IArbitrableV2.json" assert { type: "json" }; import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; +import { ArbitratorTypes, arbitratorType } from "src/consts"; + dotenv.config(); type ArtifactPartial = { @@ -20,7 +22,14 @@ const getAbi = (artifact: any) => { return (artifact as ArtifactPartial).abi; }; -const readArtifacts = async (viemChainName: string, hardhatChainName?: string) => { +const readArtifacts = async (type: ArbitratorTypes, viemChainName: string, hardhatChainName?: string) => { + const artifactSuffix = + type === ArbitratorTypes.vanilla + ? "" + : ArbitratorTypes[type].toString().charAt(0).toUpperCase() + ArbitratorTypes[type].toString().slice(1); + const vanillaArtifacts = ["KlerosCore", "DisputeKitClassic", "SortitionModule", "DisputeResolver"]; + const typeSpecificArtifacts = vanillaArtifacts.map((artifact) => `${artifact}${artifactSuffix}`); + const chains = await import("wagmi/chains"); const chain = chains[viemChainName] as Chain; if (!chain) { @@ -34,11 +43,22 @@ const readArtifacts = async (viemChainName: string, hardhatChainName?: string) = for (const file of files) { const { name, ext } = parse(file); if (ext === ".json") { + let nameWithoutSuffix = name; + if (vanillaArtifacts.some((artifact) => name.startsWith(artifact))) { + if (!typeSpecificArtifacts.includes(name)) { + // console.debug(`Skipping ${name} for deployment type ${ArbitratorTypes[type]}`); + continue; + } + if (type !== ArbitratorTypes.vanilla) { + nameWithoutSuffix = name.slice(0, -artifactSuffix.length); + // console.debug(`Using ${nameWithoutSuffix} instead of ${name}`); + } + } const filePath = join(directoryPath, file); const fileContent = await readFile(filePath, "utf-8"); const jsonContent = JSON.parse(fileContent); results.push({ - name, + name: nameWithoutSuffix, address: { [chain.id]: jsonContent.address as `0x{string}`, }, @@ -51,6 +71,7 @@ const readArtifacts = async (viemChainName: string, hardhatChainName?: string) = const getConfig = async (): Promise => { const deployment = process.env.REACT_APP_DEPLOYMENT ?? "testnet"; + const type = arbitratorType(); let viemNetwork: string; let hardhatNetwork: string; @@ -71,7 +92,7 @@ const getConfig = async (): Promise => { throw new Error(`Unknown deployment ${deployment}`); } - const deploymentContracts = await readArtifacts(viemNetwork, hardhatNetwork); + const deploymentContracts = await readArtifacts(type, viemNetwork, hardhatNetwork); return { out: "src/hooks/contracts/generated.ts",