From b44a886889c7c5ae8d3f9815a538cd141dcfcda4 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 1 Feb 2023 12:17:25 +0000 Subject: [PATCH 1/9] feat: chiado deployment scripts (WIP) --- contracts/deploy/01-foreign-gateway-gnosis.ts | 82 +++++++++++++ .../deploy/04-klerosliquid-to-v2-gnosis.ts | 115 ++++++++++++++++++ .../MetaEvidence_ArbitrableExample.json | 27 ++++ contracts/scripts/console-init.ts | 9 ++ contracts/src/arbitration/mock/Faucet.sol | 27 ++++ contracts/src/arbitration/mock/WETH.sol | 11 ++ .../kleros-liquid-xdai/WrappedPinakion.sol | 1 - .../kleros-liquid-xdai/xKlerosLiquidToV2.sol | 2 +- 8 files changed, 272 insertions(+), 2 deletions(-) create mode 100644 contracts/deploy/01-foreign-gateway-gnosis.ts create mode 100644 contracts/deploy/04-klerosliquid-to-v2-gnosis.ts create mode 100644 contracts/deployments/chiado/MetaEvidence_ArbitrableExample.json create mode 100644 contracts/scripts/console-init.ts create mode 100644 contracts/src/arbitration/mock/Faucet.sol create mode 100644 contracts/src/arbitration/mock/WETH.sol diff --git a/contracts/deploy/01-foreign-gateway-gnosis.ts b/contracts/deploy/01-foreign-gateway-gnosis.ts new file mode 100644 index 000000000..ab833a346 --- /dev/null +++ b/contracts/deploy/01-foreign-gateway-gnosis.ts @@ -0,0 +1,82 @@ +import { parseEther } from "ethers/lib/utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import getContractAddress from "../deploy-helpers/getContractAddress"; + +enum ForeignChains { + GNOSIS_MAINNET = 100, + GNOSIS_CHIADO = 10200, + HARDHAT = 31337, +} + +const wethByChain = new Map([ + [ForeignChains.GNOSIS_MAINNET, "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1"], +]); + +const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; + const { deploy, execute } = deployments; + const { hexZeroPad, hexlify } = ethers.utils; + + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; + const chainId = Number(await getChainId()); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); + + const homeNetworks = { + 1: config.networks.arbitrum, + 5: config.networks.arbitrumGoerli, + }; + + // Hack to predict the deployment address on the home chain. + // TODO: use deterministic deployments + const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[chainId].url); + let nonce = await homeChainProvider.getTransactionCount(deployer); + nonce += 2; // HomeGatewayToEthereum deploy tx will the third tx after this on its home network, so we add two to the current nonce. + const homeChainId = (await homeChainProvider.getNetwork()).chainId; + const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); + const homeGatewayAddress = getContractAddress(deployer, nonce); + console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + + const veaReceiver = await deployments.get("FastBridgeReceiverOnGnosis"); + + if (!wethByChain.get(chainId)) { + const weth = await deploy("WETH", { + from: deployer, + log: true, + }); + + wethByChain.set(ForeignChains[ForeignChains[chainId]], weth.address); + + await deploy("WETHFaucet", { + from: deployer, + contract: "Faucet", + args: [weth], + log: true, + }); + } + + const foreignGateway = await deploy("xForeignGateway", { + from: deployer, + contract: "xForeignGateway", + args: [deployer, veaReceiver.address, homeGatewayAddress, homeChainIdAsBytes32, wethByChain[chainId]], + gasLimit: 4000000, + log: true, + }); + + await execute( + "xForeignGateway", + { from: deployer, log: true }, + "changeCourtJurorFee", + 0, + ethers.utils.parseEther("0.00001") // TODO: fix this from xKlerosLiquid xDAI -> ETH amount + ); +}; + +deployForeignGateway.tags = ["ForeignChain", "ForeignGatewayOnGnosis"]; +deployForeignGateway.skip = async ({ getChainId }) => { + const chainId = Number(await getChainId()); + return !ForeignChains[chainId]; +}; + +export default deployForeignGateway; diff --git a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts new file mode 100644 index 000000000..ab1bae1c1 --- /dev/null +++ b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts @@ -0,0 +1,115 @@ +import { parseEther } from "ethers/lib/utils"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import getContractAddress from "../deploy-helpers/getContractAddress"; +import { util } from "chai"; +import { rng } from "../typechain-types/src"; + +enum ForeignChains { + GNOSIS_MAINNET = 100, + GNOSIS_CHIADO = 10200, + HARDHAT = 31337, +} + +const wethByChain = new Map([ + [ForeignChains.GNOSIS_MAINNET, "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1"], +]); + +const xPinakionByChain = new Map([ + [ForeignChains.GNOSIS_MAINNET, "0x37b60f4E9A31A64cCc0024dce7D0fD07eAA0F7B3"], + [ForeignChains.GNOSIS_CHIADO, "0x00"], +]); + +const tokenBridgeByChain = new Map([ + [ForeignChains.GNOSIS_MAINNET, "0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d"], + [ForeignChains.GNOSIS_CHIADO, "0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2"], +]); + +const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; + const { deploy, execute } = deployments; + const { hexZeroPad, hexlify } = ethers.utils; + + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; + const chainId = Number(await getChainId()); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); + + const homeNetworks = { + 1: config.networks.arbitrum, + 5: config.networks.arbitrumGoerli, + }; + + // Hack to predict the deployment address on the home chain. + // TODO: use deterministic deployments + const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[chainId].url); + let nonce = await homeChainProvider.getTransactionCount(deployer); + nonce += 2; // HomeGatewayToEthereum deploy tx will the third tx after this on its home network, so we add two to the current nonce. + const homeChainId = (await homeChainProvider.getNetwork()).chainId; + const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); + const homeGatewayAddress = getContractAddress(deployer, nonce); + console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + + const veaReceiver = await deployments.get("FastBridgeReceiverOnGnosis"); + + // const wEth = await deployments.get("WETH"); + const wEth = wethByChain[chainId]; + + // const xPnk = await deployments.get("WPNK"); + const xPnk = xPinakionByChain[chainId]; + + const tokenBridge = tokenBridgeByChain[chainId]; + const rnGenerator = ethers.constants.AddressZero; + + // TODO: deploy mocks for xPinakion and tokenBridge for Hardhat network + + const wPnk = await deploy("WrappedPinakion", { + from: deployer, + log: true, + }); + + await execute( + "WrappedPinakion", + { from: deployer, log: true }, + "initialize", + "Staking PNK on xDai", + "stPNK", + xPnk, + tokenBridge + ); + + const xKlerosLiquidToV2 = await deploy("xKlerosLiquidToV2", { + from: deployer, + log: true, + }); + + await execute( + "xKlerosLiquidToV2", + { from: deployer, log: true }, + "initialize", + deployer, + wPnk, + rnGenerator, + 99999999, + 0, + false, + [999999999, 0, 0, 9999999], + [] + ); + + const metaEvidenceUri = `https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/${hre.network.name}/MetaEvidence_ArbitrableExample.json`; + + await deploy("ArbitrableExample", { + from: deployer, + args: [foreignGateway.address, metaEvidenceUri], + log: true, + }); +}; + +deployForeignGateway.tags = ["ForeignChain", "KlerosLiquidOnGnosis"]; +deployForeignGateway.skip = async ({ getChainId }) => { + const chainId = Number(await getChainId()); + return !ForeignChains[chainId]; +}; + +export default deployForeignGateway; diff --git a/contracts/deployments/chiado/MetaEvidence_ArbitrableExample.json b/contracts/deployments/chiado/MetaEvidence_ArbitrableExample.json new file mode 100644 index 000000000..9872a5f71 --- /dev/null +++ b/contracts/deployments/chiado/MetaEvidence_ArbitrableExample.json @@ -0,0 +1,27 @@ +{ + "type": "single-select", + "titles": [ + "Alice", + "Bob", + "Charlie" + ], + "descriptions": [ + "Alice is right.", + "Bob is right.", + "Charlie is right" + ], + "arbitratorChainID": 421613, + "arbitrableChainID": 10200, + "arbitrableInterfaceURI": "https://my-awesomme.dapp.io/item/1234", + "dynamicScriptRequiredParams": [ + "arbitrableChainID", + "arbitrableContractAddress" + ], + "evidenceDisplayInterfaceRequiredParams": [ + "disputeID", + "arbitrableContractAddress", + "arbitratorContractAddress", + "arbitratorChainID" + ], + "_v": "1.0.0" +} diff --git a/contracts/scripts/console-init.ts b/contracts/scripts/console-init.ts new file mode 100644 index 000000000..a3ac0ca90 --- /dev/null +++ b/contracts/scripts/console-init.ts @@ -0,0 +1,9 @@ +core = await ethers.getContract("KlerosCore"); +disputeKit = await ethers.getContract("DisputeKitClassic"); +rng = await ethers.getContract("RandomizerRNG"); +rng2 = await ethers.getContract("BlockHashRNG"); +options = { gasLimit: 10000000, gasPrice: 5000000000 }; + +console.log("core phase: %s", await core.phase()); +console.log("disputekit phase: %s", await disputeKit.phase()); +console.log("freezingPhase timeout? %s", await core.freezingPhaseTimeout()); diff --git a/contracts/src/arbitration/mock/Faucet.sol b/contracts/src/arbitration/mock/Faucet.sol new file mode 100644 index 000000000..ad592046d --- /dev/null +++ b/contracts/src/arbitration/mock/Faucet.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +contract Faucet { + IERC20 public token; + mapping(address => bool) public withdrewAlready; + + constructor(IERC20 _token) { + token = _token; + } + + function balance() public view returns (uint) { + return token.balanceOf(address(this)); + } + + function request() public { + require( + !withdrewAlready[msg.sender], + "You have used this faucet already. If you need more tokens, please use another address." + ); + token.transfer(msg.sender, 10000 ether); + withdrewAlready[msg.sender] = true; + } +} diff --git a/contracts/src/arbitration/mock/WETH.sol b/contracts/src/arbitration/mock/WETH.sol new file mode 100644 index 000000000..7f0a6ea15 --- /dev/null +++ b/contracts/src/arbitration/mock/WETH.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract WETH is ERC20 { + constructor() ERC20("Wrapped ETH", "WETH") { + _mint(msg.sender, 1000000 ether); + } +} diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol index bd7d98732..cca8c0432 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol @@ -79,7 +79,6 @@ contract WrappedPinakion is Initializable { decimals = 18; xPinakion = _xPinakion; tokenBridge = _tokenBridge; - controller = msg.sender; } diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol index cc852f438..cf4d36166 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol @@ -13,7 +13,7 @@ import {SortitionSumTreeFactory} from "../../libraries/SortitionSumTreeFactory.s import "../../gateway/interfaces/IForeignGateway.sol"; /** - * @title xKlerosLiquid + * @title xKlerosLiquidToV2 * @dev This contract is an adaption of Mainnet's KlerosLiquid (https://github.com/kleros/kleros/blob/69cfbfb2128c29f1625b3a99a3183540772fda08/contracts/kleros/KlerosLiquid.sol) * for xDai chain. Notice that variables referring to ETH values in this contract, will hold the native token values of the chain on which xKlerosLiquid is deployed. * When this contract gets deployed on xDai chain, ETH variables will hold xDai values. From 606d85ec174e91cdc9756dc838c4ac71a59b1cb3 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 1 Feb 2023 22:32:58 +0000 Subject: [PATCH 2/9] chore: generated artifacts for existing contracts --- contracts/deployments/chiado/TokenBridge.json | 4 + .../gnosischain/PolicyRegistry.json | 98 ++ .../deployments/gnosischain/TokenBridge.json | 140 +++ .../gnosischain/TransactionBatcher.json | 28 + contracts/deployments/gnosischain/WETH.json | 883 ++++++++++++++++++ .../gnosischain/WrappedPinakion.json | 136 +++ .../gnosischain/xKlerosLiquid.json | 136 +++ contracts/deployments/gnosischain/xPNK.json | 4 + contracts/hardhat.config.ts | 10 + .../scripts/generateDeploymentArtifact.sh | 68 ++ 10 files changed, 1507 insertions(+) create mode 100644 contracts/deployments/chiado/TokenBridge.json create mode 100644 contracts/deployments/gnosischain/PolicyRegistry.json create mode 100644 contracts/deployments/gnosischain/TokenBridge.json create mode 100644 contracts/deployments/gnosischain/TransactionBatcher.json create mode 100644 contracts/deployments/gnosischain/WETH.json create mode 100644 contracts/deployments/gnosischain/WrappedPinakion.json create mode 100644 contracts/deployments/gnosischain/xKlerosLiquid.json create mode 100644 contracts/deployments/gnosischain/xPNK.json create mode 100755 contracts/scripts/generateDeploymentArtifact.sh diff --git a/contracts/deployments/chiado/TokenBridge.json b/contracts/deployments/chiado/TokenBridge.json new file mode 100644 index 000000000..b948fcc54 --- /dev/null +++ b/contracts/deployments/chiado/TokenBridge.json @@ -0,0 +1,4 @@ +{ + "address": "0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2", + "abi": [] +} diff --git a/contracts/deployments/gnosischain/PolicyRegistry.json b/contracts/deployments/gnosischain/PolicyRegistry.json new file mode 100644 index 000000000..ed3066b1b --- /dev/null +++ b/contracts/deployments/gnosischain/PolicyRegistry.json @@ -0,0 +1,98 @@ +{ + "address": "0x9d494768936b6bDaabc46733b8D53A937A6c6D7e", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "governor", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_subcourtID", + "type": "uint256" + }, + { + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "_governor", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_subcourtID", + "type": "uint256" + }, + { + "indexed": false, + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + } + ] +} diff --git a/contracts/deployments/gnosischain/TokenBridge.json b/contracts/deployments/gnosischain/TokenBridge.json new file mode 100644 index 000000000..4f1c50e09 --- /dev/null +++ b/contracts/deployments/gnosischain/TokenBridge.json @@ -0,0 +1,140 @@ +{ + "address": "0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "version", + "type": "uint256" + }, + { + "name": "implementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "version", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "implementation", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "upgradeabilityOwner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "version", + "type": "uint256" + }, + { + "name": "implementation", + "type": "address" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "newOwner", + "type": "address" + } + ], + "name": "transferProxyOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "previousOwner", + "type": "address" + }, + { + "indexed": false, + "name": "newOwner", + "type": "address" + } + ], + "name": "ProxyOwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "version", + "type": "uint256" + }, + { + "indexed": true, + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + } + ] +} diff --git a/contracts/deployments/gnosischain/TransactionBatcher.json b/contracts/deployments/gnosischain/TransactionBatcher.json new file mode 100644 index 000000000..e1dbd9e24 --- /dev/null +++ b/contracts/deployments/gnosischain/TransactionBatcher.json @@ -0,0 +1,28 @@ +{ + "address": "0x6426800F8508b15AED271337498fa5e7D0794d46", + "abi": [ + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "datas", + "type": "bytes[]" + } + ], + "name": "batchSend", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} diff --git a/contracts/deployments/gnosischain/WETH.json b/contracts/deployments/gnosischain/WETH.json new file mode 100644 index 000000000..dce27dbb9 --- /dev/null +++ b/contracts/deployments/gnosischain/WETH.json @@ -0,0 +1,883 @@ +{ + "address": "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "mintingFinished", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "result", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_bridgeContract", + "type": "address" + } + ], + "name": "setBridgeContract", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "name": "result", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_data", + "type": "bytes" + } + ], + "name": "transferAndCall", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "version", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_token", + "type": "address" + }, + { + "name": "_to", + "type": "address" + } + ], + "name": "claimTokens", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_address", + "type": "address" + } + ], + "name": "isBridge", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "finishMinting", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTokenInterfacesVersion", + "outputs": [ + { + "name": "major", + "type": "uint64" + }, + { + "name": "minor", + "type": "uint64" + }, + { + "name": "patch", + "type": "uint64" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_holder", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + }, + { + "name": "_nonce", + "type": "uint256" + }, + { + "name": "_expiry", + "type": "uint256" + }, + { + "name": "_allowed", + "type": "bool" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "push", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "move", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "PERMIT_TYPEHASH_LEGACY", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "bridgeContract", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_holder", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_deadline", + "type": "uint256" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "pull", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "expirations", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_name", + "type": "string" + }, + { + "name": "_symbol", + "type": "string" + }, + { + "name": "_decimals", + "type": "uint8" + }, + { + "name": "_chainId", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "MintFinished", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "previousOwner", + "type": "address" + } + ], + "name": "OwnershipRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "burner", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "data", + "type": "bytes" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + } + ] +} diff --git a/contracts/deployments/gnosischain/WrappedPinakion.json b/contracts/deployments/gnosischain/WrappedPinakion.json new file mode 100644 index 000000000..f057e5e8c --- /dev/null +++ b/contracts/deployments/gnosischain/WrappedPinakion.json @@ -0,0 +1,136 @@ +{ + "address": "0xcb3231aBA3b451343e0Fddfc45883c842f223846", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "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" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} diff --git a/contracts/deployments/gnosischain/xKlerosLiquid.json b/contracts/deployments/gnosischain/xKlerosLiquid.json new file mode 100644 index 000000000..ee31ded75 --- /dev/null +++ b/contracts/deployments/gnosischain/xKlerosLiquid.json @@ -0,0 +1,136 @@ +{ + "address": "0x9C1dA9A04925bDfDedf0f6421bC7EEa8305F9002", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "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" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} diff --git a/contracts/deployments/gnosischain/xPNK.json b/contracts/deployments/gnosischain/xPNK.json new file mode 100644 index 000000000..406599d18 --- /dev/null +++ b/contracts/deployments/gnosischain/xPNK.json @@ -0,0 +1,4 @@ +{ + "address": "0x37b60f4E9A31A64cCc0024dce7D0fD07eAA0F7B3", + "abi": [] +} diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index faab991a3..2e729e8fc 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -140,6 +140,11 @@ const config: HardhatUserConfig = { companionNetworks: { home: "arbitrumGoerli", }, + verify: { + etherscan: { + apiKey: process.env.GNOSISSCAN_API_KEY, + }, + }, }, gnosischain: { chainId: 100, @@ -148,6 +153,11 @@ const config: HardhatUserConfig = { live: true, saveDeployments: true, tags: ["production", "foreign", "layer1"], + verify: { + etherscan: { + apiKey: process.env.GNOSISSCAN_API_KEY, + }, + }, }, }, namedAccounts: { diff --git a/contracts/scripts/generateDeploymentArtifact.sh b/contracts/scripts/generateDeploymentArtifact.sh new file mode 100755 index 000000000..ea9a7dce0 --- /dev/null +++ b/contracts/scripts/generateDeploymentArtifact.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source $SCRIPT_DIR/../.env + +if [[ $# < 2 ]] +then + echo "usage: $(basename $0)
" + exit 1 +fi + +network=$1 +address=$2 + +# Limitation: proxy contracts will return the proxy's ABI, not its implementation's ABI. +# Workaround: query the address of the implementation, and manually change the address to the proxy's in the artifact. +# Example: WETH on Gnosis chain, https://gnosisscan.io/address/0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1#code + +case $network in +gnosischain) + url="https://api.gnosisscan.io" + apiKey="$GNOSISSCAN_API_KEY" + ;; +chiado) + # Warning: these are distinct instances! + # https://blockscout.com/gnosis/chiado/api-docs + # https://blockscout.chiadochain.net + url="https://blockscout.com/gnosis/chiado" + apiKey="" + ;; +arbitrum) + url="https://api.arbiscan.io" + apiKey="$ARBISCAN_API_KEY" + ;; +arbitrumGoerli) + url="https://api-goerli.arbiscan.io" + apiKey="$ARBISCAN_API_KEY" + ;; +mainnet) + url="https://api.etherscan.io" + apiKey="$ETHERSCAN_API_KEY" + ;; +*) + echo "error: unknown network $network" + exit 1 +esac + +query="$url/api?module=contract&action=getabi&address=$address" +if [[ -n $apiKey ]] +then + query="$query&apikey=$apiKey" +fi + +result=$(curl -s "$query") +if [[ $(echo "$result" | jq -r .status) == 0 ]] +then + echo "error: contract not verified or does not exist" + abi="[]" +else + abi=$(echo "$result" | jq -r .result) +fi + +jq \ + --arg address "$address" \ + --argjson abi "$abi" \ + '{ "address": $address, "abi": $abi }' <<< '{}' + + From 880d5ed4d99cc04fe7d922a0ca2c4e97063391f9 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 1 Feb 2023 22:33:52 +0000 Subject: [PATCH 3/9] chore: extra env variable --- contracts/.env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/.env.example b/contracts/.env.example index 1b3968e7f..2fdfa0ebb 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -6,6 +6,7 @@ INFURA_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 # If ETHERSCAN_API_KEY is set, it overrides any hardhat configuration. ETHERSCAN_API_KEY_FIX=ABC123ABC123ABC123ABC123ABC123ABC1 ARBISCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 +GNOSISSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 # Optionally for debugging # TENDERLY_USERNAME=your_username From 5fc36ba7234abebf9a69ad7decc4b7cfe24d1f65 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 1 Feb 2023 22:35:23 +0000 Subject: [PATCH 4/9] chore: added goerli network --- contracts/scripts/generateDeploymentArtifact.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/scripts/generateDeploymentArtifact.sh b/contracts/scripts/generateDeploymentArtifact.sh index ea9a7dce0..f68852b07 100755 --- a/contracts/scripts/generateDeploymentArtifact.sh +++ b/contracts/scripts/generateDeploymentArtifact.sh @@ -40,6 +40,10 @@ mainnet) url="https://api.etherscan.io" apiKey="$ETHERSCAN_API_KEY" ;; +goerli) + url="https://api-goerli.etherscan.io" + apiKey="$ETHERSCAN_API_KEY" + ;; *) echo "error: unknown network $network" exit 1 From 17b427572cfcc92fc326fbc6835979dedcad1aee Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 3 Feb 2023 00:18:35 +0000 Subject: [PATCH 5/9] chore: vea-contracts bumped --- contracts/package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index 054f362ff..7f156b437 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -69,6 +69,6 @@ "typescript": "^4.6.4" }, "dependencies": { - "@kleros/vea-contracts": "^0.1.10" + "@kleros/vea-contracts": "^0.1.2" } } diff --git a/yarn.lock b/yarn.lock index d38805948..3f9e4843f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2253,7 +2253,7 @@ __metadata: version: 0.0.0-use.local resolution: "@kleros/kleros-v2-contracts@workspace:contracts" dependencies: - "@kleros/vea-contracts": ^0.1.10 + "@kleros/vea-contracts": ^0.1.2 "@nomicfoundation/hardhat-chai-matchers": ^1.0.4 "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.13" "@nomiclabs/hardhat-waffle": ^2.0.3 @@ -2385,12 +2385,12 @@ __metadata: languageName: node linkType: hard -"@kleros/vea-contracts@npm:^0.1.10": - version: 0.1.10 - resolution: "@kleros/vea-contracts@npm:0.1.10" +"@kleros/vea-contracts@npm:^0.1.2": + version: 0.1.11 + resolution: "@kleros/vea-contracts@npm:0.1.11" dependencies: "@openzeppelin/contracts": ^4.8.0 - checksum: d2972d2a9e3870817dc72c6ad8142a658ce556d6c9dc8f2ab6657d3a570f2954e6cc797466adf5e13f8f81a69e436887ff5e6f48e1fc6755b1373b584e9b6b01 + checksum: 0888cae26ac5873be8e8e84d204f53d9f48672e97b1a8eff350d72427cccca20af64a27615de4ea74109c6d14295cf7c96f0bf387e31659b10ce114a77485d75 languageName: node linkType: hard From 4baa51e895a3ec97793b950bc7a4d23fb5d2f8a1 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 3 Feb 2023 13:39:54 +0000 Subject: [PATCH 6/9] refactor: moved token folder --- contracts/src/{arbitration/mock => token}/Faucet.sol | 0 contracts/src/{arbitration/mock => token}/PNK.sol | 0 contracts/src/{arbitration/mock => token}/WETH.sol | 0 web/src/hooks/queries/usePNKAllowance.ts | 2 +- web/src/hooks/queries/usePNKBalance.ts | 2 +- web/src/pages/Courts/CourtDetails/StakeModal.tsx | 2 +- 6 files changed, 3 insertions(+), 3 deletions(-) rename contracts/src/{arbitration/mock => token}/Faucet.sol (100%) rename contracts/src/{arbitration/mock => token}/PNK.sol (100%) rename contracts/src/{arbitration/mock => token}/WETH.sol (100%) diff --git a/contracts/src/arbitration/mock/Faucet.sol b/contracts/src/token/Faucet.sol similarity index 100% rename from contracts/src/arbitration/mock/Faucet.sol rename to contracts/src/token/Faucet.sol diff --git a/contracts/src/arbitration/mock/PNK.sol b/contracts/src/token/PNK.sol similarity index 100% rename from contracts/src/arbitration/mock/PNK.sol rename to contracts/src/token/PNK.sol diff --git a/contracts/src/arbitration/mock/WETH.sol b/contracts/src/token/WETH.sol similarity index 100% rename from contracts/src/arbitration/mock/WETH.sol rename to contracts/src/token/WETH.sol diff --git a/web/src/hooks/queries/usePNKAllowance.ts b/web/src/hooks/queries/usePNKAllowance.ts index dee9d64be..8e082bbba 100644 --- a/web/src/hooks/queries/usePNKAllowance.ts +++ b/web/src/hooks/queries/usePNKAllowance.ts @@ -1,5 +1,5 @@ import useSWR from "swr"; -import { PNK } from "@kleros/kleros-v2-contracts/typechain-types/src/arbitration/mock/PNK"; +import { PNK } from "@kleros/kleros-v2-contracts/typechain-types/src/token/PNK"; import { useConnectedContract } from "hooks/useConnectedContract"; import { CONTRACTS } from "utils/getContract"; diff --git a/web/src/hooks/queries/usePNKBalance.ts b/web/src/hooks/queries/usePNKBalance.ts index e7c21b88b..9e6901775 100644 --- a/web/src/hooks/queries/usePNKBalance.ts +++ b/web/src/hooks/queries/usePNKBalance.ts @@ -1,5 +1,5 @@ import useSWR from "swr"; -import { PNK } from "@kleros/kleros-v2-contracts/typechain-types/src/arbitration/mock/PNK"; +import { PNK } from "@kleros/kleros-v2-contracts/typechain-types/src/token/PNK"; import { useConnectedContract } from "hooks/useConnectedContract"; export const usePNKBalance = (user?: string | null) => { diff --git a/web/src/pages/Courts/CourtDetails/StakeModal.tsx b/web/src/pages/Courts/CourtDetails/StakeModal.tsx index 0ea6cdf9d..56e044143 100644 --- a/web/src/pages/Courts/CourtDetails/StakeModal.tsx +++ b/web/src/pages/Courts/CourtDetails/StakeModal.tsx @@ -4,7 +4,7 @@ import { useParams } from "react-router-dom"; import Modal from "react-modal"; import { BigNumber } from "ethers"; import { Field, Button } from "@kleros/ui-components-library"; -import { PNK } from "@kleros/kleros-v2-contracts/typechain-types/src/arbitration/mock/PNK"; +import { PNK } from "@kleros/kleros-v2-contracts/typechain-types/src/token/PNK"; import { KlerosCore } from "@kleros/kleros-v2-contracts/typechain-types/src/arbitration/KlerosCore"; import { useWeb3 } from "hooks/useWeb3"; import { useConnectedContract } from "hooks/useConnectedContract"; From 3c9cb0f2fa00af35ae76321eaacfabd7470ea5bd Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 3 Feb 2023 16:05:49 +0000 Subject: [PATCH 7/9] chore: gateways deployment to ArbitrumGoerli and Chiado --- contracts/README.md | 34 +- contracts/deploy/00-home-chain-arbitration.ts | 2 +- contracts/deploy/00-rng.ts | 2 +- ...y.ts => 01-foreign-gateway-on-ethereum.ts} | 9 +- ...sis.ts => 01-foreign-gateway-on-gnosis.ts} | 51 +- ...eway.ts => 02-home-gateway-to-ethereum.ts} | 11 +- contracts/deploy/02-home-gateway-to-gnosis.ts | 42 ++ contracts/deploy/03-vea-mock.ts | 2 +- .../deploy/04-klerosliquid-to-v2-gnosis.ts | 12 +- .../arbitrumGoerli/HomeGatewayToGnosis.json | 528 +++++++++++++ contracts/deployments/chiado/.chainId | 1 + .../chiado/ForeignGatewayOnGnosis.json | 697 ++++++++++++++++++ contracts/deployments/chiado/WETH.json | 436 +++++++++++ contracts/deployments/chiado/WETHFaucet.json | 146 ++++ contracts/hardhat.config.ts | 19 +- contracts/package.json | 2 +- ...Gateway.sol => ForeignGatewayOnGnosis.sol} | 2 +- ...erosLiquidToV2.sol => xKlerosLiquidV2.sol} | 4 +- yarn.lock | 4 +- 19 files changed, 1946 insertions(+), 58 deletions(-) rename contracts/deploy/{01-foreign-gateway.ts => 01-foreign-gateway-on-ethereum.ts} (91%) rename contracts/deploy/{01-foreign-gateway-gnosis.ts => 01-foreign-gateway-on-gnosis.ts} (65%) rename contracts/deploy/{02-home-gateway.ts => 02-home-gateway-to-ethereum.ts} (72%) create mode 100644 contracts/deploy/02-home-gateway-to-gnosis.ts create mode 100644 contracts/deployments/arbitrumGoerli/HomeGatewayToGnosis.json create mode 100644 contracts/deployments/chiado/.chainId create mode 100644 contracts/deployments/chiado/ForeignGatewayOnGnosis.json create mode 100644 contracts/deployments/chiado/WETH.json create mode 100644 contracts/deployments/chiado/WETHFaucet.json rename contracts/src/gateway/{xForeignGateway.sol => ForeignGatewayOnGnosis.sol} (99%) rename contracts/src/kleros-v1/kleros-liquid-xdai/{xKlerosLiquidToV2.sol => xKlerosLiquidV2.sol} (99%) diff --git a/contracts/README.md b/contracts/README.md index 6e74920ed..9d2b95f4d 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -82,6 +82,7 @@ The ones below are optional: - `ETHERSCAN_API_KEY`: to verify the source of the newly deployed contracts on **Etherscan**. - `ARBISCAN_API_KEY`: to verify the source of the newly deployed contracts on **Arbitrum**. +- `GNOSISSCAN_API_KEY`: to verify the source of the newly deployed contracts on **Gnosis chain**. #### 1. Update the Constructor Parameters (optional) @@ -100,20 +101,25 @@ yarn hardhat node --tags nothing **Shell 2: the deploy script** ```bash -yarn deploy --network localhost --tags +yarn deploy --network localhost --tags ``` #### 3. Deploy to Public Testnets ```bash +# ArbitrumGoerli to Chiado +yarn deploy --network arbitrumGoerli --tags Arbitration +yarn deploy --network chiado --tags ForeignGatewayOnGnosis +yarn deploy --network chiado --tags KlerosLiquidOnGnosis +yarn deploy --network arbitrumGoerli --tags HomeGatewayToGnosis + # Goerli yarn deploy --network arbitrumGoerli --tags Arbitration -yarn deploy --network goerli --tags ForeignGateway -yarn deploy --network arbitrumGoerli --tags HomeGateway +yarn deploy --network goerli --tags ForeignGatewayOnEthereum +yarn deploy --network arbitrumGoerli --tags HomeGatewayToEthereum ``` -The deployed addresses should be output to the screen after the deployment is complete. -If you miss that, you can always go to the `deployments/` directory and look for the respective file. +The deployed addresses should be displayed to the screen after the deployment is complete. If you missed them, you can always go to the `deployments/` directory and look for the respective file. #### Running Test Fixtures @@ -134,7 +140,7 @@ yarn test --network localhost This must be done for each network separately. ```bash -yarn etherscan-verify --network +yarn etherscan-verify --network ``` ## Ad-hoc procedures @@ -153,7 +159,7 @@ done #### 2/ Import the data to V2 - Local Network -:warning: This script populates only from `*.mainnet.json`, but not from `*.gnosischain.json` at this time. +:warning: By default this script populates from `*.mainnet.json`. To populate from `*.gnosischain.json`, set the variable `USE_GNOSIS` to true inside [scripts/populateCourts.ts](scripts/populateCourts.ts). :warning: It is possible to switch to testnet-friendly court parameters by setting the variable `TESTING_PARAMETERS` to true inside [scripts/populateCourts.ts](scripts/populateCourts.ts). @@ -177,6 +183,20 @@ yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumGoerli yarn hardhat run scripts/populateCourts.ts --network arbitrumGoerli ``` +### Generate deployment artifacts for existing contracts + +#### Usage + +```bash +scripts/generateDeploymentArtifact.sh
+``` + +#### Example: WETH on Gnosis chain + +```bash +scripts/generateDeploymentArtifact.sh gnosischain 0xf8d1677c8a0c961938bf2f9adc3f3cfda759a9d9 > deployments/gnosischain/WETH.json +``` + ### Push the contracts to a Tenderly project Ensure that your `$TENDERLY_PROJECT` and `$TENDERLY_USERNAME` is set correctly in `.env`. diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index c3ebcb193..f23c73474 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -111,7 +111,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) }); }; -deployArbitration.tags = ["HomeChain", "Arbitration"]; +deployArbitration.tags = ["Arbitration"]; deployArbitration.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !HomeChains[chainId]; diff --git a/contracts/deploy/00-rng.ts b/contracts/deploy/00-rng.ts index afd5045b6..035243b9f 100644 --- a/contracts/deploy/00-rng.ts +++ b/contracts/deploy/00-rng.ts @@ -63,7 +63,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) await disputeKit.changeRandomNumberGenerator(rng.address, RNG_LOOKAHEAD); }; -deployArbitration.tags = ["HomeChain", "RNG"]; +deployArbitration.tags = ["RNG"]; deployArbitration.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !HomeChains[chainId]; diff --git a/contracts/deploy/01-foreign-gateway.ts b/contracts/deploy/01-foreign-gateway-on-ethereum.ts similarity index 91% rename from contracts/deploy/01-foreign-gateway.ts rename to contracts/deploy/01-foreign-gateway-on-ethereum.ts index a10f8b850..0ff562108 100644 --- a/contracts/deploy/01-foreign-gateway.ts +++ b/contracts/deploy/01-foreign-gateway-on-ethereum.ts @@ -19,13 +19,14 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme console.log("deploying to chainId %s with deployer %s", chainId, deployer); const homeNetworks = { - 1: config.networks.arbitrum, - 5: config.networks.arbitrumGoerli, + ETHEREUM_MAINNET: config.networks.arbitrum, + ETHEREUM_GOERLI: config.networks.arbitrumGoerli, + HARDHAT: config.networks.localhost, }; // Hack to predict the deployment address on the home chain. // TODO: use deterministic deployments - const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[chainId].url); + const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[ForeignChains[chainId]].url); let nonce = await homeChainProvider.getTransactionCount(deployer); nonce += 2; // HomeGatewayToEthereum deploy tx will the third tx after this on its home network, so we add two to the current nonce. const homeChainId = (await homeChainProvider.getNetwork()).chainId; @@ -60,7 +61,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme }); }; -deployForeignGateway.tags = ["ForeignChain", "ForeignGateway"]; +deployForeignGateway.tags = ["ForeignGatewayOnEthereum"]; deployForeignGateway.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !ForeignChains[chainId]; diff --git a/contracts/deploy/01-foreign-gateway-gnosis.ts b/contracts/deploy/01-foreign-gateway-on-gnosis.ts similarity index 65% rename from contracts/deploy/01-foreign-gateway-gnosis.ts rename to contracts/deploy/01-foreign-gateway-on-gnosis.ts index ab833a346..b04b4e37c 100644 --- a/contracts/deploy/01-foreign-gateway-gnosis.ts +++ b/contracts/deploy/01-foreign-gateway-on-gnosis.ts @@ -24,26 +24,29 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme console.log("deploying to chainId %s with deployer %s", chainId, deployer); const homeNetworks = { - 1: config.networks.arbitrum, - 5: config.networks.arbitrumGoerli, + GNOSIS_MAINNET: config.networks.arbitrum, + GNOSIS_CHIADO: config.networks.arbitrumGoerli, + HARDHAT: config.networks.localhost, }; // Hack to predict the deployment address on the home chain. // TODO: use deterministic deployments - const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[chainId].url); + const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[ForeignChains[chainId]].url); let nonce = await homeChainProvider.getTransactionCount(deployer); - nonce += 2; // HomeGatewayToEthereum deploy tx will the third tx after this on its home network, so we add two to the current nonce. - const homeChainId = (await homeChainProvider.getNetwork()).chainId; - const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); - const homeGatewayAddress = getContractAddress(deployer, nonce); + const homeGatewayAddress = getContractAddress(deployer, nonce); // HomeGateway deploy tx will be the next tx home network console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const veaReceiver = await deployments.get("FastBridgeReceiverOnGnosis"); + console.log("using FastBridgeReceiverOnGnosis at %s", veaReceiver.address); + + const ONE_GWEI = ethers.utils.parseUnits("1", "gwei"); if (!wethByChain.get(chainId)) { const weth = await deploy("WETH", { from: deployer, log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, }); wethByChain.set(ForeignChains[ForeignChains[chainId]], weth.address); @@ -51,29 +54,37 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme await deploy("WETHFaucet", { from: deployer, contract: "Faucet", - args: [weth], + args: [weth.address], log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, }); } - const foreignGateway = await deploy("xForeignGateway", { + const wethAddress = wethByChain.get(ForeignChains[ForeignChains[chainId]]); + const homeChainId = (await homeChainProvider.getNetwork()).chainId; + const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); + + await deploy("ForeignGatewayOnGnosis", { from: deployer, - contract: "xForeignGateway", - args: [deployer, veaReceiver.address, homeGatewayAddress, homeChainIdAsBytes32, wethByChain[chainId]], - gasLimit: 4000000, + contract: "ForeignGatewayOnGnosis", + args: [deployer, veaReceiver.address, homeGatewayAddress, homeChainIdAsBytes32, wethAddress], log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, }); - await execute( - "xForeignGateway", - { from: deployer, log: true }, - "changeCourtJurorFee", - 0, - ethers.utils.parseEther("0.00001") // TODO: fix this from xKlerosLiquid xDAI -> ETH amount - ); + // TODO: disable the gateway until fully initialized with the correct fees OR allow disputeCreators to add funds again if necessary. + // await execute( + // "ForeignGatewayOnGnosis", + // { from: deployer, log: true }, + // "changeCourtJurorFee", + // 0, + // ethers.utils.parseEther("0.00001") + // ); }; -deployForeignGateway.tags = ["ForeignChain", "ForeignGatewayOnGnosis"]; +deployForeignGateway.tags = ["ForeignGatewayOnGnosis"]; deployForeignGateway.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !ForeignChains[chainId]; diff --git a/contracts/deploy/02-home-gateway.ts b/contracts/deploy/02-home-gateway-to-ethereum.ts similarity index 72% rename from contracts/deploy/02-home-gateway.ts rename to contracts/deploy/02-home-gateway-to-ethereum.ts index 5c02bee56..ba90f8e9f 100644 --- a/contracts/deploy/02-home-gateway.ts +++ b/contracts/deploy/02-home-gateway-to-ethereum.ts @@ -18,11 +18,14 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) const chainId = Number(await getChainId()); console.log("deploying to chainId %s with deployer %s", chainId, deployer); - const veaSender = await deployments.get("FastBridgeSender"); + const veaSender = await deployments.get("FastBridgeSenderToEthereum"); const klerosCore = await deployments.get("KlerosCore"); - const foreignGateway = await hre.companionNetworks.foreign.deployments.get("ForeignGatewayOnEthereum"); - const foreignChainId = Number(await hre.companionNetworks.foreign.getChainId()); + const foreignGateway = await hre.companionNetworks.foreignGoerli.deployments.get("ForeignGatewayOnEthereum"); + const foreignChainId = Number(await hre.companionNetworks.foreignGoerli.getChainId()); + const foreignChainName = await hre.companionNetworks.foreignGoerli.deployments.getNetworkName(); + console.log("Using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); + await deploy("HomeGatewayToEthereum", { from: deployer, contract: "HomeGateway", @@ -31,7 +34,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) }); // nonce+0 }; -deployHomeGateway.tags = ["HomeChain", "HomeGateway"]; +deployHomeGateway.tags = ["HomeGatewayToEthereum"]; deployHomeGateway.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !HomeChains[chainId]; diff --git a/contracts/deploy/02-home-gateway-to-gnosis.ts b/contracts/deploy/02-home-gateway-to-gnosis.ts new file mode 100644 index 000000000..4afc58ac8 --- /dev/null +++ b/contracts/deploy/02-home-gateway-to-gnosis.ts @@ -0,0 +1,42 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; + +enum HomeChains { + ARBITRUM_ONE = 42161, + ARBITRUM_GOERLI = 421613, +} + +// TODO: use deterministic deployments + +const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, getNamedAccounts, getChainId } = hre; + const { deploy } = deployments; + + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; + const chainId = Number(await getChainId()); + console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + + const veaSender = await deployments.get("FastBridgeSenderToGnosis"); + const klerosCore = await deployments.get("KlerosCore"); + + const foreignGateway = await hre.companionNetworks.foreignChiado.deployments.get("ForeignGatewayOnGnosis"); + const foreignChainId = Number(await hre.companionNetworks.foreignChiado.getChainId()); + const foreignChainName = await hre.companionNetworks.foreignChiado.deployments.getNetworkName(); + console.log("Using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); + + await deploy("HomeGatewayToGnosis", { + from: deployer, + contract: "HomeGateway", + args: [deployer, klerosCore.address, veaSender.address, foreignGateway.address, foreignChainId], + log: true, + }); // nonce+0 +}; + +deployHomeGateway.tags = ["HomeGatewayToGnosis"]; +deployHomeGateway.skip = async ({ getChainId }) => { + const chainId = Number(await getChainId()); + return !HomeChains[chainId]; +}; + +export default deployHomeGateway; diff --git a/contracts/deploy/03-vea-mock.ts b/contracts/deploy/03-vea-mock.ts index 82cf44030..08f430026 100644 --- a/contracts/deploy/03-vea-mock.ts +++ b/contracts/deploy/03-vea-mock.ts @@ -61,7 +61,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) }); }; -deployHomeGateway.tags = ["HomeChain", "VeaMock"]; +deployHomeGateway.tags = ["VeaMock"]; deployHomeGateway.skip = async ({ getChainId }) => HARDHAT_NETWORK !== Number(await getChainId()); export default deployHomeGateway; diff --git a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts index ab1bae1c1..878f47cde 100644 --- a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts +++ b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts @@ -25,7 +25,7 @@ const tokenBridgeByChain = new Map([ [ForeignChains.GNOSIS_CHIADO, "0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2"], ]); -const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { +const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; const { deploy, execute } = deployments; const { hexZeroPad, hexlify } = ethers.utils; @@ -78,13 +78,13 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme tokenBridge ); - const xKlerosLiquidToV2 = await deploy("xKlerosLiquidToV2", { + const xKlerosLiquidV2 = await deploy("xKlerosLiquidV2", { from: deployer, log: true, }); await execute( - "xKlerosLiquidToV2", + "xKlerosLiquidV2", { from: deployer, log: true }, "initialize", deployer, @@ -106,10 +106,10 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme }); }; -deployForeignGateway.tags = ["ForeignChain", "KlerosLiquidOnGnosis"]; -deployForeignGateway.skip = async ({ getChainId }) => { +deployKlerosLiquid.tags = ["KlerosLiquidOnGnosis"]; +deployKlerosLiquid.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); return !ForeignChains[chainId]; }; -export default deployForeignGateway; +export default deployKlerosLiquid; diff --git a/contracts/deployments/arbitrumGoerli/HomeGatewayToGnosis.json b/contracts/deployments/arbitrumGoerli/HomeGatewayToGnosis.json new file mode 100644 index 000000000..5ccd4ac23 --- /dev/null +++ b/contracts/deployments/arbitrumGoerli/HomeGatewayToGnosis.json @@ -0,0 +1,528 @@ +{ + "address": "0x12613A66F1E5A2086374e103F66BF0eddA5d1478", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "contract IFastBridgeSender", + "name": "_fastBridgeSender", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiverGateway", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_receiverChainID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "Dispute", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "MetaEvidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFastBridgeSender", + "name": "_fastBridgeSender", + "type": "address" + } + ], + "name": "changeFastbridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + } + ], + "name": "disputeHashToHomeID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "disputeHashtoID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "disputeHashtoRelayedData", + "outputs": [ + { + "internalType": "uint256", + "name": "arbitrationCost", + "type": "uint256" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeIDtoHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fastBridgeSender", + "outputs": [ + { + "internalType": "contract IFastBridgeSender", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "receiverChainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "receiverGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_foreignChainID", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_foreignBlockHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_foreignDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "relayCreateDispute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x1b37361bc716a5427f13a5eb668f22871da7547ac56e7ef44c4967d6a4772e35", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x12613A66F1E5A2086374e103F66BF0eddA5d1478", + "transactionIndex": 1, + "gasUsed": "693362", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000080000000000000000000000000002000000000000000010000000000000000000000000000000000000000000000000000000000000420000000000000000000800000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x65f02fcc32ad3f4fd7aab1fb0f5e9adaf25f167be850f9260ad4f96736866e14", + "transactionHash": "0x1b37361bc716a5427f13a5eb668f22871da7547ac56e7ef44c4967d6a4772e35", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 6613971, + "transactionHash": "0x1b37361bc716a5427f13a5eb668f22871da7547ac56e7ef44c4967d6a4772e35", + "address": "0x12613A66F1E5A2086374e103F66BF0eddA5d1478", + "topics": [ + "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064252494447450000000000000000000000000000000000000000000000000000", + "logIndex": 0, + "blockHash": "0x65f02fcc32ad3f4fd7aab1fb0f5e9adaf25f167be850f9260ad4f96736866e14" + } + ], + "blockNumber": 6613971, + "cumulativeGasUsed": "693362", + "status": 1, + "byzantium": true + }, + "args": [ + "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "0x3eED6aaCa43f4Bb98C591e4A0d2C4a124efF9C24", + "0x642B66C5D0F8c620C35264F2d2899A0E209D68d9", + "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + 10200 + ], + "numDeployments": 1, + "solcInputHash": "274a15cfb06cddd0a2be7e47f1a3d37a", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"_fastBridgeSender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_receiverGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_receiverChainID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"Dispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"_fastBridgeSender\",\"type\":\"address\"}],\"name\":\"changeFastbridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToHomeID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoRelayedData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"arbitrationCost\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastBridgeSender\",\"outputs\":[{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiverChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiverGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_foreignChainID\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_foreignBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_foreignDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"relayCreateDispute\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"changeFastbridge(address)\":{\"details\":\"Changes the fastBridge, useful to increase the claim deposit.\",\"params\":{\"_fastBridgeSender\":\"The address of the new fastBridge.\"}},\"disputeHashToHomeID(bytes32)\":{\"details\":\"Looks up the local home disputeID for a disputeHash. For cross-chain Evidence standard.\",\"params\":{\"_disputeHash\":\"dispute hash\"}},\"relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)\":{\"details\":\"Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling.\",\"params\":{\"_arbitrable\":\"arbitrable\",\"_choices\":\"number of ruling choices\",\"_extraData\":\"extraData\",\"_foreignBlockHash\":\"foreignBlockHash\",\"_foreignChainID\":\"foreignChainId\",\"_foreignDisputeID\":\"foreignDisputeID\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Home Gateway Counterpart of `ForeignGateway`\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/HomeGateway.sol\":\"HomeGateway\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/vea-contracts/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @hrishibhat]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /**\\n * @dev The Fast Bridge participants watch for these events to decide if a challenge should be submitted.\\n * @param _epoch The epoch for which the the claim was made.\\n * @param _batchMerkleRoot The timestamp of the claim creation.\\n */\\n event ClaimReceived(uint256 indexed _epoch, bytes32 indexed _batchMerkleRoot);\\n\\n /**\\n * @dev This event indicates that `sendSafeFallback()` should be called on the sending side.\\n * @param _epoch The epoch associated with the challenged claim.\\n */\\n event ClaimChallenged(uint256 indexed _epoch);\\n\\n /**\\n * @dev This events indicates that optimistic verification has succeeded. The messages are ready to be relayed.\\n * @param _epoch The epoch associated with the batch.\\n * @param _success The success of the optimistic verification.\\n */\\n event BatchVerified(uint256 indexed _epoch, bool _success);\\n\\n /**\\n * @dev This event indicates that the batch has been received via the Safe Bridge.\\n * @param _epoch The epoch associated with the batch.\\n * @param _isBridgerHonest Whether the bridger made an honest claim.\\n * @param _isChallengerHonest Whether the bridger made an honest challenge.\\n */\\n event BatchSafeVerified(uint256 indexed _epoch, bool _isBridgerHonest, bool _isChallengerHonest);\\n\\n /**\\n * @dev This event indicates that the claim deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _bridger The recipient of the claim deposit.\\n */\\n event ClaimDepositWithdrawn(uint256 indexed _epoch, address indexed _bridger);\\n\\n /**\\n * @dev This event indicates that the challenge deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _challenger The recipient of the challenge deposit.\\n */\\n event ChallengeDepositWithdrawn(uint256 indexed _epoch, address indexed _challenger);\\n\\n /**\\n * @dev This event indicates that a message has been relayed for the batch in this `_epoch`.\\n * @param _epoch The epoch associated with the batch.\\n * @param _nonce The nonce of the message that was relayed.\\n */\\n event MessageRelayed(uint256 indexed _epoch, uint256 indexed _nonce);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Submit a claim about the `_batchMerkleRoot` for the latests completed Fast bridge epoch and submit a deposit. The `_batchMerkleRoot` should match the one on the sending side otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to claim.\\n * @param _batchMerkleRoot The hash claimed for the ticket.\\n */\\n function claim(uint256 _epoch, bytes32 _batchMerkleRoot) external payable;\\n\\n /**\\n * @dev Submit a challenge for the claim of the current epoch's Fast Bridge batch merkleroot state and submit a deposit. The `batchMerkleRoot` in the claim already made for the last finalized epoch should be different from the one on the sending side, otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to challenge.\\n */\\n function challenge(uint256 _epoch) external payable;\\n\\n /**\\n * @dev Resolves the optimistic claim for '_epoch'.\\n * @param _epoch The epoch of the optimistic claim.\\n */\\n function verifyBatch(uint256 _epoch) external;\\n\\n /**\\n * @dev Verifies merkle proof for the given message and associated nonce for the most recent possible epoch and relays the message.\\n * @param _epoch The epoch in which the message was batched by the bridge.\\n * @param _proof The merkle proof to prove the membership of the message and nonce in the merkle tree for the epoch.\\n * @param _message The data on the cross-domain chain for the message.\\n */\\n function verifyAndRelayMessage(\\n uint256 _epoch,\\n bytes32[] calldata _proof,\\n bytes calldata _message\\n ) external;\\n\\n /**\\n * @dev Sends the deposit back to the Bridger if their claim is not successfully challenged. Includes a portion of the Challenger's deposit if unsuccessfully challenged.\\n * @param _epoch The epoch associated with the claim deposit to withraw.\\n */\\n function withdrawClaimDeposit(uint256 _epoch) external;\\n\\n /**\\n * @dev Sends the deposit back to the Challenger if his challenge is successful. Includes a portion of the Bridger's deposit.\\n * @param _epoch The epoch associated with the challenge deposit to withraw.\\n */\\n function withdrawChallengeDeposit(uint256 _epoch) external;\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Returns the `start` and `end` time of challenge period for this `epoch`.\\n * @param _epoch The epoch of the claim to request the challenge period.\\n * @return start The start time of the challenge period.\\n * @return end The end time of the challenge period.\\n */\\n function claimChallengePeriod(uint256 _epoch) external view returns (uint256 start, uint256 end);\\n\\n /**\\n * @dev Returns the epoch period.\\n */\\n function epochPeriod() external view returns (uint256 epochPeriod);\\n\\n /**\\n * @dev Returns the challenge period.\\n */\\n function challengePeriod() external view returns (uint256 challengePeriod);\\n}\\n\",\"keccak256\":\"0xff909a62e9a08540dafcd08c779a64917ed1e44be52d5a225ff9149ff95909e8\",\"license\":\"MIT\"},\"@kleros/vea-contracts/interfaces/IFastBridgeSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeSender {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /**\\n * @dev The Fast Bridge participants need to watch for these events and relay the messageHash on the FastBridgeReceiverOnEthereum.\\n * @param fastMessage The fast message data.\\n * @param fastMessage The hash of the fast message data encoded with the nonce.\\n */\\n event MessageReceived(bytes fastMessage, bytes32 fastMessageHash);\\n\\n /**\\n * @dev The event is emitted when messages are sent through the canonical bridge.\\n * @param epoch The epoch of the batch requested to send.\\n * @param canonicalBridgeMessageID The unique identifier of the safe message returned by the canonical bridge.\\n */\\n event SentSafe(uint256 indexed epoch, bytes32 canonicalBridgeMessageID);\\n\\n /**\\n * The bridgers need to watch for these events and relay the\\n * batchMerkleRoot on the FastBridgeReceiver.\\n */\\n event BatchOutgoing(uint256 indexed batchID, uint256 batchSize, uint256 epoch, bytes32 batchMerkleRoot);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /**\\n * Note: Access must be restricted by the receiving gateway by checking the sender argument.\\n * @dev Sends an arbitrary message across domain using the Fast Bridge.\\n * @param _receiver The cross-domain contract address which receives the calldata.\\n * @param _calldata The receiving domain encoded message data.\\n */\\n function sendFast(address _receiver, bytes memory _calldata) external;\\n\\n /**\\n * Sends a batch of arbitrary message from one domain to another\\n * via the fast bridge mechanism.\\n */\\n function sendBatch() external;\\n\\n /**\\n * @dev Sends a markle root representing an arbitrary batch of messages across domain using the Safe Bridge, which relies on the chain's canonical bridge. It is unnecessary during normal operations but essential only in case of challenge.\\n * @param _epoch block number of batch\\n */\\n function sendSafeFallback(uint256 _epoch) external payable;\\n}\\n\",\"keccak256\":\"0xa5cb5243fff3d0eb309c88c3d93bc69a084b5ff46b5ab31967cfb6f41a2fa145\",\"license\":\"MIT\"},\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IFastBridgeReceiver.sol\\\";\\n\\ninterface IReceiverGateway {\\n function fastBridgeReceiver() external view returns (IFastBridgeReceiver);\\n\\n function senderChainID() external view returns (uint256);\\n\\n function senderGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0xfa82fbd575c462ad6dffa18c67eb097a4c5088715ae956a836726aafa4be0f90\",\"license\":\"MIT\"},\"@kleros/vea-contracts/interfaces/ISenderGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IFastBridgeSender.sol\\\";\\n\\ninterface ISenderGateway {\\n function fastBridgeSender() external view returns (IFastBridgeSender);\\n\\n function receiverChainID() external view returns (uint256);\\n\\n function receiverGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x0d45430dd52c290a79ab4715052550b23c36c0e83899f0be2559dd8d4477b2d9\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrable The arbitrable receiving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x2264bc7cb975d89776b9bf3e35cecd4dec7d601604601ca4822d8bfc0886c379\",\"license\":\"MIT\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/** @title IMetaEvidence\\n * ERC-1497: Evidence Standard excluding evidence emission as it will be handled by the arbitrator.\\n */\\ninterface IMetaEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\n /**\\n * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0xb87dec548b7c41bb2e2bd25ef3b2159d014c14cdd1e47ca4bec7894817cb8998\",\"license\":\"MIT\"},\"src/gateway/HomeGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\nimport \\\"@kleros/vea-contracts/interfaces/IFastBridgeSender.sol\\\";\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\nimport \\\"./interfaces/IHomeGateway.sol\\\";\\n\\n/**\\n * Home Gateway\\n * Counterpart of `ForeignGateway`\\n */\\ncontract HomeGateway is IHomeGateway {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct RelayedData {\\n uint256 arbitrationCost;\\n address relayer;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor;\\n IArbitrator public immutable arbitrator;\\n IFastBridgeSender public fastBridgeSender;\\n address public override receiverGateway;\\n uint256 public immutable override receiverChainID;\\n mapping(uint256 => bytes32) public disputeIDtoHash;\\n mapping(bytes32 => uint256) public disputeHashtoID;\\n mapping(bytes32 => RelayedData) public disputeHashtoRelayedData;\\n\\n constructor(\\n address _governor,\\n IArbitrator _arbitrator,\\n IFastBridgeSender _fastBridgeSender,\\n address _receiverGateway,\\n uint256 _receiverChainID\\n ) {\\n governor = _governor;\\n arbitrator = _arbitrator;\\n fastBridgeSender = _fastBridgeSender;\\n receiverGateway = _receiverGateway;\\n receiverChainID = _receiverChainID;\\n\\n emit MetaEvidence(0, \\\"BRIDGE\\\");\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Changes the fastBridge, useful to increase the claim deposit.\\n * @param _fastBridgeSender The address of the new fastBridge.\\n */\\n function changeFastbridge(IFastBridgeSender _fastBridgeSender) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n fastBridgeSender = _fastBridgeSender;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling.\\n * @param _foreignChainID foreignChainId\\n * @param _foreignBlockHash foreignBlockHash\\n * @param _foreignDisputeID foreignDisputeID\\n * @param _choices number of ruling choices\\n * @param _extraData extraData\\n * @param _arbitrable arbitrable\\n */\\n function relayCreateDispute(\\n uint256 _foreignChainID,\\n bytes32 _foreignBlockHash,\\n uint256 _foreignDisputeID,\\n uint256 _choices,\\n bytes calldata _extraData,\\n address _arbitrable\\n ) external payable override {\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n _foreignChainID,\\n _foreignBlockHash,\\n \\\"createDispute\\\",\\n _foreignDisputeID,\\n _choices,\\n _extraData,\\n _arbitrable\\n )\\n );\\n RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash];\\n require(relayedData.relayer == address(0), \\\"Dispute already relayed\\\");\\n\\n // TODO: will mostly be replaced by the actual arbitrationCost paid on the foreignChain.\\n relayedData.arbitrationCost = arbitrator.arbitrationCost(_extraData);\\n require(msg.value >= relayedData.arbitrationCost, \\\"Not enough arbitration cost paid\\\");\\n\\n uint256 disputeID = arbitrator.createDispute{value: msg.value}(_choices, _extraData);\\n disputeIDtoHash[disputeID] = disputeHash;\\n disputeHashtoID[disputeHash] = disputeID;\\n relayedData.relayer = msg.sender;\\n\\n emit Dispute(arbitrator, disputeID, 0, 0);\\n }\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external override {\\n require(msg.sender == address(arbitrator), \\\"Only Arbitrator\\\");\\n\\n bytes32 disputeHash = disputeIDtoHash[_disputeID];\\n RelayedData memory relayedData = disputeHashtoRelayedData[disputeHash];\\n\\n bytes4 methodSelector = IForeignGateway.relayRule.selector;\\n bytes memory data = abi.encodeWithSelector(methodSelector, disputeHash, _ruling, relayedData.relayer);\\n\\n fastBridgeSender.sendFast(receiverGateway, data);\\n }\\n\\n /**\\n * @dev Looks up the local home disputeID for a disputeHash. For cross-chain Evidence standard.\\n * @param _disputeHash dispute hash\\n */\\n function disputeHashToHomeID(bytes32 _disputeHash) external view override returns (uint256) {\\n return disputeHashtoID[_disputeHash];\\n }\\n}\\n\",\"keccak256\":\"0x795f5944681e6a795ed33881c51833070024b717645fed51cce692faa26f3720\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\nimport \\\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator, IReceiverGateway {\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external returns (uint256 disputeID);\\n}\\n\",\"keccak256\":\"0x4cfc88d2d7cf211ce9a1f3c991f093baefa026784185da2319d566051d0c8c43\",\"license\":\"MIT\"},\"src/gateway/interfaces/IHomeGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrable.sol\\\";\\nimport \\\"../../evidence/IMetaEvidence.sol\\\";\\nimport \\\"@kleros/vea-contracts/interfaces/ISenderGateway.sol\\\";\\n\\ninterface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway {\\n /**\\n * @dev Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling.\\n * @param _foreignChainID foreignChainId\\n * @param _foreignBlockHash foreignBlockHash\\n * @param _foreignDisputeID foreignDisputeID\\n * @param _choices number of ruling choices\\n * @param _extraData extraData\\n * @param _arbitrable arbitrable\\n */\\n function relayCreateDispute(\\n uint256 _foreignChainID,\\n bytes32 _foreignBlockHash,\\n uint256 _foreignDisputeID,\\n uint256 _choices,\\n bytes calldata _extraData,\\n address _arbitrable\\n ) external payable;\\n\\n /**\\n * @dev Looks up the local home disputeID for a disputeHash. For cross-chain Evidence standard.\\n * @param _disputeHash dispute hash\\n */\\n function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x6296077e9f6f88653c48cd4aef0460f63c11a48c53810afd098277f95c778d95\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c060405234801561001057600080fd5b50604051610bcf380380610bcf83398101604081905261002f916100e6565b600080546001600160a01b038088166001600160a01b031992831617835586811660805260018054878316908416179055600280549186169190921617905560a08290526040517f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906100bc9060208082526006908201526542524944474560d01b604082015260600190565b60405180910390a25050505050610151565b6001600160a01b03811681146100e357600080fd5b50565b600080600080600060a086880312156100fe57600080fd5b8551610109816100ce565b602087015190955061011a816100ce565b604087015190945061012b816100ce565b606087015190935061013c816100ce565b80925050608086015190509295509295909350565b60805160a051610a3d6101926000396000610286015260008181610130015281816102e0015281816104e3015281816105c001526106a90152610a3d6000f3fe6080604052600436106100a75760003560e01c8063c5ffcf7011610064578063c5ffcf70146101ad578063c95c0951146101cd578063cddbfa14146101fa578063e7fe313914610254578063ea4f97d314610274578063fc4ba3a2146102a857600080fd5b80630c340a24146100ac578063311a6c56146100e95780633b103f531461010b5780636cc6cde11461011e5780638ed87e0014610152578063ba4bc76314610172575b600080fd5b3480156100b857600080fd5b506000546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100f557600080fd5b50610109610104366004610790565b6102d5565b005b6101096101193660046107da565b610430565b34801561012a57600080fd5b506100cc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561015e57600080fd5b5061010961016d366004610884565b610709565b34801561017e57600080fd5b5061019f61018d3660046108a8565b60036020526000908152604090205481565b6040519081526020016100e0565b3480156101b957600080fd5b506002546100cc906001600160a01b031681565b3480156101d957600080fd5b5061019f6101e83660046108a8565b60046020526000908152604090205481565b34801561020657600080fd5b506102376102153660046108a8565b600560205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b039091166020830152016100e0565b34801561026057600080fd5b506001546100cc906001600160a01b031681565b34801561028057600080fd5b5061019f7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102b457600080fd5b5061019f6102c33660046108a8565b60009081526004602052604090205490565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103445760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b600082815260036020908152604080832054808452600583529281902081518083018352815481526001918201546001600160a01b039081168286018190528451602481018890526044810189905260648082019290925285518082039092018252608401855294850180516001600160e01b031663a60a4db560e01b9081179091529254600254945163263b083b60e21b815292959394908216926398ec20ec926103f692169085906004016108c1565b600060405180830381600087803b15801561041057600080fd5b505af1158015610424573d6000803e3d6000fd5b50505050505050505050565b60008787878787878760405160200161044f9796959493929190610926565b60408051601f1981840301815291815281516020928301206000818152600590935291206001810154919250906001600160a01b0316156104cc5760405162461bcd60e51b8152602060048201526017602482015276111a5cdc1d5d1948185b1c9958591e481c995b185e5959604a1b604482015260640161033b565b60405163f7434ea960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f7434ea99061051a90889088906004016109af565b60206040518083038186803b15801561053257600080fd5b505afa158015610546573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056a91906109cb565b8082553410156105bc5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f73742070616964604482015260640161033b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c13517e1348989896040518563ffffffff1660e01b815260040161060f939291906109e4565b6020604051808303818588803b15801561062857600080fd5b505af115801561063c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061066191906109cb565b6000818152600360209081526040808320879055868352600482528083208490556001860180546001600160a01b0319163317905580518381529182019290925291925082917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000546001600160a01b0316331461076e5760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b606482015260840161033b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080604083850312156107a357600080fd5b50508035926020909101359150565b6001600160a01b03811681146107c757600080fd5b50565b80356107d5816107b2565b919050565b600080600080600080600060c0888a0312156107f557600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff8082111561082957600080fd5b818a0191508a601f83011261083d57600080fd5b81358181111561084c57600080fd5b8b602082850101111561085e57600080fd5b60208301955080945050505061087660a089016107ca565b905092959891949750929550565b60006020828403121561089657600080fd5b81356108a1816107b2565b9392505050565b6000602082840312156108ba57600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b818110156108fd578581018301518582016060015282016108e1565b8181111561090f576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006109c3602083018486610986565b949350505050565b6000602082840312156109dd57600080fd5b5051919050565b8381526040602082015260006109fe604083018486610986565b9594505050505056fea26469706673582212202706fc81fcec6ac92b29d62968422fd856cfdf693260030262280f3f60a900e464736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106100a75760003560e01c8063c5ffcf7011610064578063c5ffcf70146101ad578063c95c0951146101cd578063cddbfa14146101fa578063e7fe313914610254578063ea4f97d314610274578063fc4ba3a2146102a857600080fd5b80630c340a24146100ac578063311a6c56146100e95780633b103f531461010b5780636cc6cde11461011e5780638ed87e0014610152578063ba4bc76314610172575b600080fd5b3480156100b857600080fd5b506000546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100f557600080fd5b50610109610104366004610790565b6102d5565b005b6101096101193660046107da565b610430565b34801561012a57600080fd5b506100cc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561015e57600080fd5b5061010961016d366004610884565b610709565b34801561017e57600080fd5b5061019f61018d3660046108a8565b60036020526000908152604090205481565b6040519081526020016100e0565b3480156101b957600080fd5b506002546100cc906001600160a01b031681565b3480156101d957600080fd5b5061019f6101e83660046108a8565b60046020526000908152604090205481565b34801561020657600080fd5b506102376102153660046108a8565b600560205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b039091166020830152016100e0565b34801561026057600080fd5b506001546100cc906001600160a01b031681565b34801561028057600080fd5b5061019f7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102b457600080fd5b5061019f6102c33660046108a8565b60009081526004602052604090205490565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103445760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b600082815260036020908152604080832054808452600583529281902081518083018352815481526001918201546001600160a01b039081168286018190528451602481018890526044810189905260648082019290925285518082039092018252608401855294850180516001600160e01b031663a60a4db560e01b9081179091529254600254945163263b083b60e21b815292959394908216926398ec20ec926103f692169085906004016108c1565b600060405180830381600087803b15801561041057600080fd5b505af1158015610424573d6000803e3d6000fd5b50505050505050505050565b60008787878787878760405160200161044f9796959493929190610926565b60408051601f1981840301815291815281516020928301206000818152600590935291206001810154919250906001600160a01b0316156104cc5760405162461bcd60e51b8152602060048201526017602482015276111a5cdc1d5d1948185b1c9958591e481c995b185e5959604a1b604482015260640161033b565b60405163f7434ea960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f7434ea99061051a90889088906004016109af565b60206040518083038186803b15801561053257600080fd5b505afa158015610546573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056a91906109cb565b8082553410156105bc5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f73742070616964604482015260640161033b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c13517e1348989896040518563ffffffff1660e01b815260040161060f939291906109e4565b6020604051808303818588803b15801561062857600080fd5b505af115801561063c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061066191906109cb565b6000818152600360209081526040808320879055868352600482528083208490556001860180546001600160a01b0319163317905580518381529182019290925291925082917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000546001600160a01b0316331461076e5760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b606482015260840161033b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080604083850312156107a357600080fd5b50508035926020909101359150565b6001600160a01b03811681146107c757600080fd5b50565b80356107d5816107b2565b919050565b600080600080600080600060c0888a0312156107f557600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff8082111561082957600080fd5b818a0191508a601f83011261083d57600080fd5b81358181111561084c57600080fd5b8b602082850101111561085e57600080fd5b60208301955080945050505061087660a089016107ca565b905092959891949750929550565b60006020828403121561089657600080fd5b81356108a1816107b2565b9392505050565b6000602082840312156108ba57600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b818110156108fd578581018301518582016060015282016108e1565b8181111561090f576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006109c3602083018486610986565b949350505050565b6000602082840312156109dd57600080fd5b5051919050565b8381526040602082015260006109fe604083018486610986565b9594505050505056fea26469706673582212202706fc81fcec6ac92b29d62968422fd856cfdf693260030262280f3f60a900e464736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "changeFastbridge(address)": { + "details": "Changes the fastBridge, useful to increase the claim deposit.", + "params": { + "_fastBridgeSender": "The address of the new fastBridge." + } + }, + "disputeHashToHomeID(bytes32)": { + "details": "Looks up the local home disputeID for a disputeHash. For cross-chain Evidence standard.", + "params": { + "_disputeHash": "dispute hash" + } + }, + "relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)": { + "details": "Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling.", + "params": { + "_arbitrable": "arbitrable", + "_choices": "number of ruling choices", + "_extraData": "extraData", + "_foreignBlockHash": "foreignBlockHash", + "_foreignChainID": "foreignChainId", + "_foreignDisputeID": "foreignDisputeID" + } + }, + "rule(uint256,uint256)": { + "details": "Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.", + "params": { + "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_ruling": "Ruling given by the arbitrator. Note that 0 is reserved for \"Not able/wanting to make a decision\"." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "notice": "Home Gateway Counterpart of `ForeignGateway`", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15581, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 15587, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "fastBridgeSender", + "offset": 0, + "slot": "1", + "type": "t_contract(IFastBridgeSender)162" + }, + { + "astId": 15590, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "receiverGateway", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 15597, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "disputeIDtoHash", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_bytes32)" + }, + { + "astId": 15601, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "disputeHashtoID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 15606, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "disputeHashtoRelayedData", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_bytes32,t_struct(RelayedData)15579_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IFastBridgeSender)162": { + "encoding": "inplace", + "label": "contract IFastBridgeSender", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(RelayedData)15579_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct HomeGateway.RelayedData)", + "numberOfBytes": "32", + "value": "t_struct(RelayedData)15579_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_struct(RelayedData)15579_storage": { + "encoding": "inplace", + "label": "struct HomeGateway.RelayedData", + "members": [ + { + "astId": 15576, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "arbitrationCost", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 15578, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "relayer", + "offset": 0, + "slot": "1", + "type": "t_address" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/chiado/.chainId b/contracts/deployments/chiado/.chainId new file mode 100644 index 000000000..6cd35a3ed --- /dev/null +++ b/contracts/deployments/chiado/.chainId @@ -0,0 +1 @@ +10200 \ No newline at end of file diff --git a/contracts/deployments/chiado/ForeignGatewayOnGnosis.json b/contracts/deployments/chiado/ForeignGatewayOnGnosis.json new file mode 100644 index 000000000..333d0f848 --- /dev/null +++ b/contracts/deployments/chiado/ForeignGatewayOnGnosis.json @@ -0,0 +1,697 @@ +{ + "address": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IFastBridgeReceiver", + "name": "_fastBridgeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "_senderGateway", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_senderChainID", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "_weth", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + } + ], + "name": "ArbitrationCostModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "disputeHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "blockhash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "localDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "arbitrable", + "type": "address" + } + ], + "name": "OutgoingDispute", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "MIN_JURORS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + } + ], + "name": "changeCourtJurorFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFastBridgeReceiver", + "name": "_fastBridgeReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "changeFastbridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "createDisputeERC20", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "depreciatedFastBridgeExpiration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depreciatedFastbridge", + "outputs": [ + { + "internalType": "contract IFastBridgeReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + } + ], + "name": "disputeHashToForeignID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "disputeHashtoDisputeData", + "outputs": [ + { + "internalType": "uint248", + "name": "id", + "type": "uint248" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "address", + "name": "arbitrable", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fastBridgeReceiver", + "outputs": [ + { + "internalType": "contract IFastBridgeReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "feeForJuror", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_messageSender", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_relayer", + "type": "address" + } + ], + "name": "relayRule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "senderChainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "senderGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + } + ], + "name": "withdrawFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xdc48a51c753a6b2470932408ce2bf86ea3aeedec7ba74e3f47d671a0a05a698c", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "transactionIndex": 1, + "gasUsed": "1015185", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5d005ec11d40324399a16ac1dd2c4f228a9d42a69344d3c7f55582a9b40a698b", + "transactionHash": "0xdc48a51c753a6b2470932408ce2bf86ea3aeedec7ba74e3f47d671a0a05a698c", + "logs": [], + "blockNumber": 2250301, + "cumulativeGasUsed": "5026485", + "status": 1, + "byzantium": true + }, + "args": [ + "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "0x26858D60FE92b50b34e236B46874e02724344275", + "0x12613A66F1E5A2086374e103F66BF0eddA5d1478", + "0x0000000000000000000000000000000000000000000000000000000000066eed", + "0x014A442480DbAD767b7615E55E271799889FA1a7" + ], + "numDeployments": 1, + "solcInputHash": "274a15cfb06cddd0a2be7e47f1a3d37a", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastBridgeReceiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_senderGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_senderChainID\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"ArbitrationCostModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"disputeHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockhash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"localDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"}],\"name\":\"OutgoingDispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeCourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastBridgeReceiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gracePeriod\",\"type\":\"uint256\"}],\"name\":\"changeFastbridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"createDisputeERC20\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depreciatedFastBridgeExpiration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depreciatedFastbridge\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToForeignID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoDisputeData\",\"outputs\":[{\"internalType\":\"uint248\",\"name\":\"id\",\"type\":\"uint248\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastBridgeReceiver\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"feeForJuror\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageSender\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"}],\"name\":\"relayRule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"cost\":\"Required cost of arbitration.\"}},\"changeCourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\"}},\"changeFastbridge(address,uint256)\":{\"details\":\"Changes the fastBridge, useful to increase the claim deposit.\",\"params\":{\"_fastBridgeReceiver\":\"The address of the new fastBridge.\",\"_gracePeriod\":\"The duration to accept messages from the deprecated bridge (if at all).\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"relayRule(address,bytes32,uint256,address)\":{\"notice\":\"Relay the rule call from the home gateway to the arbitrable.\"}},\"notice\":\"Foreign Gateway Counterpart of `HomeGateway`\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/ForeignGatewayOnGnosis.sol\":\"ForeignGatewayOnGnosis\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/vea-contracts/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @hrishibhat]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /**\\n * @dev The Fast Bridge participants watch for these events to decide if a challenge should be submitted.\\n * @param _epoch The epoch for which the the claim was made.\\n * @param _batchMerkleRoot The timestamp of the claim creation.\\n */\\n event ClaimReceived(uint256 indexed _epoch, bytes32 indexed _batchMerkleRoot);\\n\\n /**\\n * @dev This event indicates that `sendSafeFallback()` should be called on the sending side.\\n * @param _epoch The epoch associated with the challenged claim.\\n */\\n event ClaimChallenged(uint256 indexed _epoch);\\n\\n /**\\n * @dev This events indicates that optimistic verification has succeeded. The messages are ready to be relayed.\\n * @param _epoch The epoch associated with the batch.\\n * @param _success The success of the optimistic verification.\\n */\\n event BatchVerified(uint256 indexed _epoch, bool _success);\\n\\n /**\\n * @dev This event indicates that the batch has been received via the Safe Bridge.\\n * @param _epoch The epoch associated with the batch.\\n * @param _isBridgerHonest Whether the bridger made an honest claim.\\n * @param _isChallengerHonest Whether the bridger made an honest challenge.\\n */\\n event BatchSafeVerified(uint256 indexed _epoch, bool _isBridgerHonest, bool _isChallengerHonest);\\n\\n /**\\n * @dev This event indicates that the claim deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _bridger The recipient of the claim deposit.\\n */\\n event ClaimDepositWithdrawn(uint256 indexed _epoch, address indexed _bridger);\\n\\n /**\\n * @dev This event indicates that the challenge deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _challenger The recipient of the challenge deposit.\\n */\\n event ChallengeDepositWithdrawn(uint256 indexed _epoch, address indexed _challenger);\\n\\n /**\\n * @dev This event indicates that a message has been relayed for the batch in this `_epoch`.\\n * @param _epoch The epoch associated with the batch.\\n * @param _nonce The nonce of the message that was relayed.\\n */\\n event MessageRelayed(uint256 indexed _epoch, uint256 indexed _nonce);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Submit a claim about the `_batchMerkleRoot` for the latests completed Fast bridge epoch and submit a deposit. The `_batchMerkleRoot` should match the one on the sending side otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to claim.\\n * @param _batchMerkleRoot The hash claimed for the ticket.\\n */\\n function claim(uint256 _epoch, bytes32 _batchMerkleRoot) external payable;\\n\\n /**\\n * @dev Submit a challenge for the claim of the current epoch's Fast Bridge batch merkleroot state and submit a deposit. The `batchMerkleRoot` in the claim already made for the last finalized epoch should be different from the one on the sending side, otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to challenge.\\n */\\n function challenge(uint256 _epoch) external payable;\\n\\n /**\\n * @dev Resolves the optimistic claim for '_epoch'.\\n * @param _epoch The epoch of the optimistic claim.\\n */\\n function verifyBatch(uint256 _epoch) external;\\n\\n /**\\n * @dev Verifies merkle proof for the given message and associated nonce for the most recent possible epoch and relays the message.\\n * @param _epoch The epoch in which the message was batched by the bridge.\\n * @param _proof The merkle proof to prove the membership of the message and nonce in the merkle tree for the epoch.\\n * @param _message The data on the cross-domain chain for the message.\\n */\\n function verifyAndRelayMessage(\\n uint256 _epoch,\\n bytes32[] calldata _proof,\\n bytes calldata _message\\n ) external;\\n\\n /**\\n * @dev Sends the deposit back to the Bridger if their claim is not successfully challenged. Includes a portion of the Challenger's deposit if unsuccessfully challenged.\\n * @param _epoch The epoch associated with the claim deposit to withraw.\\n */\\n function withdrawClaimDeposit(uint256 _epoch) external;\\n\\n /**\\n * @dev Sends the deposit back to the Challenger if his challenge is successful. Includes a portion of the Bridger's deposit.\\n * @param _epoch The epoch associated with the challenge deposit to withraw.\\n */\\n function withdrawChallengeDeposit(uint256 _epoch) external;\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Returns the `start` and `end` time of challenge period for this `epoch`.\\n * @param _epoch The epoch of the claim to request the challenge period.\\n * @return start The start time of the challenge period.\\n * @return end The end time of the challenge period.\\n */\\n function claimChallengePeriod(uint256 _epoch) external view returns (uint256 start, uint256 end);\\n\\n /**\\n * @dev Returns the epoch period.\\n */\\n function epochPeriod() external view returns (uint256 epochPeriod);\\n\\n /**\\n * @dev Returns the challenge period.\\n */\\n function challengePeriod() external view returns (uint256 challengePeriod);\\n}\\n\",\"keccak256\":\"0xff909a62e9a08540dafcd08c779a64917ed1e44be52d5a225ff9149ff95909e8\",\"license\":\"MIT\"},\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IFastBridgeReceiver.sol\\\";\\n\\ninterface IReceiverGateway {\\n function fastBridgeReceiver() external view returns (IFastBridgeReceiver);\\n\\n function senderChainID() external view returns (uint256);\\n\\n function senderGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0xfa82fbd575c462ad6dffa18c67eb097a4c5088715ae956a836726aafa4be0f90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrable The arbitrable receiving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x2264bc7cb975d89776b9bf3e35cecd4dec7d601604601ca4822d8bfc0886c379\",\"license\":\"MIT\"},\"src/gateway/ForeignGatewayOnGnosis.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz, @unknownunknown1]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrable.sol\\\";\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * Foreign Gateway\\n * Counterpart of `HomeGateway`\\n */\\ncontract ForeignGatewayOnGnosis is IForeignGateway {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeData {\\n uint248 id;\\n bool ruled;\\n address arbitrable;\\n uint256 paid;\\n address relayer;\\n }\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event OutgoingDispute(\\n bytes32 disputeHash,\\n bytes32 blockhash,\\n uint256 localDisputeID,\\n uint256 _choices,\\n bytes _extraData,\\n address arbitrable\\n );\\n\\n event ArbitrationCostModified(uint96 indexed _courtID, uint256 _feeForJuror);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n uint256 public immutable override senderChainID;\\n address public immutable override senderGateway;\\n IERC20 public immutable weth; // WETH token on xDai.\\n uint256 internal localDisputeID = 1; // The disputeID must start from 1 as the KlerosV1 proxy governor depends on this implementation. We now also depend on localDisputeID not ever being zero.\\n mapping(uint96 => uint256) public feeForJuror; // feeForJuror[courtID], it mirrors the value on KlerosCore.\\n address public governor;\\n IFastBridgeReceiver public fastBridgeReceiver;\\n IFastBridgeReceiver public depreciatedFastbridge;\\n uint256 public depreciatedFastBridgeExpiration;\\n mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyFromFastBridge() {\\n require(\\n address(fastBridgeReceiver) == msg.sender ||\\n ((block.timestamp < depreciatedFastBridgeExpiration) && address(depreciatedFastbridge) == msg.sender),\\n \\\"Access not allowed: Fast Bridge only.\\\"\\n );\\n _;\\n }\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(\\n address _governor,\\n IFastBridgeReceiver _fastBridgeReceiver,\\n address _senderGateway,\\n uint256 _senderChainID,\\n IERC20 _weth\\n ) {\\n governor = _governor;\\n fastBridgeReceiver = _fastBridgeReceiver;\\n senderGateway = _senderGateway;\\n senderChainID = _senderChainID;\\n weth = _weth;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Changes the fastBridge, useful to increase the claim deposit.\\n * @param _fastBridgeReceiver The address of the new fastBridge.\\n * @param _gracePeriod The duration to accept messages from the deprecated bridge (if at all).\\n */\\n function changeFastbridge(IFastBridgeReceiver _fastBridgeReceiver, uint256 _gracePeriod) external onlyByGovernor {\\n // grace period to relay remaining messages in the relay / bridging process\\n depreciatedFastBridgeExpiration = block.timestamp + _fastBridgeReceiver.epochPeriod() + _gracePeriod; // 2 weeks\\n depreciatedFastbridge = fastBridgeReceiver;\\n fastBridgeReceiver = _fastBridgeReceiver;\\n }\\n\\n /**\\n * @dev Changes the `feeForJuror` property value of a specified court.\\n * @param _courtID The ID of the court.\\n * @param _feeForJuror The new value for the `feeForJuror` property value.\\n */\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n feeForJuror[_courtID] = _feeForJuror;\\n emit ArbitrationCostModified(_courtID, _feeForJuror);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function createDispute(\\n uint256 /*_choices*/,\\n bytes calldata /*_extraData*/\\n ) external payable override returns (uint256 disputeID) {\\n revert(\\\"Fees should be paid in WETH\\\");\\n }\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external override returns (uint256 disputeID) {\\n // This check is duplicated in xKlerosLiquid and transferred is done there as well.\\n require(_amount >= arbitrationCost(_extraData), \\\"Not paid enough for arbitration\\\");\\n\\n disputeID = localDisputeID++;\\n uint256 chainID;\\n assembly {\\n chainID := chainid()\\n }\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n chainID,\\n blockhash(block.number - 1),\\n \\\"createDispute\\\",\\n disputeID,\\n _choices,\\n _extraData,\\n msg.sender\\n )\\n );\\n\\n disputeHashtoDisputeData[disputeHash] = DisputeData({\\n id: uint248(disputeID),\\n arbitrable: msg.sender,\\n paid: _amount,\\n relayer: address(0),\\n ruled: false\\n });\\n\\n emit OutgoingDispute(disputeHash, blockhash(block.number - 1), disputeID, _choices, _extraData, msg.sender);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n function arbitrationCost(bytes calldata _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors) = extraDataToCourtIDMinJurors(_extraData);\\n cost = feeForJuror[courtID] * minJurors;\\n }\\n\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(\\n address _messageSender,\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _relayer\\n ) external override onlyFromFastBridge {\\n require(_messageSender == senderGateway, \\\"Only the homegateway is allowed.\\\");\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(!dispute.ruled, \\\"Cannot rule twice\\\");\\n\\n dispute.ruled = true;\\n dispute.relayer = _relayer;\\n\\n IArbitrable arbitrable = IArbitrable(dispute.arbitrable);\\n arbitrable.rule(dispute.id, _ruling);\\n }\\n\\n function withdrawFees(bytes32 _disputeHash) external override {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(dispute.ruled, \\\"Not ruled yet\\\");\\n\\n uint256 amount = dispute.paid;\\n dispute.paid = 0;\\n weth.transfer(dispute.relayer, amount);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view override returns (uint256) {\\n return disputeHashtoDisputeData[_disputeHash].id;\\n }\\n\\n // ************************ //\\n // * Internal * //\\n // ************************ //\\n\\n function extraDataToCourtIDMinJurors(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors) {\\n // Note that here we ignore DisputeKitID\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n }\\n if (feeForJuror[courtID] == 0) courtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n } else {\\n courtID = 0;\\n minJurors = MIN_JURORS;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2b08ac831644a9328a387c3ae529c5d999e9ce9ff5468a15215cd50af6a2eb16\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\nimport \\\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator, IReceiverGateway {\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external returns (uint256 disputeID);\\n}\\n\",\"keccak256\":\"0x4cfc88d2d7cf211ce9a1f3c991f093baefa026784185da2319d566051d0c8c43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60e0604052600160005534801561001557600080fd5b50604051620011573803806200115783398101604081905261003691610090565b600280546001600160a01b03199081166001600160a01b0397881617909155600380549091169486169490941790935590831660a0526080521660c0526100fb565b6001600160a01b038116811461008d57600080fd5b50565b600080600080600060a086880312156100a857600080fd5b85516100b381610078565b60208701519095506100c481610078565b60408701519094506100d581610078565b6060870151608088015191945092506100ed81610078565b809150509295509295909350565b60805160a05160c05161101e62000139600039600081816101a30152610a820152600081816102c101526107e301526000610204015261101e6000f3fe6080604052600436106100e95760003560e01c8063a60a4db511610085578063a60a4db51461027c578063c13517e11461029c578063ce0aaf95146102af578063d3c617ff146102e3578063d96a36ca14610385578063eaff425a146103a5578063ebb71194146103ba578063f7434ea9146103da578063f7f56752146103fa57600080fd5b80630c340a24146100ee5780632d5db96d1461012b5780632e1db8901461014d5780633fc8cef31461019157806345c90441146101c55780634def5455146101f257806367c5194714610226578063979f8e65146102465780639ff66f6414610266575b600080fd5b3480156100fa57600080fd5b5060025461010e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013757600080fd5b5061014b610146366004610beb565b61041a565b005b34801561015957600080fd5b50610183610168366004610c17565b6000908152600660205260409020546001600160f81b031690565b604051908152602001610122565b34801561019d57600080fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101d157600080fd5b506101836101e0366004610c4c565b60016020526000908152604090205481565b3480156101fe57600080fd5b506101837f000000000000000000000000000000000000000000000000000000000000000081565b34801561023257600080fd5b5061014b610241366004610c6e565b610507565b34801561025257600080fd5b50610183610261366004610cd3565b61058a565b34801561027257600080fd5b5061018360055481565b34801561028857600080fd5b5061014b610297366004610d26565b610758565b6101836102aa366004610d70565b610984565b3480156102bb57600080fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102ef57600080fd5b506103476102fe366004610c17565b60066020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a001610122565b34801561039157600080fd5b5060035461010e906001600160a01b031681565b3480156103b157600080fd5b50610183600381565b3480156103c657600080fd5b5061014b6103d5366004610c17565b6109cf565b3480156103e657600080fd5b506101836103f5366004610dbc565b610b06565b34801561040657600080fd5b5060045461010e906001600160a01b031681565b6002546001600160a01b0316331461044d5760405162461bcd60e51b815260040161044490610dfe565b60405180910390fd5b80826001600160a01b031663b5b7a1846040518163ffffffff1660e01b815260040160206040518083038186803b15801561048757600080fd5b505afa15801561049b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bf9190610e40565b6104c99042610e6f565b6104d39190610e6f565b6005555060038054600480546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b031633146105315760405162461bcd60e51b815260040161044490610dfe565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c5969061057e9084815260200190565b60405180910390a25050565b60006105968484610b06565b8210156105e55760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610444565b6000805490806105f483610e87565b90915550905046600081610609600143610ea2565b4084898989336040516020016106259796959493929190610eb9565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038088168552600085840181815233878701908152606088018c815260808901848152868552600690975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d8869982469082906107009043610ea2565b40858a8a8a336040516107199796959493929190610f19565b60405180910390a1604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050949350505050565b6003546001600160a01b031633148061078757506005544210801561078757506004546001600160a01b031633145b6107e15760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b6064820152608401610444565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316146108625760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792074686520686f6d656761746577617920697320616c6c6f7765642e6044820152606401610444565b600083815260066020526040902080546001600160f81b03166108975760405162461bcd60e51b815260040161044490610f77565b8054600160f81b900460ff16156108e45760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610444565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b50505050505050505050565b60405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e205745544800000000006044820152600090606401610444565b600081815260066020526040902080546001600160f81b0316610a045760405162461bcd60e51b815260040161044490610f77565b8054600160f81b900460ff16610a4c5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610444565b6002810180546000909155600382015460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015610ac857600080fd5b505af1158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b009190610fa7565b50505050565b6000806000610b4a85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b7c92505050565b6001600160601b0382166000908152600160205260409020549193509150610b73908290610fc9565b95945050505050565b6000806040835110610bc75750506020818101516040808401516001600160601b03831660009081526001909452922054909190610bb957600091505b80610bc2575060035b915091565b50600090506003915091565b6001600160a01b0381168114610be857600080fd5b50565b60008060408385031215610bfe57600080fd5b8235610c0981610bd3565b946020939093013593505050565b600060208284031215610c2957600080fd5b5035919050565b80356001600160601b0381168114610c4757600080fd5b919050565b600060208284031215610c5e57600080fd5b610c6782610c30565b9392505050565b60008060408385031215610c8157600080fd5b610c0983610c30565b60008083601f840112610c9c57600080fd5b50813567ffffffffffffffff811115610cb457600080fd5b602083019150836020828501011115610ccc57600080fd5b9250929050565b60008060008060608587031215610ce957600080fd5b84359350602085013567ffffffffffffffff811115610d0757600080fd5b610d1387828801610c8a565b9598909750949560400135949350505050565b60008060008060808587031215610d3c57600080fd5b8435610d4781610bd3565b935060208501359250604085013591506060850135610d6581610bd3565b939692955090935050565b600080600060408486031215610d8557600080fd5b83359250602084013567ffffffffffffffff811115610da357600080fd5b610daf86828701610c8a565b9497909650939450505050565b60008060208385031215610dcf57600080fd5b823567ffffffffffffffff811115610de657600080fd5b610df285828601610c8a565b90969095509350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600060208284031215610e5257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610e8257610e82610e59565b500190565b6000600019821415610e9b57610e9b610e59565b5060010190565b600082821015610eb457610eb4610e59565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b600060208284031215610fb957600080fd5b81518015158114610c6757600080fd5b6000816000190483118215151615610fe357610fe3610e59565b50029056fea2646970667358221220dd71b48d89896f779000e464425d5a23f5dc452fd7622b881f1c4c2ccb429c0864736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106100e95760003560e01c8063a60a4db511610085578063a60a4db51461027c578063c13517e11461029c578063ce0aaf95146102af578063d3c617ff146102e3578063d96a36ca14610385578063eaff425a146103a5578063ebb71194146103ba578063f7434ea9146103da578063f7f56752146103fa57600080fd5b80630c340a24146100ee5780632d5db96d1461012b5780632e1db8901461014d5780633fc8cef31461019157806345c90441146101c55780634def5455146101f257806367c5194714610226578063979f8e65146102465780639ff66f6414610266575b600080fd5b3480156100fa57600080fd5b5060025461010e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013757600080fd5b5061014b610146366004610beb565b61041a565b005b34801561015957600080fd5b50610183610168366004610c17565b6000908152600660205260409020546001600160f81b031690565b604051908152602001610122565b34801561019d57600080fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101d157600080fd5b506101836101e0366004610c4c565b60016020526000908152604090205481565b3480156101fe57600080fd5b506101837f000000000000000000000000000000000000000000000000000000000000000081565b34801561023257600080fd5b5061014b610241366004610c6e565b610507565b34801561025257600080fd5b50610183610261366004610cd3565b61058a565b34801561027257600080fd5b5061018360055481565b34801561028857600080fd5b5061014b610297366004610d26565b610758565b6101836102aa366004610d70565b610984565b3480156102bb57600080fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102ef57600080fd5b506103476102fe366004610c17565b60066020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a001610122565b34801561039157600080fd5b5060035461010e906001600160a01b031681565b3480156103b157600080fd5b50610183600381565b3480156103c657600080fd5b5061014b6103d5366004610c17565b6109cf565b3480156103e657600080fd5b506101836103f5366004610dbc565b610b06565b34801561040657600080fd5b5060045461010e906001600160a01b031681565b6002546001600160a01b0316331461044d5760405162461bcd60e51b815260040161044490610dfe565b60405180910390fd5b80826001600160a01b031663b5b7a1846040518163ffffffff1660e01b815260040160206040518083038186803b15801561048757600080fd5b505afa15801561049b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bf9190610e40565b6104c99042610e6f565b6104d39190610e6f565b6005555060038054600480546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b031633146105315760405162461bcd60e51b815260040161044490610dfe565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c5969061057e9084815260200190565b60405180910390a25050565b60006105968484610b06565b8210156105e55760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610444565b6000805490806105f483610e87565b90915550905046600081610609600143610ea2565b4084898989336040516020016106259796959493929190610eb9565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038088168552600085840181815233878701908152606088018c815260808901848152868552600690975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d8869982469082906107009043610ea2565b40858a8a8a336040516107199796959493929190610f19565b60405180910390a1604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050949350505050565b6003546001600160a01b031633148061078757506005544210801561078757506004546001600160a01b031633145b6107e15760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b6064820152608401610444565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316146108625760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792074686520686f6d656761746577617920697320616c6c6f7765642e6044820152606401610444565b600083815260066020526040902080546001600160f81b03166108975760405162461bcd60e51b815260040161044490610f77565b8054600160f81b900460ff16156108e45760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610444565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b50505050505050505050565b60405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e205745544800000000006044820152600090606401610444565b600081815260066020526040902080546001600160f81b0316610a045760405162461bcd60e51b815260040161044490610f77565b8054600160f81b900460ff16610a4c5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610444565b6002810180546000909155600382015460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015610ac857600080fd5b505af1158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b009190610fa7565b50505050565b6000806000610b4a85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b7c92505050565b6001600160601b0382166000908152600160205260409020549193509150610b73908290610fc9565b95945050505050565b6000806040835110610bc75750506020818101516040808401516001600160601b03831660009081526001909452922054909190610bb957600091505b80610bc2575060035b915091565b50600090506003915091565b6001600160a01b0381168114610be857600080fd5b50565b60008060408385031215610bfe57600080fd5b8235610c0981610bd3565b946020939093013593505050565b600060208284031215610c2957600080fd5b5035919050565b80356001600160601b0381168114610c4757600080fd5b919050565b600060208284031215610c5e57600080fd5b610c6782610c30565b9392505050565b60008060408385031215610c8157600080fd5b610c0983610c30565b60008083601f840112610c9c57600080fd5b50813567ffffffffffffffff811115610cb457600080fd5b602083019150836020828501011115610ccc57600080fd5b9250929050565b60008060008060608587031215610ce957600080fd5b84359350602085013567ffffffffffffffff811115610d0757600080fd5b610d1387828801610c8a565b9598909750949560400135949350505050565b60008060008060808587031215610d3c57600080fd5b8435610d4781610bd3565b935060208501359250604085013591506060850135610d6581610bd3565b939692955090935050565b600080600060408486031215610d8557600080fd5b83359250602084013567ffffffffffffffff811115610da357600080fd5b610daf86828701610c8a565b9497909650939450505050565b60008060208385031215610dcf57600080fd5b823567ffffffffffffffff811115610de657600080fd5b610df285828601610c8a565b90969095509350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600060208284031215610e5257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610e8257610e82610e59565b500190565b6000600019821415610e9b57610e9b610e59565b5060010190565b600082821015610eb457610eb4610e59565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b600060208284031215610fb957600080fd5b81518015158114610c6757600080fd5b6000816000190483118215151615610fe357610fe3610e59565b50029056fea2646970667358221220dd71b48d89896f779000e464425d5a23f5dc452fd7622b881f1c4c2ccb429c0864736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "arbitrationCost(bytes)": { + "details": "Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Can be used to give additional info on the dispute to be created." + }, + "returns": { + "cost": "Required cost of arbitration." + } + }, + "changeCourtJurorFee(uint96,uint256)": { + "details": "Changes the `feeForJuror` property value of a specified court.", + "params": { + "_courtID": "The ID of the court.", + "_feeForJuror": "The new value for the `feeForJuror` property value." + } + }, + "changeFastbridge(address,uint256)": { + "details": "Changes the fastBridge, useful to increase the claim deposit.", + "params": { + "_fastBridgeReceiver": "The address of the new fastBridge.", + "_gracePeriod": "The duration to accept messages from the deprecated bridge (if at all)." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "relayRule(address,bytes32,uint256,address)": { + "notice": "Relay the rule call from the home gateway to the arbitrable." + } + }, + "notice": "Foreign Gateway Counterpart of `HomeGateway`", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15102, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "localDisputeID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 15106, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "feeForJuror", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint96,t_uint256)" + }, + { + "astId": 15108, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "governor", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 15111, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "fastBridgeReceiver", + "offset": 0, + "slot": "3", + "type": "t_contract(IFastBridgeReceiver)116" + }, + { + "astId": 15114, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "depreciatedFastbridge", + "offset": 0, + "slot": "4", + "type": "t_contract(IFastBridgeReceiver)116" + }, + { + "astId": 15116, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "depreciatedFastBridgeExpiration", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 15121, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "disputeHashtoDisputeData", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_bytes32,t_struct(DisputeData)15067_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IFastBridgeReceiver)116": { + "encoding": "inplace", + "label": "contract IFastBridgeReceiver", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(DisputeData)15067_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct ForeignGatewayOnGnosis.DisputeData)", + "numberOfBytes": "32", + "value": "t_struct(DisputeData)15067_storage" + }, + "t_mapping(t_uint96,t_uint256)": { + "encoding": "mapping", + "key": "t_uint96", + "label": "mapping(uint96 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeData)15067_storage": { + "encoding": "inplace", + "label": "struct ForeignGatewayOnGnosis.DisputeData", + "members": [ + { + "astId": 15058, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint248" + }, + { + "astId": 15060, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "ruled", + "offset": 31, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 15062, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "arbitrable", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 15064, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "paid", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 15066, + "contract": "src/gateway/ForeignGatewayOnGnosis.sol:ForeignGatewayOnGnosis", + "label": "relayer", + "offset": 0, + "slot": "3", + "type": "t_address" + } + ], + "numberOfBytes": "128" + }, + "t_uint248": { + "encoding": "inplace", + "label": "uint248", + "numberOfBytes": "31" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/chiado/WETH.json b/contracts/deployments/chiado/WETH.json new file mode 100644 index 000000000..ef76efc40 --- /dev/null +++ b/contracts/deployments/chiado/WETH.json @@ -0,0 +1,436 @@ +{ + "address": "0x014A442480DbAD767b7615E55E271799889FA1a7", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x3ffdb2b0a8bf89839c9112a30bae6afd506c74ccd494df33aebf5cf669b4f92f", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x014A442480DbAD767b7615E55E271799889FA1a7", + "transactionIndex": 0, + "gasUsed": "616033", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000200000000010000000000200000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000002000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb118d798b6b5b3728f0301b72fe978f411d86c85d358d13220f5d18d74991b6d", + "transactionHash": "0x3ffdb2b0a8bf89839c9112a30bae6afd506c74ccd494df33aebf5cf669b4f92f", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 2249665, + "transactionHash": "0x3ffdb2b0a8bf89839c9112a30bae6afd506c74ccd494df33aebf5cf669b4f92f", + "address": "0x014A442480DbAD767b7615E55E271799889FA1a7", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f50e77f2a2b6138d16c6c7511562e5c33c4b15a3" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0xb118d798b6b5b3728f0301b72fe978f411d86c85d358d13220f5d18d74991b6d" + } + ], + "blockNumber": 2249665, + "cumulativeGasUsed": "616033", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "a007c0c32fbf14d3b8d9e895ad7ca280", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/WETH.sol\":\"WETH\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"src/token/WETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract WETH is ERC20 {\\n constructor() ERC20(\\\"Wrapped ETH\\\", \\\"WETH\\\") {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x14f3140078f6009f9a77ee35209325f84280c497830ac74affdedde7249eb3df\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604080518082018252600b81526a0aee4c2e0e0cac8408aa8960ab1b6020808301918252835180850190945260048452630ae8aa8960e31b90840152815191929161005e91600391610157565b508051610072906004906020840190610157565b50505061008f3369d3c21bcecceda100000061009460201b60201c565b610251565b6001600160a01b0382166100ee5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b806002600082825461010091906101f0565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b82805461016390610216565b90600052602060002090601f01602090048101928261018557600085556101cb565b82601f1061019e57805160ff19168380011785556101cb565b828001600101855582156101cb579182015b828111156101cb5782518255916020019190600101906101b0565b506101d79291506101db565b5090565b5b808211156101d757600081556001016101dc565b6000821982111561021157634e487b7160e01b600052601160045260246000fd5b500190565b600181811c9082168061022a57607f821691505b6020821081141561024b57634e487b7160e01b600052602260045260246000fd5b50919050565b61085d806102606000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069a565b60405180910390f35b6100df6100da36600461070b565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610735565b61024a565b604051601281526020016100c3565b6100df61013136600461070b565b61026e565b6100f3610144366004610771565b6001600160a01b031660009081526020819052604090205490565b6100b6610290565b6100df61017536600461070b565b61029f565b6100df61018836600461070b565b61031f565b6100f361019b366004610793565b61032d565b6060600380546101af906107c6565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c6565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b600033610240818585610358565b5060019392505050565b60003361025885828561047c565b6102638585856104f6565b506001949350505050565b600033610240818585610281838361032d565b61028b9190610801565b610358565b6060600480546101af906107c6565b600033816102ad828661032d565b9050838110156103125760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102638286868403610358565b6000336102408185856104f6565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103ba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610309565b6001600160a01b03821661041b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610309565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610488848461032d565b905060001981146104f057818110156104e35760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610309565b6104f08484848403610358565b50505050565b6001600160a01b03831661055a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610309565b6001600160a01b0382166105bc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610309565b6001600160a01b038316600090815260208190526040902054818110156106345760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610309565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f0565b600060208083528351808285015260005b818110156106c7578581018301518582016040015282016106ab565b818111156106d9576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461070657600080fd5b919050565b6000806040838503121561071e57600080fd5b610727836106ef565b946020939093013593505050565b60008060006060848603121561074a57600080fd5b610753846106ef565b9250610761602085016106ef565b9150604084013590509250925092565b60006020828403121561078357600080fd5b61078c826106ef565b9392505050565b600080604083850312156107a657600080fd5b6107af836106ef565b91506107bd602084016106ef565b90509250929050565b600181811c908216806107da57607f821691505b602082108114156107fb57634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561082257634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220105c70821f17ce182660ebdfd21d18fd546f800383325dc976b4d2f5ad3d277464736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069a565b60405180910390f35b6100df6100da36600461070b565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610735565b61024a565b604051601281526020016100c3565b6100df61013136600461070b565b61026e565b6100f3610144366004610771565b6001600160a01b031660009081526020819052604090205490565b6100b6610290565b6100df61017536600461070b565b61029f565b6100df61018836600461070b565b61031f565b6100f361019b366004610793565b61032d565b6060600380546101af906107c6565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c6565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b600033610240818585610358565b5060019392505050565b60003361025885828561047c565b6102638585856104f6565b506001949350505050565b600033610240818585610281838361032d565b61028b9190610801565b610358565b6060600480546101af906107c6565b600033816102ad828661032d565b9050838110156103125760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102638286868403610358565b6000336102408185856104f6565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103ba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610309565b6001600160a01b03821661041b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610309565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610488848461032d565b905060001981146104f057818110156104e35760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610309565b6104f08484848403610358565b50505050565b6001600160a01b03831661055a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610309565b6001600160a01b0382166105bc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610309565b6001600160a01b038316600090815260208190526040902054818110156106345760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610309565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f0565b600060208083528351808285015260005b818110156106c7578581018301518582016040015282016106ab565b818111156106d9576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461070657600080fd5b919050565b6000806040838503121561071e57600080fd5b610727836106ef565b946020939093013593505050565b60008060006060848603121561074a57600080fd5b610753846106ef565b9250610761602085016106ef565b9150604084013590509250925092565b60006020828403121561078357600080fd5b61078c826106ef565b9392505050565b600080604083850312156107a657600080fd5b6107af836106ef565b91506107bd602084016106ef565b90509250929050565b600181811c908216806107da57607f821691505b602082108114156107fb57634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561082257634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220105c70821f17ce182660ebdfd21d18fd546f800383325dc976b4d2f5ad3d277464736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 423, + "contract": "src/token/WETH.sol:WETH", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 429, + "contract": "src/token/WETH.sol:WETH", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 431, + "contract": "src/token/WETH.sol:WETH", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 433, + "contract": "src/token/WETH.sol:WETH", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 435, + "contract": "src/token/WETH.sol:WETH", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/chiado/WETHFaucet.json b/contracts/deployments/chiado/WETHFaucet.json new file mode 100644 index 000000000..0057490d8 --- /dev/null +++ b/contracts/deployments/chiado/WETHFaucet.json @@ -0,0 +1,146 @@ +{ + "address": "0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x6689d4f304c3b06f38519d390fde898bb24edee77894e415f28220720d3e2f48", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3", + "transactionIndex": 0, + "gasUsed": "260119", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3d49ab133f39228cfe8aa8940a79675131ef1db2757c3ea43f24b3776ae14e8e", + "transactionHash": "0x6689d4f304c3b06f38519d390fde898bb24edee77894e415f28220720d3e2f48", + "logs": [], + "blockNumber": 2249776, + "cumulativeGasUsed": "260119", + "status": 1, + "byzantium": true + }, + "args": [ + "0x014A442480DbAD767b7615E55E271799889FA1a7" + ], + "numDeployments": 1, + "solcInputHash": "a007c0c32fbf14d3b8d9e895ad7ca280", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"london\",\"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.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n IERC20 public token;\\n mapping(address => bool) public withdrewAlready;\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n }\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, 10000 ether);\\n withdrewAlready[msg.sender] = true;\\n }\\n}\\n\",\"keccak256\":\"0x96dfe825cf0342eeff4380ac3632e50fed75eb083ff9b5133ab1575ed38dc333\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516103e03803806103e083398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b61034d806100936000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063338cdca114610051578063b69ef8a81461005b578063d61c40dc14610076578063fc0c546a146100a9575b600080fd5b6100596100d4565b005b61006361022b565b6040519081526020015b60405180910390f35b6100996100843660046102ac565b60016020526000908152604090205460ff1681565b604051901515815260200161006d565b6000546100bc906001600160a01b031681565b6040516001600160a01b03909116815260200161006d565b3360009081526001602052604090205460ff161561017e5760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a40160405180910390fd5b60005460405163a9059cbb60e01b815233600482015269021e19e0c9bab240000060248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156101d357600080fd5b505af11580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b91906102dc565b50336000908152600160208190526040909120805460ff19169091179055565b600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561026f57600080fd5b505afa158015610283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a791906102fe565b905090565b6000602082840312156102be57600080fd5b81356001600160a01b03811681146102d557600080fd5b9392505050565b6000602082840312156102ee57600080fd5b815180151581146102d557600080fd5b60006020828403121561031057600080fd5b505191905056fea26469706673582212205834b9da8d3e30c6124c75f3a860d0d45dd1a253a98d2f15c37030d47e91889a64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063338cdca114610051578063b69ef8a81461005b578063d61c40dc14610076578063fc0c546a146100a9575b600080fd5b6100596100d4565b005b61006361022b565b6040519081526020015b60405180910390f35b6100996100843660046102ac565b60016020526000908152604090205460ff1681565b604051901515815260200161006d565b6000546100bc906001600160a01b031681565b6040516001600160a01b03909116815260200161006d565b3360009081526001602052604090205460ff161561017e5760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a40160405180910390fd5b60005460405163a9059cbb60e01b815233600482015269021e19e0c9bab240000060248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156101d357600080fd5b505af11580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b91906102dc565b50336000908152600160208190526040909120805460ff19169091179055565b600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561026f57600080fd5b505afa158015610283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a791906102fe565b905090565b6000602082840312156102be57600080fd5b81356001600160a01b03811681146102d557600080fd5b9392505050565b6000602082840312156102ee57600080fd5b815180151581146102d557600080fd5b60006020828403121561031057600080fd5b505191905056fea26469706673582212205834b9da8d3e30c6124c75f3a860d0d45dd1a253a98d2f15c37030d47e91889a64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 25951, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1072" + }, + { + "astId": 25955, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1072": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 2e729e8fc..0c8354fed 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -83,7 +83,8 @@ const config: HardhatUserConfig = { saveDeployments: true, tags: ["staging", "home", "layer2"], companionNetworks: { - foreign: "goerli", + foreignChiado: "chiado", + foreignGoerli: "goerli", }, verify: { etherscan: { @@ -142,7 +143,7 @@ const config: HardhatUserConfig = { }, verify: { etherscan: { - apiKey: process.env.GNOSISSCAN_API_KEY, + apiUrl: "https://blockscout.com/gnosis/chiado", }, }, }, @@ -208,12 +209,14 @@ const config: HardhatUserConfig = { }, external: { // https://github.com/wighawag/hardhat-deploy#importing-deployment-from-other-projects-with-truffle-support - contracts: [ - { - artifacts: "node_modules/@kleros/vea-contracts/deployments", - deploy: "node_modules/@kleros/vea-contracts/deploy", - }, - ], + deployments: { + arbitrumGoerli: ["node_modules/@kleros/vea-contracts/deployments/arbitrumGoerli"], + arbitrum: ["node_modules/@kleros/vea-contracts/deployments/arbitrum"], + chiado: ["node_modules/@kleros/vea-contracts/deployments/chiado"], + gnosischain: ["node_modules/@kleros/vea-contracts/deployments/gnosischain"], + goerli: ["node_modules/@kleros/vea-contracts/deployments/goerli"], + mainnet: ["node_modules/@kleros/vea-contracts/deployments/mainnet"], + }, }, }; diff --git a/contracts/package.json b/contracts/package.json index 7f156b437..1894182ba 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -69,6 +69,6 @@ "typescript": "^4.6.4" }, "dependencies": { - "@kleros/vea-contracts": "^0.1.2" + "@kleros/vea-contracts": "^0.1.11" } } diff --git a/contracts/src/gateway/xForeignGateway.sol b/contracts/src/gateway/ForeignGatewayOnGnosis.sol similarity index 99% rename from contracts/src/gateway/xForeignGateway.sol rename to contracts/src/gateway/ForeignGatewayOnGnosis.sol index 7973db810..8d413edae 100644 --- a/contracts/src/gateway/xForeignGateway.sol +++ b/contracts/src/gateway/ForeignGatewayOnGnosis.sol @@ -18,7 +18,7 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; * Foreign Gateway * Counterpart of `HomeGateway` */ -contract xForeignGateway is IForeignGateway { +contract ForeignGatewayOnGnosis is IForeignGateway { // ************************************* // // * Enums / Structs * // // ************************************* // diff --git a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol similarity index 99% rename from contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol rename to contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol index cf4d36166..60f731d69 100644 --- a/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidToV2.sol +++ b/contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol @@ -13,12 +13,12 @@ import {SortitionSumTreeFactory} from "../../libraries/SortitionSumTreeFactory.s import "../../gateway/interfaces/IForeignGateway.sol"; /** - * @title xKlerosLiquidToV2 + * @title xKlerosLiquidV2 * @dev This contract is an adaption of Mainnet's KlerosLiquid (https://github.com/kleros/kleros/blob/69cfbfb2128c29f1625b3a99a3183540772fda08/contracts/kleros/KlerosLiquid.sol) * for xDai chain. Notice that variables referring to ETH values in this contract, will hold the native token values of the chain on which xKlerosLiquid is deployed. * When this contract gets deployed on xDai chain, ETH variables will hold xDai values. */ -contract xKlerosLiquidToV2 is Initializable, ITokenController, IArbitrator { +contract xKlerosLiquidV2 is Initializable, ITokenController, IArbitrator { /* Enums */ // General diff --git a/yarn.lock b/yarn.lock index 3f9e4843f..18d4a3d3d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2253,7 +2253,7 @@ __metadata: version: 0.0.0-use.local resolution: "@kleros/kleros-v2-contracts@workspace:contracts" dependencies: - "@kleros/vea-contracts": ^0.1.2 + "@kleros/vea-contracts": ^0.1.11 "@nomicfoundation/hardhat-chai-matchers": ^1.0.4 "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.13" "@nomiclabs/hardhat-waffle": ^2.0.3 @@ -2385,7 +2385,7 @@ __metadata: languageName: node linkType: hard -"@kleros/vea-contracts@npm:^0.1.2": +"@kleros/vea-contracts@npm:^0.1.11": version: 0.1.11 resolution: "@kleros/vea-contracts@npm:0.1.11" dependencies: From 51da6df00b0a716a77ce0ab5a84d160badbbd424 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 3 Feb 2023 16:09:25 +0000 Subject: [PATCH 8/9] docs: added contract addresses --- contracts/README.md | 8 ++++++++ contracts/scripts/generateDeploymentsMarkdown.sh | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/contracts/README.md b/contracts/README.md index 9d2b95f4d..faacd8043 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -8,6 +8,13 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments ### v2-prealpha-3 +#### Chiado + +- [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE) +- [TokenBridge](https://blockscout.com/gnosis/chiado/address/0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2) +- [WETH](https://blockscout.com/gnosis/chiado/address/0x014A442480DbAD767b7615E55E271799889FA1a7) +- [WETHFaucet](https://blockscout.com/gnosis/chiado/address/0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3) + #### Goerli - [PNK](https://goerli.etherscan.io/token/0xA3B02bA6E10F55fb177637917B1b472da0110CcC) @@ -23,6 +30,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments - [DisputeResolver](https://goerli.arbiscan.io/address/0xDe3eCeB73C453E56F5661ad029a41341CF592b9A) - [FastBridgeSender](https://goerli.arbiscan.io/address/0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C) - [HomeGatewayToEthereum](https://goerli.arbiscan.io/address/0xed12799915180a257985631fbD2ead261eD838cf) +- [HomeGatewayToGnosis](https://goerli.arbiscan.io/address/0x12613A66F1E5A2086374e103F66BF0eddA5d1478) - [KlerosCore](https://goerli.arbiscan.io/address/0x3eED6aaCa43f4Bb98C591e4A0d2C4a124efF9C24) - [PolicyRegistry](https://goerli.arbiscan.io/address/0xC5655728387Ce5E2aAA22138114E5777370aBDae) - [RandomizerRNG](https://goerli.arbiscan.io/address/0xa2d1A3CDF0becEdb724e5A34De7022B6FF5e4787) diff --git a/contracts/scripts/generateDeploymentsMarkdown.sh b/contracts/scripts/generateDeploymentsMarkdown.sh index f08f1b9ed..d7fae73a9 100755 --- a/contracts/scripts/generateDeploymentsMarkdown.sh +++ b/contracts/scripts/generateDeploymentsMarkdown.sh @@ -12,6 +12,10 @@ function generate() { #deploymentDir #explorerUrl done } +echo "#### Chiado" +echo +generate "$SCRIPT_DIR/../deployments/chiado" "https://blockscout.com/gnosis/chiado/address/" +echo echo "#### Goerli" echo echo "- [PNK](https://goerli.etherscan.io/token/0xA3B02bA6E10F55fb177637917B1b472da0110CcC)" @@ -20,5 +24,4 @@ echo echo "#### Arbitrum Goerli" echo echo "- [PNK](https://goerli.arbiscan.io/token/0x4DEeeFD054434bf6721eF39Aa18EfB3fd0D12610/token-transfers)" -generate "$SCRIPT_DIR/../deployments/arbitrumGoerli" "https://goerli.arbiscan.io/address/" -echo \ No newline at end of file +generate "$SCRIPT_DIR/../deployments/arbitrumGoerli" "https://goerli.arbiscan.io/address/" \ No newline at end of file From 64a7a9cc3566800f8a4460918a08bae4a717c5be Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 3 Feb 2023 18:29:44 +0000 Subject: [PATCH 9/9] chore: deployment of xKlerosLiquidV2 and wrapped pnk --- contracts/README.md | 7 +- contracts/deploy/00-home-chain-arbitration.ts | 5 +- contracts/deploy/00-rng.ts | 2 +- .../deploy/01-foreign-gateway-on-ethereum.ts | 5 +- .../deploy/01-foreign-gateway-on-gnosis.ts | 28 +- .../deploy/02-home-gateway-to-ethereum.ts | 2 +- contracts/deploy/03-vea-mock.ts | 4 +- .../deploy/04-klerosliquid-to-v2-gnosis.ts | 171 +- .../deployments/chiado/ArbitrableExample.json | 403 +++ .../chiado/ForeignGatewayOnGnosis.json | 20 +- .../chiado/SortitionSumTreeFactory.json | 92 + contracts/deployments/chiado/WPNKFaucet.json | 146 + .../deployments/chiado/WrappedPinakion.json | 770 ++++++ .../deployments/chiado/xKlerosLiquidV2.json | 2402 +++++++++++++++++ contracts/scripts/console-init-chiado.ts | 17 + contracts/scripts/console-init.ts | 5 + .../arbitrables/ArbitrableExample.sol | 2 +- contracts/src/token/WrappedPinakion.sol | 11 + 18 files changed, 3990 insertions(+), 102 deletions(-) create mode 100644 contracts/deployments/chiado/ArbitrableExample.json create mode 100644 contracts/deployments/chiado/SortitionSumTreeFactory.json create mode 100644 contracts/deployments/chiado/WPNKFaucet.json create mode 100644 contracts/deployments/chiado/WrappedPinakion.json create mode 100644 contracts/deployments/chiado/xKlerosLiquidV2.json create mode 100644 contracts/scripts/console-init-chiado.ts create mode 100644 contracts/src/token/WrappedPinakion.sol diff --git a/contracts/README.md b/contracts/README.md index faacd8043..ae0490d29 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -10,10 +10,15 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Chiado -- [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE) +- [ArbitrableExample](https://blockscout.com/gnosis/chiado/address/0x823D972BAcBa033BFca208738847cC7135573316) +- [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x87142b7E9C7D026776499120D902AF8896C07894) +- [SortitionSumTreeFactory](https://blockscout.com/gnosis/chiado/address/0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636) - [TokenBridge](https://blockscout.com/gnosis/chiado/address/0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2) - [WETH](https://blockscout.com/gnosis/chiado/address/0x014A442480DbAD767b7615E55E271799889FA1a7) - [WETHFaucet](https://blockscout.com/gnosis/chiado/address/0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3) +- [WPNKFaucet](https://blockscout.com/gnosis/chiado/address/0xcFc0b84419583ff7b32fD5139B789cE858517d4C) +- [WrappedPinakion](https://blockscout.com/gnosis/chiado/address/0x04Fb43F2Ce076867b5ba38750Ecb2cc6BDe78D61) +- [xKlerosLiquidV2](https://blockscout.com/gnosis/chiado/address/0xf637A0a4415CCFB97407846486b6be663d3C33ef) #### Goerli diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index f23c73474..e61540a8f 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -27,7 +27,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // 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); + console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); if (chainId === HomeChains.HARDHAT) { pnkByChain.set( @@ -79,6 +79,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) const minStake = BigNumber.from(10).pow(20).mul(2); const alpha = 10000; const feeForJuror = BigNumber.from(10).pow(17); + const sortitionSumTreeK = 3; const klerosCore = await deploy("KlerosCore", { from: deployer, libraries: { @@ -93,7 +94,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) false, [minStake, alpha, feeForJuror, 3], // minStake, alpha, feeForJuror, jurorsForCourtJump [0, 0, 0, 0], // evidencePeriod, commitPeriod, votePeriod, appealPeriod - 3, + sortitionSumTreeK, ], log: true, }); diff --git a/contracts/deploy/00-rng.ts b/contracts/deploy/00-rng.ts index 035243b9f..fa1a41b05 100644 --- a/contracts/deploy/00-rng.ts +++ b/contracts/deploy/00-rng.ts @@ -28,7 +28,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // 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); + console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); if (chainId === HomeChains.HARDHAT) { pnkByChain.set( diff --git a/contracts/deploy/01-foreign-gateway-on-ethereum.ts b/contracts/deploy/01-foreign-gateway-on-ethereum.ts index 0ff562108..8503a1e4a 100644 --- a/contracts/deploy/01-foreign-gateway-on-ethereum.ts +++ b/contracts/deploy/01-foreign-gateway-on-ethereum.ts @@ -1,4 +1,3 @@ -import { parseEther } from "ethers/lib/utils"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; @@ -16,7 +15,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("deploying to chainId %s with deployer %s", chainId, deployer); + console.log("Deploying to chainId %s with deployer %s", chainId, deployer); const homeNetworks = { ETHEREUM_MAINNET: config.networks.arbitrum, @@ -32,7 +31,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme const homeChainId = (await homeChainProvider.getNetwork()).chainId; const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); const homeGatewayAddress = getContractAddress(deployer, nonce); - console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + console.log("Calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const veaReceiver = await deployments.get("FastBridgeReceiverOnEthereum"); diff --git a/contracts/deploy/01-foreign-gateway-on-gnosis.ts b/contracts/deploy/01-foreign-gateway-on-gnosis.ts index b04b4e37c..f1966d7eb 100644 --- a/contracts/deploy/01-foreign-gateway-on-gnosis.ts +++ b/contracts/deploy/01-foreign-gateway-on-gnosis.ts @@ -1,4 +1,4 @@ -import { parseEther } from "ethers/lib/utils"; +import { parseUnits } from "ethers/lib/utils"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import getContractAddress from "../deploy-helpers/getContractAddress"; @@ -13,6 +13,8 @@ const wethByChain = new Map([ [ForeignChains.GNOSIS_MAINNET, "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1"], ]); +const ONE_GWEI = parseUnits("1", "gwei"); + const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; const { deploy, execute } = deployments; @@ -21,7 +23,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("deploying to chainId %s with deployer %s", chainId, deployer); + console.log("Deploying to chainId %s with deployer %s", chainId, deployer); const homeNetworks = { GNOSIS_MAINNET: config.networks.arbitrum, @@ -32,14 +34,12 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme // Hack to predict the deployment address on the home chain. // TODO: use deterministic deployments const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[ForeignChains[chainId]].url); - let nonce = await homeChainProvider.getTransactionCount(deployer); + const nonce = await homeChainProvider.getTransactionCount(deployer); const homeGatewayAddress = getContractAddress(deployer, nonce); // HomeGateway deploy tx will be the next tx home network - console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + console.log("Calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const veaReceiver = await deployments.get("FastBridgeReceiverOnGnosis"); - console.log("using FastBridgeReceiverOnGnosis at %s", veaReceiver.address); - - const ONE_GWEI = ethers.utils.parseUnits("1", "gwei"); + console.log("Using FastBridgeReceiverOnGnosis at %s", veaReceiver.address); if (!wethByChain.get(chainId)) { const weth = await deploy("WETH", { @@ -75,13 +75,13 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme }); // TODO: disable the gateway until fully initialized with the correct fees OR allow disputeCreators to add funds again if necessary. - // await execute( - // "ForeignGatewayOnGnosis", - // { from: deployer, log: true }, - // "changeCourtJurorFee", - // 0, - // ethers.utils.parseEther("0.00001") - // ); + await execute( + "ForeignGatewayOnGnosis", + { from: deployer, log: true }, + "changeCourtJurorFee", + 0, + ethers.utils.parseEther("0.00001") + ); }; deployForeignGateway.tags = ["ForeignGatewayOnGnosis"]; diff --git a/contracts/deploy/02-home-gateway-to-ethereum.ts b/contracts/deploy/02-home-gateway-to-ethereum.ts index ba90f8e9f..f85e9b2cd 100644 --- a/contracts/deploy/02-home-gateway-to-ethereum.ts +++ b/contracts/deploy/02-home-gateway-to-ethereum.ts @@ -16,7 +16,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("deploying to chainId %s with deployer %s", chainId, deployer); + console.log("Deploying to chainId %s with deployer %s", chainId, deployer); const veaSender = await deployments.get("FastBridgeSenderToEthereum"); const klerosCore = await deployments.get("KlerosCore"); diff --git a/contracts/deploy/03-vea-mock.ts b/contracts/deploy/03-vea-mock.ts index 08f430026..92979ccf6 100644 --- a/contracts/deploy/03-vea-mock.ts +++ b/contracts/deploy/03-vea-mock.ts @@ -14,7 +14,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; - console.log("deploying to chainId %s with deployer %s", HARDHAT_NETWORK, deployer); + console.log("Deploying to chainId %s with deployer %s", HARDHAT_NETWORK, deployer); const klerosCore = await deployments.get("KlerosCore"); @@ -25,7 +25,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) const nonce = await ethers.provider.getTransactionCount(deployer); const homeGatewayAddress = getContractAddress(deployer, nonce + 1); - console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + console.log("Calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const homeChainIdAsBytes32 = hexZeroPad(hexlify(HARDHAT_NETWORK), 32); const foreignGateway = await deploy("ForeignGatewayOnEthereum", { diff --git a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts index 878f47cde..4407045ec 100644 --- a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts +++ b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts @@ -1,9 +1,6 @@ -import { parseEther } from "ethers/lib/utils"; +import { parseUnits, parseEther } from "ethers/lib/utils"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import getContractAddress from "../deploy-helpers/getContractAddress"; -import { util } from "chai"; -import { rng } from "../typechain-types/src"; enum ForeignChains { GNOSIS_MAINNET = 100, @@ -11,101 +8,141 @@ enum ForeignChains { HARDHAT = 31337, } -const wethByChain = new Map([ - [ForeignChains.GNOSIS_MAINNET, "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1"], +const wrappedPNKByChain = new Map([ + [ForeignChains.GNOSIS_MAINNET, "0xcb3231aBA3b451343e0Fddfc45883c842f223846"], ]); -const xPinakionByChain = new Map([ - [ForeignChains.GNOSIS_MAINNET, "0x37b60f4E9A31A64cCc0024dce7D0fD07eAA0F7B3"], - [ForeignChains.GNOSIS_CHIADO, "0x00"], -]); - -const tokenBridgeByChain = new Map([ - [ForeignChains.GNOSIS_MAINNET, "0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d"], - [ForeignChains.GNOSIS_CHIADO, "0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2"], -]); +const ONE_GWEI = parseUnits("1", "gwei"); const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; + const { ethers, deployments, getNamedAccounts, getChainId } = hre; const { deploy, execute } = deployments; - const { hexZeroPad, hexlify } = ethers.utils; // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("deploying to chainId %s with deployer %s", chainId, deployer); - - const homeNetworks = { - 1: config.networks.arbitrum, - 5: config.networks.arbitrumGoerli, - }; - - // Hack to predict the deployment address on the home chain. - // TODO: use deterministic deployments - const homeChainProvider = new ethers.providers.JsonRpcProvider(homeNetworks[chainId].url); - let nonce = await homeChainProvider.getTransactionCount(deployer); - nonce += 2; // HomeGatewayToEthereum deploy tx will the third tx after this on its home network, so we add two to the current nonce. - const homeChainId = (await homeChainProvider.getNetwork()).chainId; - const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); - const homeGatewayAddress = getContractAddress(deployer, nonce); - console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); - - const veaReceiver = await deployments.get("FastBridgeReceiverOnGnosis"); - - // const wEth = await deployments.get("WETH"); - const wEth = wethByChain[chainId]; - - // const xPnk = await deployments.get("WPNK"); - const xPnk = xPinakionByChain[chainId]; - - const tokenBridge = tokenBridgeByChain[chainId]; - const rnGenerator = ethers.constants.AddressZero; - - // TODO: deploy mocks for xPinakion and tokenBridge for Hardhat network + console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + + if (!wrappedPNKByChain.get(chainId)) { + const wPnk = await deploy("WrappedPinakion", { + from: deployer, + log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, + }); + + wrappedPNKByChain.set(ForeignChains[ForeignChains[chainId]], wPnk.address); + + await deploy("WPNKFaucet", { + from: deployer, + contract: "Faucet", + args: [wPnk.address], + log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, + }); + } + + const wPnkAddress = wrappedPNKByChain.get(ForeignChains[ForeignChains[chainId]]); + const rng = ethers.constants.AddressZero; + const minStakingTime = 99999999; + const maxFreezingTime = 0; + const minStake = parseEther("9999999"); + const alpha = 10000; + const feeForJuror = 0; + const jurorsForCourtJump = 9999999; + const sortitionSumTreeK = 3; + const foreignGateway = await deployments.get("ForeignGatewayOnGnosis"); + const weth = await deployments.get("WETH"); + + console.log( + "Using: \nwPNK at %s, \nForeignGateway at %s, \nWETH at %s", + wPnkAddress, + foreignGateway.address, + weth.address + ); - const wPnk = await deploy("WrappedPinakion", { + const sortitionSumTreeLibrary = await deploy("SortitionSumTreeFactory", { from: deployer, log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, }); - await execute( - "WrappedPinakion", - { from: deployer, log: true }, - "initialize", - "Staking PNK on xDai", - "stPNK", - xPnk, - tokenBridge - ); - - const xKlerosLiquidV2 = await deploy("xKlerosLiquidV2", { + await deploy("xKlerosLiquidV2", { from: deployer, log: true, + libraries: { + SortitionSumTreeFactory: sortitionSumTreeLibrary.address, + }, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, }); await execute( "xKlerosLiquidV2", - { from: deployer, log: true }, + { + from: deployer, + log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, + }, "initialize", deployer, - wPnk, - rnGenerator, - 99999999, - 0, + wPnkAddress, + rng, + minStakingTime, + maxFreezingTime, false, - [999999999, 0, 0, 9999999], - [] + [minStake, alpha, feeForJuror, jurorsForCourtJump], // minStake, alpha, feeForJuror, jurorsForCourtJump + [0, 0, 0, 0], // evidencePeriod, commitPeriod, votePeriod, appealPeriod + sortitionSumTreeK, + foreignGateway.address, + weth.address ); - const metaEvidenceUri = `https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/${hre.network.name}/MetaEvidence_ArbitrableExample.json`; - + const metaEvidenceUri = "INIT ME"; await deploy("ArbitrableExample", { from: deployer, args: [foreignGateway.address, metaEvidenceUri], log: true, + maxFeePerGas: ONE_GWEI, + maxPriorityFeePerGas: ONE_GWEI, }); }; +// TODO: mock deployment on the hardhat network +// const xPinakionByChain = new Map([ +// [ForeignChains.GNOSIS_MAINNET, "0x37b60f4E9A31A64cCc0024dce7D0fD07eAA0F7B3"], +// [ForeignChains.GNOSIS_CHIADO, "0x00"], +// ]); +// const tokenBridgeByChain = new Map([ +// [ForeignChains.GNOSIS_MAINNET, "0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d"], +// [ForeignChains.GNOSIS_CHIADO, "0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2"], +// ]); +// const hardhatDeployer = () => { +// // TODO: deploy mocks for xPinakion and tokenBridge for Hardhat network +// const wEth = await deployments.get("WETH"); +// const wEth = wethByChain[chainId]; +// // const xPnk = await deployments.get("WPNK"); +// const xPnk = xPinakionByChain[chainId]; +// const tokenBridge = tokenBridgeByChain[chainId]; +// const wPnk = await deploy("WrappedPinakion", { +// from: deployer, +// log: true, +// }); + +// await execute( +// "WrappedPinakion", +// { from: deployer, log: true }, +// "initialize", +// "Staking PNK on xDai", +// "stPNK", +// xPnk, +// tokenBridge +// ); +// }; + deployKlerosLiquid.tags = ["KlerosLiquidOnGnosis"]; deployKlerosLiquid.skip = async ({ getChainId }) => { const chainId = Number(await getChainId()); diff --git a/contracts/deployments/chiado/ArbitrableExample.json b/contracts/deployments/chiado/ArbitrableExample.json new file mode 100644 index 000000000..083d596cb --- /dev/null +++ b/contracts/deployments/chiado/ArbitrableExample.json @@ -0,0 +1,403 @@ +{ + "address": "0x823D972BAcBa033BFca208738847cC7135573316", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "string", + "name": "_metaEvidence", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "Dispute", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "MetaEvidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_metaEvidence", + "type": "string" + } + ], + "name": "changedMetaEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "externalIDtoLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x849a9a70f219ff9cf0f917075760977f97b5391a3bbd69b93212feb3c649d6e5", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x823D972BAcBa033BFca208738847cC7135573316", + "transactionIndex": 0, + "gasUsed": "586452", + "logsBloom": "0x00000000000000000000020000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000008000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x972c86a49647701b71aa2e77f2f0bf86981fac869d7fac694ab7abc59a71c274", + "transactionHash": "0x849a9a70f219ff9cf0f917075760977f97b5391a3bbd69b93212feb3c649d6e5", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 2252226, + "transactionHash": "0x849a9a70f219ff9cf0f917075760977f97b5391a3bbd69b93212feb3c649d6e5", + "address": "0x823D972BAcBa033BFca208738847cC7135573316", + "topics": [ + "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000007494e4954204d4500000000000000000000000000000000000000000000000000", + "logIndex": 0, + "blockHash": "0x972c86a49647701b71aa2e77f2f0bf86981fac869d7fac694ab7abc59a71c274" + } + ], + "blockNumber": 2252226, + "cumulativeGasUsed": "586452", + "status": 1, + "byzantium": true + }, + "args": [ + "0x87142b7E9C7D026776499120D902AF8896C07894", + "INIT ME" + ], + "numDeployments": 1, + "solcInputHash": "c9b600ff9291ca791c04d618ea467929", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"Dispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_metaEvidence\",\"type\":\"string\"}],\"name\":\"changedMetaEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_metaEvidence\":\"The URI of the meta evidence object for evidence submissions requests.\"}},\"createDispute(uint256,bytes,uint256)\":{\"details\":\"TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_evidenceGroupID\":\"Unique identifier of the evidence group that is linked to this dispute.\",\"_numberOfRulingOptions\":\"Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrable The arbitrable receiving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x2264bc7cb975d89776b9bf3e35cecd4dec7d601604601ca4822d8bfc0886c379\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"../IArbitrable.sol\\\";\\nimport \\\"../../evidence/IMetaEvidence.sol\\\";\\n\\n/**\\n * @title ArbitrableExample\\n * An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\n */\\ncontract ArbitrableExample is IArbitrable, IMetaEvidence {\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n uint256 META_EVIDENCE_ID = 0;\\n address public governor;\\n IArbitrator public immutable arbitrator; // Arbitrator is set in constructor and never changed.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n /** @dev Constructor\\n * @param _arbitrator The arbitrator to rule on created disputes.\\n * @param _metaEvidence The URI of the meta evidence object for evidence submissions requests.\\n */\\n constructor(IArbitrator _arbitrator, string memory _metaEvidence) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n emit MetaEvidence(META_EVIDENCE_ID, _metaEvidence);\\n }\\n\\n /** @dev TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute.\\n Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n * @param _numberOfRulingOptions Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.\\n * @param _arbitratorExtraData Extra data for the arbitrator.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n * @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n */\\n function createDispute(\\n uint256 _numberOfRulingOptions,\\n bytes calldata _arbitratorExtraData,\\n uint256 _evidenceGroupID\\n ) external payable returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Incorrect number of choices\\\");\\n\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: _numberOfRulingOptions}));\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n emit Dispute(arbitrator, disputeID, META_EVIDENCE_ID, _evidenceGroupID);\\n }\\n\\n /** @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n * @param _externalDisputeID ID of the dispute in arbitrator contract.\\n * @param _ruling The ruling choice of the arbitration.\\n */\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n function changedMetaEvidence(string memory _metaEvidence) external {\\n require(msg.sender == governor, \\\"Not authorized: governor only.\\\");\\n emit MetaEvidence(++META_EVIDENCE_ID, _metaEvidence);\\n }\\n}\\n\",\"keccak256\":\"0x405ab14ff61d32194bc190d0cfb7d192badf836543e7041105a81f2cb3c4e158\",\"license\":\"MIT\"},\"src/evidence/IMetaEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/** @title IMetaEvidence\\n * ERC-1497: Evidence Standard excluding evidence emission as it will be handled by the arbitrator.\\n */\\ninterface IMetaEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\n /**\\n * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0xb87dec548b7c41bb2e2bd25ef3b2159d014c14cdd1e47ca4bec7894817cb8998\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040526000805534801561001457600080fd5b50604051610b12380380610b12833981016040819052610033916100da565b600180546001600160a01b031916331790556001600160a01b0382166080526000546040517f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906100859084906101a8565b60405180910390a250506101db565b634e487b7160e01b600052604160045260246000fd5b60005b838110156100c55781810151838201526020016100ad565b838111156100d4576000848401525b50505050565b600080604083850312156100ed57600080fd5b82516001600160a01b038116811461010457600080fd5b60208401519092506001600160401b038082111561012157600080fd5b818501915085601f83011261013557600080fd5b81518181111561014757610147610094565b604051601f8201601f19908116603f0116810190838211818310171561016f5761016f610094565b8160405282815288602084870101111561018857600080fd5b6101998360208301602088016100aa565b80955050505050509250929050565b60208152600082518060208401526101c78160408501602087016100aa565b601f01601f19169190910160400192915050565b60805161090761020b60003960008181610154015281816101db01528181610550015261060d01526109076000f3fe6080604052600436106100605760003560e01c80630c340a2414610065578063311a6c56146100a257806332705fa6146100c4578063564a565d146100e45780636137048c146101215780636cc6cde114610142578063c21ae06114610176575b600080fd5b34801561007157600080fd5b50600154610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100c26100bd36600461066a565b6101a3565b005b3480156100d057600080fd5b506100c26100df3660046106a2565b610360565b3480156100f057600080fd5b506101046100ff366004610753565b610408565b604080519315158452602084019290925290820152606001610099565b61013461012f36600461076c565b61043f565b604051908152602001610099565b34801561014e57600080fd5b506100857f000000000000000000000000000000000000000000000000000000000000000081565b34801561018257600080fd5b50610134610191366004610753565b60026020526000908152604090205481565b60008281526002602052604081205460038054919291839081106101c9576101c96107ee565b906000526020600020906003020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03161461026d5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156102b35760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610264565b805460ff16156103115760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610264565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6001546001600160a01b031633146103ba5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e00006044820152606401610264565b60008081546103c890610804565b9190508190557f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040516103fd919061082d565b60405180910390a250565b6003818154811061041857600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000600185116104915760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f6963657300000000006044820152606401610264565b60038054604080516060810182526000808252602082018181528284018b81526001860187559186905291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b958502958601805460ff191691151591909117905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d90930192909255905163c13517e160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c13517e1903490610593908a908a908a90600401610882565b6020604051808303818588803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105e591906108b8565b60008181526002602090815260408083208590559154825190815290810186905291935083917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350949350505050565b6000806040838503121561067d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156106b457600080fd5b813567ffffffffffffffff808211156106cc57600080fd5b818401915084601f8301126106e057600080fd5b8135818111156106f2576106f261068c565b604051601f8201601f19908116603f0116810190838211818310171561071a5761071a61068c565b8160405282815287602084870101111561073357600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561076557600080fd5b5035919050565b6000806000806060858703121561078257600080fd5b84359350602085013567ffffffffffffffff808211156107a157600080fd5b818701915087601f8301126107b557600080fd5b8135818111156107c457600080fd5b8860208285010111156107d657600080fd5b95986020929092019750949560400135945092505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561082657634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208083528351808285015260005b8181101561085a5785810183015185820160400152820161083e565b8181111561086c576000604083870101525b50601f01601f1916929092016040019392505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156108ca57600080fd5b505191905056fea2646970667358221220b516bf010fa2003cc2dc067f1b04f29c860385c0155a20c26d83f8307adfa1c164736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a2414610065578063311a6c56146100a257806332705fa6146100c4578063564a565d146100e45780636137048c146101215780636cc6cde114610142578063c21ae06114610176575b600080fd5b34801561007157600080fd5b50600154610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100c26100bd36600461066a565b6101a3565b005b3480156100d057600080fd5b506100c26100df3660046106a2565b610360565b3480156100f057600080fd5b506101046100ff366004610753565b610408565b604080519315158452602084019290925290820152606001610099565b61013461012f36600461076c565b61043f565b604051908152602001610099565b34801561014e57600080fd5b506100857f000000000000000000000000000000000000000000000000000000000000000081565b34801561018257600080fd5b50610134610191366004610753565b60026020526000908152604090205481565b60008281526002602052604081205460038054919291839081106101c9576101c96107ee565b906000526020600020906003020190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03161461026d5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156102b35760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610264565b805460ff16156103115760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610264565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6001546001600160a01b031633146103ba5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420617574686f72697a65643a20676f7665726e6f72206f6e6c792e00006044820152606401610264565b60008081546103c890610804565b9190508190557f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d826040516103fd919061082d565b60405180910390a250565b6003818154811061041857600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b6000600185116104915760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662063686f6963657300000000006044820152606401610264565b60038054604080516060810182526000808252602082018181528284018b81526001860187559186905291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b958502958601805460ff191691151591909117905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d90930192909255905163c13517e160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c13517e1903490610593908a908a908a90600401610882565b6020604051808303818588803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105e591906108b8565b60008181526002602090815260408083208590559154825190815290810186905291935083917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350949350505050565b6000806040838503121561067d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156106b457600080fd5b813567ffffffffffffffff808211156106cc57600080fd5b818401915084601f8301126106e057600080fd5b8135818111156106f2576106f261068c565b604051601f8201601f19908116603f0116810190838211818310171561071a5761071a61068c565b8160405282815287602084870101111561073357600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561076557600080fd5b5035919050565b6000806000806060858703121561078257600080fd5b84359350602085013567ffffffffffffffff808211156107a157600080fd5b818701915087601f8301126107b557600080fd5b8135818111156107c457600080fd5b8860208285010111156107d657600080fd5b95986020929092019750949560400135945092505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561082657634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208083528351808285015260005b8181101561085a5785810183015185820160400152820161083e565b8181111561086c576000604083870101525b50601f01601f1916929092016040019392505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156108ca57600080fd5b505191905056fea2646970667358221220b516bf010fa2003cc2dc067f1b04f29c860385c0155a20c26d83f8307adfa1c164736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "The arbitrator to rule on created disputes.", + "_metaEvidence": "The URI of the meta evidence object for evidence submissions requests." + } + }, + "createDispute(uint256,bytes,uint256)": { + "details": "TRUSTED. Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator.", + "_evidenceGroupID": "Unique identifier of the evidence group that is linked to this dispute.", + "_numberOfRulingOptions": "Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 8331, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "META_EVIDENCE_ID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 8333, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 8340, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "externalIDtoLocalID", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 8344, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "disputes", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(DisputeStruct)8328_storage)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)8328_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)8328_storage", + "encoding": "dynamic_array", + "label": "struct ArbitrableExample.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)8328_storage": { + "encoding": "inplace", + "label": "struct ArbitrableExample.DisputeStruct", + "members": [ + { + "astId": 8323, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "isRuled", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 8325, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "ruling", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 8327, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/chiado/ForeignGatewayOnGnosis.json b/contracts/deployments/chiado/ForeignGatewayOnGnosis.json index 333d0f848..bf0573fc3 100644 --- a/contracts/deployments/chiado/ForeignGatewayOnGnosis.json +++ b/contracts/deployments/chiado/ForeignGatewayOnGnosis.json @@ -1,5 +1,5 @@ { - "address": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "address": "0x87142b7E9C7D026776499120D902AF8896C07894", "abi": [ { "inputs": [ @@ -469,30 +469,30 @@ "type": "function" } ], - "transactionHash": "0xdc48a51c753a6b2470932408ce2bf86ea3aeedec7ba74e3f47d671a0a05a698c", + "transactionHash": "0xc66218d80b9f21642728c230fb9f6bb598207929c32d12e48a8c92d717a06614", "receipt": { "to": null, "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", - "contractAddress": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", - "transactionIndex": 1, + "contractAddress": "0x87142b7E9C7D026776499120D902AF8896C07894", + "transactionIndex": 0, "gasUsed": "1015185", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5d005ec11d40324399a16ac1dd2c4f228a9d42a69344d3c7f55582a9b40a698b", - "transactionHash": "0xdc48a51c753a6b2470932408ce2bf86ea3aeedec7ba74e3f47d671a0a05a698c", + "blockHash": "0x0f263a2a8b5b01c5d70f461fd940c0b6f12ca66b408d5bbaaffd50989cf76547", + "transactionHash": "0xc66218d80b9f21642728c230fb9f6bb598207929c32d12e48a8c92d717a06614", "logs": [], - "blockNumber": 2250301, - "cumulativeGasUsed": "5026485", + "blockNumber": 2251353, + "cumulativeGasUsed": "1015185", "status": 1, "byzantium": true }, "args": [ "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", "0x26858D60FE92b50b34e236B46874e02724344275", - "0x12613A66F1E5A2086374e103F66BF0eddA5d1478", + "0x247AC8F775B77075D9eA5a895Dee0739a46fA589", "0x0000000000000000000000000000000000000000000000000000000000066eed", "0x014A442480DbAD767b7615E55E271799889FA1a7" ], - "numDeployments": 1, + "numDeployments": 2, "solcInputHash": "274a15cfb06cddd0a2be7e47f1a3d37a", "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastBridgeReceiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_senderGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_senderChainID\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"ArbitrationCostModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"disputeHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockhash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"localDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"}],\"name\":\"OutgoingDispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeCourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastBridgeReceiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gracePeriod\",\"type\":\"uint256\"}],\"name\":\"changeFastbridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"createDisputeERC20\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depreciatedFastBridgeExpiration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depreciatedFastbridge\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToForeignID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoDisputeData\",\"outputs\":[{\"internalType\":\"uint248\",\"name\":\"id\",\"type\":\"uint248\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastBridgeReceiver\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"feeForJuror\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageSender\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"}],\"name\":\"relayRule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"senderGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"cost\":\"Required cost of arbitration.\"}},\"changeCourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\"}},\"changeFastbridge(address,uint256)\":{\"details\":\"Changes the fastBridge, useful to increase the claim deposit.\",\"params\":{\"_fastBridgeReceiver\":\"The address of the new fastBridge.\",\"_gracePeriod\":\"The duration to accept messages from the deprecated bridge (if at all).\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"relayRule(address,bytes32,uint256,address)\":{\"notice\":\"Relay the rule call from the home gateway to the arbitrable.\"}},\"notice\":\"Foreign Gateway Counterpart of `HomeGateway`\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/ForeignGatewayOnGnosis.sol\":\"ForeignGatewayOnGnosis\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/vea-contracts/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @hrishibhat]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /**\\n * @dev The Fast Bridge participants watch for these events to decide if a challenge should be submitted.\\n * @param _epoch The epoch for which the the claim was made.\\n * @param _batchMerkleRoot The timestamp of the claim creation.\\n */\\n event ClaimReceived(uint256 indexed _epoch, bytes32 indexed _batchMerkleRoot);\\n\\n /**\\n * @dev This event indicates that `sendSafeFallback()` should be called on the sending side.\\n * @param _epoch The epoch associated with the challenged claim.\\n */\\n event ClaimChallenged(uint256 indexed _epoch);\\n\\n /**\\n * @dev This events indicates that optimistic verification has succeeded. The messages are ready to be relayed.\\n * @param _epoch The epoch associated with the batch.\\n * @param _success The success of the optimistic verification.\\n */\\n event BatchVerified(uint256 indexed _epoch, bool _success);\\n\\n /**\\n * @dev This event indicates that the batch has been received via the Safe Bridge.\\n * @param _epoch The epoch associated with the batch.\\n * @param _isBridgerHonest Whether the bridger made an honest claim.\\n * @param _isChallengerHonest Whether the bridger made an honest challenge.\\n */\\n event BatchSafeVerified(uint256 indexed _epoch, bool _isBridgerHonest, bool _isChallengerHonest);\\n\\n /**\\n * @dev This event indicates that the claim deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _bridger The recipient of the claim deposit.\\n */\\n event ClaimDepositWithdrawn(uint256 indexed _epoch, address indexed _bridger);\\n\\n /**\\n * @dev This event indicates that the challenge deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _challenger The recipient of the challenge deposit.\\n */\\n event ChallengeDepositWithdrawn(uint256 indexed _epoch, address indexed _challenger);\\n\\n /**\\n * @dev This event indicates that a message has been relayed for the batch in this `_epoch`.\\n * @param _epoch The epoch associated with the batch.\\n * @param _nonce The nonce of the message that was relayed.\\n */\\n event MessageRelayed(uint256 indexed _epoch, uint256 indexed _nonce);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Submit a claim about the `_batchMerkleRoot` for the latests completed Fast bridge epoch and submit a deposit. The `_batchMerkleRoot` should match the one on the sending side otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to claim.\\n * @param _batchMerkleRoot The hash claimed for the ticket.\\n */\\n function claim(uint256 _epoch, bytes32 _batchMerkleRoot) external payable;\\n\\n /**\\n * @dev Submit a challenge for the claim of the current epoch's Fast Bridge batch merkleroot state and submit a deposit. The `batchMerkleRoot` in the claim already made for the last finalized epoch should be different from the one on the sending side, otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to challenge.\\n */\\n function challenge(uint256 _epoch) external payable;\\n\\n /**\\n * @dev Resolves the optimistic claim for '_epoch'.\\n * @param _epoch The epoch of the optimistic claim.\\n */\\n function verifyBatch(uint256 _epoch) external;\\n\\n /**\\n * @dev Verifies merkle proof for the given message and associated nonce for the most recent possible epoch and relays the message.\\n * @param _epoch The epoch in which the message was batched by the bridge.\\n * @param _proof The merkle proof to prove the membership of the message and nonce in the merkle tree for the epoch.\\n * @param _message The data on the cross-domain chain for the message.\\n */\\n function verifyAndRelayMessage(\\n uint256 _epoch,\\n bytes32[] calldata _proof,\\n bytes calldata _message\\n ) external;\\n\\n /**\\n * @dev Sends the deposit back to the Bridger if their claim is not successfully challenged. Includes a portion of the Challenger's deposit if unsuccessfully challenged.\\n * @param _epoch The epoch associated with the claim deposit to withraw.\\n */\\n function withdrawClaimDeposit(uint256 _epoch) external;\\n\\n /**\\n * @dev Sends the deposit back to the Challenger if his challenge is successful. Includes a portion of the Bridger's deposit.\\n * @param _epoch The epoch associated with the challenge deposit to withraw.\\n */\\n function withdrawChallengeDeposit(uint256 _epoch) external;\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Returns the `start` and `end` time of challenge period for this `epoch`.\\n * @param _epoch The epoch of the claim to request the challenge period.\\n * @return start The start time of the challenge period.\\n * @return end The end time of the challenge period.\\n */\\n function claimChallengePeriod(uint256 _epoch) external view returns (uint256 start, uint256 end);\\n\\n /**\\n * @dev Returns the epoch period.\\n */\\n function epochPeriod() external view returns (uint256 epochPeriod);\\n\\n /**\\n * @dev Returns the challenge period.\\n */\\n function challengePeriod() external view returns (uint256 challengePeriod);\\n}\\n\",\"keccak256\":\"0xff909a62e9a08540dafcd08c779a64917ed1e44be52d5a225ff9149ff95909e8\",\"license\":\"MIT\"},\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IFastBridgeReceiver.sol\\\";\\n\\ninterface IReceiverGateway {\\n function fastBridgeReceiver() external view returns (IFastBridgeReceiver);\\n\\n function senderChainID() external view returns (uint256);\\n\\n function senderGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0xfa82fbd575c462ad6dffa18c67eb097a4c5088715ae956a836726aafa4be0f90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrable The arbitrable receiving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x2264bc7cb975d89776b9bf3e35cecd4dec7d601604601ca4822d8bfc0886c379\",\"license\":\"MIT\"},\"src/gateway/ForeignGatewayOnGnosis.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz, @unknownunknown1]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrable.sol\\\";\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * Foreign Gateway\\n * Counterpart of `HomeGateway`\\n */\\ncontract ForeignGatewayOnGnosis is IForeignGateway {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeData {\\n uint248 id;\\n bool ruled;\\n address arbitrable;\\n uint256 paid;\\n address relayer;\\n }\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event OutgoingDispute(\\n bytes32 disputeHash,\\n bytes32 blockhash,\\n uint256 localDisputeID,\\n uint256 _choices,\\n bytes _extraData,\\n address arbitrable\\n );\\n\\n event ArbitrationCostModified(uint96 indexed _courtID, uint256 _feeForJuror);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n uint256 public immutable override senderChainID;\\n address public immutable override senderGateway;\\n IERC20 public immutable weth; // WETH token on xDai.\\n uint256 internal localDisputeID = 1; // The disputeID must start from 1 as the KlerosV1 proxy governor depends on this implementation. We now also depend on localDisputeID not ever being zero.\\n mapping(uint96 => uint256) public feeForJuror; // feeForJuror[courtID], it mirrors the value on KlerosCore.\\n address public governor;\\n IFastBridgeReceiver public fastBridgeReceiver;\\n IFastBridgeReceiver public depreciatedFastbridge;\\n uint256 public depreciatedFastBridgeExpiration;\\n mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyFromFastBridge() {\\n require(\\n address(fastBridgeReceiver) == msg.sender ||\\n ((block.timestamp < depreciatedFastBridgeExpiration) && address(depreciatedFastbridge) == msg.sender),\\n \\\"Access not allowed: Fast Bridge only.\\\"\\n );\\n _;\\n }\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(\\n address _governor,\\n IFastBridgeReceiver _fastBridgeReceiver,\\n address _senderGateway,\\n uint256 _senderChainID,\\n IERC20 _weth\\n ) {\\n governor = _governor;\\n fastBridgeReceiver = _fastBridgeReceiver;\\n senderGateway = _senderGateway;\\n senderChainID = _senderChainID;\\n weth = _weth;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Changes the fastBridge, useful to increase the claim deposit.\\n * @param _fastBridgeReceiver The address of the new fastBridge.\\n * @param _gracePeriod The duration to accept messages from the deprecated bridge (if at all).\\n */\\n function changeFastbridge(IFastBridgeReceiver _fastBridgeReceiver, uint256 _gracePeriod) external onlyByGovernor {\\n // grace period to relay remaining messages in the relay / bridging process\\n depreciatedFastBridgeExpiration = block.timestamp + _fastBridgeReceiver.epochPeriod() + _gracePeriod; // 2 weeks\\n depreciatedFastbridge = fastBridgeReceiver;\\n fastBridgeReceiver = _fastBridgeReceiver;\\n }\\n\\n /**\\n * @dev Changes the `feeForJuror` property value of a specified court.\\n * @param _courtID The ID of the court.\\n * @param _feeForJuror The new value for the `feeForJuror` property value.\\n */\\n function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor {\\n feeForJuror[_courtID] = _feeForJuror;\\n emit ArbitrationCostModified(_courtID, _feeForJuror);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function createDispute(\\n uint256 /*_choices*/,\\n bytes calldata /*_extraData*/\\n ) external payable override returns (uint256 disputeID) {\\n revert(\\\"Fees should be paid in WETH\\\");\\n }\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external override returns (uint256 disputeID) {\\n // This check is duplicated in xKlerosLiquid and transferred is done there as well.\\n require(_amount >= arbitrationCost(_extraData), \\\"Not paid enough for arbitration\\\");\\n\\n disputeID = localDisputeID++;\\n uint256 chainID;\\n assembly {\\n chainID := chainid()\\n }\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n chainID,\\n blockhash(block.number - 1),\\n \\\"createDispute\\\",\\n disputeID,\\n _choices,\\n _extraData,\\n msg.sender\\n )\\n );\\n\\n disputeHashtoDisputeData[disputeHash] = DisputeData({\\n id: uint248(disputeID),\\n arbitrable: msg.sender,\\n paid: _amount,\\n relayer: address(0),\\n ruled: false\\n });\\n\\n emit OutgoingDispute(disputeHash, blockhash(block.number - 1), disputeID, _choices, _extraData, msg.sender);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n function arbitrationCost(bytes calldata _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors) = extraDataToCourtIDMinJurors(_extraData);\\n cost = feeForJuror[courtID] * minJurors;\\n }\\n\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(\\n address _messageSender,\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _relayer\\n ) external override onlyFromFastBridge {\\n require(_messageSender == senderGateway, \\\"Only the homegateway is allowed.\\\");\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(!dispute.ruled, \\\"Cannot rule twice\\\");\\n\\n dispute.ruled = true;\\n dispute.relayer = _relayer;\\n\\n IArbitrable arbitrable = IArbitrable(dispute.arbitrable);\\n arbitrable.rule(dispute.id, _ruling);\\n }\\n\\n function withdrawFees(bytes32 _disputeHash) external override {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(dispute.ruled, \\\"Not ruled yet\\\");\\n\\n uint256 amount = dispute.paid;\\n dispute.paid = 0;\\n weth.transfer(dispute.relayer, amount);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view override returns (uint256) {\\n return disputeHashtoDisputeData[_disputeHash].id;\\n }\\n\\n // ************************ //\\n // * Internal * //\\n // ************************ //\\n\\n function extraDataToCourtIDMinJurors(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors) {\\n // Note that here we ignore DisputeKitID\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n }\\n if (feeForJuror[courtID] == 0) courtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n } else {\\n courtID = 0;\\n minJurors = MIN_JURORS;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2b08ac831644a9328a387c3ae529c5d999e9ce9ff5468a15215cd50af6a2eb16\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\nimport \\\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator, IReceiverGateway {\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external returns (uint256 disputeID);\\n}\\n\",\"keccak256\":\"0x4cfc88d2d7cf211ce9a1f3c991f093baefa026784185da2319d566051d0c8c43\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60e0604052600160005534801561001557600080fd5b50604051620011573803806200115783398101604081905261003691610090565b600280546001600160a01b03199081166001600160a01b0397881617909155600380549091169486169490941790935590831660a0526080521660c0526100fb565b6001600160a01b038116811461008d57600080fd5b50565b600080600080600060a086880312156100a857600080fd5b85516100b381610078565b60208701519095506100c481610078565b60408701519094506100d581610078565b6060870151608088015191945092506100ed81610078565b809150509295509295909350565b60805160a05160c05161101e62000139600039600081816101a30152610a820152600081816102c101526107e301526000610204015261101e6000f3fe6080604052600436106100e95760003560e01c8063a60a4db511610085578063a60a4db51461027c578063c13517e11461029c578063ce0aaf95146102af578063d3c617ff146102e3578063d96a36ca14610385578063eaff425a146103a5578063ebb71194146103ba578063f7434ea9146103da578063f7f56752146103fa57600080fd5b80630c340a24146100ee5780632d5db96d1461012b5780632e1db8901461014d5780633fc8cef31461019157806345c90441146101c55780634def5455146101f257806367c5194714610226578063979f8e65146102465780639ff66f6414610266575b600080fd5b3480156100fa57600080fd5b5060025461010e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013757600080fd5b5061014b610146366004610beb565b61041a565b005b34801561015957600080fd5b50610183610168366004610c17565b6000908152600660205260409020546001600160f81b031690565b604051908152602001610122565b34801561019d57600080fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101d157600080fd5b506101836101e0366004610c4c565b60016020526000908152604090205481565b3480156101fe57600080fd5b506101837f000000000000000000000000000000000000000000000000000000000000000081565b34801561023257600080fd5b5061014b610241366004610c6e565b610507565b34801561025257600080fd5b50610183610261366004610cd3565b61058a565b34801561027257600080fd5b5061018360055481565b34801561028857600080fd5b5061014b610297366004610d26565b610758565b6101836102aa366004610d70565b610984565b3480156102bb57600080fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102ef57600080fd5b506103476102fe366004610c17565b60066020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a001610122565b34801561039157600080fd5b5060035461010e906001600160a01b031681565b3480156103b157600080fd5b50610183600381565b3480156103c657600080fd5b5061014b6103d5366004610c17565b6109cf565b3480156103e657600080fd5b506101836103f5366004610dbc565b610b06565b34801561040657600080fd5b5060045461010e906001600160a01b031681565b6002546001600160a01b0316331461044d5760405162461bcd60e51b815260040161044490610dfe565b60405180910390fd5b80826001600160a01b031663b5b7a1846040518163ffffffff1660e01b815260040160206040518083038186803b15801561048757600080fd5b505afa15801561049b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bf9190610e40565b6104c99042610e6f565b6104d39190610e6f565b6005555060038054600480546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6002546001600160a01b031633146105315760405162461bcd60e51b815260040161044490610dfe565b6001600160601b03821660008181526001602052604090819020839055517f20a6ef9c48f3a1ae927e70bc34e82d974c53d3c98c8fd9e731c4bacd5842c5969061057e9084815260200190565b60405180910390a25050565b60006105968484610b06565b8210156105e55760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610444565b6000805490806105f483610e87565b90915550905046600081610609600143610ea2565b4084898989336040516020016106259796959493929190610eb9565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038088168552600085840181815233878701908152606088018c815260808901848152868552600690975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d8869982469082906107009043610ea2565b40858a8a8a336040516107199796959493929190610f19565b60405180910390a1604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050949350505050565b6003546001600160a01b031633148061078757506005544210801561078757506004546001600160a01b031633145b6107e15760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b6064820152608401610444565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316146108625760405162461bcd60e51b815260206004820181905260248201527f4f6e6c792074686520686f6d656761746577617920697320616c6c6f7765642e6044820152606401610444565b600083815260066020526040902080546001600160f81b03166108975760405162461bcd60e51b815260040161044490610f77565b8054600160f81b900460ff16156108e45760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610444565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b50505050505050505050565b60405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e205745544800000000006044820152600090606401610444565b600081815260066020526040902080546001600160f81b0316610a045760405162461bcd60e51b815260040161044490610f77565b8054600160f81b900460ff16610a4c5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610444565b6002810180546000909155600382015460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb90604401602060405180830381600087803b158015610ac857600080fd5b505af1158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b009190610fa7565b50505050565b6000806000610b4a85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b7c92505050565b6001600160601b0382166000908152600160205260409020549193509150610b73908290610fc9565b95945050505050565b6000806040835110610bc75750506020818101516040808401516001600160601b03831660009081526001909452922054909190610bb957600091505b80610bc2575060035b915091565b50600090506003915091565b6001600160a01b0381168114610be857600080fd5b50565b60008060408385031215610bfe57600080fd5b8235610c0981610bd3565b946020939093013593505050565b600060208284031215610c2957600080fd5b5035919050565b80356001600160601b0381168114610c4757600080fd5b919050565b600060208284031215610c5e57600080fd5b610c6782610c30565b9392505050565b60008060408385031215610c8157600080fd5b610c0983610c30565b60008083601f840112610c9c57600080fd5b50813567ffffffffffffffff811115610cb457600080fd5b602083019150836020828501011115610ccc57600080fd5b9250929050565b60008060008060608587031215610ce957600080fd5b84359350602085013567ffffffffffffffff811115610d0757600080fd5b610d1387828801610c8a565b9598909750949560400135949350505050565b60008060008060808587031215610d3c57600080fd5b8435610d4781610bd3565b935060208501359250604085013591506060850135610d6581610bd3565b939692955090935050565b600080600060408486031215610d8557600080fd5b83359250602084013567ffffffffffffffff811115610da357600080fd5b610daf86828701610c8a565b9497909650939450505050565b60008060208385031215610dcf57600080fd5b823567ffffffffffffffff811115610de657600080fd5b610df285828601610c8a565b90969095509350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600060208284031215610e5257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610e8257610e82610e59565b500190565b6000600019821415610e9b57610e9b610e59565b5060010190565b600082821015610eb457610eb4610e59565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b602080825260169082015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b604082015260600190565b600060208284031215610fb957600080fd5b81518015158114610c6757600080fd5b6000816000190483118215151615610fe357610fe3610e59565b50029056fea2646970667358221220dd71b48d89896f779000e464425d5a23f5dc452fd7622b881f1c4c2ccb429c0864736f6c63430008090033", diff --git a/contracts/deployments/chiado/SortitionSumTreeFactory.json b/contracts/deployments/chiado/SortitionSumTreeFactory.json new file mode 100644 index 000000000..4c58b9303 --- /dev/null +++ b/contracts/deployments/chiado/SortitionSumTreeFactory.json @@ -0,0 +1,92 @@ +{ + "address": "0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636", + "abi": [], + "transactionHash": "0x405e9f06449c4d61948ed7f0c9c6cf3f6a9bab4fd8b42db9c1232d41f07ee7d9", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636", + "transactionIndex": 0, + "gasUsed": "636060", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xced975b8d1ee04c3fb122c9d467d1d6bc3ea17b087b9b223c84ecbcfe267e271", + "transactionHash": "0x405e9f06449c4d61948ed7f0c9c6cf3f6a9bab4fd8b42db9c1232d41f07ee7d9", + "logs": [], + "blockNumber": 2252213, + "cumulativeGasUsed": "636060", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "c9b600ff9291ca791c04d618ea467929", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Enrique Piqueras - \",\"details\":\"A factory of trees that keep track of staked values for sortition.\",\"kind\":\"dev\",\"methods\":{\"createTree(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,uint256)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_K\":\"The number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,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\":{\"_drawnNumber\":\"The drawn number.\",\"_key\":\"The key of the tree.\"},\"returns\":{\"ID\":\"The drawn ID. `O(k * log_k(n))` where `k` is the maximum number of childs per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"queryLeafs(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,uint256,uint256)\":{\"details\":\"Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned.\",\"params\":{\"_count\":\"The number of items to return.\",\"_cursor\":\"The pagination cursor.\",\"_key\":\"The key of the tree to get the leaves from.\"},\"returns\":{\"hasMore\":\"Whether there are more for pagination. `O(n)` where `n` is the maximum number of nodes ever appended.\",\"startIndex\":\"The index at which leaves start.\",\"values\":\"The values of the returned leaves.\"}},\"set(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,uint256,bytes32)\":{\"details\":\"Set a value of a tree.\",\"params\":{\"_ID\":\"The ID of the value. `O(log_k(n))` where `k` is the maximum number of childs per node in the tree, and `n` is the maximum number of nodes ever appended.\",\"_key\":\"The key of the tree.\",\"_value\":\"The new value.\"}},\"stakeOf(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,bytes32)\":{\"details\":\"Gets a specified ID's associated value.\",\"params\":{\"_ID\":\"The ID of the value.\",\"_key\":\"The key of the tree.\"},\"returns\":{\"value\":\"The associated value.\"}}},\"title\":\"SortitionSumTreeFactory\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/libraries/SortitionSumTreeFactory.sol\":\"SortitionSumTreeFactory\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/libraries/SortitionSumTreeFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@epiqueras, @unknownunknown1]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @title SortitionSumTreeFactory\\n * @author Enrique Piqueras - \\n * @dev A factory of trees that keep track of staked values for sortition.\\n */\\nlibrary SortitionSumTreeFactory {\\n /* Structs */\\n\\n struct SortitionSumTree {\\n uint K; // The maximum number of childs per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint[] stack;\\n uint[] 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 => uint) IDsToNodeIndexes;\\n mapping(uint => bytes32) nodeIndexesToIDs;\\n }\\n\\n /* Storage */\\n\\n struct SortitionSumTrees {\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees;\\n }\\n\\n /* Public */\\n\\n /**\\n * @dev Create a sortition sum tree at the specified key.\\n * @param _key The key of the new tree.\\n * @param _K The number of children each node in the tree should have.\\n */\\n function createTree(SortitionSumTrees storage self, bytes32 _key, uint _K) public {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(_K > 1, \\\"K must be greater than one.\\\");\\n tree.K = _K;\\n tree.nodes.push(0);\\n }\\n\\n /**\\n * @dev Set a value of a tree.\\n * @param _key The key of the tree.\\n * @param _value The new value.\\n * @param _ID The ID of the value.\\n * `O(log_k(n))` where\\n * `k` is the maximum number of childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function set(SortitionSumTrees storage self, bytes32 _key, uint _value, bytes32 _ID) public {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint 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 uint parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n updateParents(self, _key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n updateParents(self, _key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint plusOrMinusValue = plusOrMinus ? _value - tree.nodes[treeIndex] : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n updateParents(self, _key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /* Public Views */\\n\\n /**\\n * @dev Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned.\\n * @param _key The key of the tree to get the leaves from.\\n * @param _cursor The pagination cursor.\\n * @param _count The number of items to return.\\n * @return startIndex The index at which leaves start.\\n * @return values The values of the returned leaves.\\n * @return hasMore Whether there are more for pagination.\\n * `O(n)` where\\n * `n` is the maximum number of nodes ever appended.\\n */\\n function queryLeafs(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint _cursor,\\n uint _count\\n ) public view returns (uint startIndex, uint[] memory values, bool hasMore) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n // Find the start index.\\n for (uint i = 0; i < tree.nodes.length; i++) {\\n if ((tree.K * i) + 1 >= tree.nodes.length) {\\n startIndex = i;\\n break;\\n }\\n }\\n\\n // Get the values.\\n uint loopStartIndex = startIndex + _cursor;\\n values = new uint[](loopStartIndex + _count > tree.nodes.length ? tree.nodes.length - loopStartIndex : _count);\\n uint valuesIndex = 0;\\n for (uint j = loopStartIndex; j < tree.nodes.length; j++) {\\n if (valuesIndex < _count) {\\n values[valuesIndex] = tree.nodes[j];\\n valuesIndex++;\\n } else {\\n hasMore = true;\\n break;\\n }\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _key The key of the tree.\\n * @param _drawnNumber The drawn number.\\n * @return ID The drawn ID.\\n * `O(k * log_k(n))` where\\n * `k` is the maximum number of childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function draw(SortitionSumTrees storage self, bytes32 _key, uint _drawnNumber) public view returns (bytes32 ID) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint treeIndex = 0;\\n uint currentDrawnNumber = _drawnNumber % tree.nodes[0];\\n\\n while (\\n (tree.K * treeIndex) + 1 < tree.nodes.length // While it still has children.\\n )\\n for (uint i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint nodeIndex = (tree.K * treeIndex) + i;\\n uint nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue)\\n currentDrawnNumber -= nodeValue; // Go to the next child.\\n else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n\\n ID = tree.nodeIndexesToIDs[treeIndex];\\n }\\n\\n /** @dev Gets a specified ID's associated value.\\n * @param _key The key of the tree.\\n * @param _ID The ID of the value.\\n * @return value The associated value.\\n */\\n function stakeOf(SortitionSumTrees storage self, bytes32 _key, bytes32 _ID) public view returns (uint value) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) value = 0;\\n else value = tree.nodes[treeIndex];\\n }\\n\\n /* Private */\\n\\n /**\\n * @dev Update all the parents of a node.\\n * @param _key The key of the tree to update.\\n * @param _treeIndex The index of the node to start from.\\n * @param _plusOrMinus Wether to add (true) or substract (false).\\n * @param _value The value to add or substract.\\n * `O(log_k(n))` where\\n * `k` is the maximum number of childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function updateParents(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint _treeIndex,\\n bool _plusOrMinus,\\n uint _value\\n ) private {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n uint parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x053af9495cb8382dfc1e1503d8f3dab3d356d664efdbdf534f146ab8f3834e95\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x610a8c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c80632e25c38a1461006657806365b81f4f146100885780637521ccb1146100b357806388c1d467146100d45780639075789e146100e7575b600080fd5b81801561007257600080fd5b506100866100813660046108a0565b610107565b005b61009b6100963660046108a0565b610455565b6040516100aa939291906108d2565b60405180910390f35b6100c66100c136600461092b565b6105c0565b6040519081526020016100aa565b6100c66100e236600461092b565b610616565b8180156100f357600080fd5b5061008661010236600461092b565b61071c565b6000838152602085815260408083208484526003810190925290912054806102cd5783156102c857600182015461021a5750600281018054600180820183556000928352602090922081018590559081148015906101795750815461016d60018361096d565b610177919061099a565b155b1561021557815460009061018d90836109ae565b60008181526004850160205260408120549192506101ac8460016109c2565b9050846002018560020184815481106101c7576101c76109da565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b610295565b60018083018054909161022c9161096d565b8154811061023c5761023c6109da565b906000526020600020015490508160010180548061025c5761025c6109f0565b6001900381819060005260206000200160009055905583826002018281548110610288576102886109da565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556102c88686836001886107e2565b61044d565b8361036a5760008260020182815481106102e9576102e96109da565b90600052602060002001549050600083600201838154811061030d5761030d6109da565b600091825260208083209091019290925560018086018054918201815582528282200184905585815260038501825260408082208290558482526004860190925290812081905561036490889088908590856107e2565b5061044d565b81600201818154811061037f5761037f6109da565b9060005260206000200154841461044d576000848360020183815481106103a8576103a86109da565b9060005260206000200154111590506000816103ee57858460020184815481106103d4576103d46109da565b90600052602060002001546103e9919061096d565b610419565b836002018381548110610403576104036109da565b906000526020600020015486610419919061096d565b905085846002018481548110610431576104316109da565b60009182526020909120015561044a88888585856107e2565b50505b505050505050565b60008381526020859052604081206060908290815b60028201548110156104b25760028201548254610488908390610a06565b6104939060016109c2565b106104a0578094506104b2565b806104aa81610a25565b91505061046a565b5060006104bf87866109c2565b60028301549091506104d187836109c2565b116104dc57856104ec565b60028201546104ec90829061096d565b67ffffffffffffffff81111561050457610504610a40565b60405190808252806020026020018201604052801561052d578160200160208202803683370190505b5093506000815b60028401548110156105b257878210156105975783600201818154811061055d5761055d6109da565b906000526020600020015486838151811061057a5761057a6109da565b60209081029190910101528161058f81610a25565b9250506105a0565b600194506105b2565b806105aa81610a25565b915050610534565b505050509450945094915050565b60008281526020848152604080832084845260038101909252822054806105ea576000925061060d565b8160020181815481106105ff576105ff6109da565b906000526020600020015492505b50509392505050565b600082815260208490526040812060028101805483918291829061063c5761063c6109da565b906000526020600020015485610652919061099a565b90505b60028301548354610667908490610a06565b6106729060016109c2565b10156107015760015b835481116106fb576000818486600001546106969190610a06565b6106a091906109c2565b905060008560020182815481106106b9576106b96109da565b906000526020600020015490508084106106de576106d7818561096d565b93506106e6565b5092506106fb565b505080806106f390610a25565b91505061067b565b50610655565b50600090815260049091016020526040902054949350505050565b60008281526020849052604090208054156107755760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064015b60405180910390fd5b600182116107c55760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e0000000000604482015260640161076c565b908155600201805460018101825560009182526020822001555050565b6000848152602086905260409020835b801561089757815461080560018361096d565b61080f91906109ae565b905083610846578282600201828154811061082c5761082c6109da565b9060005260206000200154610841919061096d565b610871565b8282600201828154811061085c5761085c6109da565b906000526020600020015461087191906109c2565b826002018281548110610886576108866109da565b6000918252602090912001556107f2565b50505050505050565b600080600080608085870312156108b657600080fd5b5050823594602084013594506040840135936060013592509050565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015610913578451835293830193918301916001016108f7565b50508093505050508215156040830152949350505050565b60008060006060848603121561094057600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561097f5761097f610957565b500390565b634e487b7160e01b600052601260045260246000fd5b6000826109a9576109a9610984565b500690565b6000826109bd576109bd610984565b500490565b600082198211156109d5576109d5610957565b500190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615610a2057610a20610957565b500290565b6000600019821415610a3957610a39610957565b5060010190565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220ed612533fe19900f6f7bcb3715e15197fada76852ddc384bf142ca0012dbbcf664736f6c63430008090033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c80632e25c38a1461006657806365b81f4f146100885780637521ccb1146100b357806388c1d467146100d45780639075789e146100e7575b600080fd5b81801561007257600080fd5b506100866100813660046108a0565b610107565b005b61009b6100963660046108a0565b610455565b6040516100aa939291906108d2565b60405180910390f35b6100c66100c136600461092b565b6105c0565b6040519081526020016100aa565b6100c66100e236600461092b565b610616565b8180156100f357600080fd5b5061008661010236600461092b565b61071c565b6000838152602085815260408083208484526003810190925290912054806102cd5783156102c857600182015461021a5750600281018054600180820183556000928352602090922081018590559081148015906101795750815461016d60018361096d565b610177919061099a565b155b1561021557815460009061018d90836109ae565b60008181526004850160205260408120549192506101ac8460016109c2565b9050846002018560020184815481106101c7576101c76109da565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b610295565b60018083018054909161022c9161096d565b8154811061023c5761023c6109da565b906000526020600020015490508160010180548061025c5761025c6109f0565b6001900381819060005260206000200160009055905583826002018281548110610288576102886109da565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556102c88686836001886107e2565b61044d565b8361036a5760008260020182815481106102e9576102e96109da565b90600052602060002001549050600083600201838154811061030d5761030d6109da565b600091825260208083209091019290925560018086018054918201815582528282200184905585815260038501825260408082208290558482526004860190925290812081905561036490889088908590856107e2565b5061044d565b81600201818154811061037f5761037f6109da565b9060005260206000200154841461044d576000848360020183815481106103a8576103a86109da565b9060005260206000200154111590506000816103ee57858460020184815481106103d4576103d46109da565b90600052602060002001546103e9919061096d565b610419565b836002018381548110610403576104036109da565b906000526020600020015486610419919061096d565b905085846002018481548110610431576104316109da565b60009182526020909120015561044a88888585856107e2565b50505b505050505050565b60008381526020859052604081206060908290815b60028201548110156104b25760028201548254610488908390610a06565b6104939060016109c2565b106104a0578094506104b2565b806104aa81610a25565b91505061046a565b5060006104bf87866109c2565b60028301549091506104d187836109c2565b116104dc57856104ec565b60028201546104ec90829061096d565b67ffffffffffffffff81111561050457610504610a40565b60405190808252806020026020018201604052801561052d578160200160208202803683370190505b5093506000815b60028401548110156105b257878210156105975783600201818154811061055d5761055d6109da565b906000526020600020015486838151811061057a5761057a6109da565b60209081029190910101528161058f81610a25565b9250506105a0565b600194506105b2565b806105aa81610a25565b915050610534565b505050509450945094915050565b60008281526020848152604080832084845260038101909252822054806105ea576000925061060d565b8160020181815481106105ff576105ff6109da565b906000526020600020015492505b50509392505050565b600082815260208490526040812060028101805483918291829061063c5761063c6109da565b906000526020600020015485610652919061099a565b90505b60028301548354610667908490610a06565b6106729060016109c2565b10156107015760015b835481116106fb576000818486600001546106969190610a06565b6106a091906109c2565b905060008560020182815481106106b9576106b96109da565b906000526020600020015490508084106106de576106d7818561096d565b93506106e6565b5092506106fb565b505080806106f390610a25565b91505061067b565b50610655565b50600090815260049091016020526040902054949350505050565b60008281526020849052604090208054156107755760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064015b60405180910390fd5b600182116107c55760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e0000000000604482015260640161076c565b908155600201805460018101825560009182526020822001555050565b6000848152602086905260409020835b801561089757815461080560018361096d565b61080f91906109ae565b905083610846578282600201828154811061082c5761082c6109da565b9060005260206000200154610841919061096d565b610871565b8282600201828154811061085c5761085c6109da565b906000526020600020015461087191906109c2565b826002018281548110610886576108866109da565b6000918252602090912001556107f2565b50505050505050565b600080600080608085870312156108b657600080fd5b5050823594602084013594506040840135936060013592509050565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015610913578451835293830193918301916001016108f7565b50508093505050508215156040830152949350505050565b60008060006060848603121561094057600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561097f5761097f610957565b500390565b634e487b7160e01b600052601260045260246000fd5b6000826109a9576109a9610984565b500690565b6000826109bd576109bd610984565b500490565b600082198211156109d5576109d5610957565b500190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615610a2057610a20610957565b500290565b6000600019821415610a3957610a39610957565b5060010190565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220ed612533fe19900f6f7bcb3715e15197fada76852ddc384bf142ca0012dbbcf664736f6c63430008090033", + "devdoc": { + "author": "Enrique Piqueras - ", + "details": "A factory of trees that keep track of staked values for sortition.", + "kind": "dev", + "methods": { + "createTree(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,uint256)": { + "details": "Create a sortition sum tree at the specified key.", + "params": { + "_K": "The number of children each node in the tree should have.", + "_key": "The key of the new tree." + } + }, + "draw(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,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": { + "_drawnNumber": "The drawn number.", + "_key": "The key of the tree." + }, + "returns": { + "ID": "The drawn ID. `O(k * log_k(n))` where `k` is the maximum number of childs per node in the tree, and `n` is the maximum number of nodes ever appended." + } + }, + "queryLeafs(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,uint256,uint256)": { + "details": "Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned.", + "params": { + "_count": "The number of items to return.", + "_cursor": "The pagination cursor.", + "_key": "The key of the tree to get the leaves from." + }, + "returns": { + "hasMore": "Whether there are more for pagination. `O(n)` where `n` is the maximum number of nodes ever appended.", + "startIndex": "The index at which leaves start.", + "values": "The values of the returned leaves." + } + }, + "set(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,uint256,bytes32)": { + "details": "Set a value of a tree.", + "params": { + "_ID": "The ID of the value. `O(log_k(n))` where `k` is the maximum number of childs per node in the tree, and `n` is the maximum number of nodes ever appended.", + "_key": "The key of the tree.", + "_value": "The new value." + } + }, + "stakeOf(SortitionSumTreeFactory.SortitionSumTrees storage,bytes32,bytes32)": { + "details": "Gets a specified ID's associated value.", + "params": { + "_ID": "The ID of the value.", + "_key": "The key of the tree." + }, + "returns": { + "value": "The associated value." + } + } + }, + "title": "SortitionSumTreeFactory", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/chiado/WPNKFaucet.json b/contracts/deployments/chiado/WPNKFaucet.json new file mode 100644 index 000000000..9e7e07782 --- /dev/null +++ b/contracts/deployments/chiado/WPNKFaucet.json @@ -0,0 +1,146 @@ +{ + "address": "0xcFc0b84419583ff7b32fD5139B789cE858517d4C", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xcd1d60786d8623a68acf5ff033d57a4c22aa35df7891218a3469ce61736fe938", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0xcFc0b84419583ff7b32fD5139B789cE858517d4C", + "transactionIndex": 1, + "gasUsed": "260119", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x36a70f83be9a73c14fbffc7cfd1cb5805f454604382feaaef48c2709e7ea5143", + "transactionHash": "0xcd1d60786d8623a68acf5ff033d57a4c22aa35df7891218a3469ce61736fe938", + "logs": [], + "blockNumber": 2252067, + "cumulativeGasUsed": "4264245", + "status": 1, + "byzantium": true + }, + "args": [ + "0x04Fb43F2Ce076867b5ba38750Ecb2cc6BDe78D61" + ], + "numDeployments": 1, + "solcInputHash": "274a15cfb06cddd0a2be7e47f1a3d37a", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"london\",\"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.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n IERC20 public token;\\n mapping(address => bool) public withdrewAlready;\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n }\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, 10000 ether);\\n withdrewAlready[msg.sender] = true;\\n }\\n}\\n\",\"keccak256\":\"0x96dfe825cf0342eeff4380ac3632e50fed75eb083ff9b5133ab1575ed38dc333\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516103e03803806103e083398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b61034d806100936000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063338cdca114610051578063b69ef8a81461005b578063d61c40dc14610076578063fc0c546a146100a9575b600080fd5b6100596100d4565b005b61006361022b565b6040519081526020015b60405180910390f35b6100996100843660046102ac565b60016020526000908152604090205460ff1681565b604051901515815260200161006d565b6000546100bc906001600160a01b031681565b6040516001600160a01b03909116815260200161006d565b3360009081526001602052604090205460ff161561017e5760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a40160405180910390fd5b60005460405163a9059cbb60e01b815233600482015269021e19e0c9bab240000060248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156101d357600080fd5b505af11580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b91906102dc565b50336000908152600160208190526040909120805460ff19169091179055565b600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561026f57600080fd5b505afa158015610283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a791906102fe565b905090565b6000602082840312156102be57600080fd5b81356001600160a01b03811681146102d557600080fd5b9392505050565b6000602082840312156102ee57600080fd5b815180151581146102d557600080fd5b60006020828403121561031057600080fd5b505191905056fea26469706673582212205834b9da8d3e30c6124c75f3a860d0d45dd1a253a98d2f15c37030d47e91889a64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063338cdca114610051578063b69ef8a81461005b578063d61c40dc14610076578063fc0c546a146100a9575b600080fd5b6100596100d4565b005b61006361022b565b6040519081526020015b60405180910390f35b6100996100843660046102ac565b60016020526000908152604090205460ff1681565b604051901515815260200161006d565b6000546100bc906001600160a01b031681565b6040516001600160a01b03909116815260200161006d565b3360009081526001602052604090205460ff161561017e5760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a40160405180910390fd5b60005460405163a9059cbb60e01b815233600482015269021e19e0c9bab240000060248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156101d357600080fd5b505af11580156101e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020b91906102dc565b50336000908152600160208190526040909120805460ff19169091179055565b600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561026f57600080fd5b505afa158015610283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a791906102fe565b905090565b6000602082840312156102be57600080fd5b81356001600160a01b03811681146102d557600080fd5b9392505050565b6000602082840312156102ee57600080fd5b815180151581146102d557600080fd5b60006020828403121561031057600080fd5b505191905056fea26469706673582212205834b9da8d3e30c6124c75f3a860d0d45dd1a253a98d2f15c37030d47e91889a64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 25951, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1072" + }, + { + "astId": 25955, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1072": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} diff --git a/contracts/deployments/chiado/WrappedPinakion.json b/contracts/deployments/chiado/WrappedPinakion.json new file mode 100644 index 000000000..80b5a4ef9 --- /dev/null +++ b/contracts/deployments/chiado/WrappedPinakion.json @@ -0,0 +1,770 @@ +{ + "address": "0x04Fb43F2Ce076867b5ba38750Ecb2cc6BDe78D61", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_controller", + "type": "address" + } + ], + "name": "changeController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "contract IERC677", + "name": "_xPinakion", + "type": "address" + }, + { + "internalType": "contract ITokenBridge", + "name": "_tokenBridge", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenBridged", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenBridge", + "outputs": [ + { + "internalType": "contract ITokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "withdrawAndConvertToPNK", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xPinakion", + "outputs": [ + { + "internalType": "contract IERC677", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xcf82b5a5b2d3290660320d9a0ecf766b1227361f05d73fe3754a155b780c2d19", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x04Fb43F2Ce076867b5ba38750Ecb2cc6BDe78D61", + "transactionIndex": 0, + "gasUsed": "1298416", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xde9c8f2f419b6160f2d8e75a9c9d45f46cfbfd3699ff8fca13e8ff39becc9399", + "transactionHash": "0xcf82b5a5b2d3290660320d9a0ecf766b1227361f05d73fe3754a155b780c2d19", + "logs": [], + "blockNumber": 2252066, + "cumulativeGasUsed": "1298416", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "274a15cfb06cddd0a2be7e47f1a3d37a", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"changeController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"contract IERC677\",\"name\":\"_xPinakion\",\"type\":\"address\"},{\"internalType\":\"contract ITokenBridge\",\"name\":\"_tokenBridge\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenBridged\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenBridge\",\"outputs\":[{\"internalType\":\"contract ITokenBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"}],\"name\":\"withdrawAndConvertToPNK\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"xPinakion\",\"outputs\":[{\"internalType\":\"contract IERC677\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Transfer(address,address,uint256)\":{\"details\":\"Notice that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"approve(address,uint256)\":{\"params\":{\"_amount\":\"The amount of base units the entity will be allowed to spend.\",\"_spender\":\"The entity allowed to spend funds.\"},\"returns\":{\"_0\":\"True on success.\"}},\"balanceOf(address)\":{\"details\":\"Gets the balance of the specified address.\",\"params\":{\"_owner\":\"The address to query the balance of.\"},\"returns\":{\"_0\":\"uint256 value representing the amount owned by the passed address.\"}},\"changeController(address)\":{\"params\":{\"_controller\":\"The new controller of the contract\"}},\"decreaseAllowance(address,uint256)\":{\"params\":{\"_spender\":\"The entity whose spending allocation will be reduced.\",\"_subtractedValue\":\"The reduction of spending allocation in base units.\"},\"returns\":{\"_0\":\"True on success.\"}},\"deposit(uint256)\":{\"params\":{\"_amount\":\"The amount of wrapped pinakions to mint.\"}},\"increaseAllowance(address,uint256)\":{\"params\":{\"_addedValue\":\"The amount of extra base units the entity will be allowed to spend.\",\"_spender\":\"The entity allowed to spend funds.\"},\"returns\":{\"_0\":\"True on success.\"}},\"initialize(string,string,address,address)\":{\"details\":\"Constructor.\",\"params\":{\"_name\":\"for the wrapped PNK on the home chain.\",\"_symbol\":\"for wrapped PNK ticker on the home chain.\",\"_tokenBridge\":\"the TokenBridge contract.\",\"_xPinakion\":\"the home PNK contract which is already bridged to the foreign PNK contract.\"}},\"onTokenBridged(address,uint256,bytes)\":{\"details\":\"Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid. If the tokenBridge is calling this function, then this contract has already received the xPinakion tokens. Notice that the Home bridge calls onTokenBridge as a result of someone invoking `relayTokensAndCall()` on the Foreign bridge contract.\",\"params\":{\"_amount\":\"The amount of wrapped PNK to mint.\",\"_data\":\"Calldata containing the address of the recipient. Notice that the address has to be padded to the right 32 bytes.\",\"_token\":\"The token address the _amount belongs to.\"}},\"transfer(address,uint256)\":{\"params\":{\"_amount\":\"The amount to tranfer in base units.\",\"_recipient\":\"The entity receiving the funds.\"},\"returns\":{\"_0\":\"True on success.\"}},\"transferFrom(address,address,uint256)\":{\"params\":{\"_amount\":\"The amount to tranfer in base units.\",\"_recipient\":\"The entity receiving the funds.\",\"_sender\":\"The entity to take the funds from.\"},\"returns\":{\"_0\":\"True on success.\"}},\"withdraw(uint256)\":{\"params\":{\"_amount\":\"The amount of bridged PNK to withdraw.\"}},\"withdrawAndConvertToPNK(uint256,address)\":{\"details\":\"This function is not strictly needed, but it provides a good UX to users who want to get their Mainnet's PNK back. What normally takes 3 transactions, here is done in one go. Notice that the PNK have to be claimed on Mainnet's TokenBridge by the receiver.\",\"params\":{\"_amount\":\"The amount of PNK to withdraw.\",\"_receiver\":\"The address which will receive the PNK back in the foreign chain.\"}}},\"version\":1},\"userdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"notice\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"notice\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`).\"}},\"kind\":\"user\",\"methods\":{\"approve(address,uint256)\":{\"notice\":\"Approves `_spender` to spend `_amount`.\"},\"changeController(address)\":{\"notice\":\"Changes `controller` to `_controller`.\"},\"controller()\":{\"notice\":\"The token's controller.\"},\"decimals()\":{\"notice\":\"Number of decimals of the token.\"},\"decreaseAllowance(address,uint256)\":{\"notice\":\"Decreases the `_spender` allowance by `_subtractedValue`.\"},\"deposit(uint256)\":{\"notice\":\"Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid.\"},\"increaseAllowance(address,uint256)\":{\"notice\":\"Increases the `_spender` allowance by `_addedValue`.\"},\"name()\":{\"notice\":\"Name of the token.\"},\"onTokenBridged(address,uint256,bytes)\":{\"notice\":\"IERC20 Receiver functionality.\"},\"symbol()\":{\"notice\":\"Symbol of the token.\"},\"tokenBridge()\":{\"notice\":\"xDai Token Bridge. The Token Bridge is upgradeable.\"},\"totalSupply()\":{\"notice\":\"Total supply of the token. Equals the total xPinakion deposit into the contract.\"},\"transfer(address,uint256)\":{\"notice\":\"Moves `_amount` tokens from the caller's account to `_recipient`.\"},\"transferFrom(address,address,uint256)\":{\"notice\":\"Moves `_amount` tokens from `_sender` to `_recipient` using the allowance mechanism. `_amount` is then deducted from the caller's allowance.\"},\"withdraw(uint256)\":{\"notice\":\"Converts wrapped PNK back into bridged PNK (xPinakion).\"},\"withdrawAndConvertToPNK(uint256,address)\":{\"notice\":\"Converts wrapped PNK back into PNK using the Token Bridge.\"},\"xPinakion()\":{\"notice\":\"Bridged PNK on xDai to be wrapped. This token is upgradeable.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol\":\"WrappedPinakion\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\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 * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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 {ERC1967Proxy-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 * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 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 bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\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(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\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 require(_initializing, \\\"Initializable: contract is not initializing\\\");\\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 require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _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 _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x3798da9e212cd00a7cda94ddb5a9721171a718e89c500d8901f810e0e37fa74e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.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 *\\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://diligence.consensys.net/posts/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.5.11/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(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) 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\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a + b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a * b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator.\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0f633a0223d9a1dcccfcf38a64c9de0874dfcbfac0c6941ccf074d63a2ce0e1e\",\"license\":\"MIT\"},\"src/kleros-v1/interfaces/ITokenController.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @dev The token controller contract must implement these functions. See https://github.com/Giveth/minime/blob/master/contracts/TokenController.sol\\n */\\ninterface ITokenController {\\n /**\\n * @notice Called when `_owner` sends ether to the MiniMe Token contract\\n * @param _owner The address that sent the ether to create tokens\\n * @return True if the ether is accepted, false if it throws\\n */\\n function proxyPayment(address _owner) external payable returns (bool);\\n\\n /**\\n * @notice Notifies the controller about a token transfer allowing the controller to react if desired\\n * @param _from The origin of the transfer\\n * @param _to The destination of the transfer\\n * @param _amount The amount of the transfer\\n * @return False if the controller does not authorize the transfer\\n */\\n function onTransfer(address _from, address _to, uint256 _amount) external returns (bool);\\n\\n /**\\n * @notice Notifies the controller about an approval allowing the controller to react if desired\\n * @param _owner The address that calls `approve()`\\n * @param _spender The spender in the `approve()` call\\n * @param _amount The amount in the `approve()` call\\n * @return False if the controller does not authorize the approval\\n */\\n function onApprove(address _owner, address _spender, uint256 _amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x872b17903608262164b43c7304e9fe1d6ae631070ffd2c911e7508d7f7cf7c91\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\nimport \\\"../interfaces/ITokenController.sol\\\";\\nimport \\\"./interfaces/ITokenBridge.sol\\\";\\nimport \\\"./interfaces/IERC677.sol\\\";\\n\\ncontract WrappedPinakion is Initializable {\\n using SafeMath for uint256;\\n\\n /* Events */\\n\\n /**\\n * @notice Emitted when `value` tokens are moved from one account (`from`) to another (`to`).\\n * @dev Notice that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @notice 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 /* Storage */\\n\\n mapping(address => uint256) private balances;\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /// @notice Total supply of the token. Equals the total xPinakion deposit into the contract.\\n uint256 public totalSupply;\\n\\n /// @notice Name of the token.\\n string public name;\\n\\n /// @notice Symbol of the token.\\n string public symbol;\\n\\n /// @notice Number of decimals of the token.\\n uint8 public decimals;\\n\\n /// @notice The token's controller.\\n address public controller;\\n\\n /// @notice Bridged PNK on xDai to be wrapped. This token is upgradeable.\\n IERC677 public xPinakion;\\n\\n /// @notice xDai Token Bridge. The Token Bridge is upgradeable.\\n ITokenBridge public tokenBridge;\\n\\n /* Modifiers */\\n\\n /// @dev Verifies that the sender has ability to modify controlled parameters.\\n modifier onlyController() {\\n require(controller == msg.sender, \\\"The caller is not the controller.\\\");\\n _;\\n }\\n\\n /* Initializer */\\n\\n /**\\n * @dev Constructor.\\n * @param _name for the wrapped PNK on the home chain.\\n * @param _symbol for wrapped PNK ticker on the home chain.\\n * @param _xPinakion the home PNK contract which is already bridged to the foreign PNK contract.\\n * @param _tokenBridge the TokenBridge contract.\\n */\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n IERC677 _xPinakion,\\n ITokenBridge _tokenBridge\\n ) public initializer {\\n name = _name;\\n symbol = _symbol;\\n decimals = 18;\\n xPinakion = _xPinakion;\\n tokenBridge = _tokenBridge;\\n controller = msg.sender;\\n }\\n\\n /* External */\\n\\n /**\\n * @notice Changes `controller` to `_controller`.\\n * @param _controller The new controller of the contract\\n */\\n function changeController(address _controller) external onlyController {\\n controller = _controller;\\n }\\n\\n /**\\n * @notice Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid.\\n * @param _amount The amount of wrapped pinakions to mint.\\n */\\n function deposit(uint256 _amount) external {\\n _mint(msg.sender, _amount);\\n require(\\n xPinakion.transferFrom(msg.sender, address(this), _amount),\\n \\\"Sender does not have enough approved funds.\\\"\\n );\\n }\\n\\n /**\\n * @notice IERC20 Receiver functionality.\\n * @dev Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid.\\n * If the tokenBridge is calling this function, then this contract has already received\\n * the xPinakion tokens. Notice that the Home bridge calls onTokenBridge as a result of\\n * someone invoking `relayTokensAndCall()` on the Foreign bridge contract.\\n * @param _token The token address the _amount belongs to.\\n * @param _amount The amount of wrapped PNK to mint.\\n * @param _data Calldata containing the address of the recipient.\\n * Notice that the address has to be padded to the right 32 bytes.\\n */\\n function onTokenBridged(address _token, uint256 _amount, bytes calldata _data) external {\\n require(msg.sender == address(tokenBridge), \\\"Sender not authorized.\\\");\\n require(_token == address(xPinakion), \\\"Token bridged is not xPinakion.\\\");\\n\\n address recipient;\\n assembly {\\n recipient := calldataload(0x84)\\n }\\n _mint(recipient, _amount);\\n }\\n\\n /**\\n * @notice Converts wrapped PNK back into bridged PNK (xPinakion).\\n * @param _amount The amount of bridged PNK to withdraw.\\n */\\n function withdraw(uint256 _amount) external {\\n _burn(_amount);\\n require(xPinakion.transfer(msg.sender, _amount), \\\"The `transfer` function must not fail.\\\");\\n }\\n\\n /**\\n * @notice Converts wrapped PNK back into PNK using the Token Bridge.\\n * @dev This function is not strictly needed, but it provides a good UX to users who want to get their Mainnet's PNK back.\\n * What normally takes 3 transactions, here is done in one go.\\n * Notice that the PNK have to be claimed on Mainnet's TokenBridge by the receiver.\\n * @param _amount The amount of PNK to withdraw.\\n * @param _receiver The address which will receive the PNK back in the foreign chain.\\n */\\n function withdrawAndConvertToPNK(uint256 _amount, address _receiver) external {\\n _burn(_amount);\\n // Using approve is safe here, because this contract approves the bridge to spend the tokens and triggers the relay immediately.\\n xPinakion.approve(address(tokenBridge), _amount);\\n tokenBridge.relayTokens(xPinakion, _receiver, _amount);\\n }\\n\\n /**\\n * @notice Moves `_amount` tokens from the caller's account to `_recipient`.\\n * @param _recipient The entity receiving the funds.\\n * @param _amount The amount to tranfer in base units.\\n * @return True on success.\\n */\\n function transfer(address _recipient, uint256 _amount) public returns (bool) {\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onTransfer(msg.sender, _recipient, _amount),\\n \\\"Token controller rejects transfer.\\\"\\n );\\n }\\n balances[msg.sender] = balances[msg.sender].sub(_amount); // ERC20: transfer amount exceeds balance\\n balances[_recipient] = balances[_recipient].add(_amount);\\n emit Transfer(msg.sender, _recipient, _amount);\\n return true;\\n }\\n\\n /**\\n * @notice Moves `_amount` tokens from `_sender` to `_recipient` using the\\n * allowance mechanism. `_amount` is then deducted from the caller's allowance.\\n * @param _sender The entity to take the funds from.\\n * @param _recipient The entity receiving the funds.\\n * @param _amount The amount to tranfer in base units.\\n * @return True on success.\\n */\\n function transferFrom(address _sender, address _recipient, uint256 _amount) public returns (bool) {\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onTransfer(_sender, _recipient, _amount),\\n \\\"Token controller rejects transfer.\\\"\\n );\\n }\\n\\n /** The controller of this contract can move tokens around at will,\\n * this is important to recognize! Confirm that you trust the\\n * controller of this contract, which in most situations should be\\n * another open source smart contract or 0x0.\\n */\\n if (msg.sender != controller) {\\n allowance[_sender][msg.sender] = allowance[_sender][msg.sender].sub(_amount); // ERC20: transfer amount exceeds allowance.\\n }\\n\\n balances[_sender] = balances[_sender].sub(_amount); // ERC20: transfer amount exceeds balance\\n balances[_recipient] = balances[_recipient].add(_amount);\\n emit Transfer(_sender, _recipient, _amount);\\n return true;\\n }\\n\\n /**\\n * @notice Approves `_spender` to spend `_amount`.\\n * @param _spender The entity allowed to spend funds.\\n * @param _amount The amount of base units the entity will be allowed to spend.\\n * @return True on success.\\n */\\n function approve(address _spender, uint256 _amount) public returns (bool) {\\n // Alerts the token controller of the approve function call\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onApprove(msg.sender, _spender, _amount),\\n \\\"Token controller does not approve.\\\"\\n );\\n }\\n\\n allowance[msg.sender][_spender] = _amount;\\n emit Approval(msg.sender, _spender, _amount);\\n return true;\\n }\\n\\n /**\\n * @notice Increases the `_spender` allowance by `_addedValue`.\\n * @param _spender The entity allowed to spend funds.\\n * @param _addedValue The amount of extra base units the entity will be allowed to spend.\\n * @return True on success.\\n */\\n function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) {\\n uint256 newAllowance = allowance[msg.sender][_spender].add(_addedValue);\\n // Alerts the token controller of the approve function call\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onApprove(msg.sender, _spender, newAllowance),\\n \\\"Token controller does not approve.\\\"\\n );\\n }\\n\\n allowance[msg.sender][_spender] = newAllowance;\\n emit Approval(msg.sender, _spender, newAllowance);\\n return true;\\n }\\n\\n /**\\n * @notice Decreases the `_spender` allowance by `_subtractedValue`.\\n * @param _spender The entity whose spending allocation will be reduced.\\n * @param _subtractedValue The reduction of spending allocation in base units.\\n * @return True on success.\\n */\\n function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) {\\n uint256 newAllowance = allowance[msg.sender][_spender].sub(_subtractedValue); // ERC20: decreased allowance below zero\\n // Alerts the token controller of the approve function call\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onApprove(msg.sender, _spender, newAllowance),\\n \\\"Token controller does not approve.\\\"\\n );\\n }\\n\\n allowance[msg.sender][_spender] = newAllowance;\\n emit Approval(msg.sender, _spender, newAllowance);\\n return true;\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Internal function that mints an amount of the token and assigns it to\\n * an account. This encapsulates the modification of balances such that the\\n * proper events are emitted.\\n * @param _recipient The address which will receive the minted tokens.\\n * @param _amount The amount that will be created.\\n */\\n function _mint(address _recipient, uint256 _amount) internal {\\n totalSupply = totalSupply.add(_amount);\\n balances[_recipient] = balances[_recipient].add(_amount);\\n emit Transfer(address(0x0), _recipient, _amount);\\n }\\n\\n /**\\n * @dev Destroys `_amount` tokens from the caller. Cannot burn locked tokens.\\n * @param _amount The quantity of tokens to burn in base units.\\n */\\n function _burn(uint256 _amount) internal {\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onTransfer(msg.sender, address(0x0), _amount),\\n \\\"Token controller rejects transfer.\\\"\\n );\\n }\\n balances[msg.sender] = balances[msg.sender].sub(_amount); // ERC20: burn amount exceeds balance\\n totalSupply = totalSupply.sub(_amount);\\n emit Transfer(msg.sender, address(0x0), _amount);\\n }\\n\\n /**\\n * @dev Internal function to determine if an address is a contract.\\n * @param _addr The address being queried.\\n * @return True if `_addr` is a contract.\\n */\\n function isContract(address _addr) internal view returns (bool) {\\n uint256 size;\\n if (_addr == address(0)) return false;\\n assembly {\\n size := extcodesize(_addr)\\n }\\n return size > 0;\\n }\\n\\n /* Getters */\\n\\n /**\\n * @dev Gets the balance of the specified address.\\n * @param _owner The address to query the balance of.\\n * @return uint256 value representing the amount owned by the passed address.\\n */\\n function balanceOf(address _owner) public view returns (uint256) {\\n return balances[_owner];\\n }\\n}\\n\",\"keccak256\":\"0x1cdaf0dd439866cb5029d3299bd3bb7412c4d55aeafebdd168a60914da741606\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/interfaces/IERC677.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\ninterface IERC677 {\\n function transfer(address _to, uint256 _value) external returns (bool);\\n\\n function transferFrom(address _from, address _to, uint256 _value) external returns (bool);\\n\\n function approve(address _spender, uint256 _value) external returns (bool);\\n}\\n\",\"keccak256\":\"0x901e298088578c3333807574c52d2d288a1a1036531bd85168f9505cb85168e7\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/interfaces/ITokenBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IERC677.sol\\\";\\n\\ninterface ITokenBridge {\\n function relayTokens(IERC677 token, address _receiver, uint256 _value) external;\\n}\\n\",\"keccak256\":\"0x8054fe008a2a2473ab24168068e9207b54bc0ac9a6de31899f5da62ef1a85805\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50611687806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638108022d116100ad578063b6b55f2511610071578063b6b55f251461029e578063c6328a46146102b1578063db7af854146102c4578063dd62ed3e146102d7578063f77c47911461030257600080fd5b80638108022d1461024a5780638f15b4141461025d57806395d89b4114610270578063a457c2d714610278578063a9059cbb1461028b57600080fd5b8063313ce567116100f4578063313ce567146101b157806333e1cbda146101d057806339509351146101fb5780633cebb8231461020e57806370a082311461022157600080fd5b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017257806323b872dd146101895780632e1a7d4d1461019c575b600080fd5b61013961031a565b60405161014691906111c7565b60405180910390f35b61016261015d366004611231565b6103a8565b6040519015158152602001610146565b61017b60035481565b604051908152602001610146565b61016261019736600461125d565b6104de565b6101af6101aa36600461129e565b6106b6565b005b6006546101be9060ff1681565b60405160ff9091168152602001610146565b6007546101e3906001600160a01b031681565b6040516001600160a01b039091168152602001610146565b610162610209366004611231565b6107a1565b6101af61021c3660046112b7565b6108fe565b61017b61022f3660046112b7565b6001600160a01b031660009081526001602052604090205490565b6101af6102583660046112d4565b61098f565b6101af61026b3660046113a7565b610a8f565b610139610c0f565b610162610286366004611231565b610c1c565b610162610299366004611231565b610c4c565b6101af6102ac36600461129e565b610d99565b6008546101e3906001600160a01b031681565b6101af6102d2366004611430565b610e89565b61017b6102e53660046114b9565b600260209081526000928352604080842090915290825290205481565b6006546101e39061010090046001600160a01b031681565b60048054610327906114e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610353906114e7565b80156103a05780601f10610375576101008083540402835291602001916103a0565b820191906000526020600020905b81548152906001019060200180831161038357829003601f168201915b505050505081565b6006546000906103c59061010090046001600160a01b0316610f46565b156104795760065460405163da682aeb60e01b81526101009091046001600160a01b03169063da682aeb9061040290339087908790600401611522565b602060405180830381600087803b15801561041c57600080fd5b505af1158015610430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104549190611546565b6104795760405162461bcd60e51b815260040161047090611568565b60405180910390fd5b3360008181526002602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a350600192915050565b6006546000906104fb9061010090046001600160a01b0316610f46565b156105a657600654604051634a39314960e01b81526101009091046001600160a01b031690634a3931499061053890879087908790600401611522565b602060405180830381600087803b15801561055257600080fd5b505af1158015610566573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058a9190611546565b6105a65760405162461bcd60e51b8152600401610470906115aa565b60065461010090046001600160a01b03163314610610576001600160a01b03841660009081526002602090815260408083203384529091529020546105eb9083610f68565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b6001600160a01b0384166000908152600160205260409020546106339083610f68565b6001600160a01b0380861660009081526001602052604080822093909355908516815220546106629083610f7b565b6001600160a01b038085166000818152600160205260409081902093909355915190861690600080516020611632833981519152906106a49086815260200190565b60405180910390a35060019392505050565b6106bf81610f87565b60075460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561070b57600080fd5b505af115801561071f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107439190611546565b61079e5760405162461bcd60e51b815260206004820152602660248201527f54686520607472616e73666572602066756e6374696f6e206d757374206e6f74604482015265103330b4b61760d11b6064820152608401610470565b50565b3360009081526002602090815260408083206001600160a01b038616845290915281205481906107d19084610f7b565b6006549091506107ee9061010090046001600160a01b0316610f46565b156108995760065460405163da682aeb60e01b81526101009091046001600160a01b03169063da682aeb9061082b90339088908690600401611522565b602060405180830381600087803b15801561084557600080fd5b505af1158015610859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087d9190611546565b6108995760405162461bcd60e51b815260040161047090611568565b3360008181526002602090815260408083206001600160a01b03891680855290835292819020859055518481529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b60065461010090046001600160a01b031633146109675760405162461bcd60e51b815260206004820152602160248201527f5468652063616c6c6572206973206e6f742074686520636f6e74726f6c6c65726044820152601760f91b6064820152608401610470565b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b61099882610f87565b60075460085460405163095ea7b360e01b81526001600160a01b0391821660048201526024810185905291169063095ea7b390604401602060405180830381600087803b1580156109e857600080fd5b505af11580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a209190611546565b5060085460075460405163ad58bdd160e01b81526001600160a01b039283169263ad58bdd192610a599291169085908790600401611522565b600060405180830381600087803b158015610a7357600080fd5b505af1158015610a87573d6000803e3d6000fd5b505050505050565b600054610100900460ff1615808015610aaf5750600054600160ff909116105b80610ac95750303b158015610ac9575060005460ff166001145b610b2c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610470565b6000805460ff191660011790558015610b4f576000805461ff0019166101001790555b8451610b6290600490602088019061112e565b508351610b7690600590602087019061112e565b5060068054600780546001600160a01b038088166001600160a01b031992831617909255600880549287169290911691909117905533610100026001600160a81b03199091161760121790558015610c08576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60058054610327906114e7565b3360009081526002602090815260408083206001600160a01b038616845290915281205481906107d19084610f68565b600654600090610c699061010090046001600160a01b0316610f46565b15610d1457600654604051634a39314960e01b81526101009091046001600160a01b031690634a39314990610ca690339087908790600401611522565b602060405180830381600087803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf89190611546565b610d145760405162461bcd60e51b8152600401610470906115aa565b33600090815260016020526040902054610d2e9083610f68565b33600090815260016020526040808220929092556001600160a01b03851681522054610d5a9083610f7b565b6001600160a01b038416600081815260016020526040908190209290925590513390600080516020611632833981519152906104cd9086815260200190565b610da333826110b0565b6007546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610dd790339030908690600401611522565b602060405180830381600087803b158015610df157600080fd5b505af1158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190611546565b61079e5760405162461bcd60e51b815260206004820152602b60248201527f53656e64657220646f6573206e6f74206861766520656e6f756768206170707260448201526a37bb32b210333ab732399760a91b6064820152608401610470565b6008546001600160a01b03163314610edc5760405162461bcd60e51b815260206004820152601660248201527529b2b73232b9103737ba1030baba3437b934bd32b21760511b6044820152606401610470565b6007546001600160a01b03858116911614610f395760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e2062726964676564206973206e6f74207850696e616b696f6e2e006044820152606401610470565b608435610c0881856110b0565b6000806001600160a01b038316610f605750600092915050565b50503b151590565b6000610f748284611602565b9392505050565b6000610f748284611619565b600654610fa19061010090046001600160a01b0316610f46565b1561104d57600654604051634a39314960e01b81526101009091046001600160a01b031690634a39314990610fdf9033906000908690600401611522565b602060405180830381600087803b158015610ff957600080fd5b505af115801561100d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110319190611546565b61104d5760405162461bcd60e51b8152600401610470906115aa565b336000908152600160205260409020546110679082610f68565b336000908152600160205260409020556003546110849082610f68565b60035560405181815260009033906000805160206116328339815191529060200160405180910390a350565b6003546110bd9082610f7b565b6003556001600160a01b0382166000908152600160205260409020546110e39082610f7b565b6001600160a01b038316600081815260016020526040808220939093559151909190600080516020611632833981519152906111229085815260200190565b60405180910390a35050565b82805461113a906114e7565b90600052602060002090601f01602090048101928261115c57600085556111a2565b82601f1061117557805160ff19168380011785556111a2565b828001600101855582156111a2579182015b828111156111a2578251825591602001919060010190611187565b506111ae9291506111b2565b5090565b5b808211156111ae57600081556001016111b3565b600060208083528351808285015260005b818110156111f4578581018301518582016040015282016111d8565b81811115611206576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461079e57600080fd5b6000806040838503121561124457600080fd5b823561124f8161121c565b946020939093013593505050565b60008060006060848603121561127257600080fd5b833561127d8161121c565b9250602084013561128d8161121c565b929592945050506040919091013590565b6000602082840312156112b057600080fd5b5035919050565b6000602082840312156112c957600080fd5b8135610f748161121c565b600080604083850312156112e757600080fd5b8235915060208301356112f98161121c565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261132b57600080fd5b813567ffffffffffffffff8082111561134657611346611304565b604051601f8301601f19908116603f0116810190828211818310171561136e5761136e611304565b8160405283815286602085880101111561138757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080608085870312156113bd57600080fd5b843567ffffffffffffffff808211156113d557600080fd5b6113e18883890161131a565b955060208701359150808211156113f757600080fd5b506114048782880161131a565b93505060408501356114158161121c565b915060608501356114258161121c565b939692955090935050565b6000806000806060858703121561144657600080fd5b84356114518161121c565b935060208501359250604085013567ffffffffffffffff8082111561147557600080fd5b818701915087601f83011261148957600080fd5b81358181111561149857600080fd5b8860208285010111156114aa57600080fd5b95989497505060200194505050565b600080604083850312156114cc57600080fd5b82356114d78161121c565b915060208301356112f98161121c565b600181811c908216806114fb57607f821691505b6020821081141561151c57634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561155857600080fd5b81518015158114610f7457600080fd5b60208082526022908201527f546f6b656e20636f6e74726f6c6c657220646f6573206e6f7420617070726f76604082015261329760f11b606082015260800190565b60208082526022908201527f546f6b656e20636f6e74726f6c6c65722072656a65637473207472616e736665604082015261391760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015611614576116146115ec565b500390565b6000821982111561162c5761162c6115ec565b50019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204717c2ac4da3a3984647ffc72e968a5cb1643291be6cb1c8abe15350f5f3179e64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638108022d116100ad578063b6b55f2511610071578063b6b55f251461029e578063c6328a46146102b1578063db7af854146102c4578063dd62ed3e146102d7578063f77c47911461030257600080fd5b80638108022d1461024a5780638f15b4141461025d57806395d89b4114610270578063a457c2d714610278578063a9059cbb1461028b57600080fd5b8063313ce567116100f4578063313ce567146101b157806333e1cbda146101d057806339509351146101fb5780633cebb8231461020e57806370a082311461022157600080fd5b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017257806323b872dd146101895780632e1a7d4d1461019c575b600080fd5b61013961031a565b60405161014691906111c7565b60405180910390f35b61016261015d366004611231565b6103a8565b6040519015158152602001610146565b61017b60035481565b604051908152602001610146565b61016261019736600461125d565b6104de565b6101af6101aa36600461129e565b6106b6565b005b6006546101be9060ff1681565b60405160ff9091168152602001610146565b6007546101e3906001600160a01b031681565b6040516001600160a01b039091168152602001610146565b610162610209366004611231565b6107a1565b6101af61021c3660046112b7565b6108fe565b61017b61022f3660046112b7565b6001600160a01b031660009081526001602052604090205490565b6101af6102583660046112d4565b61098f565b6101af61026b3660046113a7565b610a8f565b610139610c0f565b610162610286366004611231565b610c1c565b610162610299366004611231565b610c4c565b6101af6102ac36600461129e565b610d99565b6008546101e3906001600160a01b031681565b6101af6102d2366004611430565b610e89565b61017b6102e53660046114b9565b600260209081526000928352604080842090915290825290205481565b6006546101e39061010090046001600160a01b031681565b60048054610327906114e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610353906114e7565b80156103a05780601f10610375576101008083540402835291602001916103a0565b820191906000526020600020905b81548152906001019060200180831161038357829003601f168201915b505050505081565b6006546000906103c59061010090046001600160a01b0316610f46565b156104795760065460405163da682aeb60e01b81526101009091046001600160a01b03169063da682aeb9061040290339087908790600401611522565b602060405180830381600087803b15801561041c57600080fd5b505af1158015610430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104549190611546565b6104795760405162461bcd60e51b815260040161047090611568565b60405180910390fd5b3360008181526002602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a350600192915050565b6006546000906104fb9061010090046001600160a01b0316610f46565b156105a657600654604051634a39314960e01b81526101009091046001600160a01b031690634a3931499061053890879087908790600401611522565b602060405180830381600087803b15801561055257600080fd5b505af1158015610566573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058a9190611546565b6105a65760405162461bcd60e51b8152600401610470906115aa565b60065461010090046001600160a01b03163314610610576001600160a01b03841660009081526002602090815260408083203384529091529020546105eb9083610f68565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b6001600160a01b0384166000908152600160205260409020546106339083610f68565b6001600160a01b0380861660009081526001602052604080822093909355908516815220546106629083610f7b565b6001600160a01b038085166000818152600160205260409081902093909355915190861690600080516020611632833981519152906106a49086815260200190565b60405180910390a35060019392505050565b6106bf81610f87565b60075460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561070b57600080fd5b505af115801561071f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107439190611546565b61079e5760405162461bcd60e51b815260206004820152602660248201527f54686520607472616e73666572602066756e6374696f6e206d757374206e6f74604482015265103330b4b61760d11b6064820152608401610470565b50565b3360009081526002602090815260408083206001600160a01b038616845290915281205481906107d19084610f7b565b6006549091506107ee9061010090046001600160a01b0316610f46565b156108995760065460405163da682aeb60e01b81526101009091046001600160a01b03169063da682aeb9061082b90339088908690600401611522565b602060405180830381600087803b15801561084557600080fd5b505af1158015610859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087d9190611546565b6108995760405162461bcd60e51b815260040161047090611568565b3360008181526002602090815260408083206001600160a01b03891680855290835292819020859055518481529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b60065461010090046001600160a01b031633146109675760405162461bcd60e51b815260206004820152602160248201527f5468652063616c6c6572206973206e6f742074686520636f6e74726f6c6c65726044820152601760f91b6064820152608401610470565b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b61099882610f87565b60075460085460405163095ea7b360e01b81526001600160a01b0391821660048201526024810185905291169063095ea7b390604401602060405180830381600087803b1580156109e857600080fd5b505af11580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a209190611546565b5060085460075460405163ad58bdd160e01b81526001600160a01b039283169263ad58bdd192610a599291169085908790600401611522565b600060405180830381600087803b158015610a7357600080fd5b505af1158015610a87573d6000803e3d6000fd5b505050505050565b600054610100900460ff1615808015610aaf5750600054600160ff909116105b80610ac95750303b158015610ac9575060005460ff166001145b610b2c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610470565b6000805460ff191660011790558015610b4f576000805461ff0019166101001790555b8451610b6290600490602088019061112e565b508351610b7690600590602087019061112e565b5060068054600780546001600160a01b038088166001600160a01b031992831617909255600880549287169290911691909117905533610100026001600160a81b03199091161760121790558015610c08576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60058054610327906114e7565b3360009081526002602090815260408083206001600160a01b038616845290915281205481906107d19084610f68565b600654600090610c699061010090046001600160a01b0316610f46565b15610d1457600654604051634a39314960e01b81526101009091046001600160a01b031690634a39314990610ca690339087908790600401611522565b602060405180830381600087803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf89190611546565b610d145760405162461bcd60e51b8152600401610470906115aa565b33600090815260016020526040902054610d2e9083610f68565b33600090815260016020526040808220929092556001600160a01b03851681522054610d5a9083610f7b565b6001600160a01b038416600081815260016020526040908190209290925590513390600080516020611632833981519152906104cd9086815260200190565b610da333826110b0565b6007546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610dd790339030908690600401611522565b602060405180830381600087803b158015610df157600080fd5b505af1158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190611546565b61079e5760405162461bcd60e51b815260206004820152602b60248201527f53656e64657220646f6573206e6f74206861766520656e6f756768206170707260448201526a37bb32b210333ab732399760a91b6064820152608401610470565b6008546001600160a01b03163314610edc5760405162461bcd60e51b815260206004820152601660248201527529b2b73232b9103737ba1030baba3437b934bd32b21760511b6044820152606401610470565b6007546001600160a01b03858116911614610f395760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e2062726964676564206973206e6f74207850696e616b696f6e2e006044820152606401610470565b608435610c0881856110b0565b6000806001600160a01b038316610f605750600092915050565b50503b151590565b6000610f748284611602565b9392505050565b6000610f748284611619565b600654610fa19061010090046001600160a01b0316610f46565b1561104d57600654604051634a39314960e01b81526101009091046001600160a01b031690634a39314990610fdf9033906000908690600401611522565b602060405180830381600087803b158015610ff957600080fd5b505af115801561100d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110319190611546565b61104d5760405162461bcd60e51b8152600401610470906115aa565b336000908152600160205260409020546110679082610f68565b336000908152600160205260409020556003546110849082610f68565b60035560405181815260009033906000805160206116328339815191529060200160405180910390a350565b6003546110bd9082610f7b565b6003556001600160a01b0382166000908152600160205260409020546110e39082610f7b565b6001600160a01b038316600081815260016020526040808220939093559151909190600080516020611632833981519152906111229085815260200190565b60405180910390a35050565b82805461113a906114e7565b90600052602060002090601f01602090048101928261115c57600085556111a2565b82601f1061117557805160ff19168380011785556111a2565b828001600101855582156111a2579182015b828111156111a2578251825591602001919060010190611187565b506111ae9291506111b2565b5090565b5b808211156111ae57600081556001016111b3565b600060208083528351808285015260005b818110156111f4578581018301518582016040015282016111d8565b81811115611206576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461079e57600080fd5b6000806040838503121561124457600080fd5b823561124f8161121c565b946020939093013593505050565b60008060006060848603121561127257600080fd5b833561127d8161121c565b9250602084013561128d8161121c565b929592945050506040919091013590565b6000602082840312156112b057600080fd5b5035919050565b6000602082840312156112c957600080fd5b8135610f748161121c565b600080604083850312156112e757600080fd5b8235915060208301356112f98161121c565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261132b57600080fd5b813567ffffffffffffffff8082111561134657611346611304565b604051601f8301601f19908116603f0116810190828211818310171561136e5761136e611304565b8160405283815286602085880101111561138757600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080608085870312156113bd57600080fd5b843567ffffffffffffffff808211156113d557600080fd5b6113e18883890161131a565b955060208701359150808211156113f757600080fd5b506114048782880161131a565b93505060408501356114158161121c565b915060608501356114258161121c565b939692955090935050565b6000806000806060858703121561144657600080fd5b84356114518161121c565b935060208501359250604085013567ffffffffffffffff8082111561147557600080fd5b818701915087601f83011261148957600080fd5b81358181111561149857600080fd5b8860208285010111156114aa57600080fd5b95989497505060200194505050565b600080604083850312156114cc57600080fd5b82356114d78161121c565b915060208301356112f98161121c565b600181811c908216806114fb57607f821691505b6020821081141561151c57634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561155857600080fd5b81518015158114610f7457600080fd5b60208082526022908201527f546f6b656e20636f6e74726f6c6c657220646f6573206e6f7420617070726f76604082015261329760f11b606082015260800190565b60208082526022908201527f546f6b656e20636f6e74726f6c6c65722072656a65637473207472616e736665604082015261391760f11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015611614576116146115ec565b500390565b6000821982111561162c5761162c6115ec565b50019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204717c2ac4da3a3984647ffc72e968a5cb1643291be6cb1c8abe15350f5f3179e64736f6c63430008090033", + "devdoc": { + "events": { + "Transfer(address,address,uint256)": { + "details": "Notice that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "approve(address,uint256)": { + "params": { + "_amount": "The amount of base units the entity will be allowed to spend.", + "_spender": "The entity allowed to spend funds." + }, + "returns": { + "_0": "True on success." + } + }, + "balanceOf(address)": { + "details": "Gets the balance of the specified address.", + "params": { + "_owner": "The address to query the balance of." + }, + "returns": { + "_0": "uint256 value representing the amount owned by the passed address." + } + }, + "changeController(address)": { + "params": { + "_controller": "The new controller of the contract" + } + }, + "decreaseAllowance(address,uint256)": { + "params": { + "_spender": "The entity whose spending allocation will be reduced.", + "_subtractedValue": "The reduction of spending allocation in base units." + }, + "returns": { + "_0": "True on success." + } + }, + "deposit(uint256)": { + "params": { + "_amount": "The amount of wrapped pinakions to mint." + } + }, + "increaseAllowance(address,uint256)": { + "params": { + "_addedValue": "The amount of extra base units the entity will be allowed to spend.", + "_spender": "The entity allowed to spend funds." + }, + "returns": { + "_0": "True on success." + } + }, + "initialize(string,string,address,address)": { + "details": "Constructor.", + "params": { + "_name": "for the wrapped PNK on the home chain.", + "_symbol": "for wrapped PNK ticker on the home chain.", + "_tokenBridge": "the TokenBridge contract.", + "_xPinakion": "the home PNK contract which is already bridged to the foreign PNK contract." + } + }, + "onTokenBridged(address,uint256,bytes)": { + "details": "Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid. If the tokenBridge is calling this function, then this contract has already received the xPinakion tokens. Notice that the Home bridge calls onTokenBridge as a result of someone invoking `relayTokensAndCall()` on the Foreign bridge contract.", + "params": { + "_amount": "The amount of wrapped PNK to mint.", + "_data": "Calldata containing the address of the recipient. Notice that the address has to be padded to the right 32 bytes.", + "_token": "The token address the _amount belongs to." + } + }, + "transfer(address,uint256)": { + "params": { + "_amount": "The amount to tranfer in base units.", + "_recipient": "The entity receiving the funds." + }, + "returns": { + "_0": "True on success." + } + }, + "transferFrom(address,address,uint256)": { + "params": { + "_amount": "The amount to tranfer in base units.", + "_recipient": "The entity receiving the funds.", + "_sender": "The entity to take the funds from." + }, + "returns": { + "_0": "True on success." + } + }, + "withdraw(uint256)": { + "params": { + "_amount": "The amount of bridged PNK to withdraw." + } + }, + "withdrawAndConvertToPNK(uint256,address)": { + "details": "This function is not strictly needed, but it provides a good UX to users who want to get their Mainnet's PNK back. What normally takes 3 transactions, here is done in one go. Notice that the PNK have to be claimed on Mainnet's TokenBridge by the receiver.", + "params": { + "_amount": "The amount of PNK to withdraw.", + "_receiver": "The address which will receive the PNK back in the foreign chain." + } + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "Approval(address,address,uint256)": { + "notice": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "notice": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`)." + } + }, + "kind": "user", + "methods": { + "approve(address,uint256)": { + "notice": "Approves `_spender` to spend `_amount`." + }, + "changeController(address)": { + "notice": "Changes `controller` to `_controller`." + }, + "controller()": { + "notice": "The token's controller." + }, + "decimals()": { + "notice": "Number of decimals of the token." + }, + "decreaseAllowance(address,uint256)": { + "notice": "Decreases the `_spender` allowance by `_subtractedValue`." + }, + "deposit(uint256)": { + "notice": "Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid." + }, + "increaseAllowance(address,uint256)": { + "notice": "Increases the `_spender` allowance by `_addedValue`." + }, + "name()": { + "notice": "Name of the token." + }, + "onTokenBridged(address,uint256,bytes)": { + "notice": "IERC20 Receiver functionality." + }, + "symbol()": { + "notice": "Symbol of the token." + }, + "tokenBridge()": { + "notice": "xDai Token Bridge. The Token Bridge is upgradeable." + }, + "totalSupply()": { + "notice": "Total supply of the token. Equals the total xPinakion deposit into the contract." + }, + "transfer(address,uint256)": { + "notice": "Moves `_amount` tokens from the caller's account to `_recipient`." + }, + "transferFrom(address,address,uint256)": { + "notice": "Moves `_amount` tokens from `_sender` to `_recipient` using the allowance mechanism. `_amount` is then deducted from the caller's allowance." + }, + "withdraw(uint256)": { + "notice": "Converts wrapped PNK back into bridged PNK (xPinakion)." + }, + "withdrawAndConvertToPNK(uint256,address)": { + "notice": "Converts wrapped PNK back into PNK using the Token Bridge." + }, + "xPinakion()": { + "notice": "Bridged PNK on xDai to be wrapped. This token is upgradeable." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 245, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 248, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 17270, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "balances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 17276, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "allowance", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 17279, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "totalSupply", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 17282, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "name", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 17285, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "symbol", + "offset": 0, + "slot": "5", + "type": "t_string_storage" + }, + { + "astId": 17288, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "decimals", + "offset": 0, + "slot": "6", + "type": "t_uint8" + }, + { + "astId": 17291, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "controller", + "offset": 1, + "slot": "6", + "type": "t_address" + }, + { + "astId": 17295, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "xPinakion", + "offset": 0, + "slot": "7", + "type": "t_contract(IERC677)17963" + }, + { + "astId": 17299, + "contract": "src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol:WrappedPinakion", + "label": "tokenBridge", + "offset": 0, + "slot": "8", + "type": "t_contract(ITokenBridge)18000" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC677)17963": { + "encoding": "inplace", + "label": "contract IERC677", + "numberOfBytes": "20" + }, + "t_contract(ITokenBridge)18000": { + "encoding": "inplace", + "label": "contract ITokenBridge", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/contracts/deployments/chiado/xKlerosLiquidV2.json b/contracts/deployments/chiado/xKlerosLiquidV2.json new file mode 100644 index 000000000..690778bec --- /dev/null +++ b/contracts/deployments/chiado/xKlerosLiquidV2.json @@ -0,0 +1,2402 @@ +{ + "address": "0xf637A0a4415CCFB97407846486b6be663d3C33ef", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_appeal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum xKlerosLiquidV2.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum xKlerosLiquidV2.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_subcourtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "_stake", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_newTotalStake", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_tokenAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_ETHAmount", + "type": "int256" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "inputs": [], + "name": "ALPHA_DIVISOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STAKE_PATHS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_JURORS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NON_PAYABLE_AMOUNT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RN", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RNBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RNGenerator", + "outputs": [ + { + "internalType": "contract IRandomAuRa", + "name": "", + "type": "address" + } + ], + "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 IForeignGateway", + "name": "_foreignGateway", + "type": "address" + } + ], + "name": "changeForeignGateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract WrappedPinakion", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomAuRa", + "name": "_RNGenerator", + "type": "address" + } + ], + "name": "changeRNGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + } + ], + "name": "changeSubcourtAlpha", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + } + ], + "name": "changeSubcourtJurorFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + } + ], + "name": "changeSubcourtJurorsForJump", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + } + ], + "name": "changeSubcourtMinStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeSubcourtTimesPerPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_weth", + "type": "address" + } + ], + "name": "changeWethAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "uint256", + "name": "_sortitionSumTreeK", + "type": "uint256" + } + ], + "name": "createSubcourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedSetStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "subcourtID", + "type": "uint96" + }, + { + "internalType": "uint128", + "name": "stake", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "subcourtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrable", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "enum xKlerosLiquidV2.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "drawsInRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "commitsInRound", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputesRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedSetStakes", + "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": [], + "name": "foreignGateway", + "outputs": [ + { + "internalType": "contract IForeignGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getDispute", + "outputs": [ + { + "internalType": "uint256[]", + "name": "votesLengths", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "tokensAtStakePerJuror", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "totalFeesForJurors", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "votesInEachRound", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "repartitionsInEachRound", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "penaltiesInEachRound", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "getJuror", + "outputs": [ + { + "internalType": "uint96[]", + "name": "subcourtIDs", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + } + ], + "name": "getSubcourt", + "outputs": [ + { + "internalType": "uint256[]", + "name": "children", + "type": "uint256[]" + }, + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_appeal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVote", + "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": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_appeal", + "type": "uint256" + } + ], + "name": "getVoteCounter", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "counts", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "tied", + "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 WrappedPinakion", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "contract IRandomAuRa", + "name": "_RNGenerator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "uint256", + "name": "_sortitionSumTreeK", + "type": "uint256" + }, + { + "internalType": "contract IForeignGateway", + "name": "_foreignGateway", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_weth", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedTokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastDelayedSetStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockInsolventTransfers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextDelayedSetStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "onApprove", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "onTransfer", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum xKlerosLiquidV2.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract WrappedPinakion", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "proxyPayment", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint128", + "name": "_stake", + "type": "uint128" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDisputes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x3b022c078e8885c5876144e53402a5e84428badef799a77592f90fd5b467409b", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0xf637A0a4415CCFB97407846486b6be663d3C33ef", + "transactionIndex": 1, + "gasUsed": "3014724", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5e3e74a7702cfc3ffeeb017a0517a71b4199528024e31c22f85cf9a489367122", + "transactionHash": "0x3b022c078e8885c5876144e53402a5e84428badef799a77592f90fd5b467409b", + "logs": [], + "blockNumber": 2252223, + "cumulativeGasUsed": "7011839", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "c9b600ff9291ca791c04d618ea467929", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_appeal\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum xKlerosLiquidV2.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum xKlerosLiquidV2.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_subcourtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"_stake\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_newTotalStake\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_tokenAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_ETHAmount\",\"type\":\"int256\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ALPHA_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NON_PAYABLE_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RN\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RNBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RNGenerator\",\"outputs\":[{\"internalType\":\"contract IRandomAuRa\",\"name\":\"\",\"type\":\"address\"}],\"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 IForeignGateway\",\"name\":\"_foreignGateway\",\"type\":\"address\"}],\"name\":\"changeForeignGateway\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract WrappedPinakion\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRandomAuRa\",\"name\":\"_RNGenerator\",\"type\":\"address\"}],\"name\":\"changeRNGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtAlpha\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtJurorsForJump\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtMinStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeSubcourtTimesPerPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"name\":\"changeWethAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256\",\"name\":\"_sortitionSumTreeK\",\"type\":\"uint256\"}],\"name\":\"createSubcourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedSetStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint128\",\"name\":\"stake\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrable\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"enum xKlerosLiquidV2.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"drawsInRound\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitsInRound\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputesRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedSetStakes\",\"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\":[],\"name\":\"foreignGateway\",\"outputs\":[{\"internalType\":\"contract IForeignGateway\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getDispute\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"votesLengths\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"tokensAtStakePerJuror\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"votesInEachRound\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"repartitionsInEachRound\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"penaltiesInEachRound\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"getJuror\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"subcourtIDs\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"}],\"name\":\"getSubcourt\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"children\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_appeal\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVote\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_appeal\",\"type\":\"uint256\"}],\"name\":\"getVoteCounter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"counts\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"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 WrappedPinakion\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"contract IRandomAuRa\",\"name\":\"_RNGenerator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256\",\"name\":\"_sortitionSumTreeK\",\"type\":\"uint256\"},{\"internalType\":\"contract IForeignGateway\",\"name\":\"_foreignGateway\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedTokens\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedTokens\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastDelayedSetStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockInsolventTransfers\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextDelayedSetStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"onApprove\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"onTransfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum xKlerosLiquidV2.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract WrappedPinakion\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"proxyPayment\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint128\",\"name\":\"_stake\",\"type\":\"uint128\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalDisputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract is an adaption of Mainnet's KlerosLiquid (https://github.com/kleros/kleros/blob/69cfbfb2128c29f1625b3a99a3183540772fda08/contracts/kleros/KlerosLiquid.sol) for xDai chain. Notice that variables referring to ETH values in this contract, will hold the native token values of the chain on which xKlerosLiquid is deployed. When this contract gets deployed on xDai chain, ETH variables will hold xDai values.\",\"events\":{\"Draw(address,uint256,uint256,uint256)\":{\"details\":\"Emitted when a juror is drawn.\",\"params\":{\"_address\":\"The drawn address.\",\"_appeal\":\"The appeal the draw is for. 0 is for the first round.\",\"_disputeID\":\"The ID of the dispute.\",\"_voteID\":\"The vote ID.\"}},\"NewPeriod(uint256,uint8)\":{\"details\":\"Emitted when a dispute passes to a new period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_period\":\"The new period.\"}},\"NewPhase(uint8)\":{\"details\":\"Emitted when we pass to a new phase.\",\"params\":{\"_phase\":\"The new phase.\"}},\"StakeSet(address,uint256,uint128,uint256)\":{\"details\":\"Emitted when a juror's stake is set.\",\"params\":{\"_address\":\"The address of the juror.\",\"_newTotalStake\":\"The new total stake.\",\"_stake\":\"The new stake.\",\"_subcourtID\":\"The ID of the subcourt at the end of the stake path.\"}},\"TokenAndETHShift(address,uint256,int256,int256)\":{\"details\":\"Emitted when a juror wins or loses tokens and ETH from a dispute.\",\"params\":{\"_ETHAmount\":\"The amount of ETH won or lost.\",\"_address\":\"The juror affected.\",\"_disputeID\":\"The ID of the dispute.\",\"_tokenAmount\":\"The amount of tokens won or lost.\"}}},\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"Gets the cost of arbitration in a specified subcourt.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).\"},\"returns\":{\"cost\":\"The cost.\"}},\"changeForeignGateway(address)\":{\"details\":\"Changes the `foreignGateway` storage variable.\",\"params\":{\"_foreignGateway\":\"The new value for the `foreignGateway` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"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.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeRNGenerator(address)\":{\"details\":\"Changes the `RNGenerator` storage variable.\",\"params\":{\"_RNGenerator\":\"The new value for the `RNGenerator` storage variable.\"}},\"changeSubcourtAlpha(uint96,uint256)\":{\"details\":\"Changes the `alpha` property value of a specified subcourt.\",\"params\":{\"_alpha\":\"The new value for the `alpha` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified subcourt.\",\"params\":{\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtJurorsForJump(uint96,uint256)\":{\"details\":\"Changes the `jurorsForCourtJump` property value of a specified subcourt.\",\"params\":{\"_jurorsForCourtJump\":\"The new value for the `jurorsForCourtJump` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtMinStake(uint96,uint256)\":{\"details\":\"Changes the `minStake` property value of a specified subcourt. Don't set to a value lower than its parent's `minStake` property value.\",\"params\":{\"_minStake\":\"The new value for the `minStake` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"changeSubcourtTimesPerPeriod(uint96,uint256[4])\":{\"details\":\"Changes the `timesPerPeriod` property value of a specified subcourt.\",\"params\":{\"_subcourtID\":\"The ID of the subcourt.\",\"_timesPerPeriod\":\"The new value for the `timesPerPeriod` property value.\"}},\"changeWethAddress(address)\":{\"details\":\"Changes the `weth` storage variable.\",\"params\":{\"_weth\":\"The new value for the `weth` storage variable.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Creates a dispute. Must be called by the arbitrable contract.\",\"params\":{\"_extraData\":\"Additional info about the dispute to be created. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).\",\"_numberOfChoices\":\"Number of choices to choose from in the dispute to be created.\"},\"returns\":{\"disputeID\":\"The ID of the created dispute.\"}},\"createSubcourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256)\":{\"details\":\"Creates a subcourt under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the subcourt.\",\"_feeForJuror\":\"The `feeForJuror` property value of the subcourt.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the subcourt.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the subcourt.\",\"_minStake\":\"The `minStake` property value of the subcourt.\",\"_parent\":\"The `parent` property value of the subcourt.\",\"_sortitionSumTreeK\":\"The number of children per node of the subcourt's sortition sum tree.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the subcourt.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"ruling\":\"The current ruling.\"}},\"executeDelayedSetStakes(uint256)\":{\"details\":\"Executes the next delayed set stakes. `O(n)` where `n` is the number of iterations to run.\",\"params\":{\"_iterations\":\"The number of delayed set stakes to execute.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Lets the governor 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.\"}},\"getDispute(uint256)\":{\"details\":\"Gets a specified dispute's non primitive properties.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"penaltiesInEachRound\":\"The dispute's amount of tokens collected from penalties in each round. `O(a)` where `a` is the number of appeals of the dispute.\",\"repartitionsInEachRound\":\"The dispute's counter of vote reward repartitions made in each round.\",\"tokensAtStakePerJuror\":\"The dispute's required tokens at stake per Juror.\",\"totalFeesForJurors\":\"The dispute's total fees for Jurors.\",\"votesInEachRound\":\"The dispute's counter of votes made in each round.\",\"votesLengths\":\"The dispute's vote length.\"}},\"getJuror(address)\":{\"details\":\"Gets a specified juror's non primitive properties.\",\"params\":{\"_account\":\"The address of the juror.\"},\"returns\":{\"subcourtIDs\":\"The juror's IDs of subcourts where the juror has stake path.\"}},\"getSubcourt(uint96)\":{\"details\":\"Gets a specified subcourt's non primitive properties.\",\"params\":{\"_subcourtID\":\"The ID of the subcourt.\"},\"returns\":{\"children\":\"The subcourt's child court list.\",\"timesPerPeriod\":\"The subcourt's time per period.\"}},\"getVote(uint256,uint256,uint256)\":{\"details\":\"Gets a specified vote for a specified appeal in a specified dispute.\",\"params\":{\"_appeal\":\"The appeal.\",\"_disputeID\":\"The ID of the dispute.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"account\":\"The account for vote.\",\"choice\":\" The choice for vote.\",\"commit\":\" The commit for vote.\",\"voted\":\"True if the account voted, False otherwise.\"}},\"getVoteCounter(uint256,uint256)\":{\"details\":\"Gets the vote counter for a specified appeal in a specified dispute. Note: This function is only to be used by the interface and it won't work if the number of choices is too high.\",\"params\":{\"_appeal\":\"The appeal.\",\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"counts\":\"The count.\",\"tied\":\"Whether the vote tied. `O(n)` where `n` is the number of choices of the dispute.\",\"winningChoice\":\"The winning choice.\"}},\"initialize(address,address,address,uint256,uint256,bool,uint256[4],uint256[4],uint256,address,address)\":{\"details\":\"Constructs the KlerosLiquid contract.\",\"params\":{\"_RNGenerator\":\"The address of the random number generator contract.\",\"_courtParameters\":\"MinStake, alpha, feeForJuror and jurorsForCourtJump respectively.\",\"_foreignGateway\":\"Foreign gateway on xDai.\",\"_governor\":\"The governor's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_maxDrawingTime\":\"The maximum time that the drawing phase should last.\",\"_minStakingTime\":\"The minimum time that the staking phase should last.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionSumTreeK\":\"The number of children per node of the general court's sortition sum tree.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\",\"_weth\":\"Weth contract.\"}},\"onApprove(address,address,uint256)\":{\"details\":\"Notifies the controller about an approval allowing the controller to react if desired.\",\"params\":{\"_amount\":\"The amount in the `approve()` call.\",\"_owner\":\"The address that calls `approve()`.\",\"_spender\":\"The spender in the `approve()` call.\"},\"returns\":{\"allowed\":\"Whether the operation should be allowed or not.\"}},\"onTransfer(address,address,uint256)\":{\"details\":\"Notifies the controller about a token transfer allowing the controller to react if desired.\",\"params\":{\"_amount\":\"The amount of the transfer.\",\"_from\":\"The origin of the transfer.\",\"_to\":\"The destination of the transfer.\"},\"returns\":{\"allowed\":\"Whether the operation should be allowed or not.\"}},\"proxyPayment(address)\":{\"details\":\"DEPRECATED. Called when `_owner` sends ETH to the Wrapped Token contract.\",\"params\":{\"_owner\":\"The address that sent the ETH to create tokens.\"},\"returns\":{\"allowed\":\"Whether the operation should be allowed or not.\"}},\"rule(uint256,uint256)\":{\"details\":\"Receive the ruling from foreign gateway which technically is an arbitrator of this contract.\",\"params\":{\"_disputeID\":\"ID of the dispute.\",\"_ruling\":\"Ruling given by V2 court and relayed by foreign gateway.\"}},\"setStake(uint96,uint128)\":{\"details\":\"Sets the caller's stake in a subcourt.\",\"params\":{\"_stake\":\"The new stake.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Gets the stake of a specified juror in a specified subcourt.\",\"params\":{\"_account\":\"The address of the juror.\",\"_subcourtID\":\"The ID of the subcourt.\"},\"returns\":{\"stake\":\"The stake.\"}}},\"title\":\"xKlerosLiquidV2\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol\":\"xKlerosLiquidV2\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/vea-contracts/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @hrishibhat]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /**\\n * @dev The Fast Bridge participants watch for these events to decide if a challenge should be submitted.\\n * @param _epoch The epoch for which the the claim was made.\\n * @param _batchMerkleRoot The timestamp of the claim creation.\\n */\\n event ClaimReceived(uint256 indexed _epoch, bytes32 indexed _batchMerkleRoot);\\n\\n /**\\n * @dev This event indicates that `sendSafeFallback()` should be called on the sending side.\\n * @param _epoch The epoch associated with the challenged claim.\\n */\\n event ClaimChallenged(uint256 indexed _epoch);\\n\\n /**\\n * @dev This events indicates that optimistic verification has succeeded. The messages are ready to be relayed.\\n * @param _epoch The epoch associated with the batch.\\n * @param _success The success of the optimistic verification.\\n */\\n event BatchVerified(uint256 indexed _epoch, bool _success);\\n\\n /**\\n * @dev This event indicates that the batch has been received via the Safe Bridge.\\n * @param _epoch The epoch associated with the batch.\\n * @param _isBridgerHonest Whether the bridger made an honest claim.\\n * @param _isChallengerHonest Whether the bridger made an honest challenge.\\n */\\n event BatchSafeVerified(uint256 indexed _epoch, bool _isBridgerHonest, bool _isChallengerHonest);\\n\\n /**\\n * @dev This event indicates that the claim deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _bridger The recipient of the claim deposit.\\n */\\n event ClaimDepositWithdrawn(uint256 indexed _epoch, address indexed _bridger);\\n\\n /**\\n * @dev This event indicates that the challenge deposit has been withdrawn.\\n * @param _epoch The epoch associated with the batch.\\n * @param _challenger The recipient of the challenge deposit.\\n */\\n event ChallengeDepositWithdrawn(uint256 indexed _epoch, address indexed _challenger);\\n\\n /**\\n * @dev This event indicates that a message has been relayed for the batch in this `_epoch`.\\n * @param _epoch The epoch associated with the batch.\\n * @param _nonce The nonce of the message that was relayed.\\n */\\n event MessageRelayed(uint256 indexed _epoch, uint256 indexed _nonce);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Submit a claim about the `_batchMerkleRoot` for the latests completed Fast bridge epoch and submit a deposit. The `_batchMerkleRoot` should match the one on the sending side otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to claim.\\n * @param _batchMerkleRoot The hash claimed for the ticket.\\n */\\n function claim(uint256 _epoch, bytes32 _batchMerkleRoot) external payable;\\n\\n /**\\n * @dev Submit a challenge for the claim of the current epoch's Fast Bridge batch merkleroot state and submit a deposit. The `batchMerkleRoot` in the claim already made for the last finalized epoch should be different from the one on the sending side, otherwise the sender will lose his deposit.\\n * @param _epoch The epoch of the claim to challenge.\\n */\\n function challenge(uint256 _epoch) external payable;\\n\\n /**\\n * @dev Resolves the optimistic claim for '_epoch'.\\n * @param _epoch The epoch of the optimistic claim.\\n */\\n function verifyBatch(uint256 _epoch) external;\\n\\n /**\\n * @dev Verifies merkle proof for the given message and associated nonce for the most recent possible epoch and relays the message.\\n * @param _epoch The epoch in which the message was batched by the bridge.\\n * @param _proof The merkle proof to prove the membership of the message and nonce in the merkle tree for the epoch.\\n * @param _message The data on the cross-domain chain for the message.\\n */\\n function verifyAndRelayMessage(\\n uint256 _epoch,\\n bytes32[] calldata _proof,\\n bytes calldata _message\\n ) external;\\n\\n /**\\n * @dev Sends the deposit back to the Bridger if their claim is not successfully challenged. Includes a portion of the Challenger's deposit if unsuccessfully challenged.\\n * @param _epoch The epoch associated with the claim deposit to withraw.\\n */\\n function withdrawClaimDeposit(uint256 _epoch) external;\\n\\n /**\\n * @dev Sends the deposit back to the Challenger if his challenge is successful. Includes a portion of the Bridger's deposit.\\n * @param _epoch The epoch associated with the challenge deposit to withraw.\\n */\\n function withdrawChallengeDeposit(uint256 _epoch) external;\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Returns the `start` and `end` time of challenge period for this `epoch`.\\n * @param _epoch The epoch of the claim to request the challenge period.\\n * @return start The start time of the challenge period.\\n * @return end The end time of the challenge period.\\n */\\n function claimChallengePeriod(uint256 _epoch) external view returns (uint256 start, uint256 end);\\n\\n /**\\n * @dev Returns the epoch period.\\n */\\n function epochPeriod() external view returns (uint256 epochPeriod);\\n\\n /**\\n * @dev Returns the challenge period.\\n */\\n function challengePeriod() external view returns (uint256 challengePeriod);\\n}\\n\",\"keccak256\":\"0xff909a62e9a08540dafcd08c779a64917ed1e44be52d5a225ff9149ff95909e8\",\"license\":\"MIT\"},\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IFastBridgeReceiver.sol\\\";\\n\\ninterface IReceiverGateway {\\n function fastBridgeReceiver() external view returns (IFastBridgeReceiver);\\n\\n function senderChainID() external view returns (uint256);\\n\\n function senderGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0xfa82fbd575c462ad6dffa18c67eb097a4c5088715ae956a836726aafa4be0f90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\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 * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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 {ERC1967Proxy-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 * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 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 bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\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(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\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 require(_initializing, \\\"Initializable: contract is not initializing\\\");\\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 require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _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 _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x3798da9e212cd00a7cda94ddb5a9721171a718e89c500d8901f810e0e37fa74e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.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 *\\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://diligence.consensys.net/posts/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.5.11/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(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) 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\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a + b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a * b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator.\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0f633a0223d9a1dcccfcf38a64c9de0874dfcbfac0c6941ccf074d63a2ce0e1e\",\"license\":\"MIT\"},\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrable The arbitrable receiving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrable indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0x2264bc7cb975d89776b9bf3e35cecd4dec7d601604601ca4822d8bfc0886c379\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@jaybuidl, @shotaronowhere, @shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\nimport \\\"@kleros/vea-contracts/interfaces/IReceiverGateway.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator, IReceiverGateway {\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function createDisputeERC20(\\n uint256 _choices,\\n bytes calldata _extraData,\\n uint256 _amount\\n ) external returns (uint256 disputeID);\\n}\\n\",\"keccak256\":\"0x4cfc88d2d7cf211ce9a1f3c991f093baefa026784185da2319d566051d0c8c43\",\"license\":\"MIT\"},\"src/kleros-v1/interfaces/ITokenController.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @dev The token controller contract must implement these functions. See https://github.com/Giveth/minime/blob/master/contracts/TokenController.sol\\n */\\ninterface ITokenController {\\n /**\\n * @notice Called when `_owner` sends ether to the MiniMe Token contract\\n * @param _owner The address that sent the ether to create tokens\\n * @return True if the ether is accepted, false if it throws\\n */\\n function proxyPayment(address _owner) external payable returns (bool);\\n\\n /**\\n * @notice Notifies the controller about a token transfer allowing the controller to react if desired\\n * @param _from The origin of the transfer\\n * @param _to The destination of the transfer\\n * @param _amount The amount of the transfer\\n * @return False if the controller does not authorize the transfer\\n */\\n function onTransfer(address _from, address _to, uint256 _amount) external returns (bool);\\n\\n /**\\n * @notice Notifies the controller about an approval allowing the controller to react if desired\\n * @param _owner The address that calls `approve()`\\n * @param _spender The spender in the `approve()` call\\n * @param _amount The amount in the `approve()` call\\n * @return False if the controller does not authorize the approval\\n */\\n function onApprove(address _owner, address _spender, uint256 _amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x872b17903608262164b43c7304e9fe1d6ae631070ffd2c911e7508d7f7cf7c91\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/WrappedPinakion.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\nimport \\\"../interfaces/ITokenController.sol\\\";\\nimport \\\"./interfaces/ITokenBridge.sol\\\";\\nimport \\\"./interfaces/IERC677.sol\\\";\\n\\ncontract WrappedPinakion is Initializable {\\n using SafeMath for uint256;\\n\\n /* Events */\\n\\n /**\\n * @notice Emitted when `value` tokens are moved from one account (`from`) to another (`to`).\\n * @dev Notice that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @notice 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 /* Storage */\\n\\n mapping(address => uint256) private balances;\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /// @notice Total supply of the token. Equals the total xPinakion deposit into the contract.\\n uint256 public totalSupply;\\n\\n /// @notice Name of the token.\\n string public name;\\n\\n /// @notice Symbol of the token.\\n string public symbol;\\n\\n /// @notice Number of decimals of the token.\\n uint8 public decimals;\\n\\n /// @notice The token's controller.\\n address public controller;\\n\\n /// @notice Bridged PNK on xDai to be wrapped. This token is upgradeable.\\n IERC677 public xPinakion;\\n\\n /// @notice xDai Token Bridge. The Token Bridge is upgradeable.\\n ITokenBridge public tokenBridge;\\n\\n /* Modifiers */\\n\\n /// @dev Verifies that the sender has ability to modify controlled parameters.\\n modifier onlyController() {\\n require(controller == msg.sender, \\\"The caller is not the controller.\\\");\\n _;\\n }\\n\\n /* Initializer */\\n\\n /**\\n * @dev Constructor.\\n * @param _name for the wrapped PNK on the home chain.\\n * @param _symbol for wrapped PNK ticker on the home chain.\\n * @param _xPinakion the home PNK contract which is already bridged to the foreign PNK contract.\\n * @param _tokenBridge the TokenBridge contract.\\n */\\n function initialize(\\n string memory _name,\\n string memory _symbol,\\n IERC677 _xPinakion,\\n ITokenBridge _tokenBridge\\n ) public initializer {\\n name = _name;\\n symbol = _symbol;\\n decimals = 18;\\n xPinakion = _xPinakion;\\n tokenBridge = _tokenBridge;\\n controller = msg.sender;\\n }\\n\\n /* External */\\n\\n /**\\n * @notice Changes `controller` to `_controller`.\\n * @param _controller The new controller of the contract\\n */\\n function changeController(address _controller) external onlyController {\\n controller = _controller;\\n }\\n\\n /**\\n * @notice Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid.\\n * @param _amount The amount of wrapped pinakions to mint.\\n */\\n function deposit(uint256 _amount) external {\\n _mint(msg.sender, _amount);\\n require(\\n xPinakion.transferFrom(msg.sender, address(this), _amount),\\n \\\"Sender does not have enough approved funds.\\\"\\n );\\n }\\n\\n /**\\n * @notice IERC20 Receiver functionality.\\n * @dev Converts bridged PNK (xPinakion) into wrapped PNK which can be staked in KlerosLiquid.\\n * If the tokenBridge is calling this function, then this contract has already received\\n * the xPinakion tokens. Notice that the Home bridge calls onTokenBridge as a result of\\n * someone invoking `relayTokensAndCall()` on the Foreign bridge contract.\\n * @param _token The token address the _amount belongs to.\\n * @param _amount The amount of wrapped PNK to mint.\\n * @param _data Calldata containing the address of the recipient.\\n * Notice that the address has to be padded to the right 32 bytes.\\n */\\n function onTokenBridged(address _token, uint256 _amount, bytes calldata _data) external {\\n require(msg.sender == address(tokenBridge), \\\"Sender not authorized.\\\");\\n require(_token == address(xPinakion), \\\"Token bridged is not xPinakion.\\\");\\n\\n address recipient;\\n assembly {\\n recipient := calldataload(0x84)\\n }\\n _mint(recipient, _amount);\\n }\\n\\n /**\\n * @notice Converts wrapped PNK back into bridged PNK (xPinakion).\\n * @param _amount The amount of bridged PNK to withdraw.\\n */\\n function withdraw(uint256 _amount) external {\\n _burn(_amount);\\n require(xPinakion.transfer(msg.sender, _amount), \\\"The `transfer` function must not fail.\\\");\\n }\\n\\n /**\\n * @notice Converts wrapped PNK back into PNK using the Token Bridge.\\n * @dev This function is not strictly needed, but it provides a good UX to users who want to get their Mainnet's PNK back.\\n * What normally takes 3 transactions, here is done in one go.\\n * Notice that the PNK have to be claimed on Mainnet's TokenBridge by the receiver.\\n * @param _amount The amount of PNK to withdraw.\\n * @param _receiver The address which will receive the PNK back in the foreign chain.\\n */\\n function withdrawAndConvertToPNK(uint256 _amount, address _receiver) external {\\n _burn(_amount);\\n // Using approve is safe here, because this contract approves the bridge to spend the tokens and triggers the relay immediately.\\n xPinakion.approve(address(tokenBridge), _amount);\\n tokenBridge.relayTokens(xPinakion, _receiver, _amount);\\n }\\n\\n /**\\n * @notice Moves `_amount` tokens from the caller's account to `_recipient`.\\n * @param _recipient The entity receiving the funds.\\n * @param _amount The amount to tranfer in base units.\\n * @return True on success.\\n */\\n function transfer(address _recipient, uint256 _amount) public returns (bool) {\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onTransfer(msg.sender, _recipient, _amount),\\n \\\"Token controller rejects transfer.\\\"\\n );\\n }\\n balances[msg.sender] = balances[msg.sender].sub(_amount); // ERC20: transfer amount exceeds balance\\n balances[_recipient] = balances[_recipient].add(_amount);\\n emit Transfer(msg.sender, _recipient, _amount);\\n return true;\\n }\\n\\n /**\\n * @notice Moves `_amount` tokens from `_sender` to `_recipient` using the\\n * allowance mechanism. `_amount` is then deducted from the caller's allowance.\\n * @param _sender The entity to take the funds from.\\n * @param _recipient The entity receiving the funds.\\n * @param _amount The amount to tranfer in base units.\\n * @return True on success.\\n */\\n function transferFrom(address _sender, address _recipient, uint256 _amount) public returns (bool) {\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onTransfer(_sender, _recipient, _amount),\\n \\\"Token controller rejects transfer.\\\"\\n );\\n }\\n\\n /** The controller of this contract can move tokens around at will,\\n * this is important to recognize! Confirm that you trust the\\n * controller of this contract, which in most situations should be\\n * another open source smart contract or 0x0.\\n */\\n if (msg.sender != controller) {\\n allowance[_sender][msg.sender] = allowance[_sender][msg.sender].sub(_amount); // ERC20: transfer amount exceeds allowance.\\n }\\n\\n balances[_sender] = balances[_sender].sub(_amount); // ERC20: transfer amount exceeds balance\\n balances[_recipient] = balances[_recipient].add(_amount);\\n emit Transfer(_sender, _recipient, _amount);\\n return true;\\n }\\n\\n /**\\n * @notice Approves `_spender` to spend `_amount`.\\n * @param _spender The entity allowed to spend funds.\\n * @param _amount The amount of base units the entity will be allowed to spend.\\n * @return True on success.\\n */\\n function approve(address _spender, uint256 _amount) public returns (bool) {\\n // Alerts the token controller of the approve function call\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onApprove(msg.sender, _spender, _amount),\\n \\\"Token controller does not approve.\\\"\\n );\\n }\\n\\n allowance[msg.sender][_spender] = _amount;\\n emit Approval(msg.sender, _spender, _amount);\\n return true;\\n }\\n\\n /**\\n * @notice Increases the `_spender` allowance by `_addedValue`.\\n * @param _spender The entity allowed to spend funds.\\n * @param _addedValue The amount of extra base units the entity will be allowed to spend.\\n * @return True on success.\\n */\\n function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) {\\n uint256 newAllowance = allowance[msg.sender][_spender].add(_addedValue);\\n // Alerts the token controller of the approve function call\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onApprove(msg.sender, _spender, newAllowance),\\n \\\"Token controller does not approve.\\\"\\n );\\n }\\n\\n allowance[msg.sender][_spender] = newAllowance;\\n emit Approval(msg.sender, _spender, newAllowance);\\n return true;\\n }\\n\\n /**\\n * @notice Decreases the `_spender` allowance by `_subtractedValue`.\\n * @param _spender The entity whose spending allocation will be reduced.\\n * @param _subtractedValue The reduction of spending allocation in base units.\\n * @return True on success.\\n */\\n function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) {\\n uint256 newAllowance = allowance[msg.sender][_spender].sub(_subtractedValue); // ERC20: decreased allowance below zero\\n // Alerts the token controller of the approve function call\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onApprove(msg.sender, _spender, newAllowance),\\n \\\"Token controller does not approve.\\\"\\n );\\n }\\n\\n allowance[msg.sender][_spender] = newAllowance;\\n emit Approval(msg.sender, _spender, newAllowance);\\n return true;\\n }\\n\\n /* Internal */\\n\\n /**\\n * @dev Internal function that mints an amount of the token and assigns it to\\n * an account. This encapsulates the modification of balances such that the\\n * proper events are emitted.\\n * @param _recipient The address which will receive the minted tokens.\\n * @param _amount The amount that will be created.\\n */\\n function _mint(address _recipient, uint256 _amount) internal {\\n totalSupply = totalSupply.add(_amount);\\n balances[_recipient] = balances[_recipient].add(_amount);\\n emit Transfer(address(0x0), _recipient, _amount);\\n }\\n\\n /**\\n * @dev Destroys `_amount` tokens from the caller. Cannot burn locked tokens.\\n * @param _amount The quantity of tokens to burn in base units.\\n */\\n function _burn(uint256 _amount) internal {\\n if (isContract(controller)) {\\n require(\\n ITokenController(controller).onTransfer(msg.sender, address(0x0), _amount),\\n \\\"Token controller rejects transfer.\\\"\\n );\\n }\\n balances[msg.sender] = balances[msg.sender].sub(_amount); // ERC20: burn amount exceeds balance\\n totalSupply = totalSupply.sub(_amount);\\n emit Transfer(msg.sender, address(0x0), _amount);\\n }\\n\\n /**\\n * @dev Internal function to determine if an address is a contract.\\n * @param _addr The address being queried.\\n * @return True if `_addr` is a contract.\\n */\\n function isContract(address _addr) internal view returns (bool) {\\n uint256 size;\\n if (_addr == address(0)) return false;\\n assembly {\\n size := extcodesize(_addr)\\n }\\n return size > 0;\\n }\\n\\n /* Getters */\\n\\n /**\\n * @dev Gets the balance of the specified address.\\n * @param _owner The address to query the balance of.\\n * @return uint256 value representing the amount owned by the passed address.\\n */\\n function balanceOf(address _owner) public view returns (uint256) {\\n return balances[_owner];\\n }\\n}\\n\",\"keccak256\":\"0x1cdaf0dd439866cb5029d3299bd3bb7412c4d55aeafebdd168a60914da741606\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/interfaces/IERC677.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\ninterface IERC677 {\\n function transfer(address _to, uint256 _value) external returns (bool);\\n\\n function transferFrom(address _from, address _to, uint256 _value) external returns (bool);\\n\\n function approve(address _spender, uint256 _value) external returns (bool);\\n}\\n\",\"keccak256\":\"0x901e298088578c3333807574c52d2d288a1a1036531bd85168f9505cb85168e7\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/interfaces/IRandomAuRa.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\ninterface IRandomAuRa {\\n function currentSeed() external view returns (uint256);\\n\\n function isCommitPhase() external view returns (bool);\\n\\n function nextCommitPhaseStartBlock() external view returns (uint256);\\n\\n function collectRoundLength() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x0fcb472d7f826d65845caa8683bb25159ae0ce4bbc03fe1569af7a65dca7398d\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/interfaces/ITokenBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IERC677.sol\\\";\\n\\ninterface ITokenBridge {\\n function relayTokens(IERC677 token, address _receiver, uint256 _value) external;\\n}\\n\",\"keccak256\":\"0x8054fe008a2a2473ab24168068e9207b54bc0ac9a6de31899f5da62ef1a85805\",\"license\":\"MIT\"},\"src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {IArbitrator, IArbitrable} from \\\"../../arbitration/IArbitrator.sol\\\";\\nimport {ITokenController} from \\\"../interfaces/ITokenController.sol\\\";\\nimport {WrappedPinakion} from \\\"./WrappedPinakion.sol\\\";\\nimport {IRandomAuRa} from \\\"./interfaces/IRandomAuRa.sol\\\";\\n\\nimport {SortitionSumTreeFactory} from \\\"../../libraries/SortitionSumTreeFactory.sol\\\";\\nimport \\\"../../gateway/interfaces/IForeignGateway.sol\\\";\\n\\n/**\\n * @title xKlerosLiquidV2\\n * @dev This contract is an adaption of Mainnet's KlerosLiquid (https://github.com/kleros/kleros/blob/69cfbfb2128c29f1625b3a99a3183540772fda08/contracts/kleros/KlerosLiquid.sol)\\n * for xDai chain. Notice that variables referring to ETH values in this contract, will hold the native token values of the chain on which xKlerosLiquid is deployed.\\n * When this contract gets deployed on xDai chain, ETH variables will hold xDai values.\\n */\\ncontract xKlerosLiquidV2 is Initializable, ITokenController, IArbitrator {\\n /* Enums */\\n\\n // General\\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 // Dispute\\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 /* Structs */\\n\\n // General\\n struct Court {\\n uint96 parent; // The parent court.\\n uint256[] children; // List of child courts.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256 minStake; // Minimum tokens needed to stake in the court.\\n uint256 alpha; // Basis point of tokens that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n // The appeal after the one that reaches this number of jurors will go to the parent court if any, otherwise, no more appeals are possible.\\n uint256 jurorsForCourtJump;\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n }\\n struct DelayedSetStake {\\n address account; // The address of the juror.\\n uint96 subcourtID; // The ID of the subcourt.\\n uint128 stake; // The new stake.\\n }\\n\\n // Dispute\\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 or revealed, false otherwise.\\n }\\n struct VoteCounter {\\n // 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 uint256 winningChoice;\\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 }\\n struct Dispute {\\n // Note that appeal `0` is equivalent to the first round of the dispute.\\n uint96 subcourtID; // The ID of the subcourt the dispute is in.\\n IArbitrable arbitrated; // The arbitrated arbitrable contract.\\n // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\"/\\\"no ruling\\\".\\n uint256 numberOfChoices;\\n Period period; // The current period of the dispute.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n // The votes in the form `votes[appeal][voteID]`. On each round, a new list is pushed and packed with as many empty votes as there are draws. We use `dispute.votes.length` to get the number of appeals plus 1 for the first round.\\n Vote[][] votes;\\n VoteCounter[] voteCounters; // The vote counters in the form `voteCounters[appeal]`.\\n uint256[] tokensAtStakePerJuror; // The amount of tokens at stake for each juror in the form `tokensAtStakePerJuror[appeal]`.\\n uint256[] totalFeesForJurors; // The total juror fees paid in the form `totalFeesForJurors[appeal]`.\\n uint256 drawsInRound; // A counter of draws made in the current round.\\n uint256 commitsInRound; // A counter of commits made in the current round.\\n uint256[] votesInEachRound; // A counter of votes made in each round in the form `votesInEachRound[appeal]`.\\n // A counter of vote reward repartitions made in each round in the form `repartitionsInEachRound[appeal]`.\\n uint256[] repartitionsInEachRound;\\n uint256[] penaltiesInEachRound; // The amount of tokens collected from penalties in each round in the form `penaltiesInEachRound[appeal]`.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n }\\n\\n // Juror\\n struct Juror {\\n // The IDs of subcourts where the juror has stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint96[] subcourtIDs;\\n uint256 stakedTokens; // The juror's total amount of tokens staked in subcourts.\\n uint256 lockedTokens; // The juror's total amount of tokens locked in disputes.\\n }\\n\\n /* Events */\\n\\n /** @dev Emitted when we pass to a new phase.\\n * @param _phase The new phase.\\n */\\n event NewPhase(Phase _phase);\\n\\n /** @dev Emitted when a dispute passes to a new period.\\n * @param _disputeID The ID of the dispute.\\n * @param _period The new period.\\n */\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n\\n /** @dev Emitted when a juror's stake is set.\\n * @param _address The address of the juror.\\n * @param _subcourtID The ID of the subcourt at the end of the stake path.\\n * @param _stake The new stake.\\n * @param _newTotalStake The new total stake.\\n */\\n event StakeSet(address indexed _address, uint256 _subcourtID, uint128 _stake, uint256 _newTotalStake);\\n\\n /** @dev Emitted when a juror is drawn.\\n * @param _address The drawn address.\\n * @param _disputeID The ID of the dispute.\\n * @param _appeal The appeal the draw is for. 0 is for the first round.\\n * @param _voteID The vote ID.\\n */\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _appeal, uint256 _voteID);\\n\\n /** @dev Emitted when a juror wins or loses tokens and ETH from a dispute.\\n * @param _address The juror affected.\\n * @param _disputeID The ID of the dispute.\\n * @param _tokenAmount The amount of tokens won or lost.\\n * @param _ETHAmount The amount of ETH won or lost.\\n */\\n event TokenAndETHShift(address indexed _address, uint256 indexed _disputeID, int _tokenAmount, int _ETHAmount);\\n\\n /* Storage */\\n\\n // General Constants\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant MIN_JURORS = 3; // The global default minimum number of jurors in a dispute.\\n uint256 public constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n uint256 public constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n // General Contracts\\n address public governor; // The governor of the contract.\\n WrappedPinakion public pinakion; // The Pinakion token contract.\\n IRandomAuRa public RNGenerator; // The random number generator contract.\\n // General Dynamic\\n Phase public phase; // The current phase.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n // The block number to get the next random number from. Used so there is at least a 1 block difference from the staking phase.\\n uint256 public RNBlock;\\n uint256 public RN; // The current random number.\\n uint256 public minStakingTime; // The minimum staking time.\\n uint256 public maxDrawingTime; // The maximum drawing time.\\n // True if insolvent (`balance < stakedTokens || balance < lockedTokens`) token transfers should be blocked. Used to avoid blocking penalties.\\n bool public lockInsolventTransfers;\\n // General Storage\\n Court[] public courts; // The subcourts.\\n using SortitionSumTreeFactory for SortitionSumTreeFactory.SortitionSumTrees; // Use library functions for sortition sum trees.\\n SortitionSumTreeFactory.SortitionSumTrees internal sortitionSumTrees; // The sortition sum trees.\\n // The delayed calls to `_setStake`. Used to schedule `_setStake`s when not in the staking phase.\\n mapping(uint256 => DelayedSetStake) public delayedSetStakes;\\n // The index of the next `delayedSetStakes` item to execute. Starts at 1 because `lastDelayedSetStake` starts at 0.\\n uint256 public nextDelayedSetStake;\\n uint256 public lastDelayedSetStake; // The index of the last `delayedSetStakes` item. 0 is skipped because it is the initial value.\\n\\n // Dispute\\n // Use a mapping instead of an array so that upgrading (appending variables to) the Dispute struct is possible without big layout changes.\\n mapping(uint256 => Dispute) public disputes; // The disputes.\\n uint256 public totalDisputes;\\n\\n // Juror\\n mapping(address => Juror) public jurors; // The jurors.\\n\\n IForeignGateway public foreignGateway; // Foreign gateway contract.\\n IERC20 public weth; // WETH token address.\\n\\n mapping(uint256 => uint256) public disputesRuling;\\n\\n /* Modifiers */\\n\\n /** @dev Requires a specific phase.\\n * @param _phase The required phase.\\n */\\n modifier onlyDuringPhase(Phase _phase) {\\n require(phase == _phase);\\n _;\\n }\\n\\n /** @dev Requires a specific period in a dispute.\\n * @param _disputeID The ID of the dispute.\\n * @param _period The required period.\\n */\\n modifier onlyDuringPeriod(uint256 _disputeID, Period _period) {\\n require(disputes[_disputeID].period == _period);\\n _;\\n }\\n\\n /** @dev Requires that the sender is the governor. Note that the governor is expected to not be malicious. */\\n modifier onlyByGovernor() {\\n require(governor == msg.sender);\\n _;\\n }\\n\\n /* Constructor */\\n\\n /** @dev Constructs the KlerosLiquid contract.\\n * @param _governor The governor's address.\\n * @param _pinakion The address of the token contract.\\n * @param _RNGenerator The address of the random number generator contract.\\n * @param _minStakingTime The minimum time that the staking phase should last.\\n * @param _maxDrawingTime The maximum time that the drawing phase should last.\\n * @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n * @param _courtParameters MinStake, alpha, feeForJuror and jurorsForCourtJump respectively.\\n * @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n * @param _sortitionSumTreeK The number of children per node of the general court's sortition sum tree.\\n * @param _foreignGateway Foreign gateway on xDai.\\n * @param _weth Weth contract.\\n */\\n function initialize(\\n address _governor,\\n WrappedPinakion _pinakion,\\n IRandomAuRa _RNGenerator,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n uint256 _sortitionSumTreeK,\\n IForeignGateway _foreignGateway,\\n IERC20 _weth\\n ) public initializer {\\n // Initialize contract.\\n governor = _governor;\\n pinakion = _pinakion;\\n RNGenerator = _RNGenerator;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n phase = Phase.staking;\\n lastPhaseChange = block.timestamp;\\n lockInsolventTransfers = true;\\n if (nextDelayedSetStake == 0) nextDelayedSetStake = 1;\\n foreignGateway = _foreignGateway;\\n weth = _weth;\\n\\n // Create the general court.\\n if (courts.length == 0) {\\n courts.push(\\n Court({\\n parent: 0,\\n children: new uint256[](0),\\n hiddenVotes: _hiddenVotes,\\n minStake: _courtParameters[0],\\n alpha: _courtParameters[1],\\n feeForJuror: _courtParameters[2],\\n jurorsForCourtJump: _courtParameters[3],\\n timesPerPeriod: _timesPerPeriod\\n })\\n );\\n sortitionSumTrees.createTree(bytes32(0), _sortitionSumTreeK);\\n }\\n }\\n\\n /* External */\\n\\n /** @dev Lets the governor call anything on behalf of the contract.\\n * @param _destination The destination of the call.\\n * @param _amount The value sent with the call.\\n * @param _data The data sent with the call.\\n */\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /** @dev Changes the `governor` storage variable.\\n * @param _governor The new value for the `governor` storage variable.\\n */\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /** @dev Changes the `pinakion` storage variable.\\n * @param _pinakion The new value for the `pinakion` storage variable.\\n */\\n function changePinakion(WrappedPinakion _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /** @dev Changes the `RNGenerator` storage variable.\\n * @param _RNGenerator The new value for the `RNGenerator` storage variable.\\n */\\n function changeRNGenerator(IRandomAuRa _RNGenerator) external onlyByGovernor {\\n RNGenerator = _RNGenerator;\\n if (phase == Phase.generating) {\\n RNBlock = RNGenerator.nextCommitPhaseStartBlock() + RNGenerator.collectRoundLength();\\n }\\n }\\n\\n /** @dev Changes the `minStakingTime` storage variable.\\n * @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n */\\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 */\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /** @dev Changes the `foreignGateway` storage variable.\\n * @param _foreignGateway The new value for the `foreignGateway` storage variable.\\n */\\n function changeForeignGateway(IForeignGateway _foreignGateway) external onlyByGovernor {\\n foreignGateway = _foreignGateway;\\n }\\n\\n /** @dev Changes the `weth` storage variable.\\n * @param _weth The new value for the `weth` storage variable.\\n */\\n function changeWethAddress(IERC20 _weth) external onlyByGovernor {\\n weth = _weth;\\n }\\n\\n /** @dev Creates a subcourt under a specified parent court.\\n * @param _parent The `parent` property value of the subcourt.\\n * @param _hiddenVotes The `hiddenVotes` property value of the subcourt.\\n * @param _minStake The `minStake` property value of the subcourt.\\n * @param _alpha The `alpha` property value of the subcourt.\\n * @param _feeForJuror The `feeForJuror` property value of the subcourt.\\n * @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the subcourt.\\n * @param _timesPerPeriod The `timesPerPeriod` property value of the subcourt.\\n * @param _sortitionSumTreeK The number of children per node of the subcourt's sortition sum tree.\\n */\\n function createSubcourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n uint256 _sortitionSumTreeK\\n ) external onlyByGovernor {\\n require(\\n courts[_parent].minStake <= _minStake,\\n \\\"A subcourt cannot be a child of a subcourt with a higher minimum stake.\\\"\\n );\\n\\n // Create the subcourt.\\n uint256 subcourtID = courts.length;\\n Court storage subcourt = courts.push();\\n subcourt.parent = _parent;\\n subcourt.children = new uint256[](0);\\n subcourt.hiddenVotes = _hiddenVotes;\\n subcourt.minStake = _minStake;\\n subcourt.alpha = _alpha;\\n subcourt.feeForJuror = _feeForJuror;\\n subcourt.jurorsForCourtJump = _jurorsForCourtJump;\\n subcourt.timesPerPeriod = _timesPerPeriod;\\n sortitionSumTrees.createTree(bytes32(subcourtID), _sortitionSumTreeK);\\n\\n // Update the parent.\\n courts[_parent].children.push(subcourtID);\\n }\\n\\n /** @dev Changes the `minStake` property value of a specified subcourt. Don't set to a value lower than its parent's `minStake` property value.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _minStake The new value for the `minStake` property value.\\n */\\n function changeSubcourtMinStake(uint96 _subcourtID, uint256 _minStake) external onlyByGovernor {\\n require(_subcourtID == 0 || courts[courts[_subcourtID].parent].minStake <= _minStake);\\n for (uint256 i = 0; i < courts[_subcourtID].children.length; i++) {\\n require(\\n courts[courts[_subcourtID].children[i]].minStake >= _minStake,\\n \\\"A subcourt cannot be the parent of a subcourt with a lower minimum stake.\\\"\\n );\\n }\\n\\n courts[_subcourtID].minStake = _minStake;\\n }\\n\\n /** @dev Changes the `alpha` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _alpha The new value for the `alpha` property value.\\n */\\n function changeSubcourtAlpha(uint96 _subcourtID, uint256 _alpha) external onlyByGovernor {\\n courts[_subcourtID].alpha = _alpha;\\n }\\n\\n /** @dev Changes the `feeForJuror` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _feeForJuror The new value for the `feeForJuror` property value.\\n */\\n function changeSubcourtJurorFee(uint96 _subcourtID, uint256 _feeForJuror) external onlyByGovernor {\\n courts[_subcourtID].feeForJuror = _feeForJuror;\\n }\\n\\n /** @dev Changes the `jurorsForCourtJump` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _jurorsForCourtJump The new value for the `jurorsForCourtJump` property value.\\n */\\n function changeSubcourtJurorsForJump(uint96 _subcourtID, uint256 _jurorsForCourtJump) external onlyByGovernor {\\n courts[_subcourtID].jurorsForCourtJump = _jurorsForCourtJump;\\n }\\n\\n /** @dev Changes the `timesPerPeriod` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _timesPerPeriod The new value for the `timesPerPeriod` property value.\\n */\\n function changeSubcourtTimesPerPeriod(\\n uint96 _subcourtID,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n courts[_subcourtID].timesPerPeriod = _timesPerPeriod;\\n }\\n\\n /** @dev Sets the caller's stake in a subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _stake The new stake.\\n */\\n function setStake(uint96 _subcourtID, uint128 _stake) external {\\n require(_setStake(msg.sender, _subcourtID, _stake));\\n }\\n\\n /** @dev Executes the next delayed set stakes.\\n * `O(n)` where `n` is the number of iterations to run.\\n * @param _iterations The number of delayed set stakes to execute.\\n */\\n function executeDelayedSetStakes(uint256 _iterations) external onlyDuringPhase(Phase.staking) {\\n uint256 actualIterations = (nextDelayedSetStake + _iterations) - 1 > lastDelayedSetStake\\n ? (lastDelayedSetStake - nextDelayedSetStake) + 1\\n : _iterations;\\n uint256 newNextDelayedSetStake = nextDelayedSetStake + actualIterations;\\n require(newNextDelayedSetStake >= nextDelayedSetStake);\\n for (uint256 i = nextDelayedSetStake; i < newNextDelayedSetStake; i++) {\\n DelayedSetStake storage delayedSetStake = delayedSetStakes[i];\\n _setStake(delayedSetStake.account, delayedSetStake.subcourtID, delayedSetStake.stake);\\n delete delayedSetStakes[i];\\n }\\n nextDelayedSetStake = newNextDelayedSetStake;\\n }\\n\\n /** @dev Receive the ruling from foreign gateway which technically is an arbitrator of this contract.\\n * @param _disputeID ID of the dispute.\\n * @param _ruling Ruling given by V2 court and relayed by foreign gateway.\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(_disputeID < totalDisputes, \\\"Dispute ID does not exist.\\\");\\n require(msg.sender == address(foreignGateway), \\\"Can only be called by gateway\\\");\\n\\n Dispute storage dispute = disputes[_disputeID];\\n require(!dispute.ruled, \\\"Ruling already executed.\\\");\\n dispute.ruled = true;\\n disputesRuling[_disputeID] = _ruling;\\n\\n // Send the relayed ruling to the arbitrable while fully bypassing the dispute flow.\\n dispute.arbitrated.rule(_disputeID, _ruling);\\n\\n emit Ruling(dispute.arbitrated, _disputeID, _ruling);\\n }\\n\\n /* Public */\\n\\n /** @dev Creates a dispute. Must be called by the arbitrable contract.\\n * @param _numberOfChoices Number of choices to choose from in the dispute to be created.\\n * @param _extraData Additional info about the dispute to be created. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).\\n * @return disputeID The ID of the created dispute.\\n */\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) public payable override returns (uint256 disputeID) {\\n require(msg.value == 0, \\\"Fees should be paid in WETH\\\");\\n uint256 fee = arbitrationCost(_extraData);\\n require(weth.transferFrom(msg.sender, address(this), fee), \\\"Not enough WETH for arbitration\\\");\\n\\n disputeID = totalDisputes++;\\n Dispute storage dispute = disputes[disputeID];\\n dispute.arbitrated = IArbitrable(msg.sender);\\n\\n require(weth.transfer(address(foreignGateway), fee), \\\"Fee transfer to gateway failed\\\");\\n foreignGateway.createDisputeERC20(_numberOfChoices, _extraData, fee);\\n\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n /** @dev DEPRECATED. Called when `_owner` sends ETH to the Wrapped Token contract.\\n * @param _owner The address that sent the ETH to create tokens.\\n * @return allowed Whether the operation should be allowed or not.\\n */\\n function proxyPayment(address _owner) public payable override returns (bool allowed) {\\n allowed = false;\\n }\\n\\n /** @dev Notifies the controller about a token transfer allowing the controller to react if desired.\\n * @param _from The origin of the transfer.\\n * @param _to The destination of the transfer.\\n * @param _amount The amount of the transfer.\\n * @return allowed Whether the operation should be allowed or not.\\n */\\n function onTransfer(address _from, address _to, uint256 _amount) public override returns (bool allowed) {\\n if (lockInsolventTransfers) {\\n // Never block penalties or rewards.\\n uint256 newBalance = pinakion.balanceOf(_from) - _amount;\\n if (newBalance < jurors[_from].stakedTokens || newBalance < jurors[_from].lockedTokens) return false;\\n }\\n allowed = true;\\n }\\n\\n /** @dev Notifies the controller about an approval allowing the controller to react if desired.\\n * @param _owner The address that calls `approve()`.\\n * @param _spender The spender in the `approve()` call.\\n * @param _amount The amount in the `approve()` call.\\n * @return allowed Whether the operation should be allowed or not.\\n */\\n function onApprove(address _owner, address _spender, uint256 _amount) public override returns (bool allowed) {\\n allowed = true;\\n }\\n\\n /* Public Views */\\n\\n /** @dev Gets the cost of arbitration in a specified subcourt.\\n * @param _extraData Additional info about the dispute. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).\\n * @return cost The cost.\\n */\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n cost = foreignGateway.arbitrationCost(_extraData);\\n }\\n\\n /** @dev Gets the current ruling of a specified dispute.\\n * @param _disputeID The ID of the dispute.\\n * @return ruling The current ruling.\\n */\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.voteCounters.length == 0) {\\n ruling = disputesRuling[_disputeID];\\n } else {\\n ruling = dispute.voteCounters[dispute.voteCounters.length - 1].tied\\n ? 0\\n : dispute.voteCounters[dispute.voteCounters.length - 1].winningChoice;\\n }\\n }\\n\\n /* Internal */\\n\\n /** @dev Sets the specified juror's stake in a subcourt.\\n * `O(n + p * log_k(j))` where\\n * `n` is the number of subcourts the juror has staked in,\\n * `p` is the depth of the subcourt tree,\\n * `k` is the minimum number of children per node of one of these subcourts' sortition sum tree,\\n * and `j` is the maximum number of jurors that ever staked in one of these subcourts simultaneously.\\n * @param _account The address of the juror.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _stake The new stake.\\n * @return succeeded True if the call succeeded, false otherwise.\\n */\\n function _setStake(address _account, uint96 _subcourtID, uint128 _stake) internal returns (bool succeeded) {\\n if (!(_subcourtID < courts.length)) return false;\\n\\n if (!(_stake == 0 || courts[_subcourtID].minStake <= _stake)) return false; // The juror's stake cannot be lower than the minimum stake for the subcourt.\\n Juror storage juror = jurors[_account];\\n bytes32 stakePathID = accountAndSubcourtIDToStakePathID(_account, _subcourtID);\\n uint256 currentStake = sortitionSumTrees.stakeOf(bytes32(uint256(_subcourtID)), stakePathID);\\n if (!(_stake == 0 || currentStake > 0 || juror.subcourtIDs.length < MAX_STAKE_PATHS)) return false; // Maximum stake paths reached.\\n uint256 newTotalStake = juror.stakedTokens - currentStake + _stake; // Can't overflow because _stake is a uint128.\\n if (!(_stake == 0 || pinakion.balanceOf(_account) >= newTotalStake)) return false; // The juror's total amount of staked tokens cannot be higher than the juror's balance.\\n\\n // Update juror's records.\\n juror.stakedTokens = newTotalStake;\\n if (_stake == 0) {\\n for (uint256 i = 0; i < juror.subcourtIDs.length; i++)\\n if (juror.subcourtIDs[i] == _subcourtID) {\\n juror.subcourtIDs[i] = juror.subcourtIDs[juror.subcourtIDs.length - 1];\\n juror.subcourtIDs.pop();\\n break;\\n }\\n } else if (currentStake == 0) juror.subcourtIDs.push(_subcourtID);\\n\\n // Update subcourt parents.\\n bool finished = false;\\n uint256 currentSubcourtID = _subcourtID;\\n while (!finished) {\\n sortitionSumTrees.set(bytes32(currentSubcourtID), _stake, stakePathID);\\n if (currentSubcourtID == 0) finished = true;\\n else currentSubcourtID = courts[currentSubcourtID].parent;\\n }\\n emit StakeSet(_account, _subcourtID, _stake, newTotalStake);\\n return true;\\n }\\n\\n /** @dev Gets a subcourt ID and the minimum number of jurors required from a specified extra data bytes array.\\n * @param _extraData The extra data bytes array. The first 32 bytes are the subcourt ID and the next 32 bytes are the minimum number of jurors.\\n * @return subcourtID The subcourt ID.\\n * @return minJurors The minimum number of jurors required.\\n */\\n function extraDataToSubcourtIDAndMinJurors(\\n bytes memory _extraData\\n ) internal view returns (uint96 subcourtID, uint256 minJurors) {\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n subcourtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n }\\n if (subcourtID >= courts.length) subcourtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n } else {\\n subcourtID = 0;\\n minJurors = MIN_JURORS;\\n }\\n }\\n\\n /** @dev Packs an account and a subcourt ID into a stake path ID.\\n * @param _account The account to pack.\\n * @param _subcourtID The subcourt ID to pack.\\n * @return stakePathID The stake path ID.\\n */\\n function accountAndSubcourtIDToStakePathID(\\n address _account,\\n uint96 _subcourtID\\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, _subcourtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n\\n /* Interface Views */\\n\\n /** @dev Gets a specified subcourt's non primitive properties.\\n * @param _subcourtID The ID of the subcourt.\\n * @return children The subcourt's child court list.\\n * @return timesPerPeriod The subcourt's time per period.\\n */\\n function getSubcourt(\\n uint96 _subcourtID\\n ) external view returns (uint256[] memory children, uint256[4] memory timesPerPeriod) {\\n Court storage subcourt = courts[_subcourtID];\\n children = subcourt.children;\\n timesPerPeriod = subcourt.timesPerPeriod;\\n }\\n\\n /** @dev Gets a specified vote for a specified appeal in a specified dispute.\\n * @param _disputeID The ID of the dispute.\\n * @param _appeal The appeal.\\n * @param _voteID The ID of the vote.\\n * @return account The account for vote.\\n * @return commit The commit for vote.\\n * @return choice The choice for vote.\\n * @return voted True if the account voted, False otherwise.\\n */\\n function getVote(\\n uint256 _disputeID,\\n uint256 _appeal,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Vote storage vote = disputes[_disputeID].votes[_appeal][_voteID];\\n account = vote.account;\\n commit = vote.commit;\\n choice = vote.choice;\\n voted = vote.voted;\\n }\\n\\n /** @dev Gets the vote counter for a specified appeal in a specified dispute.\\n * Note: This function is only to be used by the interface and it won't work if the number of choices is too high.\\n * @param _disputeID The ID of the dispute.\\n * @param _appeal The appeal.\\n * @return winningChoice The winning choice.\\n * @return counts The count.\\n * @return tied Whether the vote tied.\\n * `O(n)` where\\n * `n` is the number of choices of the dispute.\\n */\\n function getVoteCounter(\\n uint256 _disputeID,\\n uint256 _appeal\\n ) external view returns (uint256 winningChoice, uint256[] memory counts, bool tied) {\\n Dispute storage dispute = disputes[_disputeID];\\n VoteCounter storage voteCounter = dispute.voteCounters[_appeal];\\n winningChoice = voteCounter.winningChoice;\\n counts = new uint256[](dispute.numberOfChoices + 1);\\n for (uint256 i = 0; i <= dispute.numberOfChoices; i++) counts[i] = voteCounter.counts[i];\\n tied = voteCounter.tied;\\n }\\n\\n /** @dev Gets a specified dispute's non primitive properties.\\n * @param _disputeID The ID of the dispute.\\n * @return votesLengths The dispute's vote length.\\n * @return tokensAtStakePerJuror The dispute's required tokens at stake per Juror.\\n * @return totalFeesForJurors The dispute's total fees for Jurors.\\n * @return votesInEachRound The dispute's counter of votes made in each round.\\n * @return repartitionsInEachRound The dispute's counter of vote reward repartitions made in each round.\\n * @return penaltiesInEachRound The dispute's amount of tokens collected from penalties in each round.\\n * `O(a)` where\\n * `a` is the number of appeals of the dispute.\\n */\\n function getDispute(\\n uint256 _disputeID\\n )\\n external\\n view\\n returns (\\n uint256[] memory votesLengths,\\n uint256[] memory tokensAtStakePerJuror,\\n uint256[] memory totalFeesForJurors,\\n uint256[] memory votesInEachRound,\\n uint256[] memory repartitionsInEachRound,\\n uint256[] memory penaltiesInEachRound\\n )\\n {\\n Dispute storage dispute = disputes[_disputeID];\\n votesLengths = new uint256[](dispute.votes.length);\\n for (uint256 i = 0; i < dispute.votes.length; i++) votesLengths[i] = dispute.votes[i].length;\\n tokensAtStakePerJuror = dispute.tokensAtStakePerJuror;\\n totalFeesForJurors = dispute.totalFeesForJurors;\\n votesInEachRound = dispute.votesInEachRound;\\n repartitionsInEachRound = dispute.repartitionsInEachRound;\\n penaltiesInEachRound = dispute.penaltiesInEachRound;\\n }\\n\\n /** @dev Gets a specified juror's non primitive properties.\\n * @param _account The address of the juror.\\n * @return subcourtIDs The juror's IDs of subcourts where the juror has stake path.\\n */\\n function getJuror(address _account) external view returns (uint96[] memory subcourtIDs) {\\n Juror storage juror = jurors[_account];\\n subcourtIDs = juror.subcourtIDs;\\n }\\n\\n /** @dev Gets the stake of a specified juror in a specified subcourt.\\n * @param _account The address of the juror.\\n * @param _subcourtID The ID of the subcourt.\\n * @return stake The stake.\\n */\\n function stakeOf(address _account, uint96 _subcourtID) external view returns (uint256 stake) {\\n return\\n sortitionSumTrees.stakeOf(\\n bytes32(uint256(_subcourtID)),\\n accountAndSubcourtIDToStakePathID(_account, _subcourtID)\\n );\\n }\\n}\\n\",\"keccak256\":\"0x13ec819678c1453153ba4dd0213e509b8c4728512069bd57d5247b9cfc251984\",\"license\":\"MIT\"},\"src/libraries/SortitionSumTreeFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@epiqueras, @unknownunknown1]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8;\\n\\n/**\\n * @title SortitionSumTreeFactory\\n * @author Enrique Piqueras - \\n * @dev A factory of trees that keep track of staked values for sortition.\\n */\\nlibrary SortitionSumTreeFactory {\\n /* Structs */\\n\\n struct SortitionSumTree {\\n uint K; // The maximum number of childs per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint[] stack;\\n uint[] 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 => uint) IDsToNodeIndexes;\\n mapping(uint => bytes32) nodeIndexesToIDs;\\n }\\n\\n /* Storage */\\n\\n struct SortitionSumTrees {\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees;\\n }\\n\\n /* Public */\\n\\n /**\\n * @dev Create a sortition sum tree at the specified key.\\n * @param _key The key of the new tree.\\n * @param _K The number of children each node in the tree should have.\\n */\\n function createTree(SortitionSumTrees storage self, bytes32 _key, uint _K) public {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(_K > 1, \\\"K must be greater than one.\\\");\\n tree.K = _K;\\n tree.nodes.push(0);\\n }\\n\\n /**\\n * @dev Set a value of a tree.\\n * @param _key The key of the tree.\\n * @param _value The new value.\\n * @param _ID The ID of the value.\\n * `O(log_k(n))` where\\n * `k` is the maximum number of childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function set(SortitionSumTrees storage self, bytes32 _key, uint _value, bytes32 _ID) public {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint 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 uint parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n updateParents(self, _key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n updateParents(self, _key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint plusOrMinusValue = plusOrMinus ? _value - tree.nodes[treeIndex] : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n updateParents(self, _key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /* Public Views */\\n\\n /**\\n * @dev Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned.\\n * @param _key The key of the tree to get the leaves from.\\n * @param _cursor The pagination cursor.\\n * @param _count The number of items to return.\\n * @return startIndex The index at which leaves start.\\n * @return values The values of the returned leaves.\\n * @return hasMore Whether there are more for pagination.\\n * `O(n)` where\\n * `n` is the maximum number of nodes ever appended.\\n */\\n function queryLeafs(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint _cursor,\\n uint _count\\n ) public view returns (uint startIndex, uint[] memory values, bool hasMore) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n // Find the start index.\\n for (uint i = 0; i < tree.nodes.length; i++) {\\n if ((tree.K * i) + 1 >= tree.nodes.length) {\\n startIndex = i;\\n break;\\n }\\n }\\n\\n // Get the values.\\n uint loopStartIndex = startIndex + _cursor;\\n values = new uint[](loopStartIndex + _count > tree.nodes.length ? tree.nodes.length - loopStartIndex : _count);\\n uint valuesIndex = 0;\\n for (uint j = loopStartIndex; j < tree.nodes.length; j++) {\\n if (valuesIndex < _count) {\\n values[valuesIndex] = tree.nodes[j];\\n valuesIndex++;\\n } else {\\n hasMore = true;\\n break;\\n }\\n }\\n }\\n\\n /**\\n * @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.\\n * @param _key The key of the tree.\\n * @param _drawnNumber The drawn number.\\n * @return ID The drawn ID.\\n * `O(k * log_k(n))` where\\n * `k` is the maximum number of childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function draw(SortitionSumTrees storage self, bytes32 _key, uint _drawnNumber) public view returns (bytes32 ID) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint treeIndex = 0;\\n uint currentDrawnNumber = _drawnNumber % tree.nodes[0];\\n\\n while (\\n (tree.K * treeIndex) + 1 < tree.nodes.length // While it still has children.\\n )\\n for (uint i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint nodeIndex = (tree.K * treeIndex) + i;\\n uint nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue)\\n currentDrawnNumber -= nodeValue; // Go to the next child.\\n else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n\\n ID = tree.nodeIndexesToIDs[treeIndex];\\n }\\n\\n /** @dev Gets a specified ID's associated value.\\n * @param _key The key of the tree.\\n * @param _ID The ID of the value.\\n * @return value The associated value.\\n */\\n function stakeOf(SortitionSumTrees storage self, bytes32 _key, bytes32 _ID) public view returns (uint value) {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) value = 0;\\n else value = tree.nodes[treeIndex];\\n }\\n\\n /* Private */\\n\\n /**\\n * @dev Update all the parents of a node.\\n * @param _key The key of the tree to update.\\n * @param _treeIndex The index of the node to start from.\\n * @param _plusOrMinus Wether to add (true) or substract (false).\\n * @param _value The value to add or substract.\\n * `O(log_k(n))` where\\n * `k` is the maximum number of childs per node in the tree,\\n * and `n` is the maximum number of nodes ever appended.\\n */\\n function updateParents(\\n SortitionSumTrees storage self,\\n bytes32 _key,\\n uint _treeIndex,\\n bool _plusOrMinus,\\n uint _value\\n ) private {\\n SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n uint parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x053af9495cb8382dfc1e1503d8f3dab3d356d664efdbdf534f146ab8f3834e95\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613599806100206000396000f3fe6080604052600436106102df5760003560e01c80638ce7ff4a11610186578063c5e4ccc4116100d7578063e3b0073e11610085578063e3b0073e14610a4c578063e4c0aaf414610a7b578063eaff425a14610a9b578063f48c305414610ab0578063f66d685a14610ac4578063f7434ea914610ade578063fbf405b014610afe57600080fd5b8063c5e4ccc414610927578063ce9e77301461093d578063d4155d1f1461095d578063da682aeb1461098a578063dca5f6b0146109ae578063dd5e5cb5146109fa578063e3a96cbd14610a1a57600080fd5b8063b1c9fe6e11610134578063b1c9fe6e14610800578063b4a616081461082e578063b78a80ff14610843578063b888adfa146108d2578063c057eca7146108e8578063c108f3b4146108fe578063c13517e11461091457600080fd5b80638ce7ff4a146106f45780638d7c7daa1461074057806396d92a72146107605780639929057b146107805780639e72c153146107a0578063a2473cc1146107c0578063a57366e7146107e057600080fd5b806340026c87116102405780635e4a627d116101ee5780635e4a627d146106235780636a4f8f3914610639578063751accd0146106595780637a5de2a914610679578063823cfd7014610699578063840bc19c146106b957806385c855f3146106d457600080fd5b806340026c87146104be57806348b4e924146104ec5780634a3931491461050c578063564a565d1461053c57806357260364146105c357806359354c77146105e35780635bc24dd31461060357600080fd5b80631b92bbbe1161029d5780631b92bbbe146103bb5780631c3db16d146103d15780631f5a0dd2146103f15780632ea7b4d014610448578063311a6c561461045e5780633e1d09be1461047e5780633fc8cef31461049e57600080fd5b8062f5822c146102e4578063023d44df14610306578063034327441461032f57806303438616146103455780630c340a24146103725780630d44cf79146103a5575b600080fd5b3480156102f057600080fd5b506103046102ff366004612ccf565b610b1e565b005b34801561031257600080fd5b5061031c60055481565b6040519081526020015b60405180910390f35b34801561033b57600080fd5b5061031c60045481565b34801561035157600080fd5b5061031c610360366004612cec565b60146020526000908152604090205481565b34801561037e57600080fd5b50600054610398906201000090046001600160a01b031681565b6040516103269190612d05565b3480156103b157600080fd5b5061031c600e5481565b3480156103c757600080fd5b5061031c60085481565b3480156103dd57600080fd5b5061031c6103ec366004612cec565b610b5d565b3480156103fd57600080fd5b5061041161040c366004612cec565b610c0c565b604080516001600160601b0390971687529415156020870152938501929092526060840152608083015260a082015260c001610326565b34801561045457600080fd5b5061031c61271081565b34801561046a57600080fd5b50610304610479366004612d19565b610c60565b34801561048a57600080fd5b50610304610499366004612d57565b610e49565b3480156104aa57600080fd5b50601354610398906001600160a01b031681565b3480156104ca57600080fd5b506104de6104d9366004612d81565b611057565b604051610326929190612dd7565b3480156104f857600080fd5b50610304610507366004612eae565b61111d565b34801561051857600080fd5b5061052c610527366004612f76565b611497565b6040519015158152602001610326565b34801561054857600080fd5b506105af610557366004612cec565b600f602052600090815260409020805460018201546002830154600384015460088501546009860154600d909601546001600160601b03861696600160601b9096046001600160a01b03169560ff9485169490911688565b604051610326989796959493929190612fcd565b3480156105cf57600080fd5b506103046105de366004613030565b611596565b3480156105ef57600080fd5b506103046105fe366004612d57565b6115f4565b34801561060f57600080fd5b5061030461061e366004612d57565b611647565b34801561062f57600080fd5b5061031c60065481565b34801561064557600080fd5b50600254610398906001600160a01b031681565b34801561066557600080fd5b506103046106743660046130f0565b61169a565b34801561068557600080fd5b50610304610694366004612ccf565b61175f565b3480156106a557600080fd5b506103046106b4366004612cec565b61179e565b3480156106c557600080fd5b5061031c6001600160ff1b0381565b3480156106e057600080fd5b506103046106ef366004613148565b6117c0565b34801561070057600080fd5b5061071461070f36600461318b565b6117d8565b604080516001600160a01b03909516855260208501939093529183015215156060820152608001610326565b34801561074c57600080fd5b50601254610398906001600160a01b031681565b34801561076c57600080fd5b5061030461077b366004612ccf565b611863565b34801561078c57600080fd5b5061030461079b366004612cec565b6119de565b3480156107ac57600080fd5b506103046107bb366004612ccf565b611b00565b3480156107cc57600080fd5b5061031c6107db3660046131b7565b611b3f565b3480156107ec57600080fd5b506103046107fb366004612d57565b611bed565b34801561080c57600080fd5b5060025461082190600160a01b900460ff1681565b60405161032691906131e3565b34801561083a57600080fd5b5061031c600481565b34801561084f57600080fd5b5061089c61085e366004612cec565b600c60205260009081526040902080546001909101546001600160a01b03821691600160a01b90046001600160601b0316906001600160801b031683565b604080516001600160a01b0390941684526001600160601b0390921660208401526001600160801b031690820152606001610326565b3480156108de57600080fd5b5061031c60035481565b3480156108f457600080fd5b5061031c60075481565b34801561090a57600080fd5b5061031c600d5481565b61031c6109223660046131fd565b611c40565b34801561093357600080fd5b5061031c60105481565b34801561094957600080fd5b50610304610958366004613243565b611f3f565b34801561096957600080fd5b5061097d610978366004612ccf565b61219b565b60405161032691906132bb565b34801561099657600080fd5b5061052c6109a5366004612f76565b50600192915050565b3480156109ba57600080fd5b506109e56109c9366004612ccf565b6011602052600090815260409020600181015460029091015482565b60408051928352602083019190915201610326565b348015610a0657600080fd5b50610304610a15366004612cec565b61223e565b348015610a2657600080fd5b50610a3a610a35366004612cec565b612260565b60405161032696959493929190613308565b348015610a5857600080fd5b50610a6c610a67366004612d19565b6124d8565b6040516103269392919061338a565b348015610a8757600080fd5b50610304610a96366004612ccf565b6125d7565b348015610aa757600080fd5b5061031c600381565b61052c610abe366004612ccf565b50600090565b348015610ad057600080fd5b5060095461052c9060ff1681565b348015610aea57600080fd5b5061031c610af93660046133b5565b61261e565b348015610b0a57600080fd5b50600154610398906001600160a01b031681565b6000546201000090046001600160a01b03163314610b3b57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600f602052604081206005810154610b8a576000838152601460205260409020549150610c06565b600581018054610b9c90600190613407565b81548110610bac57610bac61341e565b600091825260209091206002600390920201015460ff16610c0057600581018054610bd990600190613407565b81548110610be957610be961341e565b906000526020600020906003020160000154610c03565b60005b91505b50919050565b600a8181548110610c1c57600080fd5b60009182526020909120600b90910201805460028201546003830154600484015460058501546006909501546001600160601b03909416955060ff90921693909286565b6010548210610cb65760405162461bcd60e51b815260206004820152601a60248201527f4469737075746520494420646f6573206e6f742065786973742e00000000000060448201526064015b60405180910390fd5b6012546001600160a01b03163314610d105760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c792062652063616c6c656420627920676174657761790000006044820152606401610cad565b6000828152600f60205260409020600d81015460ff1615610d6e5760405162461bcd60e51b8152602060048201526018602482015277293ab634b7339030b63932b0b23c9032bc32b1baba32b21760411b6044820152606401610cad565b600d81018054600160ff19909116179055600083815260146020526040908190208390558154905163188d362b60e11b81526004810185905260248101849052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b158015610de357600080fd5b505af1158015610df7573d6000803e3d6000fd5b50508254604051858152869350600160601b9091046001600160a01b031691507f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3505050565b6000546201000090046001600160a01b03163314610e6657600080fd5b6001600160601b0382161580610ed7575080600a80846001600160601b031681548110610e9557610e9561341e565b60009182526020909120600b909102015481546001600160601b03909116908110610ec257610ec261341e565b90600052602060002090600b02016003015411155b610ee057600080fd5b60005b600a836001600160601b031681548110610eff57610eff61341e565b90600052602060002090600b0201600101805490508110156110205781600a80856001600160601b031681548110610f3957610f3961341e565b90600052602060002090600b02016001018381548110610f5b57610f5b61341e565b906000526020600020015481548110610f7657610f7661341e565b90600052602060002090600b020160030154101561100e5760405162461bcd60e51b815260206004820152604960248201527f4120737562636f7572742063616e6e6f742062652074686520706172656e742060448201527f6f66206120737562636f75727420776974682061206c6f776572206d696e696d6064820152683ab69039ba30b5b29760b91b608482015260a401610cad565b8061101881613434565b915050610ee3565b5080600a836001600160601b03168154811061103e5761103e61341e565b90600052602060002090600b0201600301819055505050565b6060611061612c0f565b6000600a846001600160601b03168154811061107f5761107f61341e565b90600052602060002090600b02019050806001018054806020026020016040519081016040528092919081815260200182805480156110dd57602002820191906000526020600020905b8154815260200190600101908083116110c9575b505060408051608081019182905294975060078601935060049250905082845b8154815260200190600101908083116110fd575050505050915050915091565b600054610100900460ff161580801561113d5750600054600160ff909116105b806111575750303b158015611157575060005460ff166001145b6111ba5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610cad565b6000805460ff1916600117905580156111dd576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038f81169190910291909117909155600180546001600160a01b0319168d83161781556002805460078d905560088c90556001600160a81b031916928d1692909217909155426003556009805460ff19169091179055600d5461125b576001600d555b601280546001600160a01b038086166001600160a01b0319928316179092556013805492851692909116919091179055600a5461144357604080516101008101825260008082528251818152602080820185528084019182528b1515848601528a516060808601919091528b8201516080860152948b015160a0850152938a015160c084015260e08301899052600a8054600181018255925282517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600b90930292830180546001600160601b0319166001600160601b039092169190911781559051805193949193611375937fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a901929190910190612c2d565b50604082015160028201805460ff191691151591909117905560608201516003820155608082015160048083019190915560a0830151600583015560c0830151600683015560e08301516113ce91600784019190612c78565b505060405163483abc4f60e11b8152600b6004820152600060248201526044810186905273c7e3BF90299f6BD9FA7c3703837A9CAbB57436369150639075789e9060640160006040518083038186803b15801561142a57600080fd5b505af415801561143e573d6000803e3d6000fd5b505050505b8015611489576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60095460009060ff161561158b576001546040516370a0823160e01b815260009184916001600160a01b03909116906370a08231906114da908990600401612d05565b60206040518083038186803b1580156114f257600080fd5b505afa158015611506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152a919061344f565b6115349190613407565b6001600160a01b03861660009081526011602052604090206001015490915081108061157a57506001600160a01b03851660009081526011602052604090206002015481105b1561158957600091505061158f565b505b5060015b9392505050565b6000546201000090046001600160a01b031633146115b357600080fd5b80600a836001600160601b0316815481106115d0576115d061341e565b90600052602060002090600b02016007019060046115ef929190612c78565b505050565b6000546201000090046001600160a01b0316331461161157600080fd5b80600a836001600160601b03168154811061162e5761162e61341e565b90600052602060002090600b0201600501819055505050565b6000546201000090046001600160a01b0316331461166457600080fd5b80600a836001600160601b0316815481106116815761168161341e565b90600052602060002090600b0201600401819055505050565b6000546201000090046001600160a01b031633146116b757600080fd5b6000836001600160a01b031683836040516116d29190613494565b60006040518083038185875af1925050503d806000811461170f576040519150601f19603f3d011682016040523d82523d6000602084013e611714565b606091505b50509050806117595760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610cad565b50505050565b6000546201000090046001600160a01b0316331461177c57600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546201000090046001600160a01b031633146117bb57600080fd5b600755565b6117cb3383836126a5565b6117d457600080fd5b5050565b6000806000806000600f600089815260200190815260200160002060040187815481106118075761180761341e565b9060005260206000200186815481106118225761182261341e565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169b909a5091985060ff169650945050505050565b6000546201000090046001600160a01b0316331461188057600080fd5b600280546001600160a01b0319166001600160a01b038316179055600160028054600160a01b900460ff16908111156118bb576118bb612fb7565b14156119db57600260009054906101000a90046001600160a01b03166001600160a01b0316631c77c58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561190f57600080fd5b505afa158015611923573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611947919061344f565b600260009054906101000a90046001600160a01b03166001600160a01b03166378ab865d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561199557600080fd5b505afa1580156119a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cd919061344f565b6119d791906134b0565b6005555b50565b60008060028054600160a01b900460ff16908111156119ff576119ff612fb7565b14611a0957600080fd5b6000600e54600184600d54611a1e91906134b0565b611a289190613407565b11611a335782611a4e565b600d54600e54611a439190613407565b611a4e9060016134b0565b9050600081600d54611a6091906134b0565b9050600d54811015611a7157600080fd5b600d545b81811015611af7576000818152600c6020526040902080546001820154611ac1916001600160a01b03811691600160a01b9091046001600160601b0316906001600160801b03166126a5565b50506000818152600c6020526040812090815560010180546001600160801b031916905580611aef81613434565b915050611a75565b50600d55505050565b6000546201000090046001600160a01b03163314611b1d57600080fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b600073c7e3BF90299f6BD9FA7c3703837A9CAbB5743636637521ccb1600b6001600160601b038516611b718787612bc7565b6040516001600160e01b031960e086901b16815260048101939093526024830191909152604482015260640160206040518083038186803b158015611bb557600080fd5b505af4158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158f919061344f565b6000546201000090046001600160a01b03163314611c0a57600080fd5b80600a836001600160601b031681548110611c2757611c2761341e565b90600052602060002090600b0201600601819055505050565b60003415611c905760405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e205745544800000000006044820152606401610cad565b6000611c9b8361261e565b6013546040516323b872dd60e01b8152336004820152306024820152604481018390529192506001600160a01b0316906323b872dd90606401602060405180830381600087803b158015611cee57600080fd5b505af1158015611d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2691906134c8565b611d725760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f756768205745544820666f72206172626974726174696f6e006044820152606401610cad565b60108054906000611d8283613434565b909155506000818152600f60205260409081902080546001600160601b031633600160601b02178155601354601254925163a9059cbb60e01b81526001600160a01b03938416600482015260248101869052939550909291169063a9059cbb90604401602060405180830381600087803b158015611dff57600080fd5b505af1158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906134c8565b611e835760405162461bcd60e51b815260206004820152601e60248201527f466565207472616e7366657220746f2067617465776179206661696c656400006044820152606401610cad565b60125460405163979f8e6560e01b81526001600160a01b039091169063979f8e6590611eb790889088908790600401613511565b602060405180830381600087803b158015611ed157600080fd5b505af1158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f09919061344f565b50604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a3505092915050565b6000546201000090046001600160a01b03163314611f5c57600080fd5b85600a896001600160601b031681548110611f7957611f7961341e565b90600052602060002090600b020160030154111561200f5760405162461bcd60e51b815260206004820152604760248201527f4120737562636f7572742063616e6e6f742062652061206368696c64206f662060448201527f6120737562636f7572742077697468206120686967686572206d696e696d756d6064820152661039ba30b5b29760c91b608482015260a401610cad565b600a805460018101825560009182527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600b82020180546001600160601b0319166001600160601b038c161781559091604051908082528060200260200182016040528015612088578160200160208202803683370190505b50805161209f916001840191602090910190612c2d565b5060028101805460ff19168a151517905560038101889055600480820188905560058201879055600682018690556120dd9060078301908690612c78565b5060405163483abc4f60e11b8152600b6004820152602481018390526044810184905273c7e3BF90299f6BD9FA7c3703837A9CAbB574363690639075789e9060640160006040518083038186803b15801561213757600080fd5b505af415801561214b573d6000803e3d6000fd5b50505050600a8a6001600160601b03168154811061216b5761216b61341e565b600091825260208083206001600b9093020182018054928301815583529091200191909155505050505050505050565b6001600160a01b0381166000908152601160209081526040918290208054835181840281018401909452808452606093919283919083018282801561223157602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116121ee5790505b5050505050915050919050565b6000546201000090046001600160a01b0316331461225b57600080fd5b600855565b6000818152600f602052604090206004810154606091829182918291829182916001600160401b0381111561229757612297612e2b565b6040519080825280602002602001820160405280156122c0578160200160208202803683370190505b50965060005b6004820154811015612324578160040181815481106122e7576122e761341e565b90600052602060002001805490508882815181106123075761230761341e565b60209081029190910101528061231c81613434565b9150506122c6565b508060060180548060200260200160405190810160405280929190818152602001828054801561237357602002820191906000526020600020905b81548152602001906001019080831161235f575b50505050509550806007018054806020026020016040519081016040528092919081815260200182805480156123c857602002820191906000526020600020905b8154815260200190600101908083116123b4575b5050505050945080600a0180548060200260200160405190810160405280929190818152602001828054801561241d57602002820191906000526020600020905b815481526020019060010190808311612409575b5050505050935080600b0180548060200260200160405190810160405280929190818152602001828054801561247257602002820191906000526020600020905b81548152602001906001019080831161245e575b5050505050925080600c018054806020026020016040519081016040528092919081815260200182805480156124c757602002820191906000526020600020905b8154815260200190600101908083116124b3575b505050505091505091939550919395565b6000828152600f6020526040812060058101805460609284929091839190879081106125065761250661341e565b90600052602060002090600302019050806000015494508160010154600161252e91906134b0565b6001600160401b0381111561254557612545612e2b565b60405190808252806020026020018201604052801561256e578160200160208202803683370190505b50935060005b826001015481116125c157600081815260018301602052604090205485518690839081106125a4576125a461341e565b6020908102919091010152806125b981613434565b915050612574565b506002015493969295505060ff90921692509050565b6000546201000090046001600160a01b031633146125f457600080fd5b600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b60125460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea99061264f90859060040161353a565b60206040518083038186803b15801561266757600080fd5b505afa15801561267b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061269f919061344f565b92915050565b600a546000906001600160601b038416106126c25750600061158f565b6001600160801b038216158061270e5750816001600160801b0316600a846001600160601b0316815481106126f9576126f961341e565b90600052602060002090600b02016003015411155b61271a5750600061158f565b6001600160a01b03841660009081526011602052604081209061273d8686612bc7565b604051637521ccb160e01b8152600b60048201526001600160601b03871660248201526044810182905290915060009073c7e3BF90299f6BD9FA7c3703837A9CAbB574363690637521ccb19060640160206040518083038186803b1580156127a457600080fd5b505af41580156127b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127dc919061344f565b90506001600160801b03851615806127f45750600081115b80612800575082546004115b612810576000935050505061158f565b6000856001600160801b031682856001015461282c9190613407565b61283691906134b0565b90506001600160801b03861615806128cc57506001546040516370a0823160e01b815282916001600160a01b0316906370a0823190612879908c90600401612d05565b60206040518083038186803b15801561289157600080fd5b505afa1580156128a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c9919061344f565b10155b6128dd57600094505050505061158f565b600184018190556001600160801b038616612a425760005b8454811015612a3c57876001600160601b031685600001828154811061291d5761291d61341e565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03161415612a2a578454859061295a90600190613407565b8154811061296a5761296a61341e565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b03168560000182815481106129a8576129a861341e565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550846000018054806129f4576129f461354d565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055612a3c565b80612a3481613434565b9150506128f5565b50612a82565b81612a82578354600180820186556000868152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918a16021790555b60006001600160601b0388165b81612b5a57604051631712e1c560e11b8152600b6004820152602481018290526001600160801b03891660448201526064810186905273c7e3BF90299f6BD9FA7c3703837A9CAbB574363690632e25c38a9060840160006040518083038186803b158015612afc57600080fd5b505af4158015612b10573d6000803e3d6000fd5b505050508060001415612b265760019150612a8f565b600a8181548110612b3957612b3961341e565b60009182526020909120600b90910201546001600160601b03169050612a8f565b604080516001600160601b038b1681526001600160801b038a1660208201529081018490526001600160a01b038b16907f8f753321c98641397daaca5e8abf8881fff1fd7a7bc229924a012e2cb61763d59060600160405180910390a25060019998505050505050505050565b600060405160005b6014811015612bea578481600c011a81830153600101612bcf565b5060145b6020811015612c065783811a81830153600101612bee565b50519392505050565b60405180608001604052806004906020820280368337509192915050565b828054828255906000526020600020908101928215612c68579160200282015b82811115612c68578251825591602001919060010190612c4d565b50612c74929150612ca5565b5090565b8260048101928215612c685791602002820182811115612c68578251825591602001919060010190612c4d565b5b80821115612c745760008155600101612ca6565b6001600160a01b03811681146119db57600080fd5b600060208284031215612ce157600080fd5b813561158f81612cba565b600060208284031215612cfe57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008060408385031215612d2c57600080fd5b50508035926020909101359150565b80356001600160601b0381168114612d5257600080fd5b919050565b60008060408385031215612d6a57600080fd5b612d7383612d3b565b946020939093013593505050565b600060208284031215612d9357600080fd5b61158f82612d3b565b600081518084526020808501945080840160005b83811015612dcc57815187529582019590820190600101612db0565b509495945050505050565b60a081526000612dea60a0830185612d9c565b905060208083018460005b6004811015612e1257815183529183019190830190600101612df5565b505050509392505050565b80151581146119db57600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f830112612e5257600080fd5b604051608081018181106001600160401b0382111715612e7457612e74612e2b565b604052806080840185811115612e8957600080fd5b845b81811015612ea3578035835260209283019201612e8b565b509195945050505050565b60008060008060008060008060008060006102208c8e031215612ed057600080fd5b8b35612edb81612cba565b9a5060208c0135612eeb81612cba565b995060408c0135612efb81612cba565b985060608c0135975060808c0135965060a08c0135612f1981612e1d565b9550612f288d60c08e01612e41565b9450612f388d6101408e01612e41565b93506101c08c013592506101e08c0135612f5181612cba565b91506102008c0135612f6281612cba565b809150509295989b509295989b9093969950565b600080600060608486031215612f8b57600080fd5b8335612f9681612cba565b92506020840135612fa681612cba565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b6001600160601b03891681526001600160a01b03881660208201526040810187905261010081016005871061300457613004612fb7565b6060820196909652608081019490945260a084019290925260c0830152151560e0909101529392505050565b60008060a0838503121561304357600080fd5b61304c83612d3b565b915061305b8460208501612e41565b90509250929050565b600082601f83011261307557600080fd5b81356001600160401b038082111561308f5761308f612e2b565b604051601f8301601f19908116603f011681019082821181831017156130b7576130b7612e2b565b816040528381528660208588010111156130d057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561310557600080fd5b833561311081612cba565b92506020840135915060408401356001600160401b0381111561313257600080fd5b61313e86828701613064565b9150509250925092565b6000806040838503121561315b57600080fd5b61316483612d3b565b915060208301356001600160801b038116811461318057600080fd5b809150509250929050565b6000806000606084860312156131a057600080fd5b505081359360208301359350604090920135919050565b600080604083850312156131ca57600080fd5b82356131d581612cba565b915061305b60208401612d3b565b60208101600383106131f7576131f7612fb7565b91905290565b6000806040838503121561321057600080fd5b8235915060208301356001600160401b0381111561322d57600080fd5b61323985828601613064565b9150509250929050565b600080600080600080600080610160898b03121561326057600080fd5b61326989612d3b565b9750602089013561327981612e1d565b965060408901359550606089013594506080890135935060a089013592506132a48a60c08b01612e41565b915061014089013590509295985092959890939650565b6020808252825182820181905260009190848201906040850190845b818110156132fc5783516001600160601b0316835292840192918401916001016132d7565b50909695505050505050565b60c08152600061331b60c0830189612d9c565b828103602084015261332d8189612d9c565b905082810360408401526133418188612d9c565b905082810360608401526133558187612d9c565b905082810360808401526133698186612d9c565b905082810360a084015261337d8185612d9c565b9998505050505050505050565b8381526060602082015260006133a36060830185612d9c565b90508215156040830152949350505050565b6000602082840312156133c757600080fd5b81356001600160401b038111156133dd57600080fd5b6133e984828501613064565b949350505050565b634e487b7160e01b600052601160045260246000fd5b600082821015613419576134196133f1565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415613448576134486133f1565b5060010190565b60006020828403121561346157600080fd5b5051919050565b60005b8381101561348357818101518382015260200161346b565b838111156117595750506000910152565b600082516134a6818460208701613468565b9190910192915050565b600082198211156134c3576134c36133f1565b500190565b6000602082840312156134da57600080fd5b815161158f81612e1d565b600081518084526134fd816020860160208601613468565b601f01601f19169290920160200192915050565b83815260606020820152600061352a60608301856134e5565b9050826040830152949350505050565b60208152600061158f60208301846134e5565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ebedfeba07618f8e6e1a8c18f59095f87c72475a28c1fd55f36a87b305d2dba664736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106102df5760003560e01c80638ce7ff4a11610186578063c5e4ccc4116100d7578063e3b0073e11610085578063e3b0073e14610a4c578063e4c0aaf414610a7b578063eaff425a14610a9b578063f48c305414610ab0578063f66d685a14610ac4578063f7434ea914610ade578063fbf405b014610afe57600080fd5b8063c5e4ccc414610927578063ce9e77301461093d578063d4155d1f1461095d578063da682aeb1461098a578063dca5f6b0146109ae578063dd5e5cb5146109fa578063e3a96cbd14610a1a57600080fd5b8063b1c9fe6e11610134578063b1c9fe6e14610800578063b4a616081461082e578063b78a80ff14610843578063b888adfa146108d2578063c057eca7146108e8578063c108f3b4146108fe578063c13517e11461091457600080fd5b80638ce7ff4a146106f45780638d7c7daa1461074057806396d92a72146107605780639929057b146107805780639e72c153146107a0578063a2473cc1146107c0578063a57366e7146107e057600080fd5b806340026c87116102405780635e4a627d116101ee5780635e4a627d146106235780636a4f8f3914610639578063751accd0146106595780637a5de2a914610679578063823cfd7014610699578063840bc19c146106b957806385c855f3146106d457600080fd5b806340026c87146104be57806348b4e924146104ec5780634a3931491461050c578063564a565d1461053c57806357260364146105c357806359354c77146105e35780635bc24dd31461060357600080fd5b80631b92bbbe1161029d5780631b92bbbe146103bb5780631c3db16d146103d15780631f5a0dd2146103f15780632ea7b4d014610448578063311a6c561461045e5780633e1d09be1461047e5780633fc8cef31461049e57600080fd5b8062f5822c146102e4578063023d44df14610306578063034327441461032f57806303438616146103455780630c340a24146103725780630d44cf79146103a5575b600080fd5b3480156102f057600080fd5b506103046102ff366004612ccf565b610b1e565b005b34801561031257600080fd5b5061031c60055481565b6040519081526020015b60405180910390f35b34801561033b57600080fd5b5061031c60045481565b34801561035157600080fd5b5061031c610360366004612cec565b60146020526000908152604090205481565b34801561037e57600080fd5b50600054610398906201000090046001600160a01b031681565b6040516103269190612d05565b3480156103b157600080fd5b5061031c600e5481565b3480156103c757600080fd5b5061031c60085481565b3480156103dd57600080fd5b5061031c6103ec366004612cec565b610b5d565b3480156103fd57600080fd5b5061041161040c366004612cec565b610c0c565b604080516001600160601b0390971687529415156020870152938501929092526060840152608083015260a082015260c001610326565b34801561045457600080fd5b5061031c61271081565b34801561046a57600080fd5b50610304610479366004612d19565b610c60565b34801561048a57600080fd5b50610304610499366004612d57565b610e49565b3480156104aa57600080fd5b50601354610398906001600160a01b031681565b3480156104ca57600080fd5b506104de6104d9366004612d81565b611057565b604051610326929190612dd7565b3480156104f857600080fd5b50610304610507366004612eae565b61111d565b34801561051857600080fd5b5061052c610527366004612f76565b611497565b6040519015158152602001610326565b34801561054857600080fd5b506105af610557366004612cec565b600f602052600090815260409020805460018201546002830154600384015460088501546009860154600d909601546001600160601b03861696600160601b9096046001600160a01b03169560ff9485169490911688565b604051610326989796959493929190612fcd565b3480156105cf57600080fd5b506103046105de366004613030565b611596565b3480156105ef57600080fd5b506103046105fe366004612d57565b6115f4565b34801561060f57600080fd5b5061030461061e366004612d57565b611647565b34801561062f57600080fd5b5061031c60065481565b34801561064557600080fd5b50600254610398906001600160a01b031681565b34801561066557600080fd5b506103046106743660046130f0565b61169a565b34801561068557600080fd5b50610304610694366004612ccf565b61175f565b3480156106a557600080fd5b506103046106b4366004612cec565b61179e565b3480156106c557600080fd5b5061031c6001600160ff1b0381565b3480156106e057600080fd5b506103046106ef366004613148565b6117c0565b34801561070057600080fd5b5061071461070f36600461318b565b6117d8565b604080516001600160a01b03909516855260208501939093529183015215156060820152608001610326565b34801561074c57600080fd5b50601254610398906001600160a01b031681565b34801561076c57600080fd5b5061030461077b366004612ccf565b611863565b34801561078c57600080fd5b5061030461079b366004612cec565b6119de565b3480156107ac57600080fd5b506103046107bb366004612ccf565b611b00565b3480156107cc57600080fd5b5061031c6107db3660046131b7565b611b3f565b3480156107ec57600080fd5b506103046107fb366004612d57565b611bed565b34801561080c57600080fd5b5060025461082190600160a01b900460ff1681565b60405161032691906131e3565b34801561083a57600080fd5b5061031c600481565b34801561084f57600080fd5b5061089c61085e366004612cec565b600c60205260009081526040902080546001909101546001600160a01b03821691600160a01b90046001600160601b0316906001600160801b031683565b604080516001600160a01b0390941684526001600160601b0390921660208401526001600160801b031690820152606001610326565b3480156108de57600080fd5b5061031c60035481565b3480156108f457600080fd5b5061031c60075481565b34801561090a57600080fd5b5061031c600d5481565b61031c6109223660046131fd565b611c40565b34801561093357600080fd5b5061031c60105481565b34801561094957600080fd5b50610304610958366004613243565b611f3f565b34801561096957600080fd5b5061097d610978366004612ccf565b61219b565b60405161032691906132bb565b34801561099657600080fd5b5061052c6109a5366004612f76565b50600192915050565b3480156109ba57600080fd5b506109e56109c9366004612ccf565b6011602052600090815260409020600181015460029091015482565b60408051928352602083019190915201610326565b348015610a0657600080fd5b50610304610a15366004612cec565b61223e565b348015610a2657600080fd5b50610a3a610a35366004612cec565b612260565b60405161032696959493929190613308565b348015610a5857600080fd5b50610a6c610a67366004612d19565b6124d8565b6040516103269392919061338a565b348015610a8757600080fd5b50610304610a96366004612ccf565b6125d7565b348015610aa757600080fd5b5061031c600381565b61052c610abe366004612ccf565b50600090565b348015610ad057600080fd5b5060095461052c9060ff1681565b348015610aea57600080fd5b5061031c610af93660046133b5565b61261e565b348015610b0a57600080fd5b50600154610398906001600160a01b031681565b6000546201000090046001600160a01b03163314610b3b57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600f602052604081206005810154610b8a576000838152601460205260409020549150610c06565b600581018054610b9c90600190613407565b81548110610bac57610bac61341e565b600091825260209091206002600390920201015460ff16610c0057600581018054610bd990600190613407565b81548110610be957610be961341e565b906000526020600020906003020160000154610c03565b60005b91505b50919050565b600a8181548110610c1c57600080fd5b60009182526020909120600b90910201805460028201546003830154600484015460058501546006909501546001600160601b03909416955060ff90921693909286565b6010548210610cb65760405162461bcd60e51b815260206004820152601a60248201527f4469737075746520494420646f6573206e6f742065786973742e00000000000060448201526064015b60405180910390fd5b6012546001600160a01b03163314610d105760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c792062652063616c6c656420627920676174657761790000006044820152606401610cad565b6000828152600f60205260409020600d81015460ff1615610d6e5760405162461bcd60e51b8152602060048201526018602482015277293ab634b7339030b63932b0b23c9032bc32b1baba32b21760411b6044820152606401610cad565b600d81018054600160ff19909116179055600083815260146020526040908190208390558154905163188d362b60e11b81526004810185905260248101849052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b158015610de357600080fd5b505af1158015610df7573d6000803e3d6000fd5b50508254604051858152869350600160601b9091046001600160a01b031691507f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3505050565b6000546201000090046001600160a01b03163314610e6657600080fd5b6001600160601b0382161580610ed7575080600a80846001600160601b031681548110610e9557610e9561341e565b60009182526020909120600b909102015481546001600160601b03909116908110610ec257610ec261341e565b90600052602060002090600b02016003015411155b610ee057600080fd5b60005b600a836001600160601b031681548110610eff57610eff61341e565b90600052602060002090600b0201600101805490508110156110205781600a80856001600160601b031681548110610f3957610f3961341e565b90600052602060002090600b02016001018381548110610f5b57610f5b61341e565b906000526020600020015481548110610f7657610f7661341e565b90600052602060002090600b020160030154101561100e5760405162461bcd60e51b815260206004820152604960248201527f4120737562636f7572742063616e6e6f742062652074686520706172656e742060448201527f6f66206120737562636f75727420776974682061206c6f776572206d696e696d6064820152683ab69039ba30b5b29760b91b608482015260a401610cad565b8061101881613434565b915050610ee3565b5080600a836001600160601b03168154811061103e5761103e61341e565b90600052602060002090600b0201600301819055505050565b6060611061612c0f565b6000600a846001600160601b03168154811061107f5761107f61341e565b90600052602060002090600b02019050806001018054806020026020016040519081016040528092919081815260200182805480156110dd57602002820191906000526020600020905b8154815260200190600101908083116110c9575b505060408051608081019182905294975060078601935060049250905082845b8154815260200190600101908083116110fd575050505050915050915091565b600054610100900460ff161580801561113d5750600054600160ff909116105b806111575750303b158015611157575060005460ff166001145b6111ba5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610cad565b6000805460ff1916600117905580156111dd576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038f81169190910291909117909155600180546001600160a01b0319168d83161781556002805460078d905560088c90556001600160a81b031916928d1692909217909155426003556009805460ff19169091179055600d5461125b576001600d555b601280546001600160a01b038086166001600160a01b0319928316179092556013805492851692909116919091179055600a5461144357604080516101008101825260008082528251818152602080820185528084019182528b1515848601528a516060808601919091528b8201516080860152948b015160a0850152938a015160c084015260e08301899052600a8054600181018255925282517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600b90930292830180546001600160601b0319166001600160601b039092169190911781559051805193949193611375937fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a901929190910190612c2d565b50604082015160028201805460ff191691151591909117905560608201516003820155608082015160048083019190915560a0830151600583015560c0830151600683015560e08301516113ce91600784019190612c78565b505060405163483abc4f60e11b8152600b6004820152600060248201526044810186905273__$9b1aa2a5defb7a13dc220b13d2e6a83a6b$__9150639075789e9060640160006040518083038186803b15801561142a57600080fd5b505af415801561143e573d6000803e3d6000fd5b505050505b8015611489576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60095460009060ff161561158b576001546040516370a0823160e01b815260009184916001600160a01b03909116906370a08231906114da908990600401612d05565b60206040518083038186803b1580156114f257600080fd5b505afa158015611506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152a919061344f565b6115349190613407565b6001600160a01b03861660009081526011602052604090206001015490915081108061157a57506001600160a01b03851660009081526011602052604090206002015481105b1561158957600091505061158f565b505b5060015b9392505050565b6000546201000090046001600160a01b031633146115b357600080fd5b80600a836001600160601b0316815481106115d0576115d061341e565b90600052602060002090600b02016007019060046115ef929190612c78565b505050565b6000546201000090046001600160a01b0316331461161157600080fd5b80600a836001600160601b03168154811061162e5761162e61341e565b90600052602060002090600b0201600501819055505050565b6000546201000090046001600160a01b0316331461166457600080fd5b80600a836001600160601b0316815481106116815761168161341e565b90600052602060002090600b0201600401819055505050565b6000546201000090046001600160a01b031633146116b757600080fd5b6000836001600160a01b031683836040516116d29190613494565b60006040518083038185875af1925050503d806000811461170f576040519150601f19603f3d011682016040523d82523d6000602084013e611714565b606091505b50509050806117595760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610cad565b50505050565b6000546201000090046001600160a01b0316331461177c57600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546201000090046001600160a01b031633146117bb57600080fd5b600755565b6117cb3383836126a5565b6117d457600080fd5b5050565b6000806000806000600f600089815260200190815260200160002060040187815481106118075761180761341e565b9060005260206000200186815481106118225761182261341e565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169b909a5091985060ff169650945050505050565b6000546201000090046001600160a01b0316331461188057600080fd5b600280546001600160a01b0319166001600160a01b038316179055600160028054600160a01b900460ff16908111156118bb576118bb612fb7565b14156119db57600260009054906101000a90046001600160a01b03166001600160a01b0316631c77c58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561190f57600080fd5b505afa158015611923573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611947919061344f565b600260009054906101000a90046001600160a01b03166001600160a01b03166378ab865d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561199557600080fd5b505afa1580156119a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cd919061344f565b6119d791906134b0565b6005555b50565b60008060028054600160a01b900460ff16908111156119ff576119ff612fb7565b14611a0957600080fd5b6000600e54600184600d54611a1e91906134b0565b611a289190613407565b11611a335782611a4e565b600d54600e54611a439190613407565b611a4e9060016134b0565b9050600081600d54611a6091906134b0565b9050600d54811015611a7157600080fd5b600d545b81811015611af7576000818152600c6020526040902080546001820154611ac1916001600160a01b03811691600160a01b9091046001600160601b0316906001600160801b03166126a5565b50506000818152600c6020526040812090815560010180546001600160801b031916905580611aef81613434565b915050611a75565b50600d55505050565b6000546201000090046001600160a01b03163314611b1d57600080fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b600073__$9b1aa2a5defb7a13dc220b13d2e6a83a6b$__637521ccb1600b6001600160601b038516611b718787612bc7565b6040516001600160e01b031960e086901b16815260048101939093526024830191909152604482015260640160206040518083038186803b158015611bb557600080fd5b505af4158015611bc9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158f919061344f565b6000546201000090046001600160a01b03163314611c0a57600080fd5b80600a836001600160601b031681548110611c2757611c2761341e565b90600052602060002090600b0201600601819055505050565b60003415611c905760405162461bcd60e51b815260206004820152601b60248201527f466565732073686f756c64206265207061696420696e205745544800000000006044820152606401610cad565b6000611c9b8361261e565b6013546040516323b872dd60e01b8152336004820152306024820152604481018390529192506001600160a01b0316906323b872dd90606401602060405180830381600087803b158015611cee57600080fd5b505af1158015611d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2691906134c8565b611d725760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f756768205745544820666f72206172626974726174696f6e006044820152606401610cad565b60108054906000611d8283613434565b909155506000818152600f60205260409081902080546001600160601b031633600160601b02178155601354601254925163a9059cbb60e01b81526001600160a01b03938416600482015260248101869052939550909291169063a9059cbb90604401602060405180830381600087803b158015611dff57600080fd5b505af1158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906134c8565b611e835760405162461bcd60e51b815260206004820152601e60248201527f466565207472616e7366657220746f2067617465776179206661696c656400006044820152606401610cad565b60125460405163979f8e6560e01b81526001600160a01b039091169063979f8e6590611eb790889088908790600401613511565b602060405180830381600087803b158015611ed157600080fd5b505af1158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f09919061344f565b50604051339084907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a3505092915050565b6000546201000090046001600160a01b03163314611f5c57600080fd5b85600a896001600160601b031681548110611f7957611f7961341e565b90600052602060002090600b020160030154111561200f5760405162461bcd60e51b815260206004820152604760248201527f4120737562636f7572742063616e6e6f742062652061206368696c64206f662060448201527f6120737562636f7572742077697468206120686967686572206d696e696d756d6064820152661039ba30b5b29760c91b608482015260a401610cad565b600a805460018101825560009182527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8600b82020180546001600160601b0319166001600160601b038c161781559091604051908082528060200260200182016040528015612088578160200160208202803683370190505b50805161209f916001840191602090910190612c2d565b5060028101805460ff19168a151517905560038101889055600480820188905560058201879055600682018690556120dd9060078301908690612c78565b5060405163483abc4f60e11b8152600b6004820152602481018390526044810184905273__$9b1aa2a5defb7a13dc220b13d2e6a83a6b$__90639075789e9060640160006040518083038186803b15801561213757600080fd5b505af415801561214b573d6000803e3d6000fd5b50505050600a8a6001600160601b03168154811061216b5761216b61341e565b600091825260208083206001600b9093020182018054928301815583529091200191909155505050505050505050565b6001600160a01b0381166000908152601160209081526040918290208054835181840281018401909452808452606093919283919083018282801561223157602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116121ee5790505b5050505050915050919050565b6000546201000090046001600160a01b0316331461225b57600080fd5b600855565b6000818152600f602052604090206004810154606091829182918291829182916001600160401b0381111561229757612297612e2b565b6040519080825280602002602001820160405280156122c0578160200160208202803683370190505b50965060005b6004820154811015612324578160040181815481106122e7576122e761341e565b90600052602060002001805490508882815181106123075761230761341e565b60209081029190910101528061231c81613434565b9150506122c6565b508060060180548060200260200160405190810160405280929190818152602001828054801561237357602002820191906000526020600020905b81548152602001906001019080831161235f575b50505050509550806007018054806020026020016040519081016040528092919081815260200182805480156123c857602002820191906000526020600020905b8154815260200190600101908083116123b4575b5050505050945080600a0180548060200260200160405190810160405280929190818152602001828054801561241d57602002820191906000526020600020905b815481526020019060010190808311612409575b5050505050935080600b0180548060200260200160405190810160405280929190818152602001828054801561247257602002820191906000526020600020905b81548152602001906001019080831161245e575b5050505050925080600c018054806020026020016040519081016040528092919081815260200182805480156124c757602002820191906000526020600020905b8154815260200190600101908083116124b3575b505050505091505091939550919395565b6000828152600f6020526040812060058101805460609284929091839190879081106125065761250661341e565b90600052602060002090600302019050806000015494508160010154600161252e91906134b0565b6001600160401b0381111561254557612545612e2b565b60405190808252806020026020018201604052801561256e578160200160208202803683370190505b50935060005b826001015481116125c157600081815260018301602052604090205485518690839081106125a4576125a461341e565b6020908102919091010152806125b981613434565b915050612574565b506002015493969295505060ff90921692509050565b6000546201000090046001600160a01b031633146125f457600080fd5b600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b60125460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea99061264f90859060040161353a565b60206040518083038186803b15801561266757600080fd5b505afa15801561267b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061269f919061344f565b92915050565b600a546000906001600160601b038416106126c25750600061158f565b6001600160801b038216158061270e5750816001600160801b0316600a846001600160601b0316815481106126f9576126f961341e565b90600052602060002090600b02016003015411155b61271a5750600061158f565b6001600160a01b03841660009081526011602052604081209061273d8686612bc7565b604051637521ccb160e01b8152600b60048201526001600160601b03871660248201526044810182905290915060009073__$9b1aa2a5defb7a13dc220b13d2e6a83a6b$__90637521ccb19060640160206040518083038186803b1580156127a457600080fd5b505af41580156127b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127dc919061344f565b90506001600160801b03851615806127f45750600081115b80612800575082546004115b612810576000935050505061158f565b6000856001600160801b031682856001015461282c9190613407565b61283691906134b0565b90506001600160801b03861615806128cc57506001546040516370a0823160e01b815282916001600160a01b0316906370a0823190612879908c90600401612d05565b60206040518083038186803b15801561289157600080fd5b505afa1580156128a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c9919061344f565b10155b6128dd57600094505050505061158f565b600184018190556001600160801b038616612a425760005b8454811015612a3c57876001600160601b031685600001828154811061291d5761291d61341e565b600091825260209091206002820401546001909116600c026101000a90046001600160601b03161415612a2a578454859061295a90600190613407565b8154811061296a5761296a61341e565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b03168560000182815481106129a8576129a861341e565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550846000018054806129f4576129f461354d565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a02191690559055612a3c565b80612a3481613434565b9150506128f5565b50612a82565b81612a82578354600180820186556000868152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918a16021790555b60006001600160601b0388165b81612b5a57604051631712e1c560e11b8152600b6004820152602481018290526001600160801b03891660448201526064810186905273__$9b1aa2a5defb7a13dc220b13d2e6a83a6b$__90632e25c38a9060840160006040518083038186803b158015612afc57600080fd5b505af4158015612b10573d6000803e3d6000fd5b505050508060001415612b265760019150612a8f565b600a8181548110612b3957612b3961341e565b60009182526020909120600b90910201546001600160601b03169050612a8f565b604080516001600160601b038b1681526001600160801b038a1660208201529081018490526001600160a01b038b16907f8f753321c98641397daaca5e8abf8881fff1fd7a7bc229924a012e2cb61763d59060600160405180910390a25060019998505050505050505050565b600060405160005b6014811015612bea578481600c011a81830153600101612bcf565b5060145b6020811015612c065783811a81830153600101612bee565b50519392505050565b60405180608001604052806004906020820280368337509192915050565b828054828255906000526020600020908101928215612c68579160200282015b82811115612c68578251825591602001919060010190612c4d565b50612c74929150612ca5565b5090565b8260048101928215612c685791602002820182811115612c68578251825591602001919060010190612c4d565b5b80821115612c745760008155600101612ca6565b6001600160a01b03811681146119db57600080fd5b600060208284031215612ce157600080fd5b813561158f81612cba565b600060208284031215612cfe57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008060408385031215612d2c57600080fd5b50508035926020909101359150565b80356001600160601b0381168114612d5257600080fd5b919050565b60008060408385031215612d6a57600080fd5b612d7383612d3b565b946020939093013593505050565b600060208284031215612d9357600080fd5b61158f82612d3b565b600081518084526020808501945080840160005b83811015612dcc57815187529582019590820190600101612db0565b509495945050505050565b60a081526000612dea60a0830185612d9c565b905060208083018460005b6004811015612e1257815183529183019190830190600101612df5565b505050509392505050565b80151581146119db57600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f830112612e5257600080fd5b604051608081018181106001600160401b0382111715612e7457612e74612e2b565b604052806080840185811115612e8957600080fd5b845b81811015612ea3578035835260209283019201612e8b565b509195945050505050565b60008060008060008060008060008060006102208c8e031215612ed057600080fd5b8b35612edb81612cba565b9a5060208c0135612eeb81612cba565b995060408c0135612efb81612cba565b985060608c0135975060808c0135965060a08c0135612f1981612e1d565b9550612f288d60c08e01612e41565b9450612f388d6101408e01612e41565b93506101c08c013592506101e08c0135612f5181612cba565b91506102008c0135612f6281612cba565b809150509295989b509295989b9093969950565b600080600060608486031215612f8b57600080fd5b8335612f9681612cba565b92506020840135612fa681612cba565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b6001600160601b03891681526001600160a01b03881660208201526040810187905261010081016005871061300457613004612fb7565b6060820196909652608081019490945260a084019290925260c0830152151560e0909101529392505050565b60008060a0838503121561304357600080fd5b61304c83612d3b565b915061305b8460208501612e41565b90509250929050565b600082601f83011261307557600080fd5b81356001600160401b038082111561308f5761308f612e2b565b604051601f8301601f19908116603f011681019082821181831017156130b7576130b7612e2b565b816040528381528660208588010111156130d057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561310557600080fd5b833561311081612cba565b92506020840135915060408401356001600160401b0381111561313257600080fd5b61313e86828701613064565b9150509250925092565b6000806040838503121561315b57600080fd5b61316483612d3b565b915060208301356001600160801b038116811461318057600080fd5b809150509250929050565b6000806000606084860312156131a057600080fd5b505081359360208301359350604090920135919050565b600080604083850312156131ca57600080fd5b82356131d581612cba565b915061305b60208401612d3b565b60208101600383106131f7576131f7612fb7565b91905290565b6000806040838503121561321057600080fd5b8235915060208301356001600160401b0381111561322d57600080fd5b61323985828601613064565b9150509250929050565b600080600080600080600080610160898b03121561326057600080fd5b61326989612d3b565b9750602089013561327981612e1d565b965060408901359550606089013594506080890135935060a089013592506132a48a60c08b01612e41565b915061014089013590509295985092959890939650565b6020808252825182820181905260009190848201906040850190845b818110156132fc5783516001600160601b0316835292840192918401916001016132d7565b50909695505050505050565b60c08152600061331b60c0830189612d9c565b828103602084015261332d8189612d9c565b905082810360408401526133418188612d9c565b905082810360608401526133558187612d9c565b905082810360808401526133698186612d9c565b905082810360a084015261337d8185612d9c565b9998505050505050505050565b8381526060602082015260006133a36060830185612d9c565b90508215156040830152949350505050565b6000602082840312156133c757600080fd5b81356001600160401b038111156133dd57600080fd5b6133e984828501613064565b949350505050565b634e487b7160e01b600052601160045260246000fd5b600082821015613419576134196133f1565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415613448576134486133f1565b5060010190565b60006020828403121561346157600080fd5b5051919050565b60005b8381101561348357818101518382015260200161346b565b838111156117595750506000910152565b600082516134a6818460208701613468565b9190910192915050565b600082198211156134c3576134c36133f1565b500190565b6000602082840312156134da57600080fd5b815161158f81612e1d565b600081518084526134fd816020860160208601613468565b601f01601f19169290920160200192915050565b83815260606020820152600061352a60608301856134e5565b9050826040830152949350505050565b60208152600061158f60208301846134e5565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ebedfeba07618f8e6e1a8c18f59095f87c72475a28c1fd55f36a87b305d2dba664736f6c63430008090033", + "libraries": { + "SortitionSumTreeFactory": "0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636" + }, + "devdoc": { + "details": "This contract is an adaption of Mainnet's KlerosLiquid (https://github.com/kleros/kleros/blob/69cfbfb2128c29f1625b3a99a3183540772fda08/contracts/kleros/KlerosLiquid.sol) for xDai chain. Notice that variables referring to ETH values in this contract, will hold the native token values of the chain on which xKlerosLiquid is deployed. When this contract gets deployed on xDai chain, ETH variables will hold xDai values.", + "events": { + "Draw(address,uint256,uint256,uint256)": { + "details": "Emitted when a juror is drawn.", + "params": { + "_address": "The drawn address.", + "_appeal": "The appeal the draw is for. 0 is for the first round.", + "_disputeID": "The ID of the dispute.", + "_voteID": "The vote ID." + } + }, + "NewPeriod(uint256,uint8)": { + "details": "Emitted when a dispute passes to a new period.", + "params": { + "_disputeID": "The ID of the dispute.", + "_period": "The new period." + } + }, + "NewPhase(uint8)": { + "details": "Emitted when we pass to a new phase.", + "params": { + "_phase": "The new phase." + } + }, + "StakeSet(address,uint256,uint128,uint256)": { + "details": "Emitted when a juror's stake is set.", + "params": { + "_address": "The address of the juror.", + "_newTotalStake": "The new total stake.", + "_stake": "The new stake.", + "_subcourtID": "The ID of the subcourt at the end of the stake path." + } + }, + "TokenAndETHShift(address,uint256,int256,int256)": { + "details": "Emitted when a juror wins or loses tokens and ETH from a dispute.", + "params": { + "_ETHAmount": "The amount of ETH won or lost.", + "_address": "The juror affected.", + "_disputeID": "The ID of the dispute.", + "_tokenAmount": "The amount of tokens won or lost." + } + } + }, + "kind": "dev", + "methods": { + "arbitrationCost(bytes)": { + "details": "Gets the cost of arbitration in a specified subcourt.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes)." + }, + "returns": { + "cost": "The cost." + } + }, + "changeForeignGateway(address)": { + "details": "Changes the `foreignGateway` storage variable.", + "params": { + "_foreignGateway": "The new value for the `foreignGateway` storage variable." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "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." + } + }, + "changePinakion(address)": { + "details": "Changes the `pinakion` storage variable.", + "params": { + "_pinakion": "The new value for the `pinakion` storage variable." + } + }, + "changeRNGenerator(address)": { + "details": "Changes the `RNGenerator` storage variable.", + "params": { + "_RNGenerator": "The new value for the `RNGenerator` storage variable." + } + }, + "changeSubcourtAlpha(uint96,uint256)": { + "details": "Changes the `alpha` property value of a specified subcourt.", + "params": { + "_alpha": "The new value for the `alpha` property value.", + "_subcourtID": "The ID of the subcourt." + } + }, + "changeSubcourtJurorFee(uint96,uint256)": { + "details": "Changes the `feeForJuror` property value of a specified subcourt.", + "params": { + "_feeForJuror": "The new value for the `feeForJuror` property value.", + "_subcourtID": "The ID of the subcourt." + } + }, + "changeSubcourtJurorsForJump(uint96,uint256)": { + "details": "Changes the `jurorsForCourtJump` property value of a specified subcourt.", + "params": { + "_jurorsForCourtJump": "The new value for the `jurorsForCourtJump` property value.", + "_subcourtID": "The ID of the subcourt." + } + }, + "changeSubcourtMinStake(uint96,uint256)": { + "details": "Changes the `minStake` property value of a specified subcourt. Don't set to a value lower than its parent's `minStake` property value.", + "params": { + "_minStake": "The new value for the `minStake` property value.", + "_subcourtID": "The ID of the subcourt." + } + }, + "changeSubcourtTimesPerPeriod(uint96,uint256[4])": { + "details": "Changes the `timesPerPeriod` property value of a specified subcourt.", + "params": { + "_subcourtID": "The ID of the subcourt.", + "_timesPerPeriod": "The new value for the `timesPerPeriod` property value." + } + }, + "changeWethAddress(address)": { + "details": "Changes the `weth` storage variable.", + "params": { + "_weth": "The new value for the `weth` storage variable." + } + }, + "createDispute(uint256,bytes)": { + "details": "Creates a dispute. Must be called by the arbitrable contract.", + "params": { + "_extraData": "Additional info about the dispute to be created. We use it to pass the ID of the subcourt to create the dispute in (first 32 bytes) and the minimum number of jurors required (next 32 bytes).", + "_numberOfChoices": "Number of choices to choose from in the dispute to be created." + }, + "returns": { + "disputeID": "The ID of the created dispute." + } + }, + "createSubcourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256)": { + "details": "Creates a subcourt under a specified parent court.", + "params": { + "_alpha": "The `alpha` property value of the subcourt.", + "_feeForJuror": "The `feeForJuror` property value of the subcourt.", + "_hiddenVotes": "The `hiddenVotes` property value of the subcourt.", + "_jurorsForCourtJump": "The `jurorsForCourtJump` property value of the subcourt.", + "_minStake": "The `minStake` property value of the subcourt.", + "_parent": "The `parent` property value of the subcourt.", + "_sortitionSumTreeK": "The number of children per node of the subcourt's sortition sum tree.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the subcourt." + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "ruling": "The current ruling." + } + }, + "executeDelayedSetStakes(uint256)": { + "details": "Executes the next delayed set stakes. `O(n)` where `n` is the number of iterations to run.", + "params": { + "_iterations": "The number of delayed set stakes to execute." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Lets the governor 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." + } + }, + "getDispute(uint256)": { + "details": "Gets a specified dispute's non primitive properties.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "penaltiesInEachRound": "The dispute's amount of tokens collected from penalties in each round. `O(a)` where `a` is the number of appeals of the dispute.", + "repartitionsInEachRound": "The dispute's counter of vote reward repartitions made in each round.", + "tokensAtStakePerJuror": "The dispute's required tokens at stake per Juror.", + "totalFeesForJurors": "The dispute's total fees for Jurors.", + "votesInEachRound": "The dispute's counter of votes made in each round.", + "votesLengths": "The dispute's vote length." + } + }, + "getJuror(address)": { + "details": "Gets a specified juror's non primitive properties.", + "params": { + "_account": "The address of the juror." + }, + "returns": { + "subcourtIDs": "The juror's IDs of subcourts where the juror has stake path." + } + }, + "getSubcourt(uint96)": { + "details": "Gets a specified subcourt's non primitive properties.", + "params": { + "_subcourtID": "The ID of the subcourt." + }, + "returns": { + "children": "The subcourt's child court list.", + "timesPerPeriod": "The subcourt's time per period." + } + }, + "getVote(uint256,uint256,uint256)": { + "details": "Gets a specified vote for a specified appeal in a specified dispute.", + "params": { + "_appeal": "The appeal.", + "_disputeID": "The ID of the dispute.", + "_voteID": "The ID of the vote." + }, + "returns": { + "account": "The account for vote.", + "choice": " The choice for vote.", + "commit": " The commit for vote.", + "voted": "True if the account voted, False otherwise." + } + }, + "getVoteCounter(uint256,uint256)": { + "details": "Gets the vote counter for a specified appeal in a specified dispute. Note: This function is only to be used by the interface and it won't work if the number of choices is too high.", + "params": { + "_appeal": "The appeal.", + "_disputeID": "The ID of the dispute." + }, + "returns": { + "counts": "The count.", + "tied": "Whether the vote tied. `O(n)` where `n` is the number of choices of the dispute.", + "winningChoice": "The winning choice." + } + }, + "initialize(address,address,address,uint256,uint256,bool,uint256[4],uint256[4],uint256,address,address)": { + "details": "Constructs the KlerosLiquid contract.", + "params": { + "_RNGenerator": "The address of the random number generator contract.", + "_courtParameters": "MinStake, alpha, feeForJuror and jurorsForCourtJump respectively.", + "_foreignGateway": "Foreign gateway on xDai.", + "_governor": "The governor's address.", + "_hiddenVotes": "The `hiddenVotes` property value of the general court.", + "_maxDrawingTime": "The maximum time that the drawing phase should last.", + "_minStakingTime": "The minimum time that the staking phase should last.", + "_pinakion": "The address of the token contract.", + "_sortitionSumTreeK": "The number of children per node of the general court's sortition sum tree.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the general court.", + "_weth": "Weth contract." + } + }, + "onApprove(address,address,uint256)": { + "details": "Notifies the controller about an approval allowing the controller to react if desired.", + "params": { + "_amount": "The amount in the `approve()` call.", + "_owner": "The address that calls `approve()`.", + "_spender": "The spender in the `approve()` call." + }, + "returns": { + "allowed": "Whether the operation should be allowed or not." + } + }, + "onTransfer(address,address,uint256)": { + "details": "Notifies the controller about a token transfer allowing the controller to react if desired.", + "params": { + "_amount": "The amount of the transfer.", + "_from": "The origin of the transfer.", + "_to": "The destination of the transfer." + }, + "returns": { + "allowed": "Whether the operation should be allowed or not." + } + }, + "proxyPayment(address)": { + "details": "DEPRECATED. Called when `_owner` sends ETH to the Wrapped Token contract.", + "params": { + "_owner": "The address that sent the ETH to create tokens." + }, + "returns": { + "allowed": "Whether the operation should be allowed or not." + } + }, + "rule(uint256,uint256)": { + "details": "Receive the ruling from foreign gateway which technically is an arbitrator of this contract.", + "params": { + "_disputeID": "ID of the dispute.", + "_ruling": "Ruling given by V2 court and relayed by foreign gateway." + } + }, + "setStake(uint96,uint128)": { + "details": "Sets the caller's stake in a subcourt.", + "params": { + "_stake": "The new stake.", + "_subcourtID": "The ID of the subcourt." + } + }, + "stakeOf(address,uint96)": { + "details": "Gets the stake of a specified juror in a specified subcourt.", + "params": { + "_account": "The address of the juror.", + "_subcourtID": "The ID of the subcourt." + }, + "returns": { + "stake": "The stake." + } + } + }, + "title": "xKlerosLiquidV2", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 245, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 248, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 21979, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "governor", + "offset": 2, + "slot": "0", + "type": "t_address" + }, + { + "astId": 21982, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "pinakion", + "offset": 0, + "slot": "1", + "type": "t_contract(WrappedPinakion)17931" + }, + { + "astId": 21985, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "RNGenerator", + "offset": 0, + "slot": "2", + "type": "t_contract(IRandomAuRa)17986" + }, + { + "astId": 21988, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "phase", + "offset": 20, + "slot": "2", + "type": "t_enum(Phase)21809" + }, + { + "astId": 21990, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "lastPhaseChange", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 21992, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "disputesWithoutJurors", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 21994, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "RNBlock", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 21996, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "RN", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 21998, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "minStakingTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 22000, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "maxDrawingTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 22002, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "lockInsolventTransfers", + "offset": 0, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 22006, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "courts", + "offset": 0, + "slot": "10", + "type": "t_array(t_struct(Court)21835_storage)dyn_storage" + }, + { + "astId": 22013, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "sortitionSumTrees", + "offset": 0, + "slot": "11", + "type": "t_struct(SortitionSumTrees)24297_storage" + }, + { + "astId": 22018, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "delayedSetStakes", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_uint256,t_struct(DelayedSetStake)21842_storage)" + }, + { + "astId": 22020, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "nextDelayedSetStake", + "offset": 0, + "slot": "13", + "type": "t_uint256" + }, + { + "astId": 22022, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "lastDelayedSetStake", + "offset": 0, + "slot": "14", + "type": "t_uint256" + }, + { + "astId": 22027, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "disputes", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_uint256,t_struct(Dispute)21903_storage)" + }, + { + "astId": 22029, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "totalDisputes", + "offset": 0, + "slot": "16", + "type": "t_uint256" + }, + { + "astId": 22034, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "jurors", + "offset": 0, + "slot": "17", + "type": "t_mapping(t_address,t_struct(Juror)21911_storage)" + }, + { + "astId": 22037, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "foreignGateway", + "offset": 0, + "slot": "18", + "type": "t_contract(IForeignGateway)15890" + }, + { + "astId": 22040, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "weth", + "offset": 0, + "slot": "19", + "type": "t_contract(IERC20)1072" + }, + { + "astId": 22044, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "disputesRuling", + "offset": 0, + "slot": "20", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_array(t_struct(Vote)21851_storage)dyn_storage)dyn_storage": { + "base": "t_array(t_struct(Vote)21851_storage)dyn_storage", + "encoding": "dynamic_array", + "label": "struct xKlerosLiquidV2.Vote[][]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Court)21835_storage)dyn_storage": { + "base": "t_struct(Court)21835_storage", + "encoding": "dynamic_array", + "label": "struct xKlerosLiquidV2.Court[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Vote)21851_storage)dyn_storage": { + "base": "t_struct(Vote)21851_storage", + "encoding": "dynamic_array", + "label": "struct xKlerosLiquidV2.Vote[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(VoteCounter)21860_storage)dyn_storage": { + "base": "t_struct(VoteCounter)21860_storage", + "encoding": "dynamic_array", + "label": "struct xKlerosLiquidV2.VoteCounter[]", + "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_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(IArbitrable)2790": { + "encoding": "inplace", + "label": "contract IArbitrable", + "numberOfBytes": "20" + }, + "t_contract(IERC20)1072": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IForeignGateway)15890": { + "encoding": "inplace", + "label": "contract IForeignGateway", + "numberOfBytes": "20" + }, + "t_contract(IRandomAuRa)17986": { + "encoding": "inplace", + "label": "contract IRandomAuRa", + "numberOfBytes": "20" + }, + "t_contract(WrappedPinakion)17931": { + "encoding": "inplace", + "label": "contract WrappedPinakion", + "numberOfBytes": "20" + }, + "t_enum(Period)21815": { + "encoding": "inplace", + "label": "enum xKlerosLiquidV2.Period", + "numberOfBytes": "1" + }, + "t_enum(Phase)21809": { + "encoding": "inplace", + "label": "enum xKlerosLiquidV2.Phase", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_struct(Juror)21911_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct xKlerosLiquidV2.Juror)", + "numberOfBytes": "32", + "value": "t_struct(Juror)21911_storage" + }, + "t_mapping(t_bytes32,t_struct(SortitionSumTree)24291_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct SortitionSumTreeFactory.SortitionSumTree)", + "numberOfBytes": "32", + "value": "t_struct(SortitionSumTree)24291_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(DelayedSetStake)21842_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct xKlerosLiquidV2.DelayedSetStake)", + "numberOfBytes": "32", + "value": "t_struct(DelayedSetStake)21842_storage" + }, + "t_mapping(t_uint256,t_struct(Dispute)21903_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct xKlerosLiquidV2.Dispute)", + "numberOfBytes": "32", + "value": "t_struct(Dispute)21903_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(Court)21835_storage": { + "encoding": "inplace", + "label": "struct xKlerosLiquidV2.Court", + "members": [ + { + "astId": 21817, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "parent", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 21820, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "children", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 21822, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "hiddenVotes", + "offset": 0, + "slot": "2", + "type": "t_bool" + }, + { + "astId": 21824, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "minStake", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 21826, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "alpha", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 21828, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "feeForJuror", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 21830, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "jurorsForCourtJump", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 21834, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "timesPerPeriod", + "offset": 0, + "slot": "7", + "type": "t_array(t_uint256)4_storage" + } + ], + "numberOfBytes": "352" + }, + "t_struct(DelayedSetStake)21842_storage": { + "encoding": "inplace", + "label": "struct xKlerosLiquidV2.DelayedSetStake", + "members": [ + { + "astId": 21837, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 21839, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "subcourtID", + "offset": 20, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 21841, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "stake", + "offset": 0, + "slot": "1", + "type": "t_uint128" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Dispute)21903_storage": { + "encoding": "inplace", + "label": "struct xKlerosLiquidV2.Dispute", + "members": [ + { + "astId": 21862, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "subcourtID", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 21865, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "arbitrated", + "offset": 12, + "slot": "0", + "type": "t_contract(IArbitrable)2790" + }, + { + "astId": 21867, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "numberOfChoices", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 21870, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "period", + "offset": 0, + "slot": "2", + "type": "t_enum(Period)21815" + }, + { + "astId": 21872, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "lastPeriodChange", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 21877, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "votes", + "offset": 0, + "slot": "4", + "type": "t_array(t_array(t_struct(Vote)21851_storage)dyn_storage)dyn_storage" + }, + { + "astId": 21881, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "voteCounters", + "offset": 0, + "slot": "5", + "type": "t_array(t_struct(VoteCounter)21860_storage)dyn_storage" + }, + { + "astId": 21884, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "tokensAtStakePerJuror", + "offset": 0, + "slot": "6", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 21887, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "totalFeesForJurors", + "offset": 0, + "slot": "7", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 21889, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "drawsInRound", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 21891, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "commitsInRound", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 21894, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "votesInEachRound", + "offset": 0, + "slot": "10", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 21897, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "repartitionsInEachRound", + "offset": 0, + "slot": "11", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 21900, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "penaltiesInEachRound", + "offset": 0, + "slot": "12", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 21902, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "ruled", + "offset": 0, + "slot": "13", + "type": "t_bool" + } + ], + "numberOfBytes": "448" + }, + "t_struct(Juror)21911_storage": { + "encoding": "inplace", + "label": "struct xKlerosLiquidV2.Juror", + "members": [ + { + "astId": 21906, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "subcourtIDs", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint96)dyn_storage" + }, + { + "astId": 21908, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "stakedTokens", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 21910, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "lockedTokens", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_struct(SortitionSumTree)24291_storage": { + "encoding": "inplace", + "label": "struct SortitionSumTreeFactory.SortitionSumTree", + "members": [ + { + "astId": 24276, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "K", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 24279, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "stack", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 24282, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "nodes", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 24286, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "IDsToNodeIndexes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 24290, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "nodeIndexesToIDs", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_bytes32)" + } + ], + "numberOfBytes": "160" + }, + "t_struct(SortitionSumTrees)24297_storage": { + "encoding": "inplace", + "label": "struct SortitionSumTreeFactory.SortitionSumTrees", + "members": [ + { + "astId": 24296, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "sortitionSumTrees", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)24291_storage)" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Vote)21851_storage": { + "encoding": "inplace", + "label": "struct xKlerosLiquidV2.Vote", + "members": [ + { + "astId": 21844, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 21846, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "commit", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 21848, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "choice", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 21850, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "voted", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_struct(VoteCounter)21860_storage": { + "encoding": "inplace", + "label": "struct xKlerosLiquidV2.VoteCounter", + "members": [ + { + "astId": 21853, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "winningChoice", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 21857, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "counts", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 21859, + "contract": "src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol:xKlerosLiquidV2", + "label": "tied", + "offset": 0, + "slot": "2", + "type": "t_bool" + } + ], + "numberOfBytes": "96" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/scripts/console-init-chiado.ts b/contracts/scripts/console-init-chiado.ts new file mode 100644 index 000000000..67e35177e --- /dev/null +++ b/contracts/scripts/console-init-chiado.ts @@ -0,0 +1,17 @@ +// .load scripts/console-init-chiado.ts +receiver = await ethers.getContract("FastBridgeReceiverOnGnosis"); +gateway = await ethers.getContract("ForeignGatewayOnGnosis"); +weth = await ethers.getContract("WETH"); +wethFaucet = await ethers.getContract("WETHFaucet"); +wpnk = await ethers.getContract("WrappedPinakion"); +wpnkFaucet = await ethers.getContract("WPNKFaucet"); +xKlerosLiquidV2 = await ethers.getContract("xKlerosLiquidV2"); +arbitrable = await ethers.getContract("ArbitrableExample"); +options = { + gasLimit: 10000000, + maxFeePerGas: ethers.utils.parseUnits("1", "gwei"), + maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"), +}; + +// dispute creation for 3 choices, 3 jurors +// await (await arbitrable.createDispute(3, "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", 0, options)).wait() diff --git a/contracts/scripts/console-init.ts b/contracts/scripts/console-init.ts index a3ac0ca90..460a4589e 100644 --- a/contracts/scripts/console-init.ts +++ b/contracts/scripts/console-init.ts @@ -1,7 +1,12 @@ +// .load scripts/console-init.ts core = await ethers.getContract("KlerosCore"); disputeKit = await ethers.getContract("DisputeKitClassic"); +pnk = await ethers.getContract("PNK"); +registry = await ethers.getContract("PolicyRegistry"); rng = await ethers.getContract("RandomizerRNG"); rng2 = await ethers.getContract("BlockHashRNG"); +gateway = await ethers.getContract("HomeGatewayToGnosis"); +sender = await ethers.getContract("FastBridgeSenderToGnosis"); options = { gasLimit: 10000000, gasPrice: 5000000000 }; console.log("core phase: %s", await core.phase()); diff --git a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol index 4b0925f26..d924beb54 100644 --- a/contracts/src/arbitration/arbitrables/ArbitrableExample.sol +++ b/contracts/src/arbitration/arbitrables/ArbitrableExample.sol @@ -73,7 +73,7 @@ contract ArbitrableExample is IArbitrable, IMetaEvidence { emit Ruling(IArbitrator(msg.sender), _externalDisputeID, dispute.ruling); } - function changedMetaEvidence(string memory _metaEvidence) external { + function changeMetaEvidence(string memory _metaEvidence) external { require(msg.sender == governor, "Not authorized: governor only."); emit MetaEvidence(++META_EVIDENCE_ID, _metaEvidence); } diff --git a/contracts/src/token/WrappedPinakion.sol b/contracts/src/token/WrappedPinakion.sol new file mode 100644 index 000000000..1ad85f2f4 --- /dev/null +++ b/contracts/src/token/WrappedPinakion.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract PNK is ERC20 { + constructor() ERC20("Staking PNK on xDai", "stPNK") { + _mint(msg.sender, 1000000 ether); + } +}