diff --git a/.vscode/settings.json b/.vscode/settings.json index e4f5e6c93..c7c428b2e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,7 @@ { "solidity.compileUsingRemoteVersion": "v0.8.10+commit.fc410830", - "mochaExplorer.files": "contracts/test/**/*.{j,t}s" + "mochaExplorer.files": "contracts/test/**/*.{j,t}s", + "cSpell.words": [ + "arbitrum" + ] } diff --git a/contracts/.env.example b/contracts/.env.example index 4783892df..a4309d099 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -1,4 +1,5 @@ PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 INFURA_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 +ARBISCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 REPORT_GAS=true \ No newline at end of file diff --git a/contracts/README.md b/contracts/README.md index f83648075..35e6df13c 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -4,14 +4,16 @@ Smart contracts for Kleros v2 ## Deployed Addresses -### Contract 1 +### Rinkeby -- Mainnet: ... -- Testnet: ... +- [FastBridgeReceiver](https://rinkeby.etherscan.io/address/0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB) +- [ForeignGateway](https://rinkeby.etherscan.io/address/0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE) -### Contract 2 +### Arbitrum Rinkeby -... +- [FastBridgeSender](https://testnet.arbiscan.io/address/0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3) +- [HomeGateway](https://testnet.arbiscan.io/address/0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB) +- [SafeBridgeArbitrum](https://testnet.arbiscan.io/address/0x014A442480DbAD767b7615E55E271799889FA1a7) ## Contributing @@ -59,19 +61,20 @@ cp .env.example .env The following env vars are required: -- `PRIVATE_KEY`: the private key of the deployer account used for xDAI, Sokol and Kovan. +- `PRIVATE_KEY`: the private key of the deployer account used for the testnets. - `MAINNET_PRIVATE_KEY`: the private key of the deployer account used for Mainnet. - `INFURA_API_KEY`: the API key for infura. The ones below are optional: -- `ETHERSCAN_API_KEY`: used only if you wish to verify the source of the newly deployed contracts on Etherscan. +- `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**. #### 1. Update the Constructor Parameters (optional) If some of the constructor parameters (such as the Meta Evidence) needs to change, you need to update the files in the `deploy/` directory. -#### 2. Deploy the Proxies +#### 2. Deploy to Public Testnets ```bash yarn deploy:staging # to deploy to L1/L2 testnet @@ -85,10 +88,6 @@ If you miss that, you can always go to the `deployments/` directory and This must be done for each network separately. -For `Mainnet` you can use the `etherscan-verify` command from `hardhat`: - ```bash -yarn hardhat --network mainnet etherscan-verify +yarn hardhat --network etherscan-verify ``` - -For `Arbitrum` the process currently must be done manually through [Arbiscan](https://arbiscan.io/verifyContract). diff --git a/contracts/deploy-helpers/getContractAddress.js b/contracts/deploy-helpers/getContractAddress.js new file mode 100644 index 000000000..f691bbd73 --- /dev/null +++ b/contracts/deploy-helpers/getContractAddress.js @@ -0,0 +1,14 @@ +const { BN, Address, toChecksumAddress } = require("ethereumjs-util"); + +/** + * Gets the address of a soon to be deployed contract. + * @param {string} deployer The address of the deployer account. + * @param {number|BN} nonce The current nonce for the deployer account. + * @return {string} The address of a contract if it is deployed in the next transaction sent by the deployer account. + */ +function getContractAddress(deployer, nonce) { + const deployAddress = Address.generate(Address.fromString(deployer), new BN(String(nonce))); + return toChecksumAddress(deployAddress.toString()); +} + +module.exports = getContractAddress; diff --git a/contracts/deploy/01-foreign-chain.ts b/contracts/deploy/01-foreign-chain.ts new file mode 100644 index 000000000..fb1dfa645 --- /dev/null +++ b/contracts/deploy/01-foreign-chain.ts @@ -0,0 +1,65 @@ +import { parseEther } from "ethers/lib/utils"; + +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; + +import getContractAddress from "../deploy-helpers/getContractAddress"; + +const FOREIGN_CHAIN_IDS = [1, 4]; +const paramsByChainId = { + 1: { + claimDeposit: parseEther("0.1"), + challengeDuration: 86400, // 1 day + homeChainId: 42161, + }, + 4: { + claimDeposit: parseEther("0.1"), + challengeDuration: 3600, // 1 hour + homeChainId: 421611, + }, +}; + +const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { ethers, deployments, getNamedAccounts, getChainId, config } = hre; + const { deploy } = deployments; + const { providers, constants } = ethers; + const { hexZeroPad } = hre.ethers.utils; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + const homeNetworks = { + 1: config.networks.arbitrum, + 4: config.networks.arbitrumRinkeby, + }; + const { url } = homeNetworks[chainId]; + const homeChainProvider = new providers.JsonRpcProvider(url); + const nonce = await homeChainProvider.getTransactionCount(deployer); + + const { claimDeposit, challengeDuration, homeChainId } = paramsByChainId[chainId]; + + // home Gateway deploy tx will the third tx after this on it's network, + // so we add two to the current nonce. + const homeGatewayAddress = getContractAddress(deployer, nonce + 2); + + const homeChainIdAsBytes32 = hexZeroPad(homeChainId, 32); + console.log(nonce + 2); + console.log(homeGatewayAddress); + + const fastBridgeReceiver = await deploy("FastBridgeReceiver", { + from: deployer, + args: [deployer, claimDeposit, challengeDuration], + log: true, + }); + + const foreignGateway = await deploy("ForeignGateway", { + from: deployer, + args: [deployer, fastBridgeReceiver.address, ["1000", "10000"], homeGatewayAddress, homeChainIdAsBytes32], + log: true, + }); +}; + +deployForeignGateway.tags = ["ForeignChain"]; +deployForeignGateway.skip = async ({ getChainId }) => !FOREIGN_CHAIN_IDS.includes(Number(await getChainId())); + +export default deployForeignGateway; diff --git a/contracts/deploy/02-home-chain.ts b/contracts/deploy/02-home-chain.ts new file mode 100644 index 000000000..855cf42dd --- /dev/null +++ b/contracts/deploy/02-home-chain.ts @@ -0,0 +1,60 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; + +import getContractAddress from "../deploy-helpers/getContractAddress"; + +const HOME_CHAIN_IDS = [42161, 421611]; +const paramsByChainId = { + 4: { + arbitrator: "0xab96e690f784b305942752a1fda42680e80f37a0", // SimplePermissionlessArbitrator + foreignChainId: 77, + }, + 42161: { + arbitrator: "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", // SimplePermissionlessArbitrator + foreignChainId: 1, + }, + 421611: { + arbitrator: "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", // SimplePermissionlessArbitrator + foreignChainId: 4, + }, +}; + +const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, getNamedAccounts, getChainId } = hre; + const { deploy, execute } = deployments; + const { hexZeroPad } = hre.ethers.utils; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + const { arbitrator, foreignChainId } = paramsByChainId[chainId]; + + const foreignGateway = await hre.companionNetworks.foreign.deployments.get("ForeignGateway"); + const fastBridgeReceiver = await hre.companionNetworks.foreign.deployments.get("FastBridgeReceiver"); + + const foreignChainIdAsBytes32 = hexZeroPad(foreignChainId, 32); + + const safeBridge = await deploy("SafeBridgeArbitrum", { + from: deployer, + log: true, + }); + + const fastBridgeSender = await deploy("FastBridgeSender", { + from: deployer, + args: [safeBridge.address, fastBridgeReceiver.address], + log: true, + }); + + const homeGateway = await deploy("HomeGateway", { + from: deployer, + args: [arbitrator, fastBridgeSender.address, foreignGateway.address, foreignChainIdAsBytes32], + log: true, + }); + + await execute("FastBridgeSender", { from: deployer, log: true }, "setFastSender", homeGateway.address); +}; + +deployHomeGateway.tags = ["HomeChain"]; +deployHomeGateway.skip = async ({ getChainId }) => !HOME_CHAIN_IDS.includes(Number(await getChainId())); + +export default deployHomeGateway; diff --git a/contracts/deployments/arbitrumRinkeby/.chainId b/contracts/deployments/arbitrumRinkeby/.chainId new file mode 100644 index 000000000..3bcb967de --- /dev/null +++ b/contracts/deployments/arbitrumRinkeby/.chainId @@ -0,0 +1 @@ +421611 \ No newline at end of file diff --git a/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json b/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json new file mode 100644 index 000000000..2d9f2cda3 --- /dev/null +++ b/contracts/deployments/arbitrumRinkeby/FastBridgeSender.json @@ -0,0 +1,239 @@ +{ + "address": "0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ISafeBridge", + "name": "_safebridge", + "type": "address" + }, + { + "internalType": "contract IFastBridgeReceiver", + "name": "_fastBridgeReceiver", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "OutgoingMessage", + "type": "event" + }, + { + "inputs": [], + "name": "fastBridgeReceiver", + "outputs": [ + { + "internalType": "contract IFastBridgeReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fastSender", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "safebridge", + "outputs": [ + { + "internalType": "contract ISafeBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "sendFast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "sendSafe", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_fastSender", + "type": "address" + } + ], + "name": "setFastSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x7be63ee825d6f802a688e5e8a46c989b36dc6593a9a2be2b4d7e7dbd5b762b15", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3", + "transactionIndex": 0, + "gasUsed": "3163693", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x03b9160800116d2856ee82fc4597d4088429b4fadfc53c69a72d78afb21b6b63", + "transactionHash": "0x7be63ee825d6f802a688e5e8a46c989b36dc6593a9a2be2b4d7e7dbd5b762b15", + "logs": [], + "blockNumber": 9350540, + "cumulativeGasUsed": "122173", + "status": 1, + "byzantium": true + }, + "args": [ + "0x014A442480DbAD767b7615E55E271799889FA1a7", + "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB" + ], + "numDeployments": 1, + "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISafeBridge\",\"name\":\"_safebridge\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastBridgeReceiver\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"OutgoingMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"fastBridgeReceiver\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastSender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safebridge\",\"outputs\":[{\"internalType\":\"contract ISafeBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"sendFast\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"sendSafe\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_fastSender\",\"type\":\"address\"}],\"name\":\"setFastSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"sendFast(address,bytes)\":{\"params\":{\"_calldata\":\"The receiving domain encoded message data.\",\"_receiver\":\"The L1 contract address who will receive the calldata\"}},\"sendSafe(address,bytes)\":{\"params\":{\"_calldata\":\"The receiving domain encoded message data.\",\"_receiver\":\"The L1 contract address who will receive the calldata\"}}},\"version\":1},\"userdoc\":{\"events\":{\"OutgoingMessage(address,bytes32,bytes)\":{\"notice\":\"The bridgers need to watch for these events and relay the messageHash on the FastBridgeReceiver.\"}},\"kind\":\"user\",\"methods\":{\"sendFast(address,bytes)\":{\"notice\":\"Sends an arbitrary message from one domain to another via the fast bridge mechanism\"},\"sendSafe(address,bytes)\":{\"notice\":\"Sends an arbitrary message from one domain to another via the safe bridge mechanism, which relies on the chain's native bridge. It is unnecessary during normal operations but essential only in case of challenge. It may require some ETH (or whichever native token) to pay for the bridging cost, depending on the underlying safe bridge.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridge/FastBridgeSender.sol\":\"FastBridgeSender\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/bridge/FastBridgeSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISafeBridge.sol\\\";\\nimport \\\"./interfaces/IFastBridgeSender.sol\\\";\\nimport \\\"./interfaces/IFastBridgeReceiver.sol\\\";\\n\\ncontract FastBridgeSender is IFastBridgeSender {\\n ISafeBridge public safebridge;\\n IFastBridgeReceiver public fastBridgeReceiver;\\n address public fastSender;\\n\\n /**\\n * The bridgers need to watch for these events and\\n * relay the messageHash on the FastBridgeReceiver.\\n */\\n event OutgoingMessage(address target, bytes32 messageHash, bytes message);\\n\\n constructor(ISafeBridge _safebridge, IFastBridgeReceiver _fastBridgeReceiver) {\\n safebridge = _safebridge;\\n fastBridgeReceiver = _fastBridgeReceiver;\\n }\\n\\n function setFastSender(address _fastSender) external {\\n require(fastSender == address(0));\\n fastSender = _fastSender;\\n }\\n\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the fast bridge mechanism\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The receiving domain encoded message data.\\n */\\n function sendFast(address _receiver, bytes memory _calldata) external {\\n require(msg.sender == fastSender, \\\"Access not allowed: Fast Sender only.\\\");\\n\\n // Encode the receiver address with the function signature + arguments i.e calldata\\n bytes memory encodedData = abi.encode(_receiver, _calldata);\\n\\n emit OutgoingMessage(_receiver, keccak256(encodedData), encodedData);\\n }\\n\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the safe bridge mechanism, which relies on the chain's native bridge.\\n *\\n * It is unnecessary during normal operations but essential only in case of challenge.\\n *\\n * It may require some ETH (or whichever native token) to pay for the bridging cost,\\n * depending on the underlying safe bridge.\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The receiving domain encoded message data.\\n */\\n function sendSafe(address _receiver, bytes memory _calldata) external payable {\\n // The safe bridge sends the encoded data to the FastBridgeReceiver\\n // in order for the FastBridgeReceiver to resolve any potential\\n // challenges and then forwards the message to the actual\\n // intended recipient encoded in `data`\\n // TODO: For this encodedData needs to be wrapped into an\\n // IFastBridgeReceiver function.\\n // TODO: add access checks for this on the FastBridgeReceiver.\\n // TODO: how much ETH should be provided for bridging? add an ISafeBridge.bridgingCost()\\n bytes memory encodedData = abi.encode(_receiver, _calldata);\\n safebridge.sendSafe{value: msg.value}(address(fastBridgeReceiver), encodedData);\\n }\\n}\\n\",\"keccak256\":\"0x38b58a84e65e83b015c2ff77333129656a759b803118870db9e2bc0a0453c3eb\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n function claim(bytes32 _messageHash) external payable;\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _calldata) external;\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external;\\n\\n function claimDeposit() external view returns (uint256 amount);\\n}\\n\",\"keccak256\":\"0x1d7f6a6ed2c2b88f51833cba6091c57a43af2915a265395ad11aad08b1f7285d\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeSender {\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the fast bridge mechanism\\n *\\n * TODO: probably needs some access control either on the sender side\\n * or the receiver side\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The receiving domain encoded message data.\\n */\\n function sendFast(address _receiver, bytes memory _calldata) external;\\n}\\n\",\"keccak256\":\"0xcbf3e9b5e153940b73ab5f09469eaf2fb24a1effac83c3786b27f785c325ff2e\",\"license\":\"MIT\"},\"src/bridge/interfaces/ISafeBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface ISafeBridge {\\n /**\\n * Sends an arbitrary message from one domain to another.\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The L2 encoded message data.\\n * @return Unique id to track the message request/transaction.\\n */\\n function sendSafe(address _receiver, bytes memory _calldata) external payable returns (uint256);\\n}\\n\",\"keccak256\":\"0x2e7ab23dc7721f51f3d115ea3a06c590869e8671ed824987756ab4bb224845d1\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516105b23803806105b283398101604081905261002f91610078565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100b2565b6001600160a01b038116811461007557600080fd5b50565b6000806040838503121561008b57600080fd5b825161009681610060565b60208401519092506100a781610060565b809150509250929050565b6104f1806100c16000396000f3fe6080604052600436106100555760003560e01c80630d85ec7e1461005a57806346c2cfee146100965780638f516b0d146100b857806398ec20ec146100d8578063be44ae1c146100f8578063d96a36ca1461010b575b600080fd5b34801561006657600080fd5b5060005461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b3480156100a257600080fd5b506100b66100b13660046102ff565b61012b565b005b3480156100c457600080fd5b5060025461007a906001600160a01b031681565b3480156100e457600080fd5b506100b66100f3366004610337565b610163565b6100b6610106366004610337565b61023c565b34801561011757600080fd5b5060015461007a906001600160a01b031681565b6002546001600160a01b03161561014157600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146101cf5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a20466173742053656e6465722060448201526437b7363c9760d91b606482015260840160405180910390fd5b600082826040516020016101e4929190610446565b60405160208183030381529060405290507f885ffc934437efa035b94d89742209ddef30dac81f0aadbb92d520cd54dc2d398382805190602001208360405161022f93929190610472565b60405180910390a1505050565b60008282604051602001610251929190610446565b60408051601f1981840301815290829052600054600154632f912b8760e21b84529193506001600160a01b039081169263be44ae1c92349261029a929116908690600401610446565b60206040518083038185885af11580156102b8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906102dd91906104a2565b50505050565b80356001600160a01b03811681146102fa57600080fd5b919050565b60006020828403121561031157600080fd5b61031a826102e3565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561034a57600080fd5b610353836102e3565b9150602083013567ffffffffffffffff8082111561037057600080fd5b818501915085601f83011261038457600080fd5b81358181111561039657610396610321565b604051601f8201601f19908116603f011681019083821181831017156103be576103be610321565b816040528281528860208487010111156103d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000815180845260005b8181101561041f57602081850181015186830182015201610403565b81811115610431576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061046a908301846103f9565b949350505050565b60018060a01b038416815282602082015260606040820152600061049960608301846103f9565b95945050505050565b6000602082840312156104b457600080fd5b505191905056fea264697066735822122027798849f47017ea415e2d49b22f4ac53ed207353ed98ef0272d1f23362730d864736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106100555760003560e01c80630d85ec7e1461005a57806346c2cfee146100965780638f516b0d146100b857806398ec20ec146100d8578063be44ae1c146100f8578063d96a36ca1461010b575b600080fd5b34801561006657600080fd5b5060005461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b3480156100a257600080fd5b506100b66100b13660046102ff565b61012b565b005b3480156100c457600080fd5b5060025461007a906001600160a01b031681565b3480156100e457600080fd5b506100b66100f3366004610337565b610163565b6100b6610106366004610337565b61023c565b34801561011757600080fd5b5060015461007a906001600160a01b031681565b6002546001600160a01b03161561014157600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146101cf5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a20466173742053656e6465722060448201526437b7363c9760d91b606482015260840160405180910390fd5b600082826040516020016101e4929190610446565b60405160208183030381529060405290507f885ffc934437efa035b94d89742209ddef30dac81f0aadbb92d520cd54dc2d398382805190602001208360405161022f93929190610472565b60405180910390a1505050565b60008282604051602001610251929190610446565b60408051601f1981840301815290829052600054600154632f912b8760e21b84529193506001600160a01b039081169263be44ae1c92349261029a929116908690600401610446565b60206040518083038185885af11580156102b8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906102dd91906104a2565b50505050565b80356001600160a01b03811681146102fa57600080fd5b919050565b60006020828403121561031157600080fd5b61031a826102e3565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561034a57600080fd5b610353836102e3565b9150602083013567ffffffffffffffff8082111561037057600080fd5b818501915085601f83011261038457600080fd5b81358181111561039657610396610321565b604051601f8201601f19908116603f011681019083821181831017156103be576103be610321565b816040528281528860208487010111156103d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000815180845260005b8181101561041f57602081850181015186830182015201610403565b81811115610431576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061046a908301846103f9565b949350505050565b60018060a01b038416815282602082015260606040820152600061049960608301846103f9565b95945050505050565b6000602082840312156104b457600080fd5b505191905056fea264697066735822122027798849f47017ea415e2d49b22f4ac53ed207353ed98ef0272d1f23362730d864736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "sendFast(address,bytes)": { + "params": { + "_calldata": "The receiving domain encoded message data.", + "_receiver": "The L1 contract address who will receive the calldata" + } + }, + "sendSafe(address,bytes)": { + "params": { + "_calldata": "The receiving domain encoded message data.", + "_receiver": "The L1 contract address who will receive the calldata" + } + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "OutgoingMessage(address,bytes32,bytes)": { + "notice": "The bridgers need to watch for these events and relay the messageHash on the FastBridgeReceiver." + } + }, + "kind": "user", + "methods": { + "sendFast(address,bytes)": { + "notice": "Sends an arbitrary message from one domain to another via the fast bridge mechanism" + }, + "sendSafe(address,bytes)": { + "notice": "Sends an arbitrary message from one domain to another via the safe bridge mechanism, which relies on the chain's native bridge. It is unnecessary during normal operations but essential only in case of challenge. It may require some ETH (or whichever native token) to pay for the bridging cost, depending on the underlying safe bridge." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7557, + "contract": "src/bridge/FastBridgeSender.sol:FastBridgeSender", + "label": "safebridge", + "offset": 0, + "slot": "0", + "type": "t_contract(ISafeBridge)7815" + }, + { + "astId": 7560, + "contract": "src/bridge/FastBridgeSender.sol:FastBridgeSender", + "label": "fastBridgeReceiver", + "offset": 0, + "slot": "1", + "type": "t_contract(IFastBridgeReceiver)7791" + }, + { + "astId": 7562, + "contract": "src/bridge/FastBridgeSender.sol:FastBridgeSender", + "label": "fastSender", + "offset": 0, + "slot": "2", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IFastBridgeReceiver)7791": { + "encoding": "inplace", + "label": "contract IFastBridgeReceiver", + "numberOfBytes": "20" + }, + "t_contract(ISafeBridge)7815": { + "encoding": "inplace", + "label": "contract ISafeBridge", + "numberOfBytes": "20" + } + } + } +} diff --git a/contracts/deployments/arbitrumRinkeby/HomeGateway.json b/contracts/deployments/arbitrumRinkeby/HomeGateway.json new file mode 100644 index 000000000..ac021cfda --- /dev/null +++ b/contracts/deployments/arbitrumRinkeby/HomeGateway.json @@ -0,0 +1,548 @@ +{ + "address": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "contract IFastBridgeSender", + "name": "_fastbridge", + "type": "address" + }, + { + "internalType": "address", + "name": "_foreignGateway", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_foreignChainID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + } + ], + "name": "Dispute", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_evidenceGroupID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_metaEvidenceID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "MetaEvidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrator", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitrator", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "chainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + } + ], + "name": "disputeHashToHomeID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "disputeHashtoID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "disputeHashtoRelayedData", + "outputs": [ + { + "internalType": "uint256", + "name": "arbitrationCost", + "type": "uint256" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeIDtoHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fastbridge", + "outputs": [ + { + "internalType": "contract IFastBridgeSender", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "foreignChainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "foreignGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_originalChainID", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_originalBlockHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_originalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "relayCreateDispute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xbb3ce0621f9a9de04f7784800125863a9c79f29985edb2da4a158809b423a000", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "transactionIndex": 0, + "gasUsed": "5322821", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000004000000000000000000000000020000000000000000000800000000000000000000000000000000000000000200000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000100000000000000000", + "blockHash": "0x0dfcd622a3f40345da51d8f4dac51483282ca97a6fe1a325a93f8059c5021b36", + "transactionHash": "0xbb3ce0621f9a9de04f7784800125863a9c79f29985edb2da4a158809b423a000", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 9350542, + "transactionHash": "0xbb3ce0621f9a9de04f7784800125863a9c79f29985edb2da4a158809b423a000", + "address": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "topics": [ + "0x61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064252494447450000000000000000000000000000000000000000000000000000", + "logIndex": 0, + "blockHash": "0x0dfcd622a3f40345da51d8f4dac51483282ca97a6fe1a325a93f8059c5021b36" + } + ], + "blockNumber": 9350542, + "cumulativeGasUsed": "289041", + "status": 1, + "byzantium": true + }, + "args": [ + "0x18c8a7ec7897177E4529065a7E7B0878358B3BfF", + "0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3", + "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "0x0000000000000000000000000000000000000000000000000000000000000004" + ], + "numDeployments": 1, + "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"_fastbridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_foreignGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_foreignChainID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"}],\"name\":\"Dispute\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_evidenceGroupID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"Evidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_metaEvidenceID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"MetaEvidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrator\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitrator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToHomeID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoRelayedData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"arbitrationCost\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastbridge\",\"outputs\":[{\"internalType\":\"contract IFastBridgeSender\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"foreignChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"foreignGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_originalChainID\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_originalBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_originalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"relayCreateDispute\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)\":{\"details\":\"Provide the same parameters as on the originalChain while creating a dispute. Providing incorrect parameters will create a different hash than on the originalChain and will not affect the actual dispute/arbitrable's ruling.\",\"params\":{\"_arbitrable\":\"arbitrable\",\"_choices\":\"number of ruling choices\",\"_extraData\":\"extraData\",\"_originalBlockHash\":\"originalBlockHash\",\"_originalChainID\":\"originalChainId\",\"_originalDisputeID\":\"originalDisputeID\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/HomeGateway.sol\":\"HomeGateway\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0xe63efdae904b4299c17efd4c6174869a49fbfe1b11ccfd05fcc22e735ced7b26\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeSender {\\n /**\\n * Sends an arbitrary message from one domain to another\\n * via the fast bridge mechanism\\n *\\n * TODO: probably needs some access control either on the sender side\\n * or the receiver side\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The receiving domain encoded message data.\\n */\\n function sendFast(address _receiver, bytes memory _calldata) external;\\n}\\n\",\"keccak256\":\"0xcbf3e9b5e153940b73ab5f09469eaf2fb24a1effac83c3786b27f785c325ff2e\",\"license\":\"MIT\"},\"src/evidence/IEvidence.sol\":{\"content\":\"pragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\n\\n/** @title IEvidence\\n * ERC-1497: Evidence Standard\\n */\\ninterface IEvidence {\\n /**\\n * @dev To be emitted when meta-evidence is submitted.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'\\n */\\n event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);\\n\\n /**\\n * @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.\\n * @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n * @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n */\\n event Evidence(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _evidenceGroupID,\\n address indexed _party,\\n string _evidence\\n );\\n\\n /**\\n * @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n * @param _arbitrator The arbitrator of the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _metaEvidenceID Unique identifier of meta-evidence.\\n * @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.\\n */\\n event Dispute(\\n IArbitrator indexed _arbitrator,\\n uint256 indexed _disputeID,\\n uint256 _metaEvidenceID,\\n uint256 _evidenceGroupID\\n );\\n}\\n\",\"keccak256\":\"0xc5f2cf95c0148aa1bddead4de02ccd8b7eaf7d5982163e7c05747cf9b3463dba\"},\"src/gateway/HomeGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrator.sol\\\";\\nimport \\\"../bridge/interfaces/IFastBridgeSender.sol\\\";\\n\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\nimport \\\"./interfaces/IHomeGateway.sol\\\";\\n\\ncontract HomeGateway is IHomeGateway {\\n mapping(uint256 => bytes32) public disputeIDtoHash;\\n mapping(bytes32 => uint256) public disputeHashtoID;\\n\\n IArbitrator public arbitrator;\\n IFastBridgeSender public fastbridge;\\n address public foreignGateway;\\n uint256 public chainID;\\n uint256 public foreignChainID;\\n\\n struct RelayedData {\\n uint256 arbitrationCost;\\n address relayer;\\n }\\n mapping(bytes32 => RelayedData) public disputeHashtoRelayedData;\\n\\n constructor(\\n IArbitrator _arbitrator,\\n IFastBridgeSender _fastbridge,\\n address _foreignGateway,\\n uint256 _foreignChainID\\n ) {\\n arbitrator = _arbitrator;\\n fastbridge = _fastbridge;\\n foreignGateway = _foreignGateway;\\n foreignChainID = _foreignChainID;\\n\\n assembly {\\n sstore(chainID.slot, chainid())\\n }\\n\\n emit MetaEvidence(0, \\\"BRIDGE\\\");\\n }\\n\\n /**\\n * @dev Provide the same parameters as on the originalChain while creating a\\n * dispute. Providing incorrect parameters will create a different hash\\n * than on the originalChain and will not affect the actual dispute/arbitrable's\\n * ruling.\\n *\\n * @param _originalChainID originalChainId\\n * @param _originalBlockHash originalBlockHash\\n * @param _originalDisputeID originalDisputeID\\n * @param _choices number of ruling choices\\n * @param _extraData extraData\\n * @param _arbitrable arbitrable\\n */\\n function relayCreateDispute(\\n uint256 _originalChainID,\\n bytes32 _originalBlockHash,\\n uint256 _originalDisputeID,\\n uint256 _choices,\\n bytes calldata _extraData,\\n address _arbitrable\\n ) external payable {\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n _originalChainID,\\n _originalBlockHash,\\n \\\"createDispute\\\",\\n _originalDisputeID,\\n _choices,\\n _extraData,\\n _arbitrable\\n )\\n );\\n RelayedData storage relayedData = disputeHashtoRelayedData[disputeHash];\\n require(relayedData.relayer == address(0), \\\"Dispute already relayed\\\");\\n\\n // TODO: will mostly be replaced by the actual arbitrationCost paid on the foreignChain.\\n relayedData.arbitrationCost = arbitrator.arbitrationCost(_extraData);\\n require(msg.value >= relayedData.arbitrationCost, \\\"Not enough arbitration cost paid\\\");\\n\\n uint256 disputeID = arbitrator.createDispute{value: msg.value}(_choices, _extraData);\\n disputeIDtoHash[disputeID] = disputeHash;\\n disputeHashtoID[disputeHash] = disputeID;\\n relayedData.relayer = msg.sender;\\n\\n emit Dispute(arbitrator, disputeID, 0, 0);\\n }\\n\\n function rule(uint256 _disputeID, uint256 _ruling) external {\\n require(msg.sender == address(arbitrator), \\\"Only Arbitrator\\\");\\n\\n bytes32 disputeHash = disputeIDtoHash[_disputeID];\\n RelayedData memory relayedData = disputeHashtoRelayedData[disputeHash];\\n\\n bytes4 methodSelector = IForeignGateway.relayRule.selector;\\n bytes memory data = abi.encodeWithSelector(methodSelector, disputeHash, _ruling, relayedData.relayer);\\n\\n fastbridge.sendFast(foreignGateway, data);\\n }\\n\\n function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256) {\\n return disputeHashtoID[_disputeHash];\\n }\\n}\\n\",\"keccak256\":\"0x838f448abaf4f9c8812ca0e4ffcd2acc1f475ef585b2287b61b0dec162dee775\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator {\\n function chainID() external view returns (uint256);\\n\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _forwarder\\n ) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function homeChainID() external view returns (uint256);\\n\\n function homeGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x9142bf9265b4399468f833c69e2f72896103e63f643ca186c9000424c2aa100a\",\"license\":\"MIT\"},\"src/gateway/interfaces/IHomeGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrable.sol\\\";\\nimport \\\"../../evidence/IEvidence.sol\\\";\\n\\ninterface IHomeGateway is IArbitrable, IEvidence {\\n function chainID() external view returns (uint256);\\n\\n function relayCreateDispute(\\n uint256 _originalChainID,\\n bytes32 _originalBlockHash,\\n uint256 _originalDisputeID,\\n uint256 _choices,\\n bytes calldata _extraData,\\n address _arbitrable\\n ) external payable;\\n\\n // For cross-chain Evidence standard\\n\\n function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function foreignChainID() external view returns (uint256);\\n\\n function foreignGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x38783b4e88382c2d87b0c5f5ac1b18450a5de41bf45b5299affaa9d6f952efb7\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516109df3803806109df83398101604081905261002f916100ea565b600280546001600160a01b038087166001600160a01b0319928316179092556003805486841690831617905560048054928516929091169190911790556006819055466005556040516000907f61606860eb6c87306811e2695215385101daab53bd6ab4e9f9049aead9363c7d906100c19060208082526006908201526542524944474560d01b604082015260600190565b60405180910390a25050505061013d565b6001600160a01b03811681146100e757600080fd5b50565b6000806000806080858703121561010057600080fd5b845161010b816100d2565b602086015190945061011c816100d2565b604086015190935061012d816100d2565b6060959095015193969295505050565b6108938061014c6000396000f3fe60806040526004361061009c5760003560e01c8063adc879e911610064578063adc879e914610157578063ba4bc7631461016d578063c95c09511461019a578063cddbfa14146101c7578063d1d559c514610221578063fc4ba3a21461024157600080fd5b8063311a6c56146100a15780633b103f53146100c35780636cc6cde1146100d65780638d7c7daa146101135780639688240314610133575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610616565b61026e565b005b6100c16100d1366004610654565b6103ac565b3480156100e257600080fd5b506002546100f6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011f57600080fd5b506004546100f6906001600160a01b031681565b34801561013f57600080fd5b5061014960065481565b60405190815260200161010a565b34801561016357600080fd5b5061014960055481565b34801561017957600080fd5b506101496101883660046106fe565b60006020819052908152604090205481565b3480156101a657600080fd5b506101496101b53660046106fe565b60016020526000908152604090205481565b3480156101d357600080fd5b506102046101e23660046106fe565b600760205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b0390911660208301520161010a565b34801561022d57600080fd5b506003546100f6906001600160a01b031681565b34801561024d57600080fd5b5061014961025c3660046106fe565b60009081526001602052604090205490565b6002546001600160a01b031633146102bf5760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b60008281526020818152604080832054808452600783529281902081518083018352815481526001909101546001600160a01b039081168285018190528351602481018790526044810188905260648082019290925284518082039092018252608401845293840180516001600160e01b0316633496987960e01b90811790915260035460048054955163263b083b60e21b8152949692959294918416936398ec20ec9361037293911691869101610717565b600060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b50505050505050505050565b6000878787878787876040516020016103cb979695949392919061077c565b60408051601f1981840301815291815281516020928301206000818152600790935291206001810154919250906001600160a01b03161561044e5760405162461bcd60e51b815260206004820152601760248201527f4469737075746520616c72656164792072656c6179656400000000000000000060448201526064016102b6565b60025460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906104809088908890600401610805565b602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610821565b8082553410156105135760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f7374207061696460448201526064016102b6565b60025460405163c13517e160e01b81526000916001600160a01b03169063c13517e190349061054a908b908b908b9060040161083a565b60206040518083038185885af1158015610568573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061058d9190610821565b6000818152602081815260408083208790558683526001808352818420859055860180546001600160a01b0319163317905560025481518481529283019390935292935083926001600160a01b03909216917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000806040838503121561062957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461064f57600080fd5b919050565b600080600080600080600060c0888a03121561066f57600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff808211156106a357600080fd5b818a0191508a601f8301126106b757600080fd5b8135818111156106c657600080fd5b8b60208285010111156106d857600080fd5b6020830195508094505050506106f060a08901610638565b905092959891949750929550565b60006020828403121561071057600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561075357858101830151858201606001528201610737565b81811115610765576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006108196020830184866107dc565b949350505050565b60006020828403121561083357600080fd5b5051919050565b8381526040602082015260006108546040830184866107dc565b9594505050505056fea2646970667358221220c32c57bb20a4d603adf4127081cc69fac6ffa5e780152402c401ddb12d7596da64736f6c634300080a0033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063adc879e911610064578063adc879e914610157578063ba4bc7631461016d578063c95c09511461019a578063cddbfa14146101c7578063d1d559c514610221578063fc4ba3a21461024157600080fd5b8063311a6c56146100a15780633b103f53146100c35780636cc6cde1146100d65780638d7c7daa146101135780639688240314610133575b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610616565b61026e565b005b6100c16100d1366004610654565b6103ac565b3480156100e257600080fd5b506002546100f6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011f57600080fd5b506004546100f6906001600160a01b031681565b34801561013f57600080fd5b5061014960065481565b60405190815260200161010a565b34801561016357600080fd5b5061014960055481565b34801561017957600080fd5b506101496101883660046106fe565b60006020819052908152604090205481565b3480156101a657600080fd5b506101496101b53660046106fe565b60016020526000908152604090205481565b3480156101d357600080fd5b506102046101e23660046106fe565b600760205260009081526040902080546001909101546001600160a01b031682565b604080519283526001600160a01b0390911660208301520161010a565b34801561022d57600080fd5b506003546100f6906001600160a01b031681565b34801561024d57600080fd5b5061014961025c3660046106fe565b60009081526001602052604090205490565b6002546001600160a01b031633146102bf5760405162461bcd60e51b815260206004820152600f60248201526e27b7363c9020b93134ba3930ba37b960891b60448201526064015b60405180910390fd5b60008281526020818152604080832054808452600783529281902081518083018352815481526001909101546001600160a01b039081168285018190528351602481018790526044810188905260648082019290925284518082039092018252608401845293840180516001600160e01b0316633496987960e01b90811790915260035460048054955163263b083b60e21b8152949692959294918416936398ec20ec9361037293911691869101610717565b600060405180830381600087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b50505050505050505050565b6000878787878787876040516020016103cb979695949392919061077c565b60408051601f1981840301815291815281516020928301206000818152600790935291206001810154919250906001600160a01b03161561044e5760405162461bcd60e51b815260206004820152601760248201527f4469737075746520616c72656164792072656c6179656400000000000000000060448201526064016102b6565b60025460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906104809088908890600401610805565b602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190610821565b8082553410156105135760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f756768206172626974726174696f6e20636f7374207061696460448201526064016102b6565b60025460405163c13517e160e01b81526000916001600160a01b03169063c13517e190349061054a908b908b908b9060040161083a565b60206040518083038185885af1158015610568573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061058d9190610821565b6000818152602081815260408083208790558683526001808352818420859055860180546001600160a01b0319163317905560025481518481529283019390935292935083926001600160a01b03909216917f74baab670a4015ab2f1b467c5252a96141a2573f2908e58a92081e80d3cfde3d910160405180910390a350505050505050505050565b6000806040838503121561062957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461064f57600080fd5b919050565b600080600080600080600060c0888a03121561066f57600080fd5b87359650602088013595506040880135945060608801359350608088013567ffffffffffffffff808211156106a357600080fd5b818a0191508a601f8301126106b757600080fd5b8135818111156106c657600080fd5b8b60208285010111156106d857600080fd5b6020830195508094505050506106f060a08901610638565b905092959891949750929550565b60006020828403121561071057600080fd5b5035919050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561075357858101830151858201606001528201610737565b81811115610765576000606083870101525b50601f01601f191692909201606001949350505050565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006108196020830184866107dc565b949350505050565b60006020828403121561083357600080fd5b5051919050565b8381526040602082015260006108546040830184866107dc565b9594505050505056fea2646970667358221220c32c57bb20a4d603adf4127081cc69fac6ffa5e780152402c401ddb12d7596da64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "relayCreateDispute(uint256,bytes32,uint256,uint256,bytes,address)": { + "details": "Provide the same parameters as on the originalChain while creating a dispute. Providing incorrect parameters will create a different hash than on the originalChain and will not affect the actual dispute/arbitrable's ruling.", + "params": { + "_arbitrable": "arbitrable", + "_choices": "number of ruling choices", + "_extraData": "extraData", + "_originalBlockHash": "originalBlockHash", + "_originalChainID": "originalChainId", + "_originalDisputeID": "originalDisputeID" + } + }, + "rule(uint256,uint256)": { + "details": "Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.", + "params": { + "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_ruling": "Ruling given by the arbitrator. Note that 0 is reserved for \"Not able/wanting to make a decision\"." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10351, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "disputeIDtoHash", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_uint256,t_bytes32)" + }, + { + "astId": 10355, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "disputeHashtoID", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 10358, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "arbitrator", + "offset": 0, + "slot": "2", + "type": "t_contract(IArbitrator)1296" + }, + { + "astId": 10361, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "fastbridge", + "offset": 0, + "slot": "3", + "type": "t_contract(IFastBridgeSender)7802" + }, + { + "astId": 10363, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "foreignGateway", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 10365, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "chainID", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 10367, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "foreignChainID", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 10377, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "disputeHashtoRelayedData", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_bytes32,t_struct(RelayedData)10372_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IArbitrator)1296": { + "encoding": "inplace", + "label": "contract IArbitrator", + "numberOfBytes": "20" + }, + "t_contract(IFastBridgeSender)7802": { + "encoding": "inplace", + "label": "contract IFastBridgeSender", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(RelayedData)10372_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct HomeGateway.RelayedData)", + "numberOfBytes": "32", + "value": "t_struct(RelayedData)10372_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)10372_storage": { + "encoding": "inplace", + "label": "struct HomeGateway.RelayedData", + "members": [ + { + "astId": 10369, + "contract": "src/gateway/HomeGateway.sol:HomeGateway", + "label": "arbitrationCost", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 10371, + "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/arbitrumRinkeby/SafeBridgeArbitrum.json b/contracts/deployments/arbitrumRinkeby/SafeBridgeArbitrum.json new file mode 100644 index 000000000..accc81e69 --- /dev/null +++ b/contracts/deployments/arbitrumRinkeby/SafeBridgeArbitrum.json @@ -0,0 +1,92 @@ +{ + "address": "0x014A442480DbAD767b7615E55E271799889FA1a7", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "withdrawalId", + "type": "uint256" + } + ], + "name": "L2ToL1TxCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "sendSafe", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x0b2bcf51bd6c17fe6fdc716f4d20f89abf4fe8a29ca690257e62c6330c204302", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x014A442480DbAD767b7615E55E271799889FA1a7", + "transactionIndex": 0, + "gasUsed": "1575442", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe30857ccd5a315a3e3273f904450468a8cb3076eff2b0926c133065ee7a4e183", + "transactionHash": "0x0b2bcf51bd6c17fe6fdc716f4d20f89abf4fe8a29ca690257e62c6330c204302", + "logs": [], + "blockNumber": 9350537, + "cumulativeGasUsed": "10062", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"withdrawalId\",\"type\":\"uint256\"}],\"name\":\"L2ToL1TxCreated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_calldata\",\"type\":\"bytes\"}],\"name\":\"sendSafe\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"sendSafe(address,bytes)\":{\"params\":{\"_calldata\":\"The L2 encoded message data.\",\"_receiver\":\"The L1 contract address who will receive the calldata\"},\"returns\":{\"_0\":\"Unique id to track the message request/transaction.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"sendSafe(address,bytes)\":{\"notice\":\"Sends an arbitrary message from one domain to another.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridge/SafeBridgeArbitrum.sol\":\"SafeBridgeArbitrum\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/bridge/SafeBridgeArbitrum.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/arbitrum/IArbSys.sol\\\";\\nimport \\\"./interfaces/arbitrum/AddressAliasHelper.sol\\\";\\n\\nimport \\\"./interfaces/ISafeBridge.sol\\\";\\n\\ncontract SafeBridgeArbitrum is ISafeBridge {\\n IArbSys constant arbsys = IArbSys(address(100));\\n\\n event L2ToL1TxCreated(uint256 indexed withdrawalId);\\n\\n function sendSafe(address _receiver, bytes memory _calldata) external payable override returns (uint256) {\\n uint256 withdrawalId = arbsys.sendTxToL1(_receiver, _calldata);\\n\\n emit L2ToL1TxCreated(withdrawalId);\\n return withdrawalId;\\n }\\n}\\n\",\"keccak256\":\"0x0079614dca40603a39d3f61fa9e31f0dbe267897b926774953c889a8c599e3fa\",\"license\":\"MIT\"},\"src/bridge/interfaces/ISafeBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface ISafeBridge {\\n /**\\n * Sends an arbitrary message from one domain to another.\\n *\\n * @param _receiver The L1 contract address who will receive the calldata\\n * @param _calldata The L2 encoded message data.\\n * @return Unique id to track the message request/transaction.\\n */\\n function sendSafe(address _receiver, bytes memory _calldata) external payable returns (uint256);\\n}\\n\",\"keccak256\":\"0x2e7ab23dc7721f51f3d115ea3a06c590869e8671ed824987756ab4bb224845d1\",\"license\":\"MIT\"},\"src/bridge/interfaces/arbitrum/AddressAliasHelper.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n\\n/*\\n * Copyright 2019-2021, Offchain Labs, Inc.\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n * http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n\\npragma solidity >=0.7.0;\\n\\nlibrary AddressAliasHelper {\\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\\n\\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\\n /// the inbox to the msg.sender viewed in the L2\\n /// @param l1Address the address in the L1 that triggered the tx to L2\\n /// @return l2Address L2 address as viewed in msg.sender\\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\\n l2Address = address(uint160(l1Address) + offset);\\n }\\n\\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\\n /// address in the L1 that submitted a tx to the inbox\\n /// @param l2Address L2 address as viewed in msg.sender\\n /// @return l1Address the address in the L1 that triggered the tx to L2\\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\\n l1Address = address(uint160(l2Address) - offset);\\n }\\n}\\n\",\"keccak256\":\"0xdd595bb9f30932cb16758f5f561b80a8fcfbf239e68319615c39441b2781a9cd\",\"license\":\"Apache-2.0\"},\"src/bridge/interfaces/arbitrum/IArbSys.sol\":{\"content\":\"pragma solidity >=0.7.0;\\n\\n/**\\n * @title Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. Exposes a variety of system-level functionality.\\n */\\ninterface IArbSys {\\n /**\\n * @notice Get internal version number identifying an ArbOS build\\n * @return version number as int\\n */\\n function arbOSVersion() external pure returns (uint256);\\n\\n /**\\n * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0)\\n * @return block number as int\\n */\\n function arbBlockNumber() external view returns (uint256);\\n\\n /**\\n * @notice Send given amount of Eth to dest from sender.\\n * This is a convenience function, which is equivalent to calling sendTxToL1 with empty calldataForL1.\\n * @param destination recipient address on L1\\n * @return unique identifier for this L2-to-L1 transaction.\\n */\\n function withdrawEth(address destination) external payable returns (uint256);\\n\\n /**\\n * @notice Send a transaction to L1\\n * @param destination recipient address on L1\\n * @param calldataForL1 (optional) calldata for L1 contract call\\n * @return a unique identifier for this L2-to-L1 transaction.\\n */\\n function sendTxToL1(address destination, bytes calldata calldataForL1) external payable returns (uint256);\\n\\n /**\\n * @notice get the number of transactions issued by the given external account or the account sequence number of the given contract\\n * @param account target account\\n * @return the number of transactions issued by the given external account or the account sequence number of the given contract\\n */\\n function getTransactionCount(address account) external view returns (uint256);\\n\\n /**\\n * @notice get the value of target L2 storage slot\\n * This function is only callable from address 0 to prevent contracts from being able to call it\\n * @param account target account\\n * @param index target index of storage slot\\n * @return stotage value for the given account at the given index\\n */\\n function getStorageAt(address account, uint256 index) external view returns (uint256);\\n\\n /**\\n * @notice check if current call is coming from l1\\n * @return true if the caller of this was called directly from L1\\n */\\n function isTopLevelCall() external view returns (bool);\\n\\n event EthWithdrawal(address indexed destAddr, uint256 amount);\\n\\n event L2ToL1Transaction(\\n address caller,\\n address indexed destination,\\n uint256 indexed uniqueId,\\n uint256 indexed batchNumber,\\n uint256 indexInBatch,\\n uint256 arbBlockNum,\\n uint256 ethBlockNum,\\n uint256 timestamp,\\n uint256 callvalue,\\n bytes data\\n );\\n}\\n\",\"keccak256\":\"0xb4607d26251273b1f9307a845295fcb982d729eb5b40efeadefb21795fad9370\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610285806100206000396000f3fe60806040526004361061001e5760003560e01c8063be44ae1c14610023575b600080fd5b610036610031366004610101565b610048565b60405190815260200160405180910390f35b6040516349460b4d60e11b8152600090819060649063928c169a9061007390879087906004016101d1565b6020604051808303816000875af1158015610092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b69190610236565b60405190915081907facd96f3817031b95eab52de9132d4a9dd13dac3d9dfcfe950ca9283c89b851a590600090a29392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561011457600080fd5b82356001600160a01b038116811461012b57600080fd5b9150602083013567ffffffffffffffff8082111561014857600080fd5b818501915085601f83011261015c57600080fd5b81358181111561016e5761016e6100eb565b604051601f8201601f19908116603f01168101908382118183101715610196576101966100eb565b816040528281528860208487010111156101af57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561020d578581018301518582016060015282016101f1565b8181111561021f576000606083870101525b50601f01601f191692909201606001949350505050565b60006020828403121561024857600080fd5b505191905056fea2646970667358221220691aeb3681b0b3a9b12bd40f31d52435b0fb90aeb41a724c79e99fdcc31d653c64736f6c634300080a0033", + "deployedBytecode": "0x60806040526004361061001e5760003560e01c8063be44ae1c14610023575b600080fd5b610036610031366004610101565b610048565b60405190815260200160405180910390f35b6040516349460b4d60e11b8152600090819060649063928c169a9061007390879087906004016101d1565b6020604051808303816000875af1158015610092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b69190610236565b60405190915081907facd96f3817031b95eab52de9132d4a9dd13dac3d9dfcfe950ca9283c89b851a590600090a29392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561011457600080fd5b82356001600160a01b038116811461012b57600080fd5b9150602083013567ffffffffffffffff8082111561014857600080fd5b818501915085601f83011261015c57600080fd5b81358181111561016e5761016e6100eb565b604051601f8201601f19908116603f01168101908382118183101715610196576101966100eb565b816040528281528860208487010111156101af57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561020d578581018301518582016060015282016101f1565b8181111561021f576000606083870101525b50601f01601f191692909201606001949350505050565b60006020828403121561024857600080fd5b505191905056fea2646970667358221220691aeb3681b0b3a9b12bd40f31d52435b0fb90aeb41a724c79e99fdcc31d653c64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "sendSafe(address,bytes)": { + "params": { + "_calldata": "The L2 encoded message data.", + "_receiver": "The L1 contract address who will receive the calldata" + }, + "returns": { + "_0": "Unique id to track the message request/transaction." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "sendSafe(address,bytes)": { + "notice": "Sends an arbitrary message from one domain to another." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/rinkeby/.chainId b/contracts/deployments/rinkeby/.chainId new file mode 100644 index 000000000..bf0d87ab1 --- /dev/null +++ b/contracts/deployments/rinkeby/.chainId @@ -0,0 +1 @@ +4 \ No newline at end of file diff --git a/contracts/deployments/rinkeby/FastBridgeReceiver.json b/contracts/deployments/rinkeby/FastBridgeReceiver.json new file mode 100644 index 000000000..fdfe1294f --- /dev/null +++ b/contracts/deployments/rinkeby/FastBridgeReceiver.json @@ -0,0 +1,335 @@ +{ + "address": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_claimDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_challengeDuration", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimedAt", + "type": "uint256" + } + ], + "name": "ClaimReceived", + "type": "event" + }, + { + "inputs": [], + "name": "challenge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "challengeDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "claimDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "address", + "name": "bridger", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimDeposit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "relayed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_challengeDuration", + "type": "uint256" + } + ], + "name": "setChallengePeriodDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_claimDeposit", + "type": "uint256" + } + ], + "name": "setClaimDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_encodedData", + "type": "bytes" + } + ], + "name": "verifyAndRelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + } + ], + "name": "withdrawClaimDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xcab257fdd573ac09f2c4f334398c75acc8b4b2aaf82027a36d2fd640def2d6ac", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "transactionIndex": 31, + "gasUsed": "667272", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x59c065fd6d66687c3e4432b2f0e67748b16bdd05c35155d23e171a790ef65c08", + "transactionHash": "0xcab257fdd573ac09f2c4f334398c75acc8b4b2aaf82027a36d2fd640def2d6ac", + "logs": [], + "blockNumber": 10134452, + "cumulativeGasUsed": "4060790", + "status": 1, + "byzantium": true + }, + "args": [ + "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "100000000000000000", + 3600 + ], + "numDeployments": 1, + "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_claimDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_challengeDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimedAt\",\"type\":\"uint256\"}],\"name\":\"ClaimReceived\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"challenge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"challengeDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"claims\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"bridger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"claimedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimDeposit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relayed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_challengeDuration\",\"type\":\"uint256\"}],\"name\":\"setChallengePeriodDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_claimDeposit\",\"type\":\"uint256\"}],\"name\":\"setClaimDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_encodedData\",\"type\":\"bytes\"}],\"name\":\"verifyAndRelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawClaimDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridge/FastBridgeReceiver.sol\":\"FastBridgeReceiver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/bridge/FastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/IFastBridgeReceiver.sol\\\";\\n\\ncontract FastBridgeReceiver is IFastBridgeReceiver {\\n address public governor;\\n uint256 public claimDeposit;\\n uint256 public challengeDuration;\\n\\n struct Claim {\\n address bridger;\\n uint256 claimedAt;\\n uint256 claimDeposit;\\n bool relayed;\\n }\\n\\n // messageHash => Claim\\n mapping(bytes32 => Claim) public claims;\\n\\n event ClaimReceived(bytes32 messageHash, uint256 claimedAt);\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(\\n address _governor,\\n uint256 _claimDeposit,\\n uint256 _challengeDuration\\n ) {\\n governor = _governor;\\n claimDeposit = _claimDeposit;\\n challengeDuration = _challengeDuration;\\n }\\n\\n function claim(bytes32 _messageHash) external payable {\\n require(msg.value >= claimDeposit, \\\"Not enough claim deposit\\\");\\n require(claims[_messageHash].bridger == address(0), \\\"Claimed already made\\\");\\n\\n claims[_messageHash] = Claim({\\n bridger: msg.sender,\\n claimedAt: block.timestamp,\\n claimDeposit: msg.value,\\n relayed: false\\n });\\n\\n emit ClaimReceived(_messageHash, block.timestamp);\\n }\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _encodedData) external {\\n require(keccak256(_encodedData) == _messageHash, \\\"Invalid hash\\\");\\n\\n Claim storage claim = claims[_messageHash];\\n require(claim.bridger != address(0), \\\"Claim does not exist\\\");\\n require(claim.claimedAt + challengeDuration < block.timestamp, \\\"Challenge period not over\\\");\\n require(claim.relayed == false, \\\"Message already relayed\\\");\\n\\n // Decode the receiver address from the data encoded by the IFastBridgeSender\\n (address receiver, bytes memory data) = abi.decode(_encodedData, (address, bytes));\\n (bool success, ) = address(receiver).call(data);\\n require(success, \\\"Failed to call contract\\\");\\n\\n claim.relayed = true;\\n }\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external {\\n Claim storage claim = claims[_messageHash];\\n require(claim.bridger != address(0), \\\"Claim does not exist\\\");\\n require(claim.claimedAt + challengeDuration < block.timestamp, \\\"Challenge period not over\\\");\\n\\n uint256 amount = claim.claimDeposit;\\n claim.claimDeposit = 0;\\n payable(claim.bridger).send(amount);\\n }\\n\\n function challenge() external {\\n revert(\\\"Not Implemented\\\");\\n }\\n\\n //**** Governor functions ****//\\n\\n function setClaimDeposit(uint256 _claimDeposit) external onlyByGovernor {\\n claimDeposit = _claimDeposit;\\n }\\n\\n function setChallengePeriodDuration(uint256 _challengeDuration) external onlyByGovernor {\\n challengeDuration = _challengeDuration;\\n }\\n}\\n\",\"keccak256\":\"0xf84287907e7101b142dddf2fd1b0357eb9d289a8dd7affbe9b7163238088cfc7\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n function claim(bytes32 _messageHash) external payable;\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _calldata) external;\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external;\\n\\n function claimDeposit() external view returns (uint256 amount);\\n}\\n\",\"keccak256\":\"0x1d7f6a6ed2c2b88f51833cba6091c57a43af2915a265395ad11aad08b1f7285d\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610a88380380610a8883398101604081905261002f9161005b565b600080546001600160a01b0319166001600160a01b03949094169390931790925560015560025561009e565b60008060006060848603121561007057600080fd5b83516001600160a01b038116811461008757600080fd5b602085015160409095015190969495509392505050565b6109db806100ad6000396000f3fe6080604052600436106100915760003560e01c8063bc43b86511610059578063bc43b8651461014f578063bd66528a1461016f578063d2ef739814610182578063ee32cceb14610197578063eff0f592146101b757600080fd5b80630c340a241461009657806323d631ac146100d3578063292f2e0e146100f557806329d07a51146101195780634458e6091461012f575b600080fd5b3480156100a257600080fd5b506000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100df57600080fd5b506100f36100ee366004610746565b610234565b005b34801561010157600080fd5b5061010b60025481565b6040519081526020016100ca565b34801561012557600080fd5b5061010b60015481565b34801561013b57600080fd5b506100f361014a366004610746565b61032b565b34801561015b57600080fd5b506100f361016a366004610746565b61035a565b6100f361017d366004610746565b610389565b34801561018e57600080fd5b506100f36104de565b3480156101a357600080fd5b506100f36101b23660046107ce565b610518565b3480156101c357600080fd5b506102086101d2366004610746565b600360208190526000918252604090912080546001820154600283015492909301546001600160a01b0390911692919060ff1684565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016100ca565b600081815260036020526040902080546001600160a01b03166102955760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b60448201526064015b60405180910390fd5b4260025482600101546102a89190610858565b106102f15760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600281018054600091829055825460405191926001600160a01b039091169183156108fc0291849190818181858888f15050505050505050565b6000546001600160a01b031633146103555760405162461bcd60e51b815260040161028c9061087e565b600255565b6000546001600160a01b031633146103845760405162461bcd60e51b815260040161028c9061087e565b600155565b6001543410156103db5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820636c61696d206465706f7369740000000000000000604482015260640161028c565b6000818152600360205260409020546001600160a01b0316156104375760405162461bcd60e51b8152602060048201526014602482015273436c61696d656420616c7265616479206d61646560601b604482015260640161028c565b6040805160808101825233815242602080830182815234848601908152600060608601818152888252600380865291889020965187546001600160a01b0319166001600160a01b03909116178755925160018701559051600286015590519301805460ff1916931515939093179092558251848152918201527f32899d160dbf80374e3a2eacfc04011027c1542248d33c4cd7b80d61176c0463910160405180910390a150565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd08125b5c1b195b595b9d1959608a1b604482015260640161028c565b80516020820120821461055c5760405162461bcd60e51b815260206004820152600c60248201526b092dcecc2d8d2c840d0c2e6d60a31b604482015260640161028c565b600082815260036020526040902080546001600160a01b03166105b85760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161028c565b4260025482600101546105cb9190610858565b106106145760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600381015460ff16156106695760405162461bcd60e51b815260206004820152601760248201527f4d65737361676520616c72656164792072656c61796564000000000000000000604482015260640161028c565b6000808380602001905181019061068091906108f0565b915091506000826001600160a01b03168260405161069e9190610989565b6000604051808303816000865af19150503d80600081146106db576040519150601f19603f3d011682016040523d82523d6000602084013e6106e0565b606091505b50509050806107315760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f2063616c6c20636f6e7472616374000000000000000000604482015260640161028c565b505050600301805460ff191660011790555050565b60006020828403121561075857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561079e5761079e61075f565b604052919050565b600067ffffffffffffffff8211156107c0576107c061075f565b50601f01601f191660200190565b600080604083850312156107e157600080fd5b82359150602083013567ffffffffffffffff8111156107ff57600080fd5b8301601f8101851361081057600080fd5b803561082361081e826107a6565b610775565b81815286602083850101111561083857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000821982111561087957634e487b7160e01b600052601160045260246000fd5b500190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60005b838110156108db5781810151838201526020016108c3565b838111156108ea576000848401525b50505050565b6000806040838503121561090357600080fd5b82516001600160a01b038116811461091a57600080fd5b602084015190925067ffffffffffffffff81111561093757600080fd5b8301601f8101851361094857600080fd5b805161095661081e826107a6565b81815286602083850101111561096b57600080fd5b61097c8260208301602086016108c0565b8093505050509250929050565b6000825161099b8184602087016108c0565b919091019291505056fea2646970667358221220b68116d29aea33bc3a2cc26b85b6677740b9b028cfa86a109ebbcb6b98615f7c64736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106100915760003560e01c8063bc43b86511610059578063bc43b8651461014f578063bd66528a1461016f578063d2ef739814610182578063ee32cceb14610197578063eff0f592146101b757600080fd5b80630c340a241461009657806323d631ac146100d3578063292f2e0e146100f557806329d07a51146101195780634458e6091461012f575b600080fd5b3480156100a257600080fd5b506000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100df57600080fd5b506100f36100ee366004610746565b610234565b005b34801561010157600080fd5b5061010b60025481565b6040519081526020016100ca565b34801561012557600080fd5b5061010b60015481565b34801561013b57600080fd5b506100f361014a366004610746565b61032b565b34801561015b57600080fd5b506100f361016a366004610746565b61035a565b6100f361017d366004610746565b610389565b34801561018e57600080fd5b506100f36104de565b3480156101a357600080fd5b506100f36101b23660046107ce565b610518565b3480156101c357600080fd5b506102086101d2366004610746565b600360208190526000918252604090912080546001820154600283015492909301546001600160a01b0390911692919060ff1684565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016100ca565b600081815260036020526040902080546001600160a01b03166102955760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b60448201526064015b60405180910390fd5b4260025482600101546102a89190610858565b106102f15760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600281018054600091829055825460405191926001600160a01b039091169183156108fc0291849190818181858888f15050505050505050565b6000546001600160a01b031633146103555760405162461bcd60e51b815260040161028c9061087e565b600255565b6000546001600160a01b031633146103845760405162461bcd60e51b815260040161028c9061087e565b600155565b6001543410156103db5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820636c61696d206465706f7369740000000000000000604482015260640161028c565b6000818152600360205260409020546001600160a01b0316156104375760405162461bcd60e51b8152602060048201526014602482015273436c61696d656420616c7265616479206d61646560601b604482015260640161028c565b6040805160808101825233815242602080830182815234848601908152600060608601818152888252600380865291889020965187546001600160a01b0319166001600160a01b03909116178755925160018701559051600286015590519301805460ff1916931515939093179092558251848152918201527f32899d160dbf80374e3a2eacfc04011027c1542248d33c4cd7b80d61176c0463910160405180910390a150565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd08125b5c1b195b595b9d1959608a1b604482015260640161028c565b80516020820120821461055c5760405162461bcd60e51b815260206004820152600c60248201526b092dcecc2d8d2c840d0c2e6d60a31b604482015260640161028c565b600082815260036020526040902080546001600160a01b03166105b85760405162461bcd60e51b815260206004820152601460248201527310db185a5b48191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161028c565b4260025482600101546105cb9190610858565b106106145760405162461bcd60e51b815260206004820152601960248201527821b430b63632b733b2903832b934b7b2103737ba1037bb32b960391b604482015260640161028c565b600381015460ff16156106695760405162461bcd60e51b815260206004820152601760248201527f4d65737361676520616c72656164792072656c61796564000000000000000000604482015260640161028c565b6000808380602001905181019061068091906108f0565b915091506000826001600160a01b03168260405161069e9190610989565b6000604051808303816000865af19150503d80600081146106db576040519150601f19603f3d011682016040523d82523d6000602084013e6106e0565b606091505b50509050806107315760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f2063616c6c20636f6e7472616374000000000000000000604482015260640161028c565b505050600301805460ff191660011790555050565b60006020828403121561075857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561079e5761079e61075f565b604052919050565b600067ffffffffffffffff8211156107c0576107c061075f565b50601f01601f191660200190565b600080604083850312156107e157600080fd5b82359150602083013567ffffffffffffffff8111156107ff57600080fd5b8301601f8101851361081057600080fd5b803561082361081e826107a6565b610775565b81815286602083850101111561083857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000821982111561087957634e487b7160e01b600052601160045260246000fd5b500190565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60005b838110156108db5781810151838201526020016108c3565b838111156108ea576000848401525b50505050565b6000806040838503121561090357600080fd5b82516001600160a01b038116811461091a57600080fd5b602084015190925067ffffffffffffffff81111561093757600080fd5b8301601f8101851361094857600080fd5b805161095661081e826107a6565b81815286602083850101111561096b57600080fd5b61097c8260208301602086016108c0565b8093505050509250929050565b6000825161099b8184602087016108c0565b919091019291505056fea2646970667358221220b68116d29aea33bc3a2cc26b85b6677740b9b028cfa86a109ebbcb6b98615f7c64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7265, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7267, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "claimDeposit", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 7269, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "challengeDuration", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 7283, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "claims", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_struct(Claim)7278_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_mapping(t_bytes32,t_struct(Claim)7278_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct FastBridgeReceiver.Claim)", + "numberOfBytes": "32", + "value": "t_struct(Claim)7278_storage" + }, + "t_struct(Claim)7278_storage": { + "encoding": "inplace", + "label": "struct FastBridgeReceiver.Claim", + "members": [ + { + "astId": 7271, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "bridger", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7273, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "claimedAt", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 7275, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "claimDeposit", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 7277, + "contract": "src/bridge/FastBridgeReceiver.sol:FastBridgeReceiver", + "label": "relayed", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/rinkeby/ForeignGateway.json b/contracts/deployments/rinkeby/ForeignGateway.json new file mode 100644 index 000000000..5fad5af66 --- /dev/null +++ b/contracts/deployments/rinkeby/ForeignGateway.json @@ -0,0 +1,563 @@ +{ + "address": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IFastBridgeReceiver", + "name": "_fastbridge", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_feeForJuror", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "_homeGateway", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_homeChainID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrable", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "disputeHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "blockhash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "localDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "arbitrable", + "type": "address" + } + ], + "name": "OutgoingDispute", + "type": "event" + }, + { + "inputs": [], + "name": "MIN_JURORS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "chainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_subcourtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + } + ], + "name": "changeSubcourtJurorFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_choices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + } + ], + "name": "disputeHashToForeignID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "disputeHashtoDisputeData", + "outputs": [ + { + "internalType": "uint248", + "name": "id", + "type": "uint248" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "address", + "name": "arbitrable", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fastbridge", + "outputs": [ + { + "internalType": "contract IFastBridgeReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "homeChainID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "homeGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_relayer", + "type": "address" + } + ], + "name": "relayRule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_disputeHash", + "type": "bytes32" + } + ], + "name": "withdrawFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x5a2014cb8fef4f14edd808cdd3782a028b51f3af87e1f2ea878c33997a20418a", + "receipt": { + "to": null, + "from": "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "contractAddress": "0x8F1a2B8F9b04320375856580Fc6B1669Cb12a9EE", + "transactionIndex": 22, + "gasUsed": "946391", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x26b5e2f437445438c874788e475f518cf560ed094fb2059c3ed7ea0f38c83185", + "transactionHash": "0x5a2014cb8fef4f14edd808cdd3782a028b51f3af87e1f2ea878c33997a20418a", + "logs": [], + "blockNumber": 10134453, + "cumulativeGasUsed": "3329468", + "status": 1, + "byzantium": true + }, + "args": [ + "0xF50E77f2A2B6138D16c6c7511562E5C33c4B15A3", + "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + [ + "1000", + "10000" + ], + "0x300CbF0829762FeDc90287D08aeDf261EE6ED8eB", + "0x0000000000000000000000000000000000000000000000000000000000066eeb" + ], + "numDeployments": 1, + "solcInputHash": "9627b78546d73cee66a2022d221ca6c9", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"_fastbridge\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"_feeForJuror\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"_homeGateway\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_homeChainID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrable\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"disputeHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockhash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"localDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"}],\"name\":\"OutgoingDispute\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_JURORS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_subcourtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"}],\"name\":\"changeSubcourtJurorFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_choices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"disputeHashToForeignID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"disputeHashtoDisputeData\",\"outputs\":[{\"internalType\":\"uint248\",\"name\":\"id\",\"type\":\"uint248\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"arbitrable\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fastbridge\",\"outputs\":[{\"internalType\":\"contract IFastBridgeReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"homeChainID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"homeGateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"}],\"name\":\"relayRule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_disputeHash\",\"type\":\"bytes32\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"cost\":\"Required cost of arbitration.\"}},\"changeSubcourtJurorFee(uint96,uint256)\":{\"details\":\"Changes the `feeForJuror` property value of a specified subcourt.\",\"params\":{\"_feeForJuror\":\"The new value for the `feeForJuror` property value.\",\"_subcourtID\":\"The ID of the subcourt.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_choices\":\"Amount of choices the arbitrator can make in this dispute.\",\"_extraData\":\"Can be used to give additional info on the dispute to be created.\"},\"returns\":{\"disputeID\":\"ID of the dispute created.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"relayRule(bytes32,uint256,address)\":{\"notice\":\"Relay the rule call from the home gateway to the arbitrable.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/gateway/ForeignGateway.sol\":\"ForeignGateway\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/arbitration/IArbitrable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrator.sol\\\";\\n\\n/**\\n * @title IArbitrable\\n * Arbitrable interface. Note that this interface follows the ERC-792 standard.\\n * When developing arbitrable contracts, we need to:\\n * - Define the action taken when a ruling is received by the contract.\\n * - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\n */\\ninterface IArbitrable {\\n /**\\n * @dev To be raised when a ruling is given.\\n * @param _arbitrator The arbitrator giving the ruling.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling The ruling which was given.\\n */\\n event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /**\\n * @dev Give a ruling for a dispute. Must be called by the arbitrator.\\n * The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n * @param _disputeID ID of the dispute in the Arbitrator contract.\\n * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n */\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x8f1c36f6206566f0790448a654190e68a43a1dd2e039c2b77e7455d3fcd599a4\",\"license\":\"MIT\"},\"src/arbitration/IArbitrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8;\\n\\nimport \\\"./IArbitrable.sol\\\";\\n\\n/**\\n * @title Arbitrator\\n * Arbitrator interface that implements the new arbitration standard.\\n * Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.\\n * When developing arbitrator contracts we need to:\\n * - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n * - Define the functions for cost display (arbitrationCost).\\n * - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\n */\\ninterface IArbitrator {\\n /**\\n * @dev To be emitted when a dispute is created.\\n * @param _disputeID ID of the dispute.\\n * @param _arbitrable The contract which created the dispute.\\n */\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrable indexed _arbitrable);\\n\\n /**\\n * @dev Create a dispute. Must be called by the arbitrable contract.\\n * Must pay at least arbitrationCost(_extraData).\\n * @param _choices Amount of choices the arbitrator can make in this dispute.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return disputeID ID of the dispute created.\\n */\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID);\\n\\n /**\\n * @dev Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n * @param _extraData Can be used to give additional info on the dispute to be created.\\n * @return cost Required cost of arbitration.\\n */\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n}\\n\",\"keccak256\":\"0xe63efdae904b4299c17efd4c6174869a49fbfe1b11ccfd05fcc22e735ced7b26\",\"license\":\"MIT\"},\"src/bridge/interfaces/IFastBridgeReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IFastBridgeReceiver {\\n function claim(bytes32 _messageHash) external payable;\\n\\n function verifyAndRelay(bytes32 _messageHash, bytes memory _calldata) external;\\n\\n function withdrawClaimDeposit(bytes32 _messageHash) external;\\n\\n function claimDeposit() external view returns (uint256 amount);\\n}\\n\",\"keccak256\":\"0x1d7f6a6ed2c2b88f51833cba6091c57a43af2915a265395ad11aad08b1f7285d\",\"license\":\"MIT\"},\"src/gateway/ForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @authors: [@shalzz]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../arbitration/IArbitrable.sol\\\";\\nimport \\\"../bridge/interfaces/IFastBridgeReceiver.sol\\\";\\n\\nimport \\\"./interfaces/IForeignGateway.sol\\\";\\n\\ncontract ForeignGateway is IForeignGateway {\\n // The global default minimum number of jurors in a dispute.\\n uint256 public constant MIN_JURORS = 3;\\n\\n // @dev Note the disputeID needs to start from one as\\n // the KlerosV1 proxy governor depends on this implementation.\\n // We now also depend on localDisputeID not being zero\\n // at any point.\\n uint256 internal localDisputeID = 1;\\n\\n // feeForJuror by subcourtID\\n uint256[] internal feeForJuror;\\n uint256 public chainID;\\n uint256 public homeChainID;\\n\\n struct DisputeData {\\n uint248 id;\\n bool ruled;\\n address arbitrable;\\n uint256 paid;\\n address relayer;\\n }\\n mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;\\n\\n address public governor;\\n IFastBridgeReceiver public fastbridge;\\n address public homeGateway;\\n\\n event OutgoingDispute(\\n bytes32 disputeHash,\\n bytes32 blockhash,\\n uint256 localDisputeID,\\n uint256 _choices,\\n bytes _extraData,\\n address arbitrable\\n );\\n\\n modifier onlyFromFastBridge() {\\n require(address(fastbridge) == msg.sender, \\\"Access not allowed: Fast Bridge only.\\\");\\n _;\\n }\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n constructor(\\n address _governor,\\n IFastBridgeReceiver _fastbridge,\\n uint256[] memory _feeForJuror,\\n address _homeGateway,\\n uint256 _homeChainID\\n ) {\\n governor = _governor;\\n fastbridge = _fastbridge;\\n feeForJuror = _feeForJuror;\\n homeGateway = _homeGateway;\\n homeChainID = _homeChainID;\\n\\n assembly {\\n sstore(chainID.slot, chainid())\\n }\\n }\\n\\n /** @dev Changes the `feeForJuror` property value of a specified subcourt.\\n * @param _subcourtID The ID of the subcourt.\\n * @param _feeForJuror The new value for the `feeForJuror` property value.\\n */\\n function changeSubcourtJurorFee(uint96 _subcourtID, uint256 _feeForJuror) external onlyByGovernor {\\n feeForJuror[_subcourtID] = _feeForJuror;\\n }\\n\\n function createDispute(uint256 _choices, bytes calldata _extraData) external payable returns (uint256 disputeID) {\\n require(msg.value >= arbitrationCost(_extraData), \\\"Not paid enough for arbitration\\\");\\n\\n (uint96 subcourtID, ) = extraDataToSubcourtIDMinJurors(_extraData);\\n uint256 nbVotes = msg.value / feeForJuror[subcourtID];\\n\\n disputeID = localDisputeID++;\\n bytes32 disputeHash = keccak256(\\n abi.encodePacked(\\n chainID,\\n blockhash(block.number - 1),\\n \\\"createDispute\\\",\\n disputeID,\\n _choices,\\n _extraData,\\n msg.sender\\n // TODO: actual arbitration Cost\\n // nbVotes * feeForJuror[subcourtID] // we calculate the min amount required for nbVotes\\n )\\n );\\n\\n disputeHashtoDisputeData[disputeHash] = DisputeData({\\n id: uint248(disputeID),\\n arbitrable: msg.sender,\\n paid: msg.value,\\n relayer: address(0),\\n ruled: false\\n });\\n\\n emit OutgoingDispute(disputeHash, blockhash(block.number - 1), disputeID, _choices, _extraData, msg.sender);\\n emit DisputeCreation(disputeID, IArbitrable(msg.sender));\\n }\\n\\n function arbitrationCost(bytes calldata _extraData) public view returns (uint256 cost) {\\n (uint96 subcourtID, uint256 minJurors) = extraDataToSubcourtIDMinJurors(_extraData);\\n\\n cost = feeForJuror[subcourtID] * minJurors;\\n }\\n\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _relayer\\n ) external onlyFromFastBridge {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(!dispute.ruled, \\\"Cannot rule twice\\\");\\n\\n dispute.ruled = true;\\n dispute.relayer = _relayer;\\n\\n IArbitrable arbitrable = IArbitrable(dispute.arbitrable);\\n arbitrable.rule(dispute.id, _ruling);\\n }\\n\\n function withdrawFees(bytes32 _disputeHash) external {\\n DisputeData storage dispute = disputeHashtoDisputeData[_disputeHash];\\n require(dispute.id != 0, \\\"Dispute does not exist\\\");\\n require(dispute.ruled, \\\"Not ruled yet\\\");\\n\\n uint256 amount = dispute.paid;\\n dispute.paid = 0;\\n payable(dispute.relayer).transfer(amount);\\n }\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256) {\\n return disputeHashtoDisputeData[_disputeHash].id;\\n }\\n\\n function extraDataToSubcourtIDMinJurors(bytes memory _extraData)\\n internal\\n view\\n returns (uint96 subcourtID, uint256 minJurors)\\n {\\n // Note that here we ignore DisputeKitID\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n subcourtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n }\\n if (subcourtID >= feeForJuror.length) subcourtID = 0;\\n if (minJurors == 0) minJurors = MIN_JURORS;\\n } else {\\n subcourtID = 0;\\n minJurors = MIN_JURORS;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce68be8c82fe08b2b9f0361f549b4f022140209a22d66ab0c3f86b8062940c82\",\"license\":\"MIT\"},\"src/gateway/interfaces/IForeignGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../arbitration/IArbitrator.sol\\\";\\n\\ninterface IForeignGateway is IArbitrator {\\n function chainID() external view returns (uint256);\\n\\n /**\\n * Relay the rule call from the home gateway to the arbitrable.\\n */\\n function relayRule(\\n bytes32 _disputeHash,\\n uint256 _ruling,\\n address _forwarder\\n ) external;\\n\\n function withdrawFees(bytes32 _disputeHash) external;\\n\\n // For cross-chain Evidence standard\\n\\n function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);\\n\\n function homeChainID() external view returns (uint256);\\n\\n function homeGateway() external view returns (address);\\n}\\n\",\"keccak256\":\"0x9142bf9265b4399468f833c69e2f72896103e63f643ca186c9000424c2aa100a\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260016000553480156200001657600080fd5b5060405162000ed238038062000ed2833981016040819052620000399162000158565b600580546001600160a01b038088166001600160a01b031992831617909255600680549287169290911691909117905582516200007e906001906020860190620000b0565b50600780546001600160a01b0319166001600160a01b039390931692909217909155600355505046600255506200026c565b828054828255906000526020600020908101928215620000ee579160200282015b82811115620000ee578251825591602001919060010190620000d1565b50620000fc92915062000100565b5090565b5b80821115620000fc576000815560010162000101565b6001600160a01b03811681146200012d57600080fd5b50565b80516200013d8162000117565b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156200017157600080fd5b85516200017e8162000117565b80955050602080870151620001938162000117565b60408801519095506001600160401b0380821115620001b157600080fd5b818901915089601f830112620001c657600080fd5b815181811115620001db57620001db62000142565b8060051b604051601f19603f8301168101818110858211171562000203576200020362000142565b60405291825284820192508381018501918c8311156200022257600080fd5b938501935b82851015620002425784518452938501939285019262000227565b809850505050505050620002596060870162000130565b9150608086015190509295509295909350565b610c56806200027c6000396000f3fe6080604052600436106100c25760003560e01c8063adc879e91161007f578063d3c617ff11610059578063d3c617ff14610209578063eaff425a146102ab578063ebb71194146102c0578063f7434ea9146102e057600080fd5b8063adc879e9146101c0578063c13517e1146101d6578063d1d559c5146101e957600080fd5b80630c340a24146100c75780631fc6b556146101045780632e1db89014610128578063349698791461015e5780634d53c2a51461018057806359354c77146101a0575b600080fd5b3480156100d357600080fd5b506005546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011057600080fd5b5061011a60035481565b6040519081526020016100fb565b34801561013457600080fd5b5061011a610143366004610956565b6000908152600460205260409020546001600160f81b031690565b34801561016a57600080fd5b5061017e61017936600461096f565b610300565b005b34801561018c57600080fd5b506007546100e7906001600160a01b031681565b3480156101ac57600080fd5b5061017e6101bb3660046109b4565b6104b7565b3480156101cc57600080fd5b5061011a60025481565b61011a6101e4366004610a35565b610549565b3480156101f557600080fd5b506006546100e7906001600160a01b031681565b34801561021557600080fd5b5061026d610224366004610956565b60046020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a0016100fb565b3480156102b757600080fd5b5061011a600381565b3480156102cc57600080fd5b5061017e6102db366004610956565b610795565b3480156102ec57600080fd5b5061011a6102fb366004610a81565b61088a565b6006546001600160a01b0316331461036d5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b60648201526084015b60405180910390fd5b600083815260046020526040902080546001600160f81b03166103cb5760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff16156104185760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610364565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561049857600080fd5b505af11580156104ac573d6000803e3d6000fd5b505050505050505050565b6005546001600160a01b0316331461051c5760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610364565b806001836001600160601b03168154811061053957610539610ac3565b6000918252602090912001555050565b6000610555838361088a565b3410156105a45760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610364565b60006105e584848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b50905060006001826001600160601b03168154811061060657610606610ac3565b90600052602060002001543461061c9190610aef565b600080549192508061062d83610b11565b91905055925060006002546001436106459190610b2c565b4085898989336040516020016106619796959493929190610b43565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038089168552600085840181815233878701908152346060890190815260808901848152868552600490975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d88699824690829061073d9043610b2c565b40868a8a8a336040516107569796959493929190610ba3565b60405180910390a1604051339085907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050509392505050565b600081815260046020526040902080546001600160f81b03166107f35760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff1661083b5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610364565b600281018054600091829055600383015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015610884573d6000803e3d6000fd5b50505050565b60008060006108ce85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b91509150806001836001600160601b0316815481106108ef576108ef610ac3565b90600052602060002001546109049190610c01565b95945050505050565b600080604083511061094a575050602081015160408201516001546001600160601b0383161061093c57600091505b80610945575060035b915091565b50600090506003915091565b60006020828403121561096857600080fd5b5035919050565b60008060006060848603121561098457600080fd5b833592506020840135915060408401356001600160a01b03811681146109a957600080fd5b809150509250925092565b600080604083850312156109c757600080fd5b82356001600160601b03811681146109de57600080fd5b946020939093013593505050565b60008083601f8401126109fe57600080fd5b50813567ffffffffffffffff811115610a1657600080fd5b602083019150836020828501011115610a2e57600080fd5b9250929050565b600080600060408486031215610a4a57600080fd5b83359250602084013567ffffffffffffffff811115610a6857600080fd5b610a74868287016109ec565b9497909650939450505050565b60008060208385031215610a9457600080fd5b823567ffffffffffffffff811115610aab57600080fd5b610ab7858286016109ec565b90969095509350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082610b0c57634e487b7160e01b600052601260045260246000fd5b500490565b6000600019821415610b2557610b25610ad9565b5060010190565b600082821015610b3e57610b3e610ad9565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b6000816000190483118215151615610c1b57610c1b610ad9565b50029056fea264697066735822122030062d64f772d29638f563564e2f95fd618feffca8f904764e78cd95f09c137c64736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106100c25760003560e01c8063adc879e91161007f578063d3c617ff11610059578063d3c617ff14610209578063eaff425a146102ab578063ebb71194146102c0578063f7434ea9146102e057600080fd5b8063adc879e9146101c0578063c13517e1146101d6578063d1d559c5146101e957600080fd5b80630c340a24146100c75780631fc6b556146101045780632e1db89014610128578063349698791461015e5780634d53c2a51461018057806359354c77146101a0575b600080fd5b3480156100d357600080fd5b506005546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011057600080fd5b5061011a60035481565b6040519081526020016100fb565b34801561013457600080fd5b5061011a610143366004610956565b6000908152600460205260409020546001600160f81b031690565b34801561016a57600080fd5b5061017e61017936600461096f565b610300565b005b34801561018c57600080fd5b506007546100e7906001600160a01b031681565b3480156101ac57600080fd5b5061017e6101bb3660046109b4565b6104b7565b3480156101cc57600080fd5b5061011a60025481565b61011a6101e4366004610a35565b610549565b3480156101f557600080fd5b506006546100e7906001600160a01b031681565b34801561021557600080fd5b5061026d610224366004610956565b60046020526000908152604090208054600182015460028301546003909301546001600160f81b03831693600160f81b90930460ff16926001600160a01b039283169290911685565b604080516001600160f81b03909616865293151560208601526001600160a01b0392831693850193909352606084015216608082015260a0016100fb565b3480156102b757600080fd5b5061011a600381565b3480156102cc57600080fd5b5061017e6102db366004610956565b610795565b3480156102ec57600080fd5b5061011a6102fb366004610a81565b61088a565b6006546001600160a01b0316331461036d5760405162461bcd60e51b815260206004820152602560248201527f416363657373206e6f7420616c6c6f7765643a2046617374204272696467652060448201526437b7363c9760d91b60648201526084015b60405180910390fd5b600083815260046020526040902080546001600160f81b03166103cb5760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff16156104185760405162461bcd60e51b815260206004820152601160248201527043616e6e6f742072756c6520747769636560781b6044820152606401610364565b80546001600160f81b0316600160f81b811782556003820180546001600160a01b038581166001600160a01b031990921691909117909155600183015460405163188d362b60e11b81526004810193909352602483018690521690819063311a6c5690604401600060405180830381600087803b15801561049857600080fd5b505af11580156104ac573d6000803e3d6000fd5b505050505050505050565b6005546001600160a01b0316331461051c5760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610364565b806001836001600160601b03168154811061053957610539610ac3565b6000918252602090912001555050565b6000610555838361088a565b3410156105a45760405162461bcd60e51b815260206004820152601f60248201527f4e6f74207061696420656e6f75676820666f72206172626974726174696f6e006044820152606401610364565b60006105e584848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b50905060006001826001600160601b03168154811061060657610606610ac3565b90600052602060002001543461061c9190610aef565b600080549192508061062d83610b11565b91905055925060006002546001436106459190610b2c565b4085898989336040516020016106619796959493929190610b43565b60408051601f19818403018152828252805160209182012060a0840183526001600160f81b038089168552600085840181815233878701908152346060890190815260808901848152868552600490975296909220965190511515600160f81b02921691909117855551600185810180546001600160a01b039384166001600160a01b031991821617909155945160028701559251600390950180549590911694909316939093179091559091507f0d14de2c628befa6eb7dc5c0b952832c96822914f589200f72acb5d88699824690829061073d9043610b2c565b40868a8a8a336040516107569796959493929190610ba3565b60405180910390a1604051339085907f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a35050509392505050565b600081815260046020526040902080546001600160f81b03166107f35760405162461bcd60e51b8152602060048201526016602482015275111a5cdc1d5d1948191bd95cc81b9bdd08195e1a5cdd60521b6044820152606401610364565b8054600160f81b900460ff1661083b5760405162461bcd60e51b815260206004820152600d60248201526c139bdd081c9d5b1959081e595d609a1b6044820152606401610364565b600281018054600091829055600383015460405191926001600160a01b039091169183156108fc0291849190818181858888f19350505050158015610884573d6000803e3d6000fd5b50505050565b60008060006108ce85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090d92505050565b91509150806001836001600160601b0316815481106108ef576108ef610ac3565b90600052602060002001546109049190610c01565b95945050505050565b600080604083511061094a575050602081015160408201516001546001600160601b0383161061093c57600091505b80610945575060035b915091565b50600090506003915091565b60006020828403121561096857600080fd5b5035919050565b60008060006060848603121561098457600080fd5b833592506020840135915060408401356001600160a01b03811681146109a957600080fd5b809150509250925092565b600080604083850312156109c757600080fd5b82356001600160601b03811681146109de57600080fd5b946020939093013593505050565b60008083601f8401126109fe57600080fd5b50813567ffffffffffffffff811115610a1657600080fd5b602083019150836020828501011115610a2e57600080fd5b9250929050565b600080600060408486031215610a4a57600080fd5b83359250602084013567ffffffffffffffff811115610a6857600080fd5b610a74868287016109ec565b9497909650939450505050565b60008060208385031215610a9457600080fd5b823567ffffffffffffffff811115610aab57600080fd5b610ab7858286016109ec565b90969095509350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082610b0c57634e487b7160e01b600052601260045260246000fd5b500490565b6000600019821415610b2557610b25610ad9565b5060010190565b600082821015610b3e57610b3e610ad9565b500390565b8781528660208201526c6372656174654469737075746560981b604082015285604d82015284606d8201528284608d83013760609190911b6bffffffffffffffffffffffff1916608d919092019081019190915260a10195945050505050565b87815286602082015285604082015284606082015260c060808201528260c0820152828460e0830137600081840160e0908101919091526001600160a01b039290921660a0820152601f909201601f19169091010195945050505050565b6000816000190483118215151615610c1b57610c1b610ad9565b50029056fea264697066735822122030062d64f772d29638f563564e2f95fd618feffca8f904764e78cd95f09c137c64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "arbitrationCost(bytes)": { + "details": "Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Can be used to give additional info on the dispute to be created." + }, + "returns": { + "cost": "Required cost of arbitration." + } + }, + "changeSubcourtJurorFee(uint96,uint256)": { + "details": "Changes the `feeForJuror` property value of a specified subcourt.", + "params": { + "_feeForJuror": "The new value for the `feeForJuror` property value.", + "_subcourtID": "The ID of the subcourt." + } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_choices": "Amount of choices the arbitrator can make in this dispute.", + "_extraData": "Can be used to give additional info on the dispute to be created." + }, + "returns": { + "disputeID": "ID of the dispute created." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "relayRule(bytes32,uint256,address)": { + "notice": "Relay the rule call from the home gateway to the arbitrable." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 9919, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "localDisputeID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 9922, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "feeForJuror", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 9924, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "chainID", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9926, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "homeChainID", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 9942, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "disputeHashtoDisputeData", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_bytes32,t_struct(DisputeData)9937_storage)" + }, + { + "astId": 9944, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "governor", + "offset": 0, + "slot": "5", + "type": "t_address" + }, + { + "astId": 9947, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "fastbridge", + "offset": 0, + "slot": "6", + "type": "t_contract(IFastBridgeReceiver)7791" + }, + { + "astId": 9949, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "homeGateway", + "offset": 0, + "slot": "7", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IFastBridgeReceiver)7791": { + "encoding": "inplace", + "label": "contract IFastBridgeReceiver", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_struct(DisputeData)9937_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct ForeignGateway.DisputeData)", + "numberOfBytes": "32", + "value": "t_struct(DisputeData)9937_storage" + }, + "t_struct(DisputeData)9937_storage": { + "encoding": "inplace", + "label": "struct ForeignGateway.DisputeData", + "members": [ + { + "astId": 9928, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint248" + }, + { + "astId": 9930, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "ruled", + "offset": 31, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 9932, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "arbitrable", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 9934, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "label": "paid", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9936, + "contract": "src/gateway/ForeignGateway.sol:ForeignGateway", + "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" + } + } + } +} diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 14cf7cbf6..8e3bc4734 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -1,7 +1,6 @@ import * as dotenv from "dotenv"; import { HardhatUserConfig, task } from "hardhat/config"; -import "@nomiclabs/hardhat-etherscan"; import "@nomiclabs/hardhat-waffle"; import "@typechain/hardhat"; import "hardhat-gas-reporter"; @@ -65,6 +64,15 @@ const config: HardhatUserConfig = { live: true, saveDeployments: true, tags: ["staging", "home", "layer2"], + companionNetworks: { + foreign: "rinkeby", + }, + verify: { + etherscan: { + apiKey: process.env.ARBISCAN_API_KEY, + apiUrl: "https://api-testnet.arbiscan.io/api", + }, + }, }, arbitrum: { chainId: 42161, @@ -73,6 +81,15 @@ const config: HardhatUserConfig = { live: true, saveDeployments: true, tags: ["production", "home", "layer2"], + companionNetworks: { + foreign: "mainnet", + }, + verify: { + etherscan: { + apiKey: process.env.ARBISCAN_API_KEY, + apiUrl: "https://api.arbiscan.io/api", + }, + }, }, // Foreign chain --------------------------------------------------------------------------------- rinkeby: { @@ -82,6 +99,9 @@ const config: HardhatUserConfig = { live: true, saveDeployments: true, tags: ["staging", "foreign", "layer1"], + companionNetworks: { + home: "arbitrumRinkeby", + }, }, kovan: { chainId: 42, @@ -98,13 +118,13 @@ const config: HardhatUserConfig = { live: true, saveDeployments: true, tags: ["production", "foreign", "layer1"], + companionNetworks: { + home: "arbitrum", + }, }, }, namedAccounts: { - homeDeployer: { - default: 0, - }, - foreignDeployer: { + deployer: { default: 0, }, }, @@ -112,9 +132,6 @@ const config: HardhatUserConfig = { enabled: process.env.REPORT_GAS !== undefined, currency: "USD", }, - etherscan: { - apiKey: process.env.ETHERSCAN_API_KEY, - }, watcher: { compilation: { tasks: ["compile"], diff --git a/contracts/package.json b/contracts/package.json index 0ddd309af..bd7486d97 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -14,13 +14,13 @@ "build": "hardhat compile", "clean": "hardhat clean", "deploy": "hardhat deploy", + "deploy:staging": "run-s \"deploy --network rinkeby {@}\" \"deploy --network arbitrumRinkeby {@}\" --", "test": "hardhat test", "watch": "hardhat watch", "docgen": "hardhat docgen" }, "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.2", - "@nomiclabs/hardhat-etherscan": "^2.1.7", "@nomiclabs/hardhat-waffle": "^2.0.1", "@openzeppelin/contracts": "^4.4.1", "@typechain/ethers-v5": "^7.2.0", @@ -37,13 +37,14 @@ "ethers": "^5.5.1", "follow-redirects": "^1.14.7", "hardhat": "^2.6.8", - "hardhat-deploy": "^0.9.6", + "hardhat-deploy": "^0.10.4", "hardhat-deploy-ethers": "^0.3.0-beta.11", "hardhat-docgen": "^1.2.1", "hardhat-gas-reporter": "^1.0.4", "hardhat-watcher": "^2.1.1", "json-schema": "^0.4.0", "mocha": "^9.1.3", + "npm-run-all": "^4.1.5", "shelljs": "0.8.5", "solhint": "^3.3.6", "solidity-coverage": "^0.7.17", diff --git a/contracts/scripts/generateDeploymentsMarkdown.sh b/contracts/scripts/generateDeploymentsMarkdown.sh new file mode 100755 index 000000000..cea83ceb3 --- /dev/null +++ b/contracts/scripts/generateDeploymentsMarkdown.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +function generate() { #deploymentDir #explorerUrl + deploymentDir=$1 + explorerUrl=$2 + for f in $(ls -1 $deploymentDir/*.json); do + contractName=$(basename $f .json) + address=$(cat $f | jq -r .address) + echo "- [$contractName]($explorerUrl$address)" + done +} + +echo Rinkeby +generate "$SCRIPT_DIR/../deployments/rinkeby" "https://rinkeby.etherscan.io/address/" +echo +echo Arbitrum Rinkeby +generate "$SCRIPT_DIR/../deployments/arbitrumRinkeby" "https://testnet.arbiscan.io/address/" \ No newline at end of file diff --git a/contracts/src/bridge/FastBridgeSender.sol b/contracts/src/bridge/FastBridgeSender.sol index afc655ab0..3d855a357 100644 --- a/contracts/src/bridge/FastBridgeSender.sol +++ b/contracts/src/bridge/FastBridgeSender.sol @@ -25,13 +25,13 @@ contract FastBridgeSender is IFastBridgeSender { */ event OutgoingMessage(address target, bytes32 messageHash, bytes message); - constructor( - ISafeBridge _safebridge, - IFastBridgeReceiver _fastBridgeReceiver, - address _fastSender - ) { + constructor(ISafeBridge _safebridge, IFastBridgeReceiver _fastBridgeReceiver) { safebridge = _safebridge; fastBridgeReceiver = _fastBridgeReceiver; + } + + function setFastSender(address _fastSender) external { + require(fastSender == address(0)); fastSender = _fastSender; } diff --git a/contracts/tsconfig.json b/contracts/tsconfig.json index 465683b5c..89fda3d84 100644 --- a/contracts/tsconfig.json +++ b/contracts/tsconfig.json @@ -13,7 +13,8 @@ "./src", "./scripts", "./test", - "./typechain" + "./typechain", + "./deploy" ], "files": [ "./hardhat.config.ts" diff --git a/yarn.lock b/yarn.lock index 644127904..0e1458a4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -620,7 +620,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/address@npm:5.5.0, @ethersproject/address@npm:>=5.0.0-beta.128, @ethersproject/address@npm:^5.0.2, @ethersproject/address@npm:^5.0.4, @ethersproject/address@npm:^5.4.0, @ethersproject/address@npm:^5.5.0": +"@ethersproject/address@npm:5.5.0, @ethersproject/address@npm:>=5.0.0-beta.128, @ethersproject/address@npm:^5.0.4, @ethersproject/address@npm:^5.4.0, @ethersproject/address@npm:^5.5.0": version: 5.5.0 resolution: "@ethersproject/address@npm:5.5.0" dependencies: @@ -1012,7 +1012,6 @@ __metadata: resolution: "@kleros/kleros-v2-contracts@workspace:contracts" dependencies: "@nomiclabs/hardhat-ethers": ^2.0.2 - "@nomiclabs/hardhat-etherscan": ^2.1.7 "@nomiclabs/hardhat-waffle": ^2.0.1 "@openzeppelin/contracts": ^4.4.1 "@typechain/ethers-v5": ^7.2.0 @@ -1029,13 +1028,14 @@ __metadata: ethers: ^5.5.1 follow-redirects: ^1.14.7 hardhat: ^2.6.8 - hardhat-deploy: ^0.9.6 + hardhat-deploy: ^0.10.4 hardhat-deploy-ethers: ^0.3.0-beta.11 hardhat-docgen: ^1.2.1 hardhat-gas-reporter: ^1.0.4 hardhat-watcher: ^2.1.1 json-schema: ^0.4.0 mocha: ^9.1.3 + npm-run-all: ^4.1.5 shelljs: 0.8.5 solhint: ^3.3.6 solidity-coverage: ^0.7.17 @@ -1082,23 +1082,6 @@ __metadata: languageName: node linkType: hard -"@nomiclabs/hardhat-etherscan@npm:^2.1.7": - version: 2.1.8 - resolution: "@nomiclabs/hardhat-etherscan@npm:2.1.8" - dependencies: - "@ethersproject/abi": ^5.1.2 - "@ethersproject/address": ^5.0.2 - cbor: ^5.0.2 - debug: ^4.1.1 - fs-extra: ^7.0.1 - node-fetch: ^2.6.0 - semver: ^6.3.0 - peerDependencies: - hardhat: ^2.0.4 - checksum: 99a4c97908198a63b3cf68c330599e117a41ffe7e1aa5314eb6e915dd95a5fa677581c79a8b59c088b2d2e090465c95857f24cec9a9e47f0fc20c43119107cdd - languageName: node - linkType: hard - "@nomiclabs/hardhat-waffle@npm:^2.0.1": version: 2.0.2 resolution: "@nomiclabs/hardhat-waffle@npm:2.0.2" @@ -3507,7 +3490,7 @@ __metadata: languageName: node linkType: hard -"bignumber.js@npm:^9.0.0, bignumber.js@npm:^9.0.1": +"bignumber.js@npm:^9.0.0": version: 9.0.2 resolution: "bignumber.js@npm:9.0.2" checksum: 8637b71d0a99104b20413c47578953970006fec6b4df796b9dcfd9835ea9c402ea0e727eba9a5ca9f9a393c1d88b6168c5bbe0887598b708d4f8b4870ad62e1f @@ -4016,16 +3999,6 @@ __metadata: languageName: node linkType: hard -"cbor@npm:^5.0.2": - version: 5.2.0 - resolution: "cbor@npm:5.2.0" - dependencies: - bignumber.js: ^9.0.1 - nofilter: ^1.0.4 - checksum: b3c39dae64370f361526dbec88f51d0f1b47027224cdd21dbd64c228f0fe7eaa945932d349ec5324068a6c6dcdbb1e3b46242852524fd53c526d14cb60514bdc - languageName: node - linkType: hard - "chai@npm:^4.3.4": version: 4.3.4 resolution: "chai@npm:4.3.4" @@ -8060,9 +8033,9 @@ __metadata: languageName: node linkType: hard -"hardhat-deploy@npm:^0.9.6": - version: 0.9.28 - resolution: "hardhat-deploy@npm:0.9.28" +"hardhat-deploy@npm:^0.10.4": + version: 0.10.4 + resolution: "hardhat-deploy@npm:0.10.4" dependencies: "@ethersproject/abi": ^5.4.0 "@ethersproject/abstract-signer": ^5.4.1 @@ -8089,7 +8062,7 @@ __metadata: peerDependencies: "@ethersproject/hardware-wallets": ^5.0.14 hardhat: ^2.6.8 - checksum: f415b20b1956e25caddb62b81926f5890ac8a523cf590b3cbaea9be519e5d7a2e6cea2e1a6547771adf1e5298f01e0ce27ad14b0d1a922878e7f97b044120d05 + checksum: d993d200e5bca75b85df983fad4526e3530d8e03648510ffd9cae30ae3ae97e34bcc1c03e0162024801f84b36d7a4bf43718548223abced1c8e76b1fd144edc4 languageName: node linkType: hard @@ -11303,13 +11276,6 @@ __metadata: languageName: node linkType: hard -"nofilter@npm:^1.0.4": - version: 1.0.4 - resolution: "nofilter@npm:1.0.4" - checksum: 54d864f745de5c3312994e880cf2d4f55e34830d6adc8275dce3731507ca380d21040336e4a277a4901551c07f04c452fbeffd57fad1dc8f68a2943eaf894a04 - languageName: node - linkType: hard - "nopt@npm:3.x": version: 3.0.6 resolution: "nopt@npm:3.0.6"